How do I link to Google Maps with a particular longitude and latitude?
I have a small application that gives the current location: longitude and latitude. Now I have to browse to google maps with the longitude and latitude. Please suggest how I can do this.
This schema has changed again (23rd October 2018). See Kushagr's answer for the latest.
This for a map with the marker (via aaronm's comment):
For an older example (no marker on this one):
The oldest format:
The best way is to use
q parameter so that it displays the map with the point marked. eg.:
Read more... Read less...
As of today (2014/09/23), I've found that to get marker on exact place (not an approximation) you can use:
Additionally, if you want to specify map center and zoom:
If you want to use satellite map type, then append
And If you want terrain view of the map, then append
As of today (23rd October, 2018), Google provided a provision of Universal URL which works quite efficiently on cross-platforms and thus, Google recommends this method.
Example: https://www.google.com/maps/search/?api=1&query=28.6139,77.2090 (New Delhi, India)
Documentation/Source : https://developers.google.com/maps/documentation/urls/guide
If you want to open Google Maps in a browser:
To open the Google Maps app on an iOS mobile device, use the Google Maps URL Scheme:
To open the Google Maps app on Android, use the geo: intent:
It´s out of the scope of the question, but I think it might be also interesting to know how to link to a route. The query would look like this:
These are URLs that work:
Although (for avid readers) This is the latest from google (August 22 2017):
Search: When searching for a specific place, the resulting map puts a pin in the specified location and displays available place details.
Important: The parameter api=1 identifies the version of Maps URLs this URL is intended for. This parameter is required in every request. The only valid value is 1. If api=1 is NOT present in the URL, all parameters are ignored and the default Google Maps app will launch, either in a browser or the Google Maps mobile app, depending on the platform in use (for example, https://www.google.com/maps).