var list = res.data.data;
var arrPois = [];
var lineColor = "";
//GPSPoint
//
var latlng = new google.maps.LatLng(39.92, 116.46);
var myOptions = {
zoom:20,
center: latlng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById("map"), myOptions);
for (var i = 0; i < list.length - 1; iPP) {
arrPois.splice(0, arrPois.length);//,
arrPois.push(new google.maps.LatLng(list[i].lat, list[i].lng));
arrPois.push(new google.maps.LatLng(list[i + 1].lat, list[i + 1].lng));
//
if (list[i].pump == 0) {
lineColor = "-sharpFFFF00";
} else {
lineColor = "-sharp28bf81";
}
map.setCenter(arrPois[0]);
//
var polylineOptions =
{
path: arrPois,//GPS
strokeColor: lineColor, //
strokeWeight: 4,//
};
//
var poly2 = new google.maps.Polyline(polylineOptions);
poly2.setMap(map);
}