修复地图

This commit is contained in:
aixianling
2024-09-14 15:41:15 +08:00
parent f962d9db1d
commit c1bca77b3f

View File

@@ -73,9 +73,11 @@ export default {
})
this.loadLibs().then(() => {
const geoJson = this.geo
const boundary = geoJson.features?.length > 1 ? turf.union(geoJson) : geoJson
const boundary = geoJson.features?.length > 1 ? turf.union(geoJson) : this.$copy(geoJson.features[0])
boundary.properties = {...boundary.properties}
boundary.properties.name = "boundary"
geoJson.features.unshift(boundary)
console.log(geoJson)
echarts.registerMap('customMap', geoJson)
const option = {
geo: {
@@ -86,12 +88,8 @@ export default {
regions: [
{
name: "boundary", itemStyle: {
areaColor: {
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
{offset: 0, color: 'rgba(61,127,255,0.35)'},
{offset: 1, color: '#09E2F8'},
]
}, shadowColor: "#1A80BF", shadowOffsetY: 2
areaColor: "rgba(2,188,255,0.16)", shadowColor: "#02F0FF21", shadowOffsetY: 20, shadowBlur: 20,
borderColor: '#02F0FF', borderWidth: 3
}, label: {show: false}
}
],