修改驾驶仓地图
parent
b55d4403e3
commit
405a461709
File diff suppressed because one or more lines are too long
|
|
@ -30,7 +30,7 @@ const convertData = (data) => {
|
||||||
var geoCoordMap = []
|
var geoCoordMap = []
|
||||||
chinaMap.features.forEach((item) => {
|
chinaMap.features.forEach((item) => {
|
||||||
geoCoordMap[item.properties.name] = item.properties.centroid ?? item.properties.center
|
geoCoordMap[item.properties.name] = item.properties.centroid ?? item.properties.center
|
||||||
if(item.properties.name=='河北省' ) console.log(item.properties.centroid)
|
// if(item.properties.name=='河北省' ) console.log(item.properties.centroid)
|
||||||
})
|
})
|
||||||
var res = []
|
var res = []
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
|
@ -56,6 +56,9 @@ const chatInit = () => {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
|
|
||||||
|
if(params.name=="南海诸岛") return ''
|
||||||
|
|
||||||
if (typeof params.value[2] == 'undefined') {
|
if (typeof params.value[2] == 'undefined') {
|
||||||
return params.name + ' : ' + params.value
|
return params.name + ' : ' + params.value
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -74,18 +77,18 @@ const chatInit = () => {
|
||||||
color: 'rgb(249, 249, 249)', //省份标签字体颜色
|
color: 'rgb(249, 249, 249)', //省份标签字体颜色
|
||||||
},
|
},
|
||||||
regions: [
|
regions: [
|
||||||
{
|
// {
|
||||||
name: "南海诸岛",
|
// name: "南海诸岛",
|
||||||
itemStyle: {
|
// itemStyle: {
|
||||||
// 隐藏地图
|
// // 隐藏地图
|
||||||
normal: {
|
// normal: {
|
||||||
opacity: 0, // 为 0 时不绘制该图形
|
// opacity: 0, // 为 0 时不绘制该图形
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
label: {
|
// label: {
|
||||||
show: false // 隐藏文字
|
// show: false // 隐藏文字
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
],
|
],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
areaColor: '#24CFF4',
|
areaColor: '#24CFF4',
|
||||||
|
|
@ -162,7 +165,11 @@ const chatInit = () => {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
formatter(value) {
|
formatter(value) {
|
||||||
return value.data.value[2]
|
|
||||||
|
if (typeof value.data.value[2] == 'undefined') {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return value.data.value[2] ?? 0
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,8 @@ function __SetOption(data) {
|
||||||
let option = {
|
let option = {
|
||||||
grid: {
|
grid: {
|
||||||
top: '10px',
|
top: '10px',
|
||||||
left: '20px',
|
left: '10px',
|
||||||
right: '30px',
|
right: '40px',
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue