日期:2014-05-17 浏览次数:20550 次
function secRing(){ var secRingCenter = new BMap.Point(118.500272,31.698775); map.clearOverlays(); var secRing = [ new BMap.Point(118.502147,31.697776), new BMap.Point(118.501842,31.697692), new BMap.Point(118.501195,31.697738), new BMap.Point(118.499704,31.697968), new BMap.Point(118.499165,31.698552), new BMap.Point(118.499964,31.699612), new BMap.Point(118.500342,31.699604), new BMap.Point(118.501078,31.69889), new BMap.Point(118.501689,31.698268), new BMap.Point(118.501689,31.698268), ]; //创建多边形 var secRingPolygon = new BMap.Polygon(secRing, {strokeColor: "#ff0000", strokeWeight:2, strokeOpacity:0.5}); map.addOverlay(secRingPolygon);//添加多边形到地图上 map.setViewport(secRingPolygon.getPath()); //调整视野 }
function secRing(){ var secRingCenter = new BMap.Point(118.5129, 31.675991); var Num=<%=Num %>; var secRing=[]; for(var i=0;i<Num/2;i++) { var temp=new BMap.Point(boundaryDatas[2*i],boundaryDatas[2*i+1]); secRing.push(temp); } var secRingPolygon = new BMap.Polygon(secRing, {strokeColor:"blue", strokeWeight:3, strokeOpacity:0.5}); map.addOverlay(secRingPolygon);//添加多边形到地图上 map.setViewport(secRingPolygon.getPath()); //调整视野 }