Reputation: 743
When I draw a route in google map between two coordinates, I am using below Google API URL it works I can get all data, but now I can draw route between many coordinates how can I do this?
Upvotes: 1
Views: 705
Reputation: 910
You can use waypoints, the documentation can be found here:
However, since waypoints only support a maximum of 23 waypoints, you'll need to divide the total number of points by 23 to get the interval you need to leave between points to end up with 23. This will not give you an incredibly accurate route, since you'll be missing many of the recorded points.
We found that an alternate solution was to not use the Google Maps Directions API, instead we just record a location as often as possible and then draw these points as a polyline directly onto the map, avoiding the need for any direction requests.
Upvotes: 1
Reputation: 18262
You can use waypoints https://developers.google.com/maps/documentation/directions/intro#Waypoints but take into account that the maximum allowed number of waypoints is 23
Upvotes: 1