initMap() {
window.screenMap = new AMap.Map("screenMap", {
viewMode: "2D", //默认使用 2D 模式
layers: [new AMap.TileLayer.Satellite()],
zoom: 15, //地图级别
center: [115.929293,29.378678], //地图中心点
});
var outer = [
new AMap.LngLat(-360, 90, true),
new AMap.LngLat(-360, -90, true),
new AMap.LngLat(360, -90, true),
new AMap.LngLat(360, 90, true)
]
// var holes = [newBounds]
var holes = [mapData] // 你的区域[ [ 115.913757115957594, 29.398164832217731], [ 115.913874455630918, 29.398038799430001], [ 115.913991437722515, 29.397933928912618], [ 115.914093306332319, 29.397888216944882], [ 115.914216774169077, 29.397844493808851], [ 115.914339884723105, 29.39782481462861], [ 115.914534272016596, 29.39780164908133], [ 115.914666383367233, 29.397771889246911], [ 115.914771497247983, 29.397749774678356], [ 115.914964082169973, 29.39764232525571]]
// var holes = []
var pathArray = [outer, mapData]
var polygon2 = new AMap.Polygon({
pathL: pathArray,
strokeColor: '#0425ae',
strokeOpacity: 0.6, //线透明度
strokeWeight: 3,
fillColor: '#0425ae',
fillOpacity: 0.5
// zIndex: 999
})
polygon2.setPath(pathArray)
window.screenMap.add(polygon2)
},
09-06
1752
03-31
572