最近项目要求榆林市飞线图,地图上特定散点图加飞线效果,看效果:

1、echarts注册地图,如榆林市地图数据yls.json(https://geo.datav.aliyun.com/areas_v3/bound/610800_full.json)
<div id="chart-box" style="height: 100%; width: 100%"></div>
import echarts from "echarts/lib/echarts";
import yls_json from "./yls.json";
let data = yls_json;
this.$echarts.registerMap("yls", data);
2、配置echarts的option的geo,将注册的地图yls放在echarts的geo中。series里的type:scatter设置coordinateSystem: 'geo';type: "lines",coordinateSystem: "geo",才能实现散点和飞线效果。
geo: {
map: "yls",
zoom: 1,
label: {
normal: {
show: true,
textStyle: {
fontSize: 12,
color: "#43D0D6",
},
},
emphasis: {
show: true,
},
},
itemStyle: {
normal: {
borderColor: "rgba(255,209,163, .5)", //区域边框颜色
areaColor: "rgba(73,86,166,.1)", //区域颜色
borderWidth: 0.5, //区域边框宽度
shadowBlur: 5,
shadowColor: "rgba(107,91,237,.7)",
},
emphasis: {
borderColor: "#FFD1A3",
areaColor: "rgba(102,105,240,.3)",
borderWidth: 1,
shadowBlur: 5,
shadowColor: "rgba(135,138,255,.5)",
},
},
},
series: [
{
name: "地点",
type: "effectScatter",
2218




被折叠的 条评论
为什么被折叠?



