131

I want to link to google maps at a particular location with a marker on a particular point.

It's easy to link to a location:

http://maps.google.com/?ll=XX.XXXX,XX.XXXX

But how do I drop a marker at that point too? preferably with a bit of my own text but that's just a bonus.

2017 - Google has released documentation on this see new accepted answer: https://stackoverflow.com/a/44477650/359135

  • i can do it easily with the static map api, but i dont want to use that. –  Jul 05 '11 at 12:43

6 Answers6

135

In May 2017 Google launched the official Google Maps URLs documentation. The Google Maps URLs introduces universal cross-platform syntax that you can use in your applications.

Have a look at the following document:

https://developers.google.com/maps/documentation/urls/guide

You can use URLs in search, directions, map and street view modes.

For example, to show the marker at specified position you can use the following URL:

https://www.google.com/maps/search/?api=1&query=36.26577,-92.54324

For further details please read aforementioned documentation.

You can also file feature requests for this API in Google issue tracker.

starball
  • 20,030
  • 7
  • 43
  • 238
xomena
  • 31,125
  • 6
  • 88
  • 117
  • Thank you for taking the time to answer this again with a current answer! –  Sep 27 '17 at 16:49
  • 4
    If you’d like to add a text/label/title/name for the marker, you can a query param like `q=36.26577,-92.54324+(My%20location)`. This however, does no longer seem to work for the Google Maps web site, but it (still) does for their iOS app. – Daniel Pietzsch Feb 16 '18 at 19:47
  • 2
    in my case this doesnt show the marker. How do i show the marker? – Milan Maharjan Feb 21 '18 at 10:21
  • 1
    Thanks you! Best answer! – Genevios May 30 '18 at 13:36
  • 3
    Is there a way to have multiple markers in different locations? – Tsingis Jul 21 '18 at 19:44
  • Unfortunately, multiple markers are not supported in Google Maps URLs. – xomena Jul 22 '18 at 11:48
  • After spend 1 day on this problem,finally i found the best answer and that awesome link.Thank you – MissAmna Nov 02 '18 at 18:15
  • It's a real shame that it's not possible to simply share a location with a custom name, like "Best mushroom spot ever", if it's not known by Google Maps. – Gabriel Glenn Jul 01 '19 at 16:16
  • What I've encountered lately: If you use the "/search/" method, you can get a marker. If you use the "map-action=map" method, you will NOT get a marker, but you will also not have the left search panel. You will also have control of zoom. See = https://developers.google.com/maps/documentation/urls/get-started#map-action – B. Shea Feb 15 '22 at 15:39
92

This format works, but it doesn't seem to be an official way of doing so

http://maps.google.com/maps?q=loc:36.26577,-92.54324

Also you may want to take a look at this. They have a few answers and seem to indicate that this is the new method:

http://maps.google.com/maps?&z=10&q=36.26577+-92.54324&ll=36.26577+-92.54324

fzwo
  • 9,842
  • 3
  • 37
  • 57
Allen Rice
  • 19,068
  • 14
  • 83
  • 115
  • 23
    this answer is outdated thanks to a new bug/feature in google maps, it now looks for the nearest address or something. to prevent this, prepend you coordinates with a "loc:". https://maps.google.com/maps?q=loc:36.26577,-92.54324 – peter Apr 05 '14 at 22:15
  • Is there any way how to do this with new Google Maps? I simply need to show marker on the map, which doesn't have any specific meaning (it could be in the middle of forest). – TondaCZE May 05 '14 at 07:59
  • 2
    @TondaCZE peter's example above works for me in the new google maps – Allen Rice May 06 '14 at 18:09
  • 2
    Edited to incorporate change suggested by @peter – fzwo Dec 08 '14 at 11:13
  • http://maps.google.com/maps?z=12&q=loc:13.7646254,100.64339910000001&ll=13.7646254+100.64339910000001&mrt=all&t=m Still not showing marker. The marker will be show if I change to satellite mode. – vee Apr 08 '17 at 06:55
  • @vee I get the marker when I click on the url. Try opening it in incognito mode in chrome or something to make sure you don't have some local settings that are preventing it from showing up – Allen Rice Apr 13 '17 at 20:11
  • @AllenRice Yes, thank you. It is only my problem. (details here https://productforums.google.com/forum/#!topic/maps/y3zJuK96ejE;context-place=forum/maps ). – vee Apr 14 '17 at 02:24
  • I have moved the accepted answer to attract attention to this answer showing the new official google documentation: https://stackoverflow.com/a/44477650/359135 –  Sep 27 '17 at 14:55
40

If you want to include a zoom level, you can use this format:

https://www.google.com/maps/place/40.7028722+-73.9868281/@40.7028722,-73.9868281,15z

will redirect to this link (per 2017.09.21)

https://www.google.com/maps/place/40%C2%B042'10.3%22N+73%C2%B059'12.6%22W/@40.7028722,-73.9868281,15z/data=!4m5!3m4!1s0x0:0x0!8m2!3d40.7028722!4d-73.9868281

bejoo
  • 3
  • 4
yndolok
  • 5,197
  • 2
  • 42
  • 46
34

This URL format worked like a charm:

http://maps.google.com/maps?&z={INSERT_MAP_ZOOM}&mrt={INSERT_TYPE_OF_SEARCH}&t={INSERT_MAP_TYPE}&q={INSERT_MAP_LAT_COORDINATES}+{INSERT_MAP_LONG_COORDINATES}

Example for Mount Everest:

http://maps.google.com/maps?&z=15&mrt=yp&t=k&q=27.9879012+86.9253141

Preview

Full reference here:

https://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters

-- EDIT --

Apparently the zoom parameter stopped working, here's the updated format.

Format

https://www.google.com/maps/@?api=1&map_action=map&basemap=satellite&center={LAT},{LONG}&zoom={ZOOM}

Example

https://www.google.com/maps/@?api=1&map_action=map&basemap=satellite&center=27.9879012,86.9253141&zoom=14

P-S
  • 3,876
  • 1
  • 29
  • 26
  • Best answer, imo, since it the format allows lots of customization - I was searching in particular for a way to change the map type to satellite. Thanks! – kushy Oct 19 '18 at 09:18
  • is there a way to make the marker have a name aswell? It only describes the coordinates as the name of the place – Christian Wolf Alves Hess Jan 29 '19 at 18:26
  • @EricDuminil I added the new format where the zoom parameter works! – P-S Feb 04 '20 at 08:28
  • 1
    Your updated example does not place a pin like the earlier one does. I'm looking for a way of being able to place a pin, _and_ not have the side panel appear. This does not seem possible? – Dave Nottage Jul 03 '22 at 00:49
2

If working with Basic4Android and looking for an easy fix to the problem, try this it works both Google maps and Openstreet even though OSM creates a bit of a messy result and thanx to [yndolok] for the google marker

GooglemLoc="https://www.google.com/maps/place/"&[Latitude]&"+"&[Longitude]&"/@"&[Latitude]&","&[Longitude]&",15z" 

GooglemRute="https://www.google.co.ls/maps/dir/"&[FrmLatt]&","&[FrmLong]&"/"&[ToLatt]&","&[FrmLong]&"/@"&[ScreenX]&","&[ScreenY]&",14z/data=!3m1!4b1!4m2!4m1!3e0?hl=en"  'route ?hl=en

OpenStreetLoc="https://www.openstreetmap.org/#map=16/"&[Latitude]&"/"&[Longitude]&"&layers=N"

OpenStreetRute="https://www.openstreetmap.org/directions?engine=osrm_car&route="&[FrmLatt]&"%2C"&[FrmLong]&"%3B"&[ToLatt]&"%2C"&[ToLong]&"#Map=15/"&[ScreenX]&"/"&[Screeny]&"&layers=N"
0

2023 update:

I found a very easy way to implement this function.

From google maps, find your POI (point of interest) and click on it. on left handside opening menu you will see an icon Share and click.

A modal opens and you see a sharing link input box. Next to it you will see Copy link. Go to your url and paste it like;

<a href="https://goo.gl/maps/GJq5XvqhJnJsS8pU8" target="_blank">Drive to our office</a>

Voila, you are done.

Alp Altunel
  • 3,324
  • 1
  • 26
  • 27