I have used the Google Place details API to get the place details which includes the lat/lng coordinates of a place.
When I launch Google maps using the Universal cross-platform Maps URL, it does not recognize the Place.
For example,
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJbf8C1yFxdDkR3n12P4DkKt0&key=XXXXXXXX
returns the place details including the following location data:
{
.....
"geometry": {
"location": {
"lat": 27.1750151,
"lng": 78.0421552
},
"viewport": {
"northeast": {
"lat": 27.1770292,
"lng": 78.04537599999999
},
"southwest": {
"lat": 27.16897280000001,
"lng": 78.0388188
}
}
},
.....
"name": "Taj Mahal",
"place_id": "ChIJbf8C1yFxdDkR3n12P4DkKt0",
.....
}
But this data, when used to create a Maps URL with direction map action, does not give the correct place in the destination field.
Google Maps URL : https://www.google.com/maps/dir/?api=1&destination=27.1750151,78.0421552&destination_place_id=ChIJbf8C1yFxdDkR3n12P4DkKt0
The destination is not shown as a place. Only the lat/lng or address is used as below.
The correct/expected result is the following. Look at the destination.
Update
The issue seems to be with the PlaceID not matching the lat/lng coordinates in the Maps URL. There seems to be an inconsistency with lat/lng provided by the Place Details API.
Below URL works
but 27.1750151,78.0421552,15z
is not the coordinates from the Place details API. The lat/lng returned by PlaceDetails API is 27.1750151,78.0421552
.
There is a difference of ,15z
which I believe it is the zoom levels.