<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=您的密钥"></script>
<div id="container" style="height: 100%; width: 100%"></div>
map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); // 初始化地图,设置中心点坐标和地图级别
map.disableScrollWheelZoom();
map.disableDragging();
map.setMinZoom(10);
map.setMaxZoom(14);
map.enableScrollWheelZoom();
map.disableDoubleClickZoom();
new BMap.Boundary().get('萧山区', function(rs){ //获取行政区域
var count = rs.boundaries.length; //行政区域的点有多少个
for(var i = 0; i < count; i++){
var ply = new BMap.Polygon(rs.boundaries[i], {strokeWeight: 2, strokeColor: "#1E90FF", strokeOpacity:0.0, fillOpacity: 0.0, fillColor: "none"}); //建立多边形覆盖物
map.addOverlay(ply); //添加覆盖物
map.setViewport(ply.getPath()); //调整视野
}
});