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
To get your current location as start point you need to use this URL:
https://www.google.com/maps/dir/?api=1&origin=Current+Location&destination=<latitude>,<longitude>
You can fill up the destination parameter with the address, name or latitude and longitude values.
As of today (1st November, 2020), Google provided a provision of Universal URL which works quite efficiently on cross-platforms and thus, Google recommends this method.
Syntax: https://www.google.com/maps/search/?api=1&query=<lat>,<lng>
Example : https://www.google.com/maps/search/?api=1&query=28.6139,77.2090 (New Delhi, India)
Documentation/Source.
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):
https://www.google.com/maps/?q=-15.623037,18.388672
For an older example (no marker on this one):
https://www.google.com/maps/preview/@-15.623037,18.388672,8z
The oldest format:
http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672
Open the following url with the latitude and longitude and zoom level.
https://maps.google.com/?q=23.22,88.32&z=8
say easily http://www.google.com/maps/place/lat,lng
format
sample url:
http://www.google.com/maps/place/30.364124,48.227034
The best way is to use q
parameter so that it displays the map with the point marked. eg.:
https://maps.google.com/?q=<lat>,<lng>