user1832583
user1832583

Reputation:

Google Maps Directions - Find Out if Route Contains Toll

I am making a program that uses the Google Maps Directions Service. In my Directions Service Request I have set avoidTolls to false. But, I would like to know if the route contains tolls just like Google Maps:

I have seen this SO question:

Return if route has Tolls Google Maps API xml request

But because the question is over a year old, I am wondering if the Google Maps API has added a toll feature, might there be a different answer?

Is this possible? If so, how?

Upvotes: 1

Views: 2231

Answers (1)

frankhommers
frankhommers

Reputation: 1305

I'd love to see this feature as well. But Google didn't make any changes to this. So you still have to check html_instructions for certain words.

The best way is to force the language to "en" and then check if it contains "Toll road" or "Partial toll road".

Fail safe might be just to lowercase the html_instruction and search for "toll road".

Upvotes: 1

Related Questions