this.map.on('zoomend', () => {
let zoom = this.map.getZoom() //获取当前地图级别
console.log(zoom + '结束')
if (zoom > 13) {
this.pointToAvoidDisasterMarkerList.forEach((item) => {
item.setLabel({
offset: new AMap.Pixel(0, -2), //设置文本标注偏移量
content: "<div class='map-info'>" + item.detail.name + '</div>', //设置文本标注内容
direction: 'bottom', //设置文本标注方位
})
})
} else {
this.pointToAvoidDisasterMarkerList.forEach((item) => {
item.setLabel(null)
})
}
})