修复地图
This commit is contained in:
@@ -73,9 +73,11 @@ export default {
|
|||||||
})
|
})
|
||||||
this.loadLibs().then(() => {
|
this.loadLibs().then(() => {
|
||||||
const geoJson = this.geo
|
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"
|
boundary.properties.name = "boundary"
|
||||||
geoJson.features.unshift(boundary)
|
geoJson.features.unshift(boundary)
|
||||||
|
console.log(geoJson)
|
||||||
echarts.registerMap('customMap', geoJson)
|
echarts.registerMap('customMap', geoJson)
|
||||||
const option = {
|
const option = {
|
||||||
geo: {
|
geo: {
|
||||||
@@ -86,12 +88,8 @@ export default {
|
|||||||
regions: [
|
regions: [
|
||||||
{
|
{
|
||||||
name: "boundary", itemStyle: {
|
name: "boundary", itemStyle: {
|
||||||
areaColor: {
|
areaColor: "rgba(2,188,255,0.16)", shadowColor: "#02F0FF21", shadowOffsetY: 20, shadowBlur: 20,
|
||||||
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
|
borderColor: '#02F0FF', borderWidth: 3
|
||||||
{offset: 0, color: 'rgba(61,127,255,0.35)'},
|
|
||||||
{offset: 1, color: '#09E2F8'},
|
|
||||||
]
|
|
||||||
}, shadowColor: "#1A80BF", shadowOffsetY: 2
|
|
||||||
}, label: {show: false}
|
}, label: {show: false}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user