1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| $.ajax({
type: "GET",
url: path + "images/parcours/" + id + "-" + dist + ".tcx",
dataType: "xml",
statusCode: {
404: function() {
...
}
},
success: function(xml) {
...
$(xml).find('Trackpoint').each(function() {
if($(this).find('DistanceMeters').text() != "" && $(this).find('AltitudeMeters').text() != "")
{
var lat = $(this).find('LatitudeDegrees').text();
var lon = $(this).find('LongitudeDegrees').text();
p = new google.maps.LatLng(lat, lon);
points1.push(p);
bounds1.extend(p);
}
});
...
poly = [];
var poly = new google.maps.Polyline({
path: points1,
strokeColor: "#af1e1e",
strokeOpacity: .7,
strokeWeight: 4
});
var marker = new google.maps.Marker({
position: dep,
map: map1,
title: "Début",
icon : path + "images/dd-start.png"
});
var marker = new google.maps.Marker({
position: p,
map: map1,
title: "Arrivée",
icon : path + "images/dd-end.png"
});
poly.setMap(map1);
map1.fitBounds(bounds1);
}, |