| | |
| | | params.put("unit",parameters.get("unit")); |
| | | params.put("description",parameters.get("description")); |
| | | String paramsJson = params.toJSONString(); |
| | | model.addObject("uavDroppointParams", paramsJson); |
| | | model.addObject("uavChannelParams", paramsJson); |
| | | model.setViewName("uavchannel"); |
| | | return model; |
| | | } else { |
| | |
| | | params.put("unit",parameters.get("unit")); |
| | | params.put("description",parameters.get("description")); |
| | | String paramsJson = params.toJSONString(); |
| | | model.addObject("uavDroppointParams", paramsJson); |
| | | model.addObject("uavTracingParams", paramsJson); |
| | | model.setViewName("uavtracing"); |
| | | return model; |
| | | } else { |
| | |
| | | for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
|
| | | for (Sensor sensor : sensors) {
|
| | | if (sensor.getSensorKey().equals(entry.getKey())) {
|
| | | dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | if (entry.getValue() != null) {
|
| | | dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | Map<String, Object> map = sensorMapper.getSensorBySensorKey(parameters.get("sensorKey").toString());
|
| | | parameters.put("unit",map.get("unit"));
|
| | | parameters.put("description",map.get("description"));
|
| | | parameters.put("unit", map.get("unit"));
|
| | | parameters.put("description", map.get("description"));
|
| | | return uavSensorData;
|
| | | }
|
| | |
|
| | |
| | | <div id="cpm">查无落点</div> |
| | | <div id="mapCanvas"></div> <!-- 百度地图容器--> |
| | | <!-- 传sensorInfo,regionCode,regionName,monitorPoint,device--> |
| | | <div id="uavDroppointParams" style="display: none;"> |
| | | ${requestScope.uavDroppointParams} |
| | | <div id="uavChannelParams" style="display: none;"> |
| | | ${requestScope.uavChannelParams} |
| | | </div> |
| | | </div> |
| | | </body> |
| | |
| | | features: ["road", "building", "water", "land"], // 隐藏地图上的poi |
| | | style: "normal" // 设置地图风格为高端黑 |
| | | }; |
| | | var params = $.parseJSON($("#uavDroppointParams").html()); |
| | | var params = $.parseJSON($("#uavChannelParams").html()); |
| | | var sensorInfo = params["sensorInfo"]; |
| | | var sensorKey = params['sensorKey']; |
| | | var unit = params['unit']; |
| | | var description=params['description']; |
| | | var backgroundValue=32; |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>"+description+"(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var description = params['description']; |
| | | var backgroundValue = 32; |
| | | |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>" + description + "(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var map = new BMap.Map("mapCanvas", {enableMapClick: false}); |
| | | map.setMapStyle(mapStyle); |
| | | map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放 |
| | |
| | | var trackPoints = []; //用来存放从后台获取到的所有历史轨迹点的数据 |
| | | if (sensorInfo.length > 0) { |
| | | $.each(sensorInfo, function (item, value) { |
| | | if (typeof (value.e76) == "undefined" || typeof (value.e78) == "undefined") { |
| | | if (typeof (value.e76) == "undefined" /*|| typeof (value.e78) == "undefined"*/) { |
| | | showNoDroppoint(); |
| | | } else { |
| | | var lon = parseFloat(value.e76.substr(0, value.e76.length - 1)).toFixed(4); |
| | | var lat = parseFloat(value.e77.substr(0, value.e77.length - 1)).toFixed(4); |
| | | if (lon <= 0 || lat <= 0 || lon > 180 || lat > 180) { |
| | | if (lon < 70 || lon > 150 || lat > 60 || lat <= 0) { |
| | | return true; |
| | | } |
| | | var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | //var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var heigh = typeof (value.e78) == "undefined" ? "" : parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var concentration = ""; |
| | | $.each(value, function (key, data) { |
| | | if (key == sensorKey) { |
| | |
| | | } |
| | | }); |
| | | var point = new BMap.Point(lon, lat); |
| | | var myIcon = ""; |
| | | if (concentration > backgroundValue) { |
| | | myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | } else if (concentration == backgroundValue) { |
| | | myIcon = new BMap.Icon('/img/uav_green.png', new BMap.Size(20, 20)); |
| | | } else { |
| | | return true; |
| | | } |
| | | //var myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | var marker = new BMap.Marker(point, {icon: myIcon}); |
| | | map.addOverlay(marker); |
| | | trackPoints.push(point); |
| | | $("#tab").append("<tr><td>" + lon + "</td><td>" + lat + "</td><td>" + heigh + "</td><td>" + concentration + "</td></tr>");//控制输出的数据格式 |
| | | var opts = { |
| | | width: 80, // 信息窗口宽度 |
| | | height: 80, // 信息窗口高度 |
| | | } |
| | | var msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78 + "<br>" +description+": "+concentration+unit; |
| | | if (concentration == "") { |
| | | msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78; |
| | | } |
| | | var infoWindow = new BMap.InfoWindow(msg, opts); // 创建信息窗口对象 |
| | | marker.addEventListener("click", function () { |
| | | map.openInfoWindow(infoWindow, point); //开启信息窗口 |
| | | }); |
| | | |
| | | /*var myIcon = ""; |
| | | if (concentration > 23) { |
| | | myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | trackPoints.push(point); |
| | | } else if (concentration == 23) { |
| | | myIcon = new BMap.Icon('/img/uav_green.png', new BMap.Size(20, 20)); |
| | | } else { |
| | | return true; |
| | | }*/ |
| | | } |
| | | } |
| | | ) |
| | | map.centerAndZoom(trackPoints, 17);// 根据经纬度显示地图的范围 |
| | | map.setViewport(trackPoints);// 根据提供的地理区域或坐标设置地图视野 |
| | | var polygon = new BMap.Polygon(trackPoints, {strokeColor: "none",fillColor:"red", strokeWeight: 2, strokeOpacity: 1}); //创建多边形 |
| | | map.addOverlay(polygon); //增加多边形 |
| | | map.setViewport(polygon.getPath()); //调整视野 |
| | | } |
| | | |
| | | function showNoDroppoint() { |
| | |
| | | var sensorInfo = params["sensorInfo"]; |
| | | var sensorKey = params['sensorKey']; |
| | | var unit = params['unit']; |
| | | var description=params['description']; |
| | | var backgroundValue=32; |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>"+description+"(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var description = params['description']; |
| | | var backgroundValue = 32; |
| | | |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>" + description + "(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var map = new BMap.Map("mapCanvas", {enableMapClick: false}); |
| | | map.setMapStyle(mapStyle); |
| | | map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放 |
| | |
| | | var trackPoints = []; //用来存放从后台获取到的所有历史轨迹点的数据 |
| | | if (sensorInfo.length > 0) { |
| | | $.each(sensorInfo, function (item, value) { |
| | | if (typeof (value.e76) == "undefined" || typeof (value.e78) == "undefined") { |
| | | if (typeof (value.e76) == "undefined" /*|| typeof (value.e78) == "undefined"*/) { |
| | | showNoDroppoint(); |
| | | } else { |
| | | var lon = parseFloat(value.e76.substr(0, value.e76.length - 1)).toFixed(4); |
| | | var lat = parseFloat(value.e77.substr(0, value.e77.length - 1)).toFixed(4); |
| | | if (lon <= 0 || lat <= 0 || lon > 180 || lat > 180) { |
| | | if (lon < 70 || lon > 150 || lat > 60 || lat <= 0) { |
| | | return true; |
| | | } |
| | | var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | //var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var heigh = typeof (value.e78) == "undefined" ? "" : parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var concentration = ""; |
| | | $.each(value, function (key, data) { |
| | | if (key == sensorKey) { |
| | |
| | | } |
| | | }); |
| | | var point = new BMap.Point(lon, lat); |
| | | var myIcon = ""; |
| | | if (concentration > backgroundValue) { |
| | | myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | } else if (concentration == backgroundValue) { |
| | | myIcon = new BMap.Icon('/img/uav_green.png', new BMap.Size(20, 20)); |
| | | } else { |
| | | return true; |
| | | } |
| | | //var myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | var marker = new BMap.Marker(point, {icon: myIcon}); |
| | | map.addOverlay(marker); |
| | | trackPoints.push(point); |
| | | $("#tab").append("<tr><td>" + lon + "</td><td>" + lat + "</td><td>" + heigh + "</td><td>" + concentration + "</td></tr>");//控制输出的数据格式 |
| | | var opts = { |
| | | width: 80, // 信息窗口宽度 |
| | | height: 80, // 信息窗口高度 |
| | | } |
| | | var msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78 + "<br>" +description+": "+concentration+unit; |
| | | if (concentration == "") { |
| | | msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78; |
| | | } |
| | | var infoWindow = new BMap.InfoWindow(msg, opts); // 创建信息窗口对象 |
| | | marker.addEventListener("click", function () { |
| | | map.openInfoWindow(infoWindow, point); //开启信息窗口 |
| | | }); |
| | | |
| | | /* var myIcon = ""; |
| | | if (concentration > 23) { |
| | | myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | trackPoints.push(point); |
| | | } else if (concentration == 23) { |
| | | myIcon = new BMap.Icon('/img/uav_green.png', new BMap.Size(20, 20)); |
| | | } else { |
| | | return true; |
| | | }*/ |
| | | } |
| | | } |
| | | ) |
| | | map.centerAndZoom(trackPoints, 17);// 根据经纬度显示地图的范围 |
| | | map.setViewport(trackPoints);// 根据提供的地理区域或坐标设置地图视野 |
| | | var polygon = new BMap.Polygon(trackPoints, {strokeColor: "none",fillColor:"red", strokeWeight: 2, strokeOpacity: 1}); //创建多边形 |
| | | map.addOverlay(polygon); //增加多边形 |
| | | map.setViewport(polygon.getPath()); //调整视野 |
| | | } |
| | | |
| | | function showNoDroppoint() { |
| | |
| | | <div id="cpm">查无落点</div> |
| | | <div id="mapCanvas"></div> <!-- 百度地图容器--> |
| | | <!-- 传sensorInfo,regionCode,regionName,monitorPoint,device--> |
| | | <div id="uavDroppointParams" style="display: none;"> |
| | | ${requestScope.uavDroppointParams} |
| | | <div id="uavTracingParams" style="display: none;"> |
| | | ${requestScope.uavTracingParams} |
| | | </div> |
| | | </div> |
| | | </body> |
| | |
| | | features: ["road", "building", "water", "land"], // 隐藏地图上的poi |
| | | style: "normal" // 设置地图风格为高端黑 |
| | | }; |
| | | var params = $.parseJSON($("#uavDroppointParams").html()); |
| | | var params = $.parseJSON($("#uavTracingParams").html()); |
| | | var sensorInfo = params["sensorInfo"]; |
| | | var sensorKey = params['sensorKey']; |
| | | var unit = params['unit']; |
| | | var description=params['description']; |
| | | var backgroundValue=32; |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>"+description+"(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var description = params['description']; |
| | | var backgroundValue = 32; |
| | | |
| | | $("#tab").append("<tr><td>经度(°)</td><td>纬度(°)</td><td>高度(m)</td><td>" + description + "(" + unit + ")</td></tr>");//控制输出的数据格式 |
| | | var map = new BMap.Map("mapCanvas", {enableMapClick: false}); |
| | | map.setMapStyle(mapStyle); |
| | | map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放 |
| | |
| | | var trackPoints = []; //用来存放从后台获取到的所有历史轨迹点的数据 |
| | | if (sensorInfo.length > 0) { |
| | | $.each(sensorInfo, function (item, value) { |
| | | if (typeof (value.e76) == "undefined" || typeof (value.e78) == "undefined") { |
| | | if (typeof (value.e76) == "undefined" /*|| typeof (value.e78) == "undefined"*/) { |
| | | showNoDroppoint(); |
| | | } else { |
| | | var lon = parseFloat(value.e76.substr(0, value.e76.length - 1)).toFixed(4); |
| | | var lat = parseFloat(value.e77.substr(0, value.e77.length - 1)).toFixed(4); |
| | | if (lon <= 0 || lat <= 0 || lon > 180 || lat > 180) { |
| | | if (lon < 70 || lon > 150 || lat > 60 || lat <= 0) { |
| | | return true; |
| | | } |
| | | var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | //var heigh = parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var heigh = typeof (value.e78) == "undefined" ? "" : parseFloat(value.e78.substr(0, value.e78.length - 1)); |
| | | var concentration = ""; |
| | | $.each(value, function (key, data) { |
| | | if (key == sensorKey) { |
| | |
| | | } |
| | | }); |
| | | var point = new BMap.Point(lon, lat); |
| | | var myIcon = ""; |
| | | if (concentration > backgroundValue) { |
| | | trackPoints.push(point); |
| | | $("#tab").append("<tr><td>" + lon + "</td><td>" + lat + "</td><td>" + heigh + "</td><td>" + concentration + "</td></tr>");//控制输出的数据格式 |
| | | |
| | | /* var myIcon = ""; |
| | | if (concentration > 23) { |
| | | myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | } else if (concentration == backgroundValue) { |
| | | trackPoints.push(point); |
| | | } else if (concentration == 23) { |
| | | myIcon = new BMap.Icon('/img/uav_green.png', new BMap.Size(20, 20)); |
| | | } else { |
| | | return true; |
| | | } |
| | | //var myIcon = new BMap.Icon('/img/uav_red.png', new BMap.Size(20, 20)); |
| | | var marker = new BMap.Marker(point, {icon: myIcon}); |
| | | map.addOverlay(marker); |
| | | trackPoints.push(point); |
| | | $("#tab").append("<tr><td>" + lon + "</td><td>" + lat + "</td><td>" + heigh + "</td><td>" + concentration + "</td></tr>");//控制输出的数据格式 |
| | | var opts = { |
| | | width: 80, // 信息窗口宽度 |
| | | height: 80, // 信息窗口高度 |
| | | } |
| | | var msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78 + "<br>" +description+": "+concentration+unit; |
| | | if (concentration == "") { |
| | | msg = "经度: " + value.e76 + "<br>纬度: " + value.e77 + "<br>高度: " + value.e78; |
| | | } |
| | | var infoWindow = new BMap.InfoWindow(msg, opts); // 创建信息窗口对象 |
| | | marker.addEventListener("click", function () { |
| | | map.openInfoWindow(infoWindow, point); //开启信息窗口 |
| | | }); |
| | | }*/ |
| | | } |
| | | } |
| | | ) |
| | | map.centerAndZoom(trackPoints, 17);// 根据经纬度显示地图的范围 |
| | | map.setViewport(trackPoints);// 根据提供的地理区域或坐标设置地图视野 |
| | | var polygon = new BMap.Polygon(trackPoints, {strokeColor: "none",fillColor:"red", strokeWeight: 2, strokeOpacity: 1}); //创建多边形 |
| | | map.addOverlay(polygon); //增加多边形 |
| | | map.setViewport(polygon.getPath()); //调整视野 |
| | | } |
| | | |
| | | function showNoDroppoint() { |
| | | var point = new BMap.Point(120.987287, 31.391562); |
| | | map.centerAndZoom(point, 17); |