Łukasz Adamus
Łukasz Adamus

Reputation: 266

How to show two routes using Google Directions Service?

Let say there is a journey A -> B

Approach:

1) Geocode A.Address and B.Address

2) Use A.LatLng and B.LatLng to calculate the route, display it and show distance

3) Do 1) and 2) for return journey B -> A

Let say in my case route A -> B is not equal B -> A I would like to show both routes on one map in same time. How can I do this?

Upvotes: 2

Views: 696

Answers (1)

david strachan
david strachan

Reputation: 7228

For 2 routes you need 2 DirectionsRenderers with different names.

Call the second after the first request.

Upvotes: 3

Related Questions