修复地图描点点击返回缩放等级与点击前不一致的问题

This commit is contained in:
aixianling
2023-10-10 09:27:23 +08:00
parent 21ed9dc914
commit c776c1d733

View File

@@ -184,8 +184,9 @@ export default {
if (AMap && map) {
map.clearMap()
const center = map.getCenter()
const zoom = map.getZoom()
map.on('click', () => {
map.setZoomAndCenter(10, center)
map.setZoomAndCenter(zoom, center)
map.setPitch(0)
this.mapDialog = false
})
@@ -212,20 +213,16 @@ export default {
polylines.filter(e => e.path?.length > 0)?.map(e => new AMap.Polyline({
map, strokeColor: "#00FFAE", ...e, path: e.path.map(p => new AMap.LngLat(p[1], p[0]))
}))
map.setFitView()
this.data.is3d > 0 && map.setPitch(65)
if (this.data.is3dAround == 1) {
this.timer = setInterval(() => map?.setRotation(360, false, 16000))
this.timer = setInterval(() => map.setRotation(360, false, 16000))
}
} else if (count < 10) {
console.log("正在加载...%s", count)
setTimeout(() => this.renderMap(++count), 1000)
}
}
},
mounted() {
if (this.currentType == 'table') {
// this.$injectLib("https://cdn.cunwuyun.cn/datav.map.vue.js")
}
}
}
</script>