Create Google Maps links based on coordinates
Asked Answered
A

5

100

How can I create Google Maps links based on coordinates? Their new basic share urls contain a lot of parameters, for example:

https://www.google.com/maps/place/Vetlanda,+Sweden/@57.4217311,15.0849255,13z/data=!3m1!4b1!4m2!3m1!1s0x465758d912d321b5:0x55675191e550be84?hl=en

Any ideas? Not looking to embed but just to create external links that can be shared.

Armyn answered 30/5, 2015 at 9:5 Comment(0)
A
267

Why not https://www.google.com/maps/place/lat,lng I think this is the simplest way

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

Acrolein answered 30/5, 2015 at 9:39 Comment(10)
is it possible to add a zoom level ?Bowline
@StanSokolov yes should be possibile adding to the url eG. &zoom=13 or &z=9Acrolein
Thanks a lot for your answer @scaisEdge. I'm looking for a solution if there's anyway for me to use the same URL you provided and open a native apps such as google MAP or IOS maps hijacking the locations for "Get Directions" purposes. Is there a quick way to do this you can suggest?Calicle
you can easly .. use the lat, lng parameter accessing as GET parameter and the eval server side the content .. try inspect the url content server sideAcrolein
@Cole128 jus add you zoomLevel and z eg: google.com/maps/place/49.46800006494457,17.11514008755796,10zAcrolein
@scaisEdge That link doesn't work for me, it doesn't actually bring me to the coordinates.Igal
@Cole128 i just copy the link and work .. be sure you have proper value lat, lng,zoomz eg: 45.00, 10.00, 13zAcrolein
I opened it with a right click. It works for you? It fails in both Chrome and Firefox for me.Igal
Yes .. i used firefox, opera, chrome and wok .. very well. both with right click of copying .. and pastingAcrolein
eventually try use this sintax based on place (move the map to the nearest place) with zoom www.google.com/maps/place/45°28'04.8"N+10°06'54.5"E/@45.468,10.1129502,10zAcrolein
T
35

The currently accepted answer ends up adding an additional history entry in browsers at the moment as Google Maps redirects to a different URL format.

To avoid that extra entry in the browser's history, use the official Maps API url:

https://www.google.com/maps/search/?api=1&query=latitude,longitude

This will display a marker at the latitude, longitude location as well.

If you only want to center the map (and not display a marker), use the map action:

https://www.google.com/maps/@?api=1&map_action=map&center=latitude,longitude
Turbo answered 21/2, 2019 at 13:44 Comment(4)
Does this support setting the zoom level?Cosme
@Cosme You can append &zoom=<zoom level> to the map action as shown in the last example (i.e. after center=....Turbo
Is there a link which includes both the marker and the zoom level?Cosme
In that case you'll have to use the /place/ url which require you to format one set of the coordinates in degrees/minute/seconds format as far as I can tell: google.com/maps/place/…Turbo
K
32

According to another answer, you can use following url

http://maps.google.com/maps?q=24.197611,120.780512

to show a pin.

Krebs answered 19/2, 2017 at 17:52 Comment(2)
except it shows side panel I just wanted to embed the map in an inline frame or div ! would it be possible to open map but with side panel collapsed.Streamway
@Banzy this still works, just took this scrennshot of the url in the post: i.imgur.com/flQa6dm.pngLeblanc
L
18
  • Working in 2022
  • No sidebar
  • Url doesnt change
  • Zoom included

Syntax:

https://www.google.com/maps/@{lat},{long},{zoom}z

Example:

https://www.google.com/maps/@51.123,10.123,15z

Leblanc answered 3/3, 2020 at 7:58 Comment(0)
T
6

The simple and best way is to use as follows:-

https://maps.google.com/?q=LATITUDE-VALUE,LONGITUDE-VALUE
Tiv answered 3/4, 2019 at 9:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.