提交 5413ef6b 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(map): web 高德地图支持 regionchange 监听缩放 (question/162763)

上级 6ff35a2d
......@@ -343,7 +343,8 @@ function useMap(
)
)
})
event.addListener(map, 'zoom_changed', () => {
const zoomChangedCallback = () => {
emit('update:scale', map.getZoom())
trigger(
'regionchange',
......@@ -356,7 +357,12 @@ function useMap(
getMapInfo()
)
)
})
}
// QQ or Google
event.addListener(map, 'zoom_changed', zoomChangedCallback)
// AMAP
event.addListener(map, 'zoomend', zoomChangedCallback)
event.addListener(map, 'center_changed', () => {
const center = map.getCenter()!
const latitude = getLat(center as LatLng)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册