完善3d地图

main
jinna 3 years ago
parent 616e0c00ac
commit 17c67e5a07
  1. 2
      package.json
  2. BIN
      public/image/map_bg.png
  3. 52
      src/views/components/showmap.vue
  4. 2
      src/views/dashboard/home.vue
  5. 2
      src/views/dashboard/homepage.vue

@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"axios": "^1.2.2", "axios": "^1.2.2",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"echarts": "^5.4.0", "echarts": "^5.4.1",
"echarts-gl": "^2.0.9", "echarts-gl": "^2.0.9",
"element-ui": "^2.15.12", "element-ui": "^2.15.12",
"highcharts": "^9.3.3", "highcharts": "^9.3.3",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

@ -178,7 +178,6 @@ export default {
} }
return res; return res;
}; };
var yMax = 0; var yMax = 0;
for (var j = 0; j < this.mapData.length; j++) { for (var j = 0; j < this.mapData.length; j++) {
if (yMax < this.mapData[j].value) { if (yMax < this.mapData[j].value) {
@ -391,7 +390,7 @@ export default {
}, },
//3d //3d
render3DMap() { render3DMap() {
var color = ['#000']; // var color = ['#000'];
this.myChart = this.$echarts.init(document.getElementById("chart_map")); this.myChart = this.$echarts.init(document.getElementById("chart_map"));
this.$echarts.registerMap("莒县", prefecture, {}); this.$echarts.registerMap("莒县", prefecture, {});
var seriesData = []; var seriesData = [];
@ -402,13 +401,21 @@ export default {
} }
); );
}) })
console.log(seriesData)
let option = { let option = {
geo3D: { geo3D: {
show:true,
map: '莒县', map: '莒县',
roam: false, left: "0%",
top: 0, // environment: '/image/map_bg.png',
bottom: 20, roam: true,
boxWidth: 200, shading:'realistic',
zoom: 2,
regionHeight: 15,
// top: -20,
// bottom: 20,
// boxWidth: 100,
// boxHeight:50,
itemStyle: { itemStyle: {
areaColor: 'rgb(5,101,123)', areaColor: 'rgb(5,101,123)',
opacity: 1, opacity: 1,
@ -416,31 +423,46 @@ export default {
borderColor: 'rgb(62,215,213)' borderColor: 'rgb(62,215,213)'
}, },
realisticMaterial: { realisticMaterial: {
detailTexture: require("@/assets/images/map_bg.png") detailTexture: require("@/assets/images/map_bg.png"),
roughness:0.8
},
viewControl: {
"projection": "perspective",
"autoRotate": false,
"distance": 180, //
"alpha": 35, //
"beta": 10, //
'rotateSensitivity': 0, //
'panSensitivity': 0, //
'zoomSensitivity': 0, //
}, },
}, },
series: [ series: [
{ {
type: "lines3D", type: "lines3D",
coordinateSystem: 'geo3D', coordinateSystem: 'geo3D',
zlevel: 2, zlevel: 1,
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter(params) { formatter(params) {
// console.log(params); console.log(params);
}, },
}, },
animation:true,
effect: { effect: {
show: true, show: true,
period: 6, // period: 10,
trailLength: 0, // [0,1] trailLength: 0.1,
symbol: "arrow", // trailColor: '#fff',
symbolSize: 5, // color: '#fff', //
symbol: 'arrow',
symbolSize: 6
}, },
lineStyle: { lineStyle: {
// normal: { // normal: {
color: color[0], color: "#e3c946",
width: 3, // 线 width: 2, // 线
opacity: 0.6, // 线 opacity: 0.6, // 线
curveness: 0.2, // 线 curveness: 0.2, // 线
// }, // },

@ -1568,7 +1568,7 @@ export default {
.pie_bg{ .pie_bg{
width: 65%; width: 65%;
height: 65%; height: 65%;
background: url(http://192.168.1.35:8080/img/pie_bg.587a605d.png) no-repeat; background: url(~@/assets/img/pie_bg.png) no-repeat;
position: absolute; position: absolute;
background-size: 100% 100%; background-size: 100% 100%;
// background-position-y: 0.5rem; // background-position-y: 0.5rem;

@ -272,7 +272,7 @@ export default {
}, },
created() { created() {
this.getTime(); this.getTime();
this.readExcelFile("http://"+location.host+"/excel/wuliu.xlsx"); this.readExcelFile("http://192.168.1.35:8080/excel/wuliu.xlsx");
// this.readExcelFile("/excelapi/ces.xlsx"); // this.readExcelFile("/excelapi/ces.xlsx");
this.$nextTick(() => { this.$nextTick(() => {
this.createCharts(); this.createCharts();

Loading…
Cancel
Save