createmap() {
let that = this
//创建地图
MapLoader().then(
(AMap) => {
that.map = new AMap.Map('containerRight', {
zoom: that.defaultZoom,
center: that.defaultCenter,
opacity: 5,
features: ['bg', 'road', 'building', 'point'],
})
that.map.on('zoomchange', function (e) {
//获取当前最新的地图层级
let Zoom = that.map.getZoom()
/**
* 地图层级发生改变后操作
* */
})
},
(e) => {
console.log('地图加载失败', e)
}
)
},
Vue创建高德地图,监听地图层级的变化进行操作
最新推荐文章于 2023-11-10 06:49:10 发布