ASP.NET Google Maps Javascript API V3 实战基础篇一多边形
2010-10-25 16:14
363 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Overlay_Polygon_Sample.aspx.cs"
Inherits="Samples.Overlays.Overlay_Polygon_Sample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>多边形</title>
<style type="text/css">
#maps
{
height: 450px;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>
<script language="javascript" type="text/javascript">
//地图初始化函数
function initialize() {
var LatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
var Options = {
zoom: 5, center: LatLng, mapTypeId: google.maps.MapTypeId.TERRAIN
};
var bermudaTriangle; //申明百莫大三角对象
var map = new google.maps.Map(document.getElementById("maps"), Options);
//多边形数据对象数组
var triangleCoords = [new google.maps.LatLng(25.774252, -80.190262),
new google.maps.LatLng(18.466465, -66.118292),
new google.maps.LatLng(32.321384, -64.75737),
new google.maps.LatLng(25.774252, -80.190262)];
//创建百莫大三角对象实例
bermudaTriangle = new google.maps.Polygon(
{
paths: triangleCoords, strokeColor: "#FF0000", strokeOpacity: 0.8, strokeWeight: 2, fillColor: "#FF0000", fillOpacity: 0.35
}
);
//将百莫大三角对象设置到地图上
bermudaTriangle.setMap(map);
}
//将地图初始化函数绑定到window的load事件
google.maps.event.addDomListener(window, "load", initialize);
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="maps">
</div>
</form>
</body>
</html>
Inherits="Samples.Overlays.Overlay_Polygon_Sample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>多边形</title>
<style type="text/css">
#maps
{
height: 450px;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>
<script language="javascript" type="text/javascript">
//地图初始化函数
function initialize() {
var LatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
var Options = {
zoom: 5, center: LatLng, mapTypeId: google.maps.MapTypeId.TERRAIN
};
var bermudaTriangle; //申明百莫大三角对象
var map = new google.maps.Map(document.getElementById("maps"), Options);
//多边形数据对象数组
var triangleCoords = [new google.maps.LatLng(25.774252, -80.190262),
new google.maps.LatLng(18.466465, -66.118292),
new google.maps.LatLng(32.321384, -64.75737),
new google.maps.LatLng(25.774252, -80.190262)];
//创建百莫大三角对象实例
bermudaTriangle = new google.maps.Polygon(
{
paths: triangleCoords, strokeColor: "#FF0000", strokeOpacity: 0.8, strokeWeight: 2, fillColor: "#FF0000", fillOpacity: 0.35
}
);
//将百莫大三角对象设置到地图上
bermudaTriangle.setMap(map);
}
//将地图初始化函数绑定到window的load事件
google.maps.event.addDomListener(window, "load", initialize);
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="maps">
</div>
</form>
</body>
</html>
相关文章推荐
- ASP.NET Google Maps Javascript API V3 实战基础篇一多边形
- ASP.NET Google Maps Javascript API V3 实战基础篇一KML 和 GeoRSS 图层
- ASP.NET Google Maps Javascript API V3 实战基础篇一反向地址解析
- ASP.NET Google Maps Javascript API V3 实战基础篇一为控件添加状态
- ASP.NET Google Maps Javascript API V3 实战基础篇一动态创建折线
- MongoDB实战开发 【零基础学习,附完整Asp.net示例】(转)
- ASP.NET Google Maps Javascript API V3 实战基础篇一KML 和 GeoRSS 图层
- ASP.NET Google Maps Javascript API V3 实战基础篇一隐藏和显示叠加层
- ASP.NET Google Maps Javascript API V3 实战基础篇一反向地址解析
- ASP.NET Google Maps Javascript API V3 实战基础篇一检测用户位置
- ASP.NET Google Maps Javascript API V3 实战基础篇一停用默认用户界面
- ASP.NET Google Maps Javascript API V3 实战基础篇一为控件添加状态
- ASP.NET Google Maps Javascript API V3 实战基础篇一动态创建折线
- ASP.NET Google Maps Javascript API V3 实战基础篇一根据指定KML构造图层
- ASP.NET Google Maps Javascript API V3 实战基础篇一隐藏和显示叠加层
- ASP.NET Google Maps Javascript API V3 实战基础篇一检测用户位置
- ASP.NET Google Maps Javascript API V3 实战基础篇一添加叠加层
- ASP.NET Google Maps Javascript API V3 实战基础篇一根据指定KML构造图层
- ASP.NET Google Maps Javascript API V3 实战基础篇一样式化地图
- ASP.NET Google Maps Javascript API V3 实战基础篇一路线查询