网格地图

This commit is contained in:
yanran200730
2022-01-17 09:37:15 +08:00
parent d85b663172
commit 69079f1368

View File

@@ -62,7 +62,8 @@ export default {
treeList: [],
showSelect: false,
editor: null,
polygons: []
polygons: [],
labels: []
}
},
computed: {...mapState(['user', 'config'])},
@@ -134,7 +135,11 @@ export default {
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
if (this.polygons.length > 0) {
this.polygons.forEach(e => e.destroy())
this.labels.forEach(e => {
e.destroy(e.id)
})
this.polygons = []
this.labels = []
}
if (paths?.length > 0) {
let bounds = []
@@ -186,6 +191,7 @@ export default {
}
]
})
this.labels.push(label)
label.on('click', e => {
this.getGridInfo(e.target.id.split('~')[1])
});