渲染地图增加判断条件是否有元素再渲染加载
This commit is contained in:
@@ -53,22 +53,25 @@ export default {
|
|||||||
Loca: {version: '2.0.0'}
|
Loca: {version: '2.0.0'}
|
||||||
}).then(AMap => {
|
}).then(AMap => {
|
||||||
this.mapLib = AMap
|
this.mapLib = AMap
|
||||||
this.amap = new AMap.Map(this.$refs.amap, {
|
|
||||||
mapStyle,
|
|
||||||
viewMode,
|
|
||||||
terrain: true,
|
|
||||||
resizeEnable: true,
|
|
||||||
skyColor: "#082243",
|
|
||||||
zoom: 11,
|
|
||||||
...this.ops
|
|
||||||
})
|
|
||||||
this.amap.on('complete', () => {
|
|
||||||
this.amap.setFitView();//视口自适应
|
|
||||||
})
|
|
||||||
this.$emit('update:lib', AMap)
|
this.$emit('update:lib', AMap)
|
||||||
this.$emit('update:map', this.amap)
|
if (this.$refs.amap) {
|
||||||
this.$emit("loaded")
|
this.amap = new AMap.Map(this.$refs.amap, {
|
||||||
this.mapLoaded()
|
mapStyle,
|
||||||
|
viewMode,
|
||||||
|
terrain: true,
|
||||||
|
resizeEnable: true,
|
||||||
|
skyColor: "#082243",
|
||||||
|
zoom: 11,
|
||||||
|
...this.ops
|
||||||
|
})
|
||||||
|
this.amap.on('complete', () => {
|
||||||
|
this.amap.setFitView();//视口自适应
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$emit('update:map', this.amap)
|
||||||
|
this.$emit("loaded")
|
||||||
|
this.mapLoaded()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getMapArea() {
|
getMapArea() {
|
||||||
@@ -216,7 +219,7 @@ export default {
|
|||||||
background: radial-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .6) 40%, #000 100%);
|
background: radial-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .6) 40%, #000 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep( .marker ){
|
:deep( .marker ) {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
& > img {
|
& > img {
|
||||||
@@ -240,11 +243,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep( .amap-logo), :deep( .amap-copyright ){
|
:deep( .amap-logo), :deep( .amap-copyright ) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep( .amap-icon ){
|
:deep( .amap-icon ) {
|
||||||
width: 40px !important;
|
width: 40px !important;
|
||||||
height: 40px !important;
|
height: 40px !important;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user