Using the Google Directions API you can provide a starting latitude and longitude and a destination latitude and longitude and get back walking directions from the start to end location. This provides you with the route the user can take and you draw that route on the map then show them the directions. That works, but what if you already have a route drawn on the map? Can you get directions given an existing GMSPath
and GMSPolyline
?
You can imagine an app that allows users to draw a route on the map they want to take then get walking directions for that route, instead of getting directions for a route Google suggests. How can that be accomplished? If Google doesn't offer that ability, is there another service that can give you directions given an existing route?
I think the best option would be to use each point from your polyline as a waypoint when calculating directions. Depending on your polyline though, it may not follow the same path exactly, but it should be pretty close.