|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
},
|
|
|
dragstartMarker: undefined,
|
|
|
map: undefined,
|
|
|
- markerGroup: [],
|
|
|
+ markerGroup: null,
|
|
|
mapList: [],
|
|
|
mapId: undefined,
|
|
|
mapRasterLayer: require('./images/layout_cont.png'),
|
|
|
@@ -149,7 +149,6 @@ export default {
|
|
|
this.saveForm.name = ''
|
|
|
this.$message.success('修改成功!')
|
|
|
this.dragstartMarker = undefined
|
|
|
- this.markerGroup.clearLayers()
|
|
|
this.getLayers()
|
|
|
})
|
|
|
} else {
|
|
|
@@ -167,8 +166,6 @@ export default {
|
|
|
this.saveForm.icon = ''
|
|
|
this.saveForm.name = ''
|
|
|
this.$message.success('新增成功!')
|
|
|
-
|
|
|
- this.markerGroup.clearLayers()
|
|
|
this.getLayers()
|
|
|
})
|
|
|
}
|
|
|
@@ -200,8 +197,6 @@ export default {
|
|
|
this.map.removeLayer(this.map._layers[this.markerId])
|
|
|
}
|
|
|
this.$message.success('删除成功!')
|
|
|
-
|
|
|
- this.markerGroup.clearLayers()
|
|
|
this.getLayers()
|
|
|
})
|
|
|
},
|
|
|
@@ -232,6 +227,9 @@ export default {
|
|
|
},
|
|
|
getLayers() {
|
|
|
getLayersApi().then((res) => {
|
|
|
+ if (this.markerGroup !== null) {
|
|
|
+ this.markerGroup?.clearLayers()
|
|
|
+ }
|
|
|
this.initMarkers(res.data)
|
|
|
})
|
|
|
},
|
|
|
@@ -360,7 +358,8 @@ export default {
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.conatiner{
|
|
|
- height: calc(100vh - 74px);
|
|
|
+ height: 100%;
|
|
|
+ height: 100vh;
|
|
|
min-width: 1000px;
|
|
|
margin: 0 auto;
|
|
|
padding: 0 16px;
|