| | |
| | | padding: 0; |
| | | list-style: none; |
| | | } |
| | | |
| | | #cpm { |
| | | width:300px; |
| | | height:100px; |
| | | position: absolute; |
| | | background-color: #ffffff; |
| | | display: none; |
| | | left:50%; |
| | | top:50%; |
| | | margin-left: -150px; |
| | | margin-top: -50px; |
| | | z-index: 11; |
| | | color: #000000; |
| | | border: 2px solid #FF7F50; |
| | | font-size : 28px; |
| | | line-height : 100px; |
| | | text-align : center; |
| | | } |
| | | </style> |
| | | |
| | | <body> |
| | | <div class="main_body"> |
| | | <div id="cpm">查无飞行轨迹</div> |
| | | <div id="mapCanvas"></div> <!-- 百度地图 --> |
| | | <!-- 传sensorInfo,regionCode,regionName,monitorPoint,device--> |
| | | <div id="uavTrajectoryParams" style="display: none;"> |
| | |
| | | latitude = 31.391562; |
| | | point = new BMap.Point(longitude, latitude); |
| | | map.centerAndZoom(point, 17); |
| | | alert("查不到相关数据"); |
| | | document.getElementById("cpm").style.display='block'; |
| | | } |
| | | var trackPoints = []; //用来存放从后台获取到的所有历史轨迹点的数据 |
| | | var coincidentPoints = new Array(); |
| | | if (sensorInfo.length > 0) { |
| | | $.each(sensorInfo, function (item, value) { |
| | | trackPoints.push(new BMap.Point(value.经度, value.纬度)); |
| | | if(typeof(value.经度)=="undefined"){ |
| | | longitude = 120.987287; |
| | | latitude = 31.391562; |
| | | point = new BMap.Point(longitude, latitude); |
| | | map.centerAndZoom(point, 17); |
| | | document.getElementById("cpm").style.display='block'; |
| | | }else{ |
| | | trackPoints.push(new BMap.Point(value.经度.substr(0,value.经度.length-1), value.纬度.substr(0,value.纬度.length-1))); |
| | | } |
| | | }) |
| | | for (var i = 0; i < trackPoints.length; i++) { |
| | | var startPoint = trackPoints[i]; |
| | |
| | | startPoint, |
| | | endPoint |
| | | ], |
| | | {strokeColor: "green", strokeWeight: 2, strokeOpacity: 1} |
| | | {strokeColor: "#5298FF", strokeWeight: 5, strokeOpacity: 1} |
| | | ); |
| | | if (i < trackPoints.length - 1 && trackPoints.length > 1) { |
| | | map.addOverlay(polyline);// 画两点间线 |
| | |
| | | })(i); |
| | | |
| | | function openInfo(e) { |
| | | var point = new BMap.Point(sensorInfo[e.id].经度, sensorInfo[e.id].纬度); |
| | | var point = new BMap.Point(sensorInfo[e.id].经度.substr(0,sensorInfo[e.id].经度.length-1), sensorInfo[e.id].纬度.substr(0,sensorInfo[e.id].纬度.length-1)); |
| | | var winfowText1 = ""; |
| | | for (var prop in sensorInfo[e.id]) { |
| | | if (sensorInfo[e.id].hasOwnProperty(prop)) { |
| | |
| | | |
| | | function black(x) { |
| | | document.getElementById(x).style.color = "#000000"; |
| | | } |
| | | |
| | | function openInfoWindow() { |
| | | map.openInfoWindow.apply(map, arguments); //开启信息窗口 |
| | | } |
| | | |
| | | if (count > 0) { |
| | |
| | | var pointArrow1 = map.pixelToPoint(new BMap.Pixel(pixelX1, pixelY1)); |
| | | var pointMiddle = map.pixelToPoint(new BMap.Pixel(poMiddleX, poMiddleY)); |
| | | var Arrow = new BMap.Polyline([pointArrow, pointMiddle, pointArrow1], |
| | | {strokeColor: "green", strokeWeight: 2, strokeOpacity: 1}); |
| | | {strokeColor: "#5298FF", strokeWeight: 5, strokeOpacity: 1}); |
| | | map.addOverlay(Arrow); |
| | | } |
| | | }; |