google-mapsgoogle-maps-urls

What parameters should I use in a Google Maps URL to go to a lat-lon?


I would like to produce a url for Google Maps that goes to a specific latitude and longitude. Now, I generate a url such as this:

http://maps.google.com/maps?z=11&t=k&q=58 41.881N 152 31.324W

The resulting map comes up with a round "A" balloon pointer, which seems to point to the nearest named object, and a green arrow, which points to the lat-lon. Sometimes, as in this example, the "A" pointer is centered and is far enough away that you cannot see the pointer to the lat-lon. (Zoom out to see both pointers in this example. The "A" pointer is in the center of Alaska, while the lat-long pointer is on Kodiak Island.)

Are there some parameters I can use in the Google Maps URL that will produce a single pointer to a designated lat-lon? (This loads in a separate window. It is not embedded.)


Solution

  • In May 2017 Google announced the Google Maps URLs API that allows to construct universal cross-platform links. Now you can open Google maps on web, Android or iOS using the same URL string in form:

    https://www.google.com/maps/search/?api=1&parameters

    There are several modes that you can use: search, directions, show map and show street view.

    So you can use something like

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

    to open map and place marker on some lat and lng.

    For further details please refer to:

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

    With zoom (z: 1 to 20) you can use this:

    https://maps.google.com/?q=38.6531004,-90.243462&ll=38.6531004,-90.243462&z=3