Search code examples
google-mapsgoogle-maps-api-3directions

Google Directions API Result is different from Google Maps result


I am developing an app that displays the Distance & path between 2 distances. In this case I have used following addresses:

Source: Major Bhola Ram Enclave

Destination: Ring Road Mall, Sector 3, Rohini, New Delhi, Delhi

When I use Directions API then I get following result, see image below: enter image description here

But, when I search these addresses in Google Maps then I get different Result.

Click here to see Google Maps result enter image description here I searched a lot about this but I couldn't find any reason/solution for this.

Please guid me in right direction. Thanks.


Solution

  • Those are not addresses, they are places. If you want a similar result to Google Maps, you need to use the placeId or the coordinates returned for that place from the places service in the directions request.

    http://www.geocodezip.com/v3_example_geo2.asp?addr1=Major%20Bhola%20Ram%20Enclave&addr2=Ring%20Road%20Mall,%20Sector%203,%20Rohini,%20New%20Delhi,%20Delhi&place=1&place=2

    (uses the results from the place service)

    enter image description here