日期:2014-05-16 浏览次数:20353 次
function getBoundary(districtName) { var bdary = new BMap.Boundary(); var name = districtName; if(districtName=="马鞍山市"||"雨山区"||"花山区"||"金家庄区") bdary.get(districtName, function(rs) { //获取行政区域 map.clearOverlays(); //清除地图覆盖物 var count = rs.boundaries.length; //行政区域的点有多少个 for(var i = 0; i < count; i++){ var ply = new BMap.Polygon(rs.boundaries[i], {strokeWeight: 2, strokeColor: "#ff0000"}); //建立多边形覆盖物 map.addOverlay(ply); //添加覆盖物 map.setViewport(ply.getPath()); //调整视野 } }); else secRing(); }