Skip to content Skip to sidebar Skip to footer

Google Direction Api And Google Maps App Showing Different Routes For Same Destination

I am working on an app in which I have to show shortest route. I am using Google Direction API but the result is different from Google Maps app for same destination and travel mode

Solution 1:

I got the solution. When I put destination place_id instead of lat lng it is showing same result as google map app. I don't know how it is working. Such variation not even mentioned in developer docs.

https://maps.googleapis.com/maps/api/directions/json?origin=19.107163,72.862375&destination=place_id:ChIJ_0P9DzjI5zsRf5xuhTv8VCk&sensor=false&mode=driving&alternatives=true&key=XXXXXXXXXXXXXXXXXXXXXX

Post a Comment for "Google Direction Api And Google Maps App Showing Different Routes For Same Destination"