|
|
@ -20,31 +20,31 @@ import "echarts/lib/component/visualMap"; |
|
|
|
import "echarts/lib/component/title"; |
|
|
|
import { ScatterChart } from "echarts/charts"; |
|
|
|
echarts.use([ScatterChart]); |
|
|
|
// 引入杭州市地图数据(引入方式重点) |
|
|
|
import mapJson from "../assets/hangzhou.json"; |
|
|
|
// 引入洛阳市地图数据(引入方式重点) |
|
|
|
import mapJson from "../assets/luoyang.json"; |
|
|
|
const regions = [ |
|
|
|
//对不同的区块进行着色 |
|
|
|
{ |
|
|
|
name: "富阳区", //区块名称 |
|
|
|
LngAndLat: [119.75, 30.030339], |
|
|
|
name: "老城区", //区块名称 |
|
|
|
LngAndLat: [112.477298,34.682945], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#b1d9e6", |
|
|
|
areaColor: "#EC9D4B", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "拱墅区", //区块名称 |
|
|
|
LngAndLat: [120.14, 30.293843], |
|
|
|
name: "西工区", //区块名称 |
|
|
|
LngAndLat: [112.443232,34.667847], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#b1d9e6", |
|
|
|
areaColor: "#FBE5F1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "滨江区", //区块名称 |
|
|
|
LngAndLat: [120.21, 30.204415], |
|
|
|
name: "瀍河回族区", //区块名称 |
|
|
|
LngAndLat: [112.491625, 34.684738], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#93cadc", |
|
|
@ -52,26 +52,26 @@ const regions = [ |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "淳安县", //区块名称 |
|
|
|
LngAndLat: [119.45, 29.559729], |
|
|
|
name: "涧西区", //区块名称 |
|
|
|
LngAndLat: [112.399243, 34.654251], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#b1d9e6", |
|
|
|
areaColor: "#D4ECB1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "建德市", //区块名称 |
|
|
|
LngAndLat: [119.0, 29.576045], |
|
|
|
name: "孟津区", //区块名称 |
|
|
|
LngAndLat: [112.443892, 34.826485], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#e6f3f7", |
|
|
|
areaColor: "#D4ECB1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "临安区", //区块名称, |
|
|
|
LngAndLat: [119.75, 30.030339], |
|
|
|
name: "洛龙区", //区块名称, |
|
|
|
LngAndLat: [112.456634, 34.618557], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#93cadc", |
|
|
@ -79,53 +79,53 @@ const regions = [ |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "上城区", //区块名称, |
|
|
|
LngAndLat: [120.3, 30.288198], |
|
|
|
name: "新安县", //区块名称, |
|
|
|
LngAndLat: [112.141403, 34.728679], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#8ac6d9", |
|
|
|
areaColor: "#F08B94", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "桐庐县", //区块名称, |
|
|
|
LngAndLat: [119.42, 29.899843], |
|
|
|
name: "栾川县", //区块名称, |
|
|
|
LngAndLat: [111.618386, 33.783195], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#9ccfdf", |
|
|
|
areaColor: "#F08B94", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "西湖区", //区块名称, |
|
|
|
LngAndLat: [120.06, 30.193843], |
|
|
|
name: "嵩县", //区块名称, |
|
|
|
LngAndLat: [112.087765, 34.131563], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#e6f3f7", |
|
|
|
areaColor: "#D4ECB1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "萧山区", //区块名称, |
|
|
|
LngAndLat: [120.44, 30.193843], |
|
|
|
name: "汝阳县", //区块名称, |
|
|
|
LngAndLat: [112.473789, 34.15323], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#9ccfdf", |
|
|
|
areaColor: "#F08B94", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "余杭区", //区块名称, |
|
|
|
LngAndLat: [119.96, 30.323843], |
|
|
|
name: "宜阳县", //区块名称, |
|
|
|
LngAndLat: [112.179989, 34.516478], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#8ac6d9", |
|
|
|
areaColor: "#FBE5F1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "临平区", //区块名称, |
|
|
|
LngAndLat: [120.29, 30.419025], |
|
|
|
name: "洛宁县", //区块名称, |
|
|
|
LngAndLat: [111.655399, 34.387179], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#93cadc", |
|
|
@ -133,14 +133,24 @@ const regions = [ |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "钱塘区", //区块名称, |
|
|
|
LngAndLat: [120.49, 30.322904], |
|
|
|
name: "伊川县", //区块名称, |
|
|
|
LngAndLat: [112.429384, 34.423416], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#e6f3f7", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "偃师区", //区块名称, |
|
|
|
LngAndLat: [112.787739, 34.723042], |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
areaColor: "#FBE5F1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
export default { |
|
|
@ -152,19 +162,20 @@ export default { |
|
|
|
return [ |
|
|
|
// 坐标点数据,格式 {name: 'xxx', value: [经度,纬度]} |
|
|
|
// 散点数据,地图上的数量 |
|
|
|
{ name: "富阳区", LngAndLat: [119.75, 30.030339], num: 0 }, |
|
|
|
{ name: "拱墅区", LngAndLat: [120.14, 30.293843], num: 0 }, |
|
|
|
{ name: "滨江区", LngAndLat: [120.21, 30.204415], num: 0 }, |
|
|
|
{ name: "淳安县", LngAndLat: [119.0, 29.576045], num: 0 }, |
|
|
|
{ name: "建德市", LngAndLat: [119.45, 29.559729], num: 0 }, |
|
|
|
{ name: "临安区", LngAndLat: [119.37, 30.183843], num: 0 }, |
|
|
|
{ name: "上城区", LngAndLat: [120.3, 30.288198], num: 0 }, |
|
|
|
{ name: "桐庐县", LngAndLat: [119.42, 29.899843], num: 0 }, |
|
|
|
{ name: "西湖区", LngAndLat: [120.06, 30.193843], num: 0 }, |
|
|
|
{ name: "萧山区", LngAndLat: [120.44, 30.193843], num: 0 }, |
|
|
|
{ name: "余杭区", LngAndLat: [119.91, 30.323843], num: 0 }, |
|
|
|
{ name: "临平区", LngAndLat: [120.29, 30.419025], num: 0 }, |
|
|
|
{ name: "钱塘区", LngAndLat: [120.49, 30.322904], num: 0 }, |
|
|
|
{ name: "老城区", LngAndLat: [112.477298,34.682945], num: 0 }, |
|
|
|
{ name: "西工区", LngAndLat: [112.443232,34.667847], num: 0 }, |
|
|
|
{ name: "瀍河回族区", LngAndLat: [112.491625, 34.684738], num: 0 }, |
|
|
|
{ name: "涧西区", LngAndLat: [112.399243, 34.654251], num: 0 }, |
|
|
|
{ name: "孟津区", LngAndLat: [112.443892, 34.826485], num: 0 }, |
|
|
|
{ name: "洛龙区", LngAndLat: [112.456634, 34.618557], num: 0 }, |
|
|
|
{ name: "新安县", LngAndLat: [112.141403, 34.728679], num: 0 }, |
|
|
|
{ name: "栾川县", LngAndLat: [111.618386, 33.783195], num: 0 }, |
|
|
|
{ name: "嵩县", LngAndLat: [112.087765, 34.131563], num: 0 }, |
|
|
|
{ name: "汝阳县", LngAndLat: [112.473789, 34.15323], num: 0 }, |
|
|
|
{ name: "宜阳县", LngAndLat: [112.179989, 34.516478], num: 0 }, |
|
|
|
{ name: "洛宁县", LngAndLat: [111.655399, 34.387179], num: 0 }, |
|
|
|
{ name: "伊川县", LngAndLat: [112.429384, 34.423416], num: 0 }, |
|
|
|
{ name: "偃师区", LngAndLat: [112.787739, 34.723042], num: 9 }, |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
@ -236,53 +247,7 @@ export default { |
|
|
|
regions: regions, |
|
|
|
zoom: 1.2, |
|
|
|
}, |
|
|
|
mapOption: { |
|
|
|
//标题内容 |
|
|
|
title: { |
|
|
|
text: "杭州市各区案件分布图 ", |
|
|
|
}, |
|
|
|
//鼠标移入时显示的内容 |
|
|
|
tooltip: { |
|
|
|
trigger: "item", |
|
|
|
formatter: "{b}<br/>{c} (p / km2)", |
|
|
|
}, |
|
|
|
series: [ |
|
|
|
{ |
|
|
|
type: "map", //图标类型 |
|
|
|
mapType: "hangzhou", // 自定义扩展图表类型 |
|
|
|
name: "杭州市各区案件完成数量对比", |
|
|
|
label: { |
|
|
|
show: true, |
|
|
|
}, |
|
|
|
//用于修改正常显示地图颜色边框等内容 |
|
|
|
normal: { |
|
|
|
borderWidth: 1, |
|
|
|
borderColor: "#e1e1e1", |
|
|
|
color: "#90c31d", |
|
|
|
opacity: 0.8, |
|
|
|
}, |
|
|
|
//用于修改鼠标移入时地图颜色边框等内容 |
|
|
|
emphasis: { |
|
|
|
areaColor: "#749f83", //修改移入时地图颜色 |
|
|
|
}, |
|
|
|
data: [ |
|
|
|
{ name: "西湖区", value: 2057.34 }, |
|
|
|
{ name: "余杭区", value: 1577.48 }, |
|
|
|
{ name: "临安区", value: 386.1 }, |
|
|
|
{ name: "淳安区", value: 692.6 }, |
|
|
|
{ name: "建德市", value: 445.49 }, |
|
|
|
{ name: "桐庐县", value: 489.64 }, |
|
|
|
{ name: "富阳区", value: 376.78 }, |
|
|
|
{ name: "萧山区", value: 451.97 }, |
|
|
|
{ name: "拱墅区", value: 520.26 }, |
|
|
|
{ name: "下城区", value: 210.9 }, |
|
|
|
{ name: "江干区", value: 418.26 }, |
|
|
|
{ name: "滨江区", value: 581.84 }, |
|
|
|
{ name: "上城区", value: 418.01 }, |
|
|
|
], |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
// 地域charts实例 |
|
|
|
dismapchart: {}, |
|
|
|
}; |
|
|
@ -359,11 +324,13 @@ export default { |
|
|
|
symbolSize: 40, |
|
|
|
coordinateSystem: "geo", |
|
|
|
data: this.convertData(this.sanData), |
|
|
|
showEffectOn: "emphasis", |
|
|
|
// showEffectOn: "emphasis", |
|
|
|
rippleEffect: { |
|
|
|
brushType: "stroke", |
|
|
|
}, |
|
|
|
backgroundColor: "#000000", |
|
|
|
emphasis: { |
|
|
|
areaColor: "#EC9D4B", //修改移入时地图颜色 |
|
|
|
}, |
|
|
|
hoverAnimation: true, |
|
|
|
label: { |
|
|
|
normal: { |
|
|
@ -372,7 +339,6 @@ export default { |
|
|
|
return params.data["num"]; //大头针标记上显示的信息 |
|
|
|
}, |
|
|
|
position: "inside", |
|
|
|
color: "#343006", |
|
|
|
fontSize: 12, |
|
|
|
}, |
|
|
|
emphasis: { |
|
|
@ -383,6 +349,10 @@ export default { |
|
|
|
normal: { |
|
|
|
color: "#FEC006", |
|
|
|
}, |
|
|
|
emphasis: { |
|
|
|
label: { show: true }, |
|
|
|
areaColor: "#749f83", //修改移入时地图颜色 |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|