diff --git a/components/AiDvRender.vue b/components/AiDvRender.vue index cdb345b1..96e4bc6b 100644 --- a/components/AiDvRender.vue +++ b/components/AiDvRender.vue @@ -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") - } } }