换个思路实现起来也很简单,好比设计图是这个样子:bash
你以为边框很差实现,可是你会不会实现下面两种样子ui
细边框: spa
若是你说你都会,那么问题就解决了,若是想实现阴影就把底层map的边框改为阴影,两个重叠一下就是你想要的效果(center,aspectScale和zoom须要同样),附上关键代码:设计
geo: {
map: 'china',
center: [112.194115019531, 23.582111640625],
zoom: 12,
aspectScale: 1, //长宽比
label: {
normal: {
show: true,
textStyle: {
fontSize: 16,
color: '#ccc'
}
},
emphasis: {
show: false,
textStyle: {
color: '#ccc'
}
}
},
roam: false,
itemStyle: {
normal: {
borderColor: "#fff",
borderWidth: 5,
areaColor: '#272235',
fontWeightL: 700,
/* shadowBlur:20,
shadowColor: '#fff',*/
},
emphasis: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#3f15d6' // 0% 处的颜色
}, {
offset: 1, color: '#d243cd' // 100% 处的颜色
}],
globalCoord: false // 缺省为 false
}
}
}
},
series: [
{
type: 'map',
map: 'china',
center: [112.194115019531, 23.582111640625],
zoom: 12,
geoIndex: 1,
aspectScale: 1, //长宽比
showLegendSymbol: false, // 存在legend时显示
label: {
normal: {
show: true,
textStyle: {
fontSize: 16,
color: '#ccc'
}
},
emphasis: {
show: false,
textStyle: {
color: '#ccc'
}
}
},
roam: false,
itemStyle: {
normal: {
areaColor: '#272235',
borderColor: '#fff',
fontWeightL: 700,
borderWidth: 1
},
emphasis: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#3f15d6' // 0% 处的颜色
}, {
offset: 1, color: '#d243cd' // 100% 处的颜色
}],
globalCoord: false // 缺省为 false
}
}
},
data: []
}
]
复制代码
本篇如能对您有所帮助,实在是感到荣幸。若有不合理之处也请你们多多指点3d