I am working with google maps api v3. When I calcluate the way(based on points saved in variables) and after that simply move one marker (change the way) – how can I save this change?
I need that, because when I change marker position and after that – change the travel mode: the new way is computing without the marker change…
var new_waypoints = directionsDisplay.directions.routes[0].legs[0];
origin = new_waypoints.start_location;
destination = new_waypoints.end_location;
var wp = new_waypoints.via_waypoints;
var w = [];
alert(wp.length);
for(var i=0; i<wp.length; i++)
{
w[i] = [wp[i].lat(),wp[i].lng()]
alert('w');
}
waypoints = w;
But new_waypoints.via_waypoints always return empty array…
I found the solution!