Commit f7bb056558129ac1d015d5479fd28de7860bf63f
1 parent
7c4ec966
Exists in
dev
fix:初始化
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
frontend/front/src/views/pages/regionalManage/components/regionManage.vue
@@ -364,9 +364,12 @@ export default { | @@ -364,9 +364,12 @@ export default { | ||
364 | }).then((AMap)=>{ | 364 | }).then((AMap)=>{ |
365 | console.log('打印AMap====>',AMap); | 365 | console.log('打印AMap====>',AMap); |
366 | let that = this; | 366 | let that = this; |
367 | - this.map = new T.Map('mapContainer',{ | ||
368 | - projection: 'EPSG:900913' | ||
369 | - }); | 367 | + if(!this.map){ |
368 | + // 防止二次初始化导致拖拽失效 | ||
369 | + this.map = new T.Map('mapContainer',{ | ||
370 | + projection: 'EPSG:900913' | ||
371 | + }); | ||
372 | + } | ||
370 | this.map.centerAndZoom(new T.LngLat(this.centerPoint[0], this.centerPoint[1]), 16); | 373 | this.map.centerAndZoom(new T.LngLat(this.centerPoint[0], this.centerPoint[1]), 16); |
371 | //允许鼠标双击放大地图 | 374 | //允许鼠标双击放大地图 |
372 | this.map.enableScrollWheelZoom(); | 375 | this.map.enableScrollWheelZoom(); |