Advertisement
Advertisement



Question

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.

2009/11/26
1
221
11/26/2009 12:24:16 PM

Accepted Answer

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

2018/11/11
218
11/11/2018 2:47:02 AM


As of today (2014/09/23), I've found that to get marker on exact place (not an approximation) you can use:

http://www.google.com/maps/place/49.46800006494457,17.11514008755796

Additionally, if you want to specify map center and zoom:

http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z

If you want to use satellite map type, then append /data=!3m1!1e3

http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!1e3

And If you want terrain view of the map, then append /data=!3m1!4b1

https://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!4b1
2015/02/24

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.

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 : https://developers.google.com/maps/documentation/urls/guide

2018/10/23

If you want to open Google Maps in a browser:

http://maps.google.com/?q=<lat>,<lng>

To open the Google Maps app on an iOS mobile device, use the Google Maps URL Scheme:

comgooglemaps://?q=<lat>,<lng>

To open the Google Maps app on Android, use the geo: intent:

geo:<lat>,<lng>?z=<zoom>

2016/02/05

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:

https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.369826049804715'
2014/06/18

These are URLs that work:

http://maps.google.com/?q=<LAT>,<LNG>

https://maps.google.com/?q=<LAT>,<LNG>&ll=<LAT>,<LNG>&z=18

https://www.google.com/maps/@<LAT>,<LNG>,16z

https://maps.google.com/?q=<LAT>,<LNG>&z=16

Although (for avid readers) This is the latest from google (August 22 2017):

Maps URLs
Maps URLs with map display
Maps URLs with search action

From google

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).

2017/08/22

Source: https://stackoverflow.com/questions/1801732
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]