I have a problem using waypoints in Google Maps: https://developers.google.com/maps/documentation/javascript/directions#DirectionsResults
I want to add waypoints and get driving directions in the order I provide them, but google automatically optimize them...
I send request with this code:
var request = {
origin: start,
destination: end,
waypoints: waypts,
optimizeWaypoints: true,
travelMode: google.maps.TravelMode.DRIVING
};
and in my array (waypts) waypoints are ordered as they should be ...
Example:
I want to go from NY via Chicago via NY to Philadelphia.. But the response I get is like this: NY via NY (1 meter) to Chicago to Philadelphia. Google somehow optimize route but I don't want this ...
Any idea?
Thanks!