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:
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.)
015 Answers
This is current accepted way to link to a specific lat lon (rather than search for the nearest object).
zis the zoom level (1-20)tis the map type ("m" map, "k" satellite, "h" hybrid, "p" terrain, "e" GoogleEarth)qis the search query, if it is prefixed byloc:then google assumes it is a lat lon separated by a+
yeah I had the same question for a long time and I found the perfect one. here are some parameters from it.
= valueq=
is used to specify the search query in Google maps search.
eg :
ornear=
is used to specify the location alternative to q=. Also has the added effect of allowing you to increase the AddressDetails Accuracy value by being more precise. Mostly only useful if query is a business or suchlike.
z=
Zoom level. Can be set 19 normally, but in certain cases can go up to 23.
ll=
Latitude and longitude of the map centre point. Must be in that order. Requires decimal format. Interestingly, you can use this without q, in which case it doesn’t show a marker.
sll=
Similar to ll, only this sets the lat/long of the centre point for a business search. Requires the same input criteria as ll.
t=
Sets the kind of map shown. Can be set to:
m – normal map,
k – satellite,
h – hybrid,
p – terrainsaddr=
Sets the starting point for directions searches. You can also add text into this in brackets to bold it in the directions sidebar.
daddr=
Sets the end point for directions searches, and again will bold any text added in brackets.You can also add "+to:" which will set via points. These can be added multiple times.
via=
Allows you to insert via points in directions. Must be in CSV format. For example, via=1,5 addresses 1 and 5 will be via points without entries in the sidebar. The start point (which is set as 0), and 2, 3 and 4 will all show full addresses.
doflg=
Changes the units used to measure distance (will default to the standard unit in country of origin). Change to ptk for metric or ptm for imperial.
msa=
Does stuff with My Maps. Set to 0 show defined My Maps, b to turn the My Maps sidebar on, 1 to show the My Maps tab on its own, or 2 to go to the new My Map creator form.
dirflg=
can set miscellaneous values below:
h - Avoid highway
t - Avoid tollsreference
4In 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:
There are several modes that you can use: search, directions, show map and show street view.
So you can use something like
to open map and place marker on some lat and lng.
For further details please refer to:
2This should help with the new Google Maps:
- The
placeadds a marker. namecould be a search term like "realtors"/"lawyers".latandlongare the coordinates in decimal format and in that order.15zsets zoom level to 15 (must be between 1 ~ 20).- You can enforce a particular view mode (map is default) - earth or terrain by adding these:
- Terrain:
/data=!5m1!1e4 - Earth:
/data=!3m1!1e3
- Terrain:
E.g.:
References:
Just use the coordinates as q-parameter. Strip the z and t prameters. While z should actually just be the zoom level, it seems that it won't work if you set any.
t is the map type. Having that said, it's not obvious how those parameters would affect the result in the shown way. But they do.
Maybe you should try the ll-parameter, but only decimal format will be accepted.
You can find a quick overview of all the parameters here.
3The following works as of April 2014. Delimiting each component of the URL with + and & for spaces and addition statements, respectively.
Full HTML:
<iframe src=""></iframe>Broken down:
where ?q= starts the general search, which I provide a venue, city, province info using + for spaces.
Scottish+Rite+Hamilton+ONNext the geo-data. Lat and lng.
&loc:43.25911+-79.879494Zoom level
&z=15Required for iframes:
&output=embed 5 If you need a name on your pin, you can also use:
2All the answers didn't work for me (the loc: and @ options). So here is my solution for the new Google maps (April 2014)
Use the q= for query description, for example the street or the name of the place. Use ll= for the lat, long coordinates.
You can add extra parameters like t=h (hybrid) and z=19 (zoom)
There have been a number of changes, some incompatible, since I asked this question 5 years ago. Currently, the following works properly:
152°31.324W/@58.698017,-152.522067,12z/The first latitude/longitude will be used for the pin location and label. It can be in degrees-minutes-seconds, degrees-minutes, or degrees. The second latitude/longitude (following the "@") is the map center. It must be in degrees only in order for the zoom (12z) to be recognized.
For terrain view, you can append "data=!4m2!3m1!1s0x0:0x0!5m1!1e4". I can find no documentation on this, though, so the spec could change.
0New Version queries have a different format
To reach a lat long by url use (e.g.)
works fine
This doesn't have to be much more complicated than passing in a value for the 'q' parameter. Google is a search engine after all and can handle the same stuff it handles when users type queries into its text boxes
"maps.google.com?/q=32.5234,-78.23432" 1 This works to zoom into an area more then drop a pin:
And the params are:
@lat,lng,zoom If you only have degrees minutes seconds you can pass them on the url :
latMinutes latSeconds longDegrees longMinutes longSeconds substitute in %20 for the spaces
"ll" worked best for me, see:
(query reference)
it shall not be too hard to convert minutes, seconds to decimal
for a marker, possibly the best would be ?q=Description@lat,long
1