jinna 3 years ago
commit 616e0c00ac
  1. 2
      package.json
  2. BIN
      src/assets/images/map_bg.png
  3. 67
      src/views/components/showmap.vue

@ -13,7 +13,7 @@
"echarts": "^5.4.0",
"echarts-gl": "^2.0.9",
"element-ui": "^2.15.12",
"highcharts": "^9.2.2",
"highcharts": "^9.3.3",
"js-cookie": "^3.0.1",
"postcss-pxtorem": "^6.0.0",
"screenfull": "^5.2.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

@ -145,8 +145,9 @@ export default {
},
watch: {},
mounted() {
console.log(this.mapData)
this.createCharts1();
// console.log(this.mapData)
// this.createCharts1();
this.render3DMap();
},
methods: {
createCharts1() {
@ -388,6 +389,68 @@ export default {
this.myChart1.setOption(option);
// this.myCharts1.setOption(option);
},
//3d
render3DMap() {
var color = ['#000'];
this.myChart = this.$echarts.init(document.getElementById("chart_map"));
this.$echarts.registerMap("莒县", prefecture, {});
var seriesData = [];
this.datas.map((item, i) => {
seriesData.push(
{
coords: [this.geoCoordMap[item[1].name], this.geoCoordMap[item[0].name]]
}
);
})
let option = {
geo3D: {
map: '莒县',
roam: false,
top: 0,
bottom: 20,
boxWidth: 200,
itemStyle: {
areaColor: 'rgb(5,101,123)',
opacity: 1,
borderWidth: 0.8,
borderColor: 'rgb(62,215,213)'
},
realisticMaterial: {
detailTexture: require("@/assets/images/map_bg.png")
},
},
series: [
{
type: "lines3D",
coordinateSystem: 'geo3D',
zlevel: 2,
tooltip: {
trigger: "item",
formatter(params) {
// console.log(params);
},
},
effect: {
show: true,
period: 6, //
trailLength: 0, // [0,1]
symbol: "arrow", //
symbolSize: 5, //
},
lineStyle: {
// normal: {
color: color[0],
width: 3, // 线
opacity: 0.6, // 线
curveness: 0.2, // 线
// },
},
data: seriesData,
},
]
}
this.myChart.setOption(option);
},
},
};
</script>

Loading…
Cancel
Save