渲染地图增加判断条件是否有元素再渲染加载
This commit is contained in:
@@ -53,6 +53,8 @@ export default {
|
|||||||
Loca: {version: '2.0.0'}
|
Loca: {version: '2.0.0'}
|
||||||
}).then(AMap => {
|
}).then(AMap => {
|
||||||
this.mapLib = AMap
|
this.mapLib = AMap
|
||||||
|
this.$emit('update:lib', AMap)
|
||||||
|
if (this.$refs.amap) {
|
||||||
this.amap = new AMap.Map(this.$refs.amap, {
|
this.amap = new AMap.Map(this.$refs.amap, {
|
||||||
mapStyle,
|
mapStyle,
|
||||||
viewMode,
|
viewMode,
|
||||||
@@ -65,10 +67,11 @@ export default {
|
|||||||
this.amap.on('complete', () => {
|
this.amap.on('complete', () => {
|
||||||
this.amap.setFitView();//视口自适应
|
this.amap.setFitView();//视口自适应
|
||||||
})
|
})
|
||||||
this.$emit('update:lib', AMap)
|
|
||||||
this.$emit('update:map', this.amap)
|
this.$emit('update:map', this.amap)
|
||||||
this.$emit("loaded")
|
this.$emit("loaded")
|
||||||
this.mapLoaded()
|
this.mapLoaded()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getMapArea() {
|
getMapArea() {
|
||||||
|
|||||||
Reference in New Issue
Block a user