百度地图画多边形区域(关注的海域)

  • Post author:
  • Post category:其他


<html>  
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">  
<head>  
<title>百度地图画多边形</title>  
</head>  
<body>  
<style type="text/css">  
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}  
</style>  
<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.3"></script>  
  
<script type="text/javascript">  
var map;  
function initialize() {  
  // 百度地图API功能  
  map = new BMap.Map("map_canvas");  
  map.addControl(new BMap.NavigationControl());               // 添加平移缩放控件  
  map.addControl(new BMap.ScaleControl());                    // 添加比例尺控件  
  map.addControl(new BMap.OverviewMapControl());              //添加缩略地图控件  
  map.enableScrollWheelZoom();                            //启用滚轮放大缩小  
  map.addControl(new BMap.MapTypeControl());          //添加地图类型控件  
    map.setMapType(BMAP_SATELLITE_MAP);  
    var point = new BMap.Point(108.896, 34.330);    // 创建点坐标  
        map.centerAndZoom(point,13);                      // 初始化地图,设置中心点坐标和地图级别。  
        var polygon = new BMap.Polygon([  
new BMap.Point(124.26086425781249, 39.79798577319721),
new BMap.Point(123.5906982421875, 39.76843641083843),
new BMap.Point(123.00292968749999, 39.62473049524286),
new BMap.Point(122.59094238281247, 39.40861097325808),
new BMap.Point(121.91528320312499, 38.93591198756164),
new BMap.Point(121.69555664062499, 38.80332983969899),
new BMap.Point(121.0693359375, 38.67907761983557),
new BMap.Point(121.02539062499999, 38.93591198756164),
new BMap.Point(121.52526855468749, 39.12792964388498),
new BMap.Point(121.50329589843749, 39.30667511534213),
new BMap.Point(121.12426757812499, 39.395877126120354),
new BMap.Point(121.43188476562499, 39.84017713275492),
new BMap.Point(121.95373535156247, 40.185168468260514),
new BMap.Point(122.20092773437501, 40.43649540640561),
new BMap.Point(122.1624755859375, 40.53676418550202),
new BMap.Point(121.9976806640625, 40.69521661351715),
new BMap.Point(121.21765136718751, 40.86575678600681),
new BMap.Point(120.48706054687501, 40.20195268954055),
new BMap.Point(119.58618164062501, 39.84017713275492),
new BMap.Point(119.31701660156253, 39.40012200014593),
new BMap.Point(118.9105224609375, 39.085304145034144),
new BMap.Point(118.3172607421875, 39.01278165162773),
new BMap.Point(118.07006835937501, 39.14497262511222),
new BMap.Point(117.83935546875001, 39.106620116621144),
new BMap.Point(117.8448486328125, 38.94872939211092),
new BMap.Point(117.61962890625, 38.700515838688716),
new BMap.Point(117.83386230468751, 38.330884319599704),
new BMap.Point(118.1689453125, 38.11943249695315),
new BMap.Point(118.88305664062501, 38.171273439283084),
new BMap.Point(119.3170166015625, 37.681646660291804),
new BMap.Point(119.21813964843751, 37.64685933620959),
new BMap.Point(119.06982421875, 37.712072193108455),
new BMap.Point(118.96545410156251, 37.35487607348372),
new BMap.Point(119.21264648437501, 37.16688291460905),
new BMap.Point(119.6575927734375, 37.14499280340637),
new BMap.Point(119.83337402343751, 37.42906945530332),
new BMap.Point(120.2728271484375, 37.72945260537779),
new BMap.Point(120.89904785156251, 37.851001264607945),
new BMap.Point(121.5142822265625, 37.58594229860422),
new BMap.Point(122.200927734375, 37.58594229860422),
new BMap.Point(122.74475097656251, 37.415981841946135),
new BMap.Point(122.5579833984375, 36.87302936279295),
new BMap.Point(122.25036621093749, 36.81588144109715),
new BMap.Point(121.93725585937499, 36.89499795802219),
new BMap.Point(121.67907714843749, 36.72787819497748),
new BMap.Point(121.14624023437499, 36.57362961247931),
new BMap.Point(120.750732421875, 36.23762751669997),
new BMap.Point(120.76171875, 36.122346200305174),
new BMap.Point(120.2783203125, 35.89127520165914),
new BMap.Point(119.937744140625, 35.610417892730524),
new BMap.Point(119.58068847656249, 35.35545618392078),
new BMap.Point(119.4049072265625, 35.077212628195525),
new BMap.Point(119.2401123046875, 34.94223663784118),
new BMap.Point(119.454345703125, 34.78448341546137),
new BMap.Point(119.8773193359375, 34.531449776214856),
new BMap.Point(120.32226562500001, 34.318486858676465),
new BMap.Point(120.91552734375001, 33.02478477990269),
new BMap.Point(120.992431640625, 32.61855682784329),
new BMap.Point(121.44836425781251, 32.41011032802449),
new BMap.Point(121.475830078125, 32.163987928240246),
new BMap.Point(121.9757080078125, 31.91719886741916),
new BMap.Point(122.2943115234375, 31.285592721861676),
new BMap.Point(122.60742187500001, 30.635548826533253),
new BMap.Point(122.530517578125, 29.761993109601534),
new BMap.Point(122.03613281250001, 28.99612953724707),
new BMap.Point(121.904296875, 28.779696384693523),
new BMap.Point(121.86584472656249, 28.39864879699246),
new BMap.Point(121.46484375000001, 28.016226126405627),
new BMap.Point(121.23413085937501, 27.841504767610246),
new BMap.Point(121.11877441406251, 27.403470801049124),
new BMap.Point(120.30578613281251, 26.66464134858272),
new BMap.Point(119.83886718749999, 25.77763387839265),
new BMap.Point(120.09155273437499, 25.525093179649858),
new BMap.Point(119.59167480468749, 25.068185076358617),
new BMap.Point(119.37744140624997, 25.187544344824488),
new BMap.Point(118.42163085937497, 24.339589469425164),
new BMap.Point(116.85058593749999, 23.147936590271485),
new BMap.Point(116.68029785156249, 23.09741782252918),
new BMap.Point(116.4935302734375, 22.88503184835787),
new BMap.Point(115.81787109375, 22.702721724459977),
new BMap.Point(115.52673339843749, 22.63175763000868),
new BMap.Point(115.24108886718749, 22.702721724459977),
new BMap.Point(114.862060546875, 22.47956837376377),
new BMap.Point(114.466552734375, 22.367856439187563),
new BMap.Point(114.28527832031247, 22.14416381335971),
new BMap.Point(113.18115234374999, 21.78755669855083),
new BMap.Point(112.96691894531249, 21.527182233339232),
new BMap.Point(112.2802734375, 21.552729888732742),
new BMap.Point(111.7803955078125, 21.516961912551352),
new BMap.Point(110.7147216796875, 21.225381663722246),
new BMap.Point(110.46203613281249, 20.74840871329924),
new BMap.Point(111.10473632812499, 19.893305732744707),
new BMap.Point(111.06079101562497, 19.552025697517507),
new BMap.Point(110.67626953124999, 19.18408366040194),
new BMap.Point(110.59936523437501, 18.820517235471073),
new BMap.Point(110.36865234374999, 18.601998315229594),
new BMap.Point(110.1104736328125, 18.48221399474552),
new BMap.Point(109.775390625, 18.231960055191507),
new BMap.Point(109.742431640625, 18.127580917219007),
new BMap.Point(109.46777343749999, 18.158901213171134),
new BMap.Point(109.33593749999999, 18.278910262696115),
new BMap.Point(108.863525390625, 18.377985612444007),
new BMap.Point(108.66027832031249, 18.53951262721411),
new BMap.Point(108.57788085937499, 19.116624354958375),
new BMap.Point(108.6273193359375, 19.407021044033186),
new BMap.Point(109.105224609375, 19.717585810896807),
new BMap.Point(109.27001953125, 19.93462334027724),
new BMap.Point(109.9456787109375, 20.104944072134444),
new BMap.Point(109.830322265625, 20.51192705703751),
new BMap.Point(109.63256835937499, 20.89730545371515),
new BMap.Point(109.775390625, 21.38914734243984),
new BMap.Point(109.73693847656249, 21.50674087295795),
new BMap.Point(109.55017089843749, 21.511851482588185),
new BMap.Point(109.13818359375, 21.363570998122682),
new BMap.Point(109.017333984375, 21.516961912551338),
new BMap.Point(108.80859374999999, 21.598704329244896),
new BMap.Point(108.12744140624997, 21.419833053493477),
new BMap.Point(107.64953613281247, 21.08706276222476),
new BMap.Point(107.20458984374999, 20.599365240955564),
new BMap.Point(106.29272460937501, 19.17111285978146),
new BMap.Point(106.50146484375, 18.088422664636212),
new BMap.Point(110.1708984375, 12.576009912063796),
new BMap.Point(109.59960937499997, 10.379765224421448),
new BMap.Point(108.19335937499999, 6.817352822622141),
new BMap.Point(107.9736328125, 3.973860975839102),
new BMap.Point(109.51171875, 2.526036752171848),
new BMap.Point(112.763671875, 3.710782004348715),
new BMap.Point(116.3232421875, 7.906911616469287),
new BMap.Point(119.0478515625, 12.103780891645812),
new BMap.Point(119.09179687499999, 15.897942401022092),
new BMap.Point(119.5751953125, 18.37537909403183),
new BMap.Point(122.08007812499999, 21.88188980762928),
new BMap.Point(127.44140624999997, 26.961245770526972),
new BMap.Point(128.05664062499997, 29.209713225868185),
new BMap.Point(127.35351562499996, 31.93351676190369),
new BMap.Point(125.37597656249997, 33.48643545099989),
new BMap.Point(125.85937499999997, 36.43896124085947),
new BMap.Point(124.40917968749997, 37.94419750075404),
new BMap.Point(124.05761718749997, 39.69450749856091),
new BMap.Point(124.26086425781249, 39.79798577319721)  
            ], {strokeColor:"#f50704",fillColor:"", strokeWeight:3, strokeOpacity:0,fillOpacity:0,});  
        map.addOverlay(polygon);  
  //showToolAutoDef();  
}  
</script>  
</head>  
<body onLoad="initialize()">  
  <div id="map_canvas" style="width: 100%; height: 100%;"></div>  
</body>  
</html> 

结果:

在这里插入图片描述



版权声明:本文为maoersong原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。