Get JSON Google Directions Output in another Langu

2019-02-27 08:41发布

问题:

I'm using JSON output of Google Directions to parse it in my Android App, is there a way to retrieve the Directions using another language? in KML I used to add this parameter hl=xx for another language Directions but I tried this out on JSON and it doesn't effect (still get english Directions). There is region parameter but I didn't understand how to use it, is this the solution (to use region parameter)? Any ideas?

This is an example link: http://maps.google.com/maps/api/directions/json?hl=fr&origin=26.2,50.6&destination=26.3,50.7&sensor=true

回答1:

Simply add language parameter in the url as shown below:

http://maps.google.com/maps/api/directions/json?origin=26.2,50.6&destination=26.3,50.7&sensor=true&language=cs