echarts 地图修改

This commit is contained in:
cwchen 2025-09-22 15:22:59 +08:00
parent 0155d8bc23
commit 0c3af55fb3
6 changed files with 17 additions and 14 deletions

View File

@ -20,7 +20,7 @@
<script src="../../js/home/userBanding.js" type="text/javascript"></script>
<script src="../../js/public/openIframe.js" type="text/javascript"></script>
<title>安全质量智慧决策中心</title>
<title>主动安全值班助手</title>
<style>
/*input框select样式*/
.layui-select {

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
//在div中初始化地图
let uploadedDataURL2 = "../../../js/compreDisplay/anhui/hefei.json";
let uploadedDataURL2 = "../../../js/compreDisplay/anhui/jilin.json";
echarts.init(document.getElementById('echarts-map')).dispose();
let myChart2 = null;
@ -194,8 +194,9 @@ function isOnline(value) {
// 地市地图
function setCityMap(name, isSup, mapPointList) {
if (isSup === '1' || isSup === '2') {
uploadedDataURL2 = '../../js/compreDisplay/anhui/anhui.json';
uploadedDataURL2 = '../../js/compreDisplay/anhui/jilin.json';
/* if (isSup === '1' || isSup === '2') {
uploadedDataURL2 = '../../js/compreDisplay/anhui/jinli.json';
} else {
if (name === "12A0") {
uploadedDataURL2 = '../../js/compreDisplay/anhui/hefei.json';
@ -232,7 +233,7 @@ function setCityMap(name, isSup, mapPointList) {
} else if (name === "12Z0") {
uploadedDataURL2 = '../../js/compreDisplay/anhui/anhui.json';
}
}
} */
myChart2 = echarts.init(document.getElementById('echarts-map'));
map2(mapPointList);
}

View File

@ -1,6 +1,7 @@
//在div中初始化地图
// /let myChart = echarts.init(document.getElementById('map-content'));
let uploadedDataURL = "../../js/compreDisplay/anhui/anhui.json";
// let uploadedDataURL = "../../js/compreDisplay/anhui/anhui.json";
let uploadedDataURL = "../../js/compreDisplay/anhui/jilin.json";
let myChart = echarts.init(document.getElementById('echarts-map'));
// 选中的地市名称和编码
let clickCityName = null, clickCityCode = null;
@ -336,7 +337,7 @@ function map(dataMap) {
/*myChart.off('click').on('click', function (params) {
// openVideo(params.data)
});*/
myChart.off('dblclick').on("dblclick", function (params) {
/* myChart.off('dblclick').on("dblclick", function (params) {
if(params.componentType === 'geo'){
$('.switch-type').css('display', 'none');
$('.switch-btn').css('display', 'none');
@ -345,7 +346,7 @@ function map(dataMap) {
console.log(params);
setUploadedDataURL2(params.name);
}
})
}) */
});
window.addEventListener("resize", function () {
myChart.resize();

View File

@ -105,7 +105,7 @@ function createMap() {
terrainMap = new BMap.Map("allMap", {
mapType: BMAP_HYBRID_MAP
}); // 创建Map实例
terrainMap.centerAndZoom('合肥', 8); // 初始化地图,设置中心点坐标和地图级别
terrainMap.centerAndZoom('吉林', 8); // 初始化地图,设置中心点坐标和地图级别
//添加地图类型控件
// terrainMap.addControl(new BMap.MapTypeControl({
// mapTypes: [
@ -113,7 +113,7 @@ function createMap() {
// BMAP_HYBRID_MAP
// ]
// }));
terrainMap.setCurrentCity("合肥"); // 设置地图显示的城市 此项是必须设置的
terrainMap.setCurrentCity("吉林"); // 设置地图显示的城市 此项是必须设置的
}
// 创建地图
@ -121,7 +121,7 @@ function createMap2() {
terrainMap = new BMap.Map("allMap", {
// mapType: BMAP_HYBRID_MAP
}); // 创建Map实例
terrainMap.centerAndZoom('合肥', 8); // 初始化地图,设置中心点坐标和地图级别
terrainMap.centerAndZoom('吉林', 8); // 初始化地图,设置中心点坐标和地图级别
//添加地图类型控件
// terrainMap.addControl(new BMap.MapTypeControl({
// mapTypes: [
@ -129,12 +129,12 @@ function createMap2() {
// BMAP_HYBRID_MAP
// ]
// }));
// terrainMap.setCurrentCity("合肥"); // 设置地图显示的城市 此项是必须设置的
// terrainMap.setCurrentCity("吉林"); // 设置地图显示的城市 此项是必须设置的
}
//设置区域图 start
function madeBoundary() {
let datas = new Array("安徽省-");
let datas = new Array("吉林省-");
var bdary = new BMap.Boundary();
for (var i = 0; i < datas.length; i++) {
getBoundary(datas[i], bdary);

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8"/>
<title>安全质量智慧决策中心</title>
<title>主动安全值班助手</title>
</head>
<link href="bns/css/login.css" rel="stylesheet">
<link href="bns/js/layui/css/layui.css" rel="stylesheet">