fix(视图): 地图范围相互影响

This commit is contained in:
fit2cloud-chenyw 2023-01-29 14:42:17 +08:00
parent 8257c44540
commit c7fbaae186

View File

@ -217,7 +217,6 @@ export default {
}
})
}
//
if (opt.geo) {
if (opt.geo instanceof Array) {
opt.geo[0].roam = this.active
@ -225,7 +224,6 @@ export default {
opt.geo.roam = this.active
}
}
//
if (this.chart.type === 'treemap' && opt.series) {
opt.series[0].roam = this.active
}
@ -413,8 +411,10 @@ export default {
},
initMapChart(geoJson, chart, curAreaCode) {
this.formatGeoJson(geoJson)
this.$echarts.registerMap('MAP', geoJson)
const mapId = 'MAP' + this.chartId
this.$echarts.registerMap(mapId, geoJson)
const base_json = JSON.parse(JSON.stringify(BASE_MAP))
base_json.geo.map = mapId
let themeStyle = null
if (this.themeStyle) {
themeStyle = JSON.parse(JSON.stringify(this.themeStyle))