0
votes

Info about App:

  • iOS App developed using Xamarin.iOS
  • Google Maps SDK used within the app for showing directions and alternate routes from Point A to Point B.

Problem Statement:

  • Let's say from Point A to Point B , there are 3 routes shown on the map.
  • ETA as an annotation is shown on the MapView by default for one the routes.
  • However for the other 2 alternate routes, no ETA information is shown on the map.
  • What needs to be done with Google Maps SDK implementation to show ETA for all the routes between Point A & Point B.
1

1 Answers

1
votes

The Google Maps SDK for iOS does not include the Directions API. So I believe you are using the web service Directions API to get the different routes.

Calculating the ETA:

In order to calculate the ETA for a route you have to iterate through all the legs of a route and sum up the distance.value attribute.

For more infos about the result set from the Directions API request check the documentation here.

Showing the ETA on the mapView:

On the polyline you drew on the map to represent the route, you may add the title attribute with the ETA.