|  |  | 
 |  |  |     } | 
 |  |  |     var trackPoints = []; //用来存放从后台获取到的所有历史轨迹点的数据 | 
 |  |  |     if (sensorInfo.length > 0) { | 
 |  |  |         for (var i = 0; i <sensorInfo.length ; i++) { | 
 |  |  |             if (typeof (sensorInfo[i]["e76"]) == "undefined") { | 
 |  |  |                 sensorInfo.splice(i,1); | 
 |  |  |                 i--; | 
 |  |  |             }else { | 
 |  |  |                 var lon = parseFloat(sensorInfo[i].e76.substr(0, sensorInfo[i].e76.length - 1)); | 
 |  |  |                 var lat = parseFloat(sensorInfo[i].e77.substr(0, sensorInfo[i].e77.length - 1)); | 
 |  |  |                 if (lon>150 || lon<70 || lat<=20 || lat>60){ | 
 |  |  |                     sensorInfo.splice(i,1); | 
 |  |  |                     i--; | 
 |  |  |                 } | 
 |  |  |                 if (i>1){ | 
 |  |  |                     if (sensorInfo[i]["e76"]==sensorInfo[i-1]["e76"] && sensorInfo[i]["e77"]==sensorInfo[i-1]["e77"]){ | 
 |  |  |                         sensorInfo.splice(i,1); | 
 |  |  |                         i--; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         $.each(sensorInfo, function (item, value) { | 
 |  |  |             if (typeof (value.e76) == "undefined") { | 
 |  |  |                 showNoFlightTrajectory(); | 
 |  |  | 
 |  |  |             } else if (pm2_5 > 150) { | 
 |  |  |                 traceColor = "#FF0000"; | 
 |  |  |             } | 
 |  |  |             drowLine(map, trackPoints[i], trackPoints[i + 1], traceColor);//画线调用 | 
 |  |  |             drowLine(map, trackPoints[i],trackPoints[0].lat, trackPoints[i + 1], traceColor,sensorInfo[i]);//画线调用 | 
 |  |  |             i = i + 1; | 
 |  |  |         }, 20); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 划线 | 
 |  |  |     function drowLine(map, PointArr, PointArrNext, traceColor) { | 
 |  |  |     function drowLine(map, PointArr,lat, PointArrNext, traceColor,info) { | 
 |  |  |         if (PointArrNext != undefined) { | 
 |  |  |             var polyline = new BMap.Polyline( | 
 |  |  |                 [ | 
 |  |  | 
 |  |  |                     strokeOpacity: 1 | 
 |  |  |                 });   //创建折线 | 
 |  |  |             map.addOverlay(polyline); | 
 |  |  |             var winOpts = { | 
 |  |  |                 width: 250, // 信息窗口宽度 | 
 |  |  |                 height: 195, // 信息窗口高度 | 
 |  |  |             } | 
 |  |  |             var textArea = "<div style='width: 250px;height: 200px;margin-left: -8px'>"; | 
 |  |  |             if (lat==PointArr.lat){ | 
 |  |  |                 var data="<p style='line-height:150px;color: red;font-size: 24px;text-align: center '>"+"暂无数据"+"</p>" | 
 |  |  |                 textArea=textArea+data+"</div>"; | 
 |  |  |             }else { | 
 |  |  |                 var data="<p style='height: 30px;font-size: 15px;font-weight: bold;padding: 10px 0 0 13px;color: #2aabd2'>"+"走航信息"+"</p>"; | 
 |  |  |                 data=data+"<p style='padding:10px 0 0 18px '>"+"时间:"+info["time"]+"</p>"; | 
 |  |  |                 if (typeof(info["e1"])!="undefined"){ | 
 |  |  |                     data=data+"<p style='padding:10px 0 0 18px '>"+"PM2.5:"+info["e1"]+"</p>"; | 
 |  |  |                 } | 
 |  |  |                 if (typeof(info["e2"])!="undefined"){ | 
 |  |  |                     data=data+"<p style='padding:10px 0 0 18px '>"+"PM10:"+info["e2"]+"</p>"; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (typeof(info["e40"])!="undefined"){ | 
 |  |  |                     data=data+"<p style='padding:10px 0 0 18px '>"+"TSP:"+info["e40"]+"</p>"; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (typeof (info["e17"])!="undefined"){ | 
 |  |  |                     data=data+"<p style='padding:10px 0 0 18px '>"+"VOCs总量:"+info["e17"]+"</p>"; | 
 |  |  |                 } | 
 |  |  |                 textArea=textArea+data+"</div>"; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             var infoWindow = new BMap.InfoWindow(textArea,winOpts); | 
 |  |  |             var lon = parseFloat(info.e76.substr(0, info.e76.length - 1)); | 
 |  |  |             var lat = parseFloat(info.e77.substr(0, info.e77.length - 1)); | 
 |  |  |             var lon1 = GPS.gcj_encrypt(lat, lon).lon; | 
 |  |  |             var lat1 = GPS.gcj_encrypt(lat, lon).lat; | 
 |  |  |             var lon2 = GPS.bd_encrypt(lat1, lon1).lon; | 
 |  |  |             var lat2 = GPS.bd_encrypt(lat1, lon1).lat; | 
 |  |  |             var point1=new BMap.Point(lon2,lat2); | 
 |  |  |             polyline.addEventListener('mouseover',function () { | 
 |  |  |                 map.openInfoWindow(infoWindow,point1); //开启信息窗口 | 
 |  |  |             }) | 
 |  |  |             polyline.addEventListener('mouseout',function () { | 
 |  |  |                 map.closeInfoWindow(infoWindow,point1); //关闭信息窗口 | 
 |  |  |             }) | 
 |  |  |             addMarkerEnd(new BMap.Point(PointArrNext.lng, PointArrNext.lat), '小车行驶', map, PointArrNext, new BMap.Point(PointArr.lng, PointArr.lat));//添加图标 | 
 |  |  |         } else { | 
 |  |  |             addMarkerEnd(new BMap.Point(PointArr.lng, PointArr.lat), '终点', map);//添加终点图标 | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     //添加行驶和终点图标 | 
 |  |  |     function addMarkerEnd(point, name, mapInit, trackUnit, prePoint) { | 
 |  |  |         if (name == "小车行驶") { |