Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude?

- Stack Overflow

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.

html google-maps

edited Nov 26 '09 at 12:24 asked Nov 26 '09 at 5:39


RedBlueThing Deepika
30.9k 16 82 112 857 2 8 13

11 Answers

Não encontrou uma resposta? Pergunte em Stack Overflow em Português. ✕

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

edited Sep 25 '17 at 2:59 answered Nov 26 '09 at 6:01


RedBlueThing
30.9k 16 82 112

1 i could not get the map of particular place on map. – Hiren Patel Feb 5 '13 at 10:10

1 Is there somewhere information about the new format? Particularly, Internet is full of examples of old
format and it is hard to Google (sic) the new format from all the noise. – Mikko Ohtamaa Mar 4 '14 at
13:29

32 The "new" format above does not include a marker, if you use this format it works - google.com/maps/?
q=<lat>,<long>; eg: google.com/maps/?q=-15.623037,18.388672 – AaronM Oct 15 '14 at 1:54

1 Is there a way to specify the map type (hybrid, road, etc)? – Redtopia Nov 30 '14 at 6:27

1 it does not work now as of 20 Nov 2016 – maq Nov 20 '16 at 15:54

as additional info;
the best way is to use q= parameter, so that it displays the map with the point marked.

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

answered Jun 5 '11 at 1:51


guleryuz
5,746 2 21 34

Simple and straightforward. Thanks! – Albert Eltawil Feb 4 '14 at 15:14

Nice answer, Is it possible to load it in div? – Jaison Apr 20 '15 at 4:52

@WareNinja do you know how to combine directions from/to with this? – Sérgio S. Filho Feb 11 '16 at
0:16

5 How do you add the zoom parameter? – Razgriz Nov 15 '16 at 17:56

Thanks, this also makes Citymapper understand the link in case this link is inside an app – vaskort Apr 9
'17 at 17:15

https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 1/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow

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:

.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

e/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

e/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!4b1

edited Feb 24 '15 at 8:54 answered Sep 23 '14 at 11:03


Lucky Pogo19
8,615 6 66 98 1,213 1 7 12

Any idea how to add the map type (hybrid, etc)? – Redtopia Nov 30 '14 at 6:01

1 @Redtopia, see my updated answer for satellite map type. – Pogo19 Dec 1 '14 at 13:52

Thanks! Do you know what that data variable means or how to interpret it? Also, are there any docs that
you know about that describe this new linking scheme? – Redtopia Dec 2 '14 at 17:15

1 @Redtopia, it is just an experimental knowledge. Actually, I had to try several URL parameters to find an
answer for you. I haven't found no such documentation. Sorry! – Pogo19 Dec 3 '14 at 22:07

2 It's February 2016 and it appears that this method still works. Well done. – gmeben Feb 9 '16 at 22: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>

edited Feb 5 '16 at 0:05 answered Jun 10 '15 at 10:38


Garland Pope Emilio Rodriguez
2,244 1 16 17 3,398 1 12 24

1 this is actually more useful as an answer – Jason Sebring Jul 31 '16 at 1:07

You can also use "google.navigation:q=latitude,longitude" to start immediately the navigation with google
maps app, but does not work with some gps apps. The more generic is "geo:<lat>,<lng>?q=<lat>,<lng>
(Label,Name)" as referred ojus kulkarni em previous comment (the parameters force to show the
marker, helping to navigate) – Manuel Romeiro Oct 25 '17 at 2:52

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.

answered Jun 18 '14 at 8:08


AlvaroSantisteban
2,349 3 21 42

Using the query parameter won't work, Google will try to approximate the location.

The location I want : http://maps.google.com/maps?ll=43.7920533400153,6.37761393942265

The approximate location (west of the actual location) : http://maps.google.com/?


q=43.7920533400153,6.37761393942265

answered Jul 9 '13 at 13:24


Frato
376 4 4

https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 2/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow

To open the google maps app in android:-

geo:<lat>,<lng>?z=<zoom>
Join Stack Overflow to learn, share knowledge, and build your career. Email Sign Up OR SIGN IN WITH Google Facebook
open app with marker for give location:-

geo:<lat>,<lng>?q=<lat>,<lng>(Label,Name)

open google map in ios:-

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

open google maps in browser with following parameters:-

http://maps.google.com/maps?z=12&t=m&q=<lat>,<lng>

z is the zoom level (1-21)


t is the map type ("m" map, "k" satellite, "h" hybrid, "p" terrain, "e"
GoogleEarth)
q is the search query

answered Jan 13 '17 at 12:26


ojus kulkarni
1,331 1 12 27

say easily http://www.google.com/maps/place/lat,lng


format

sample url:

http://www.google.com/maps/place/30.364124,48.22
7034

answered Feb 5 '17 at 18:32


pixparker
1,549 12 15

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

answered Aug 22 '17 at 18:37


Jadeye
1,346 2 27 43

This works too:

https://www.google.pl/maps/@<lat>,<lon>,<zoom>z

Example: https://www.google.pl/maps/@51.5088233,-0.1296787,13z

With pointer:

https://www.google.com/maps/place/<lat>,<lon>/@<lat>,<lon>,<zoom>z

https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 3/4
03/02/2018 html - How do I link to Google Maps with a particular longitude and latitude? - Stack Overflow
Example:
https://www.google.com/maps/search/51.5088233,-0.1296787/@51.5088233,-0.1296787,13
z

answered Apr 6 '17 at 7:06


marioosh
11.3k 34 107 159

Find your location in the Google Earth program, and click the icon "View in Google Maps". The
URL bar in your browser will show the URL you need.

answered Dec 2 '12 at 23:08


Mapileo Mapilei
25 1

https://stackoverflow.com/questions/1801732/how-do-i-link-to-google-maps-with-a-particular-longitude-and-latitude 4/4

You might also like