Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 557
xpda Avatar asked Oct 10 '22 22:10

xpda


People also ask

What coordinate reference system does Google Maps use?

(Google uses the World Geodetic System WGS84 standard.) World coordinates, which reference a point on the map uniquely.

How do you link GPS coordinates?

1. Go to maps.google.com. 2. Type out the coordinates into the search bar — using either the degrees, minutes, and seconds (DMS) format, the degrees and decimal minutes (DMM) format, or decimal degrees (DD) format — then hit enter or click on the search icon.


2 Answers

This is current accepted way to link to a specific lat lon (rather than search for the nearest object).

http://maps.google.com/maps?z=12&t=m&q=loc:38.9419+-78.3020
  • z is the zoom level (1-20)
  • t is the map type ("m" map, "k" satellite, "h" hybrid, "p" terrain, "e" GoogleEarth)
  • q is the search query, if it is prefixed by loc: then google assumes it is a lat lon separated by a +
like image 256
xordon Avatar answered Oct 17 '22 03:10

xordon


yeah I had the same question for a long time and I found the perfect one. here are some parameters from it.

https://maps.google.com?parameter = value



q=

is used to specify the search query in Google maps search.
eg :

https://maps.google.com?q=newyork or
https://maps.google.com?q=51.03841,-114.01679

near=

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 – terrain

saddr=

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 tolls

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

like image 99
Sameera R. Avatar answered Oct 17 '22 04:10

Sameera R.