var uploadedDataURL = '/json/吉林省/延边朝鲜族自治州.geojson'
var myChart = echarts.init(document.getElementById('map'));
function cityMap() {
$.get(uploadedDataURL, function(geoJson) {
echarts.registerMap('中国各市县形状', geoJson);
option = {
backgroundColor: '#040c33',
title: {
show: true,
x: "center",
y: "20",
text: "延边朝鲜族自治州区域地图",
textStyle: {
color: "#fff",
fontSize: 22,
fontWeight: 'normal'
}
},
"geo": {
"map": "中国各市县形状",
"layoutCenter": ["50%", "55%"],
"layoutSize": "82%",
"roam": false, //是否允许缩放
"mapLocation": {
"width": "100%",
"height": "85%"
},
label: {
normal: { //静态的时候展示样式
show: true, //是否显示地图份得名称
textStyle: {
color: "#fff",
fontSize: 12
}
},
emphasis: { //动态展示的样式
color: '#fff',
},
},
itemStyle: {
normal: {
areaColor: '#3a7fd5',
borderColor: '#0a53e9', //线
shadowColor: '#092f8f', //外发光
shadowBlur: 20,
},
emphasis: {
areaColor: '#0a2dae', //悬浮区背景
},
},
},
},
myChart.setOption(option);
window.addEventListener("resize", function() {
myChart.resize();
})
});
}
cityMap()
点击运行 》