| | |
| | | <body> |
| | | <div class="main_body"> |
| | | <input type="button" id="show" value="溯源运算"/> |
| | | <div id="cpm">无法推测来源</div> |
| | | <div id="cpm"></div> |
| | | <div id="mapCanvas"></div> <!-- 百度地图 --> |
| | | <!-- 传sensorInfo,regionCode,regionName,monitorPoint,device--> |
| | | <div id="pollutionSourceParams" style="display: none;"> |
| | |
| | | var marker = new BMap.Marker(point, {icon: icon, offset: new BMap.Size(0, -20)}); |
| | | map.addOverlay(marker); |
| | | map.centerAndZoom(point, 16); |
| | | if (!$.isEmptyObject(dirPoint) && !$.isEmptyObject(getPollutionSourceData) && typeof (getPollutionSourceData["e6"]) != "undefined" && typeof (getPollutionSourceData["e7"]) != "undefined" && typeof (getPollutionSourceData["e18"]) != "undefined" && typeof (getPollutionSourceData["e23"]) != "undefined" && getPollutionSourceData["e18"] > 0.03) { |
| | | var humidity = 0; |
| | | var temperature = 0; |
| | | if (!$.isEmptyObject(dirPoint) && !$.isEmptyObject(getPollutionSourceData) && typeof (getPollutionSourceData["e18"]) != "undefined" && typeof (getPollutionSourceData["e23"]) != "undefined" && getPollutionSourceData["e18"] != 0) { |
| | | var windSpeed = parseFloat(getPollutionSourceData["e18"]); |
| | | var windDir = parseFloat(getPollutionSourceData["e23"]); |
| | | var distance = windSpeed * 3600; |
| | |
| | | |
| | | $("#show").one('click', function () { |
| | | setTimeout(function () { |
| | | if ($.isEmptyObject(dirPoint) || $.isEmptyObject(getPollutionSourceData) || typeof (getPollutionSourceData["e6"]) == "undefined" || typeof (getPollutionSourceData["e7"]) == "undefined" || typeof (getPollutionSourceData["e18"]) == "undefined" || typeof (getPollutionSourceData["e23"]) == "undefined" || getPollutionSourceData["e18"] <= 0.03) { |
| | | if ($.isEmptyObject(dirPoint) || $.isEmptyObject(getPollutionSourceData) || typeof (getPollutionSourceData["e18"]) == "undefined" || typeof (getPollutionSourceData["e23"]) == "undefined" || getPollutionSourceData["e18"] === 0) { |
| | | showNoData(); |
| | | } else { |
| | | var humidity = parseFloat(getPollutionSourceData["e6"]); |
| | | var temperature = parseFloat(getPollutionSourceData["e7"]); |
| | | if (typeof (getPollutionSourceData["e6"]) != "undefined") { |
| | | humidity = parseFloat(getPollutionSourceData["e6"]); |
| | | } |
| | | if (typeof (getPollutionSourceData["e7"]) != "undefined") { |
| | | temperature = parseFloat(getPollutionSourceData["e7"]); |
| | | } |
| | | var windSpeed = parseFloat(getPollutionSourceData["e18"]); |
| | | var windDir = parseFloat(getPollutionSourceData["e23"]); |
| | | var selectSensorKey = getPollutionSourceData["selectSensorKey"]; |
| | |
| | | var winfowTextSource; |
| | | var supplement; |
| | | if (selectSensorKey == "臭氧") { |
| | | winfowTextCause = "<p style='height: 44px;line-height: 22px'>主要来源机动车尾气、燃煤电厂的排放氮氧化物,油漆油气挥发有机物在高温,阳光充足的照射下发生光化学烟雾</p>"; |
| | | winfowTextSource = "<p style='height: 22px;line-height: 22px'>Nox以及VOCs总量超标</p>"; |
| | | winfowTextCause = "<p style='height: 44px;line-height: 22px'>主要来源机动车尾气、燃煤排放氮氧化物,油漆油气挥发有机物在高温,阳光充足的照射下发生光化学烟雾</p>"; |
| | | winfowTextSource = "<p style='height: 22px;line-height: 22px'>NOx以及VOCs总量超标</p>"; |
| | | } else { |
| | | if (month == 12 || month == 1 || month == 2) { |
| | | if (windSpeed >= 3.4) { |
| | |
| | | } else if (windDir > 270 && windDir < 360) { |
| | | windDirection = "西北风"; |
| | | } |
| | | lab = new BMap.Label("<P>温度:" + temperature + "℃</p><P>湿度:" + humidity + "%</p><P>风速:" + windSpeed + "m/s</p><P>风向:" + windDirection + "</p>", { |
| | | position: pointMiddle, |
| | | offset: new BMap.Size(-50, -40) |
| | | }); |
| | | if (temperature != 0 && humidity != 0) { |
| | | lab = new BMap.Label("<P>温度:" + temperature + "℃</p><P>湿度:" + humidity + "%</p><P>风速:" + windSpeed + "m/s</p><P>风向:" + windDirection + "</p>", { |
| | | position: pointMiddle, |
| | | offset: new BMap.Size(-50, -40) |
| | | }); |
| | | } else if (temperature == 0 && humidity != 0) { |
| | | lab = new BMap.Label("<P>湿度:" + humidity + "%</p><P>风速:" + windSpeed + "m/s</p><P>风向:" + windDirection + "</p>", { |
| | | position: pointMiddle, |
| | | offset: new BMap.Size(-50, -40) |
| | | }); |
| | | } else if (temperature != 0 && humidity == 0) { |
| | | lab = new BMap.Label("<P>温度:" + temperature + "℃</p><P>风速:" + windSpeed + "m/s</p><P>风向:" + windDirection + "</p>", { |
| | | position: pointMiddle, |
| | | offset: new BMap.Size(-50, -40) |
| | | }); |
| | | } else { |
| | | lab = new BMap.Label("<P>风速:" + windSpeed + "m/s</p><P>风向:" + windDirection + "</p>", { |
| | | position: pointMiddle, |
| | | offset: new BMap.Size(-50, -40) |
| | | }); |
| | | } |
| | | lab.setStyle({ |
| | | color: "#EE3B3B", |
| | | fontSize: "16px", |
| | |
| | | function showNoData() { |
| | | map.centerAndZoom(point, 17); |
| | | setTimeout(function () { |
| | | if (JSON.stringify(getPollutionSourceData) == JSON.stringify({})) { |
| | | document.getElementById("cpm").innerText = "该时间点查询无数据"; |
| | | } else { |
| | | if (getPollutionSourceData["e18"] === 0) { |
| | | document.getElementById("cpm").style.width = '380px'; |
| | | document.getElementById("cpm").innerText = "风速为0,无法溯源运算"; |
| | | } |
| | | if (typeof (getPollutionSourceData["e18"]) == "undefined") { |
| | | document.getElementById("cpm").style.width = '400px'; |
| | | document.getElementById("cpm").innerText = "设备无风速,无法溯源运算"; |
| | | } |
| | | if (typeof (getPollutionSourceData["e23"]) == "undefined") { |
| | | document.getElementById("cpm").style.width = '400px'; |
| | | document.getElementById("cpm").innerText = "设备无风向,无法溯源运算"; |
| | | } |
| | | if (typeof (getPollutionSourceData["e18"]) == "undefined" && typeof (getPollutionSourceData["e23"]) == "undefined") { |
| | | document.getElementById("cpm").style.width = '500px'; |
| | | document.getElementById("cpm").innerText = "设备无风速,无风向,无法溯源运算"; |
| | | } |
| | | } |
| | | document.getElementById("cpm").style.display = 'block'; |
| | | }, 250); |
| | | }; |