From 1a5dddf9f8ca09da14f6abdeb0f125baffd9fc87 Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Thu, 29 Aug 2019 10:33:08 +0800 Subject: [PATCH] 修改弹窗信息内容 --- src/main/webapp/view/pollutionsource.jsp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 97 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/view/pollutionsource.jsp b/src/main/webapp/view/pollutionsource.jsp index 31d1fd0..d353b31 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 windLevel; + var condition; if (Object.keys(weatherInfoForecast).length === 0) { var windDir = weatherInfoToday["windDir"]; dirPoint = getWindDir(windDir, dirPoint); + windLevel = weatherInfoToday["windLevel"]; + condition = weatherInfoToday["condition"]; } else { if (isToday) { var windDir = weatherInfoToday["windDir"]; dirPoint = getWindDir(windDir, dirPoint); + windLevel = weatherInfoToday["windLevel"]; + condition = weatherInfoToday["condition"]; } else { var windDir = weatherInfoForecast["windDirDay"]; dirPoint = getWindDir(windDir, dirPoint); + windLevel = weatherInfoForecast["windLevelDay"]; + condition = weatherInfoForecast["conditionDay"]; } } var polyline = new BMap.Polyline([ @@ -110,16 +161,53 @@ ); 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 (windLevel >= 3) { + supplement = "���������������������������������������������������������������������������"; + } + if (condition.indexOf("���") != -1) { + supplement = "������������������������������������������������������������������������"; + } + winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������������������������������������������������" + supplement + "</p>"; + } else if (month == 3 || month == 4 || month == 5) { + if (windLevel >= 3) { + supplement = "���������������������������������������������������������������������������"; + } + if (condition.indexOf("���") != -1) { + supplement = "������������������������������������������������������������������������"; + } + winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������������������������������" + supplement + "</p>"; + } else if (month == 6 || month == 7) { + if (windLevel >= 3) { + supplement = "������������������������������������"; + } + if (condition.indexOf("���") != -1) { + supplement = "���������������������������������������������������������������������������"; + } + winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������,���������������������" + supplement + "</p>"; + } else if (month == 8 || month == 9 || month == 10 || month == 11) { + if (windLevel >= 3) { + supplement = "������������������������������������������"; + } + if (condition.indexOf("���") != -1) { + 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