Commit 0d67cf58 by hanjixin

bug

parent 2490986f
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head> <meta
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0" /> name="viewport"
content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0"
/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MAP</title> <title>MAP</title>
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css" />
<style> <style></style>
</head>
</style> <body>
</head>
<body>
<div id="container"></div> <div id="container"></div>
<div id=nav> <div id="nav">
<div class="item" onclick="go(0)"><span class="icon icon1"></span>预警信息</div> <div class="item" onclick="go(0)">
<div class="item" onclick="go(1)"><span class="icon icon2"></span>设备</div> <span class="icon icon1"></span>预警信息
</div>
<div class="item" onclick="go(1)">
<span class="icon icon2"></span>设备
</div>
<div class="subnav subnav1"> <div class="subnav subnav1">
<div class='' onclick="go(1,0)">大喇叭</div> <div class="" onclick="go(1,0)">大喇叭</div>
<div onclick="go(1,1)">显示屏</div> <div onclick="go(1,1)">显示屏</div>
<div onclick="go(1,2)">北斗</div> <div onclick="go(1,2)">北斗</div>
</div> </div>
<div class="item" onclick="go(2)"><span class="icon icon3"></span>人员</div> <div class="item" onclick="go(2)">
<span class="icon icon3"></span>人员
</div>
<div class="subnav subnav2"> <div class="subnav subnav2">
<div onclick="go(2,0)">信息员</div> <div onclick="go(2,0)">信息员</div>
<div onclick="go(2,1)">应急责任人</div> <div onclick="go(2,1)">应急责任人</div>
...@@ -43,104 +49,157 @@ ...@@ -43,104 +49,157 @@
</style> </style>
<script src="./js/tools.js"></script> <script src="./js/tools.js"></script>
<script src="./js/Map3D.js"></script> <script src="./js/Map3D.js"></script>
<script language=javascript> <script language="javascript">
// <script language=javascript type=module> // <script language=javascript type=module>
//http://106.120.82.243:8080/qxyj/pageHtml/login.html wis 12379 //http://106.120.82.243:8080/qxyj/pageHtml/login.html wis 12379
// import { Map3D } from './js/Map3D.js'; // import { Map3D } from './js/Map3D.js';
// import { GetParams } from './js/tools.js'; // import { GetParams } from './js/tools.js';
window.urlParams = GetParams() window.urlParams = GetParams();
//成都 重庆 天津 北京 上海 大连 三沙 湖北 中国 //成都 重庆 天津 北京 上海 大连 三沙 湖北 中国
//350200 //350200
//350500 //350500
//320300 370100 //320300 370100
window.map3d = new Map3D(urlParams.adcode || '610000' || '成都', 'container', urlParams, (_map3d) => { window.map3d = new Map3D(
go(0) urlParams.adcode || "610000" || "成都",
}); "container",
window.review = function (params) { urlParams,
map3d.review() _map3d => {
} go(0);
window.delPoi = function (params) { }
);
window.review = function(params) {
map3d.review();
};
window.delPoi = function(params) {
try { try {
map3d.map.clearInfoWindow() map3d.map.clearInfoWindow();
map3d.delPoi(pois) map3d.delPoi(pois);
window.pois = [] map3d.map.remove(pois);
} catch (error) { map3d.cluster.clearMarkers();
} if(params)window.pois = [];
} } catch (error) {}
};
window.addPoiByApi = function (api, type, type1) { window.addPoiByApi = function(api, type, type1) {
console.log(api); console.log(api);
window.delPoi() window.delPoi(1);
window.review() window.review();
$.get(api).then(res => { $.get(api).then(res => {
var currentDetailList = res.data var currentDetailList = res.data;
console.log(currentDetailList); console.log(currentDetailList);
if (type1 == 'MassMarks') { if (type1 == "MassMarks") {
map3d.addPoisMassMarks(currentDetailList, type).then(res => window.pois = res) window.delPoi(0);
} else if (type1 == 'Single') { map3d
map3d.addPoisSingle(currentDetailList, type).then(res => window.pois = res) .addPoisMassMarks(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else if (type1 == "Single") {
window.delPoi(0);
map3d
.addPoisSingle(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else { } else {
map3d.addPoisMarkerClusterer(currentDetailList, type).then(res => window.pois = res) window.delPoi(0);
map3d
.addPoisMarkerClusterer(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} }
}); });
} };
</script> </script>
<script> <script>
var oldi1 = 0, oldi2 = 0 var oldi1 = 0,
oldi2 = 0;
function popclose() { function popclose() {
console.log('popclose'); console.log("popclose");
map3d.map.clearInfoWindow() map3d.map.clearInfoWindow();
} }
function go(i1, i2) { function go(i1, i2) {
console.log(oldi1, oldi2); console.log(oldi1, oldi2);
console.log(i1, i2); console.log(i1, i2);
if (i1 == oldi1 && i2 == oldi2) { if (i1 == oldi1 && i2 == oldi2) {
return false return false;
} }
$(".item").removeClass("active").removeClass("text-shadow") $(".item")
$(".item").eq(i1).addClass("active text-shadow") .removeClass("active")
$(".subnav").hide() .removeClass("text-shadow");
$(".subnav" + i1).show() $(".item")
$(".subnav" + i1).find("div").removeClass("active").removeClass("text-shadow") .eq(i1)
if (typeof (i2) != 'undefined') { .addClass("active text-shadow");
$(".subnav" + i1).find("div").eq(i2).addClass("active text-shadow") $(".subnav").hide();
$(".subnav" + i1).show();
$(".subnav" + i1)
.find("div")
.removeClass("active")
.removeClass("text-shadow");
if (typeof i2 != "undefined") {
$(".subnav" + i1)
.find("div")
.eq(i2)
.addClass("active text-shadow");
} }
if (i1 == 0 && typeof i2 == "undefined") {
if (i1 == 0 && typeof (i2) == 'undefined') {//预警信息 //预警信息
addPoiByApi('http://123.56.149.208:8091/external/get/early/warn/city/two/list/' + urlParams.adcode, 'setWarnPoint', 'Single') addPoiByApi(
oldi1 = i1, oldi2 = i2 "http://123.56.149.208:8091/external/get/early/warn/city/two/list/" +
urlParams.adcode,
"setWarnPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
} }
if (i1 == 1 && i2 == 0) {//大喇叭 if (i1 == 1 && i2 == 0) {
addPoiByApi(`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=1`, 'setEquipmentPoint', 'Cluster') //大喇叭
oldi1 = i1, oldi2 = i2 addPoiByApi(
} `http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=1`,
if (i1 == 1 && i2 == 1) {//显示屏 "setEquipmentPoint",
addPoiByApi(`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=2`, 'setEquipmentPoint', 'Single') "Cluster"
oldi1 = i1, oldi2 = i2 );
} (oldi1 = i1), (oldi2 = i2);
if (i1 == 1 && i2 == 2) {//北斗 }
addPoiByApi(`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=3`, 'setEquipmentPoint', 'Single') if (i1 == 1 && i2 == 1) {
oldi1 = i1, oldi2 = i2 //显示屏
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=2`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 2) {
//北斗
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=3`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
} }
if (i1 == 2 && i2 == 0) {//信息员 if (i1 == 2 && i2 == 0) {
addPoiByApi('http://123.56.149.208:8091/external/get/early/warn/people/two/info/' + urlParams.adcode, 'setPersonalPoint', 'Cluster') //信息员
oldi1 = i1, oldi2 = i2 addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/info/" +
urlParams.adcode,
"setPersonalPoint",
"Cluster"
);
(oldi1 = i1), (oldi2 = i2);
} }
if (i1 == 2 && i2 == 1) {//应急责任人 if (i1 == 2 && i2 == 1) {
addPoiByApi('http://123.56.149.208:8091/external/get/early/warn/people/two/principal/' + urlParams.adcode, 'setPrincipalPoint', 'Single') //应急责任人
oldi1 = i1, oldi2 = i2 addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/principal/" +
urlParams.adcode,
"setPrincipalPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
} }
} }
// go(i1,i2) // go(i1,i2)
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment