From d2286cf9de87e0553a248eea703b39734a95d529 Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Fri, 23 Aug 2019 14:19:58 +0800
Subject: [PATCH] 新增信息弹窗内容
---
src/main/webapp/view/pollutionsource.jsp | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 109 insertions(+), 9 deletions(-)
diff --git a/src/main/webapp/view/pollutionsource.jsp b/src/main/webapp/view/pollutionsource.jsp
index 31d1fd0..41a309c 100644
--- a/src/main/webapp/view/pollutionsource.jsp
+++ b/src/main/webapp/view/pollutionsource.jsp
@@ -34,6 +34,51 @@
padding: 0;
list-style: none;
}
+
+ .BMap_top {
+ display: none;
+ }
+
+ .BMap_center {
+ display: none;
+ }
+
+ .BMap_bubble_title {
+ color: white;
+ padding: 0 5px 0 5px;
+ background-color: #2DA0EB;
+ }
+
+ .BMap_bubble_content {
+ background-color: white;
+ padding: 5px;
+ }
+
+ .BMap_pop > img {
+ top: 42px !important;
+ margin-left: -10px;
+ }
+
+ .BMap_pop div:nth-child(1) div {
+ display: none;
+ }
+
+ .BMap_pop div:nth-child(3) {
+ display: none;
+ }
+
+ .BMap_pop div:nth-child(5) {
+ display: none;
+ }
+
+ .BMap_pop div:nth-child(7) {
+ display: none;
+ }
+
+ .BMap_pop div:nth-child(9) {
+ top: 35px !important;
+ border-radius: 5px;
+ }
</style>
<body>
@@ -57,9 +102,7 @@
var weatherInfoToday = params["weatherInfoToday"];
var weatherInfoForecast = params["weatherInfoForecast"];
var isToday = params["isToday"];
- console.log(weatherInfoToday);
- console.log(weatherInfoForecast);
- console.log(isToday);
+ var month = params["month"];
var device = params["device"];
var cityName = params["weatherInfoToday"]["cityName"];
var map = new BMap.Map("mapCanvas", {enableMapClick: false});
@@ -90,16 +133,24 @@
var w = new BMap.Point(sw.lng, latitude);
var e = new BMap.Point(ne.lng, latitude);
var dirPoint;
+ var humidity;
+ var windLevel;
if (Object.keys(weatherInfoForecast).length === 0) {
var windDir = weatherInfoToday["windDir"];
dirPoint = getWindDir(windDir, dirPoint);
+ humidity = weatherInfoToday["humidity"];
+ windLevel = weatherInfoToday["windLevel"];
} else {
if (isToday) {
var windDir = weatherInfoToday["windDir"];
dirPoint = getWindDir(windDir, dirPoint);
+ humidity = weatherInfoToday["humidity"];
+ windLevel = weatherInfoToday["windLevel"];
} else {
var windDir = weatherInfoForecast["windDirDay"];
dirPoint = getWindDir(windDir, dirPoint);
+ humidity = weatherInfoForecast["humidity"];
+ windLevel = weatherInfoForecast["windLevelDay"];
}
}
var polyline = new BMap.Polyline([
@@ -110,16 +161,65 @@
);
map.addOverlay(polyline);// ���������������
addArrow(polyline, 50, Math.PI / 7);
+ var winfowTextCause = "<p style='height: 44px;line-height: 22px'>���������������������������������������������������������������������������������������������������������������������</p>";
+ var winfowTextSource;
+ var supplement;
+ if (month == 12 || month == 1 || month == 2) {
+ if (humidity > 60 && windLevel < 2) {
+ supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
+ } else if (humidity > 80 && windLevel < 2) {
+ supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
+ } else if (windLevel > 2) {
+ supplement = "���������������������������������������������������������������������������";
+ } else {
+ supplement = "������������������������������������������������";
+ }
+ winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������������������������" + supplement + "</p>";
+ } else if (month == 3 || month == 4 || month == 5) {
+ if (humidity > 60 && windLevel < 2) {
+ supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
+ } else if (humidity > 80 && windLevel < 2) {
+ supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
+ } else if (windLevel >= 2) {
+ supplement = "������������������������������������������������������������������������������";
+ } else {
+ supplement = "���������������������������������������������������";
+ }
+ winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������������������������������" + supplement + "</p>";
+ } else if (month == 6 || month == 7) {
+ if (humidity > 60 && windLevel < 2) {
+ supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
+ } else if (humidity > 80 && windLevel < 2) {
+ supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
+ } else if (windLevel > 2) {
+ supplement = "������������������������������������������������������������������������������";
+ } else {
+ supplement = "���������������������������������������������������";
+ }
+ winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������" + supplement + "</p>";
+ } else if (month == 8 || month == 9 || month == 10 || month == 11) {
+ if (humidity > 60 && windLevel < 2) {
+ supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
+ } else if (humidity > 80 && windLevel < 2) {
+ supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
+ } else if (windLevel > 2) {
+ supplement = "������������������������������������������������������������������������������";
+ } else {
+ supplement = "���������������������������������������������������";
+ }
+ winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������" + supplement + "</p>";
+ }
- var winfowText =
- '<div style="min-height:20px;overflow:auto;max-height:330px;" >';
+ var winfowText = '<div style="height:150px;" >';
var opts = {
- width: 220,
- height: 220,
+ width: 380,
+ title: '<h3>������������</h3>',
enableMessage: false //���������������������������������
}
- winfowText += ("<p style='height: 22px;line-height: 22px'></p>");
-
+ winfowText += '<h3 style="background-color: #CD5C5C;color:white;margin-bottom: 1px">������������</h3>';
+ winfowText += winfowTextCause;
+ winfowText += '<h3 style="background-color: #66CD00;color:white;margin-bottom: 1px">������������</h3>';
+ winfowText += winfowTextSource;
winfowText += "</div>";
marker.addEventListener("click", function () {
var infoWindow = new BMap.InfoWindow(winfowText, opts);
--
Gitblit v1.8.0