This guide came around as the result of a post
I previously wrote for YOUmoz, which in itself came around as a result
of a night of drinking and being sent an interesting Google SERP. That
post focused on the URL parameters you can feed into Google to generate
SERPs.This time, however, I’m looking at Google Maps.
On its own, this created an interesting problem, since Google doesn’t
actually update the URLs when you go to new pages. As a result, this
research was conducted by individually tweaking every option I could
find on the Google Maps interface. So appreciate it!
Thanks
A big thank you to everyone who helped compile this,
and to Teifion, who smells, and Huw, who doesn't.
Google Maps XML
To understand what we're going to be seeing, it's helpful to
understand what's going on under the hood, so I've copied an example of
the XML Google uses to geocode their maps. You can see this below.
<kml>
<Response>
<name>London</name>
<Status>
<code>200</code>
<request>geocode</request>
</Status>
<Placemark id="p1">
<address>London, Greater London, UK</address>
<AddressDetails Accuracy="4">
<Country>
<CountryNameCode>GB</CountryNameCode>
<AdministrativeArea>
<AdministrativeAreaName>England</AdministrativeAreaName>
<SubAdministrativeArea>
<SubAdministrativeAreaName>Greater
London</SubAdministrativeAreaName>
<Locality>
<LocalityName>London</LocalityName>
</Locality>
</SubAdministrativeArea>
</AdministrativeArea>
</Country>
</AddressDetails>
<Point>
<coordinates>0.126236,51.500152,0</coordinates>
</Point>
</Placemark>
</Response>
</kml>
As you can see, I've done a search for London. It's presented the
response code from the server (200 - found and valid), the address, how
likely it is that this is the place I've queried (AddressDetails
Accuracy), the country name code, and most importantly, the longitude
and latitude values.
Just as a quick aside, if you want to view this yourself, you can do
so with one of the URL strings below, but you'll need to sign up for a
Google Maps API key. Now, on with the guide… http://maps.google.co.uk/maps?
The Google Map URL. If you didn't know that bit, you're shouldn’t be
reading this. Moron.
f=q
This sets what kind of display the user is presented with. Can be set
to q (the standard layout), d (for directions) or l (for local).
Defaults to q.
q=location+goes+here
The query string. Words are separated by + signs. You can enter an
address, a town, city or village, postcodes, variables of latitude and
longitude (in either decimal form or as degrees, minutes and seconds)
and landmarks.
Everything from here on in is preceded by an & sign, as it's
tagged on to the end. Again (if you have no girlfriend), things get
interesting...
near=
Used to specify the location instead of putting it into q. Also has
the added effect of allowing you to increase the AddressDetails Accuracy
value by being more precise. Mostly only useful if q is a business or
suchlike.
z=
Zoom level. Can be set 19 normally, but in certain cases can go up to
23. More information on the super-high zoom level images can be found here.
spn=
Sets the span width and height that the geocoder will compute.
Basically, it limits the number of degrees long/lat that will be shown.
sspn=
Sets the boundaries for the search span. Used for local searches,
near as I can tell.
mrt=
Specifies the type of search (left blank by default, which searches
everything). Can be set to:
- all – all results
- loc – locations based. Requires q to be filled.
- yp – the business search. Also requires q to be set, and works
better with loc as well.
- kmlkmz – searches the community maps. Requires a location set
either in q, loc or near.
- websearch – searches webpages that Google has given a
geographical position.
- realestate – gives real estate based results. Obviously.
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
Don’t ask me why those letters were used, I don’t know why either.
layer=
Turns overlays on and off. Can be set to t for traffic or c for
street view, or tc for both at the same time.
view=
Controls the view type. Set to text for text, or map for map.
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.
mrad=
Allows you to add additional destination addresses. Just as a quick
aside, you can use saddr=, daddr= and mrad= instead of "+to:" if you
want.
dirflg=
This controls the route that will be planned. Can be set to h for no
motorways, r for public transport only or w for walking directions.
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.
cbll=
The latitude and longitude values for Street View.
cbp=
Alters the Street View window. Controls (in order) window size,
bearing, tilt, zoom and pitch.
start=
Skips the first match for search
num=
Controls how many matches are displayed. Will accept values up to 10.
om=
Set to 1 to open the overview map, or anything else to close it.
ie=
Sets the input character encoding, e.g., ie=UTF8.
oe=
Sets the output character encoding, e.g., ie=UTF8.
output=
Sets the output format. Can be set to:
- html - standard
- js – gives you object literals and function calls
- kml – an XML file like the one from the start
- nl – XML formatted NetworkLink wrapper, which links to a URL for
information to be used with Google Earth and Google Maps
- embed – for embedding maps into other sites (also note that this
requires the s= param which is obfuscated)
- dragdir – outputs a JSON object containing the reverse geocode
and an encoded polyline for a given route
f=
Controls the form style. Can be set to d for the directions form, l
for the local version, or q for the normal one.
latlng=
Not sure. Inputs as 3 figures in CVS format, but only uses the last
one. Seems to have something to do with business locations. Must be used
with valid data for other operators. Also, must have q=. Outputs a
teeny map.
cid=
Same as latlng, but allows you to specify map size.
geocode=
Geocoding service for embedded maps.
Iwloc=
Does funky things with the info window. Can be set to:
- A-J – opens the info window over a business marker
- near – puts it over the green arrow (when shown)
- addr – places it over a set address (the default value)
- start, end and pausex – for use in driving directions, where x
is the number of the point in question
iwd=
Sets the info window to expanded view when set to 1.
iwstate1=
Puts the infowindow into various edit modes. Can be set to:
- sscorrectthiscard – standard edit mode
- sscorrectthiscard:ssmovemarkercard – for marker position edits
- sscorrectthiscard:ssedithistorycard – allows you to view a
marker’s history
pw=
Sets print mode.
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.
msid=
Specifies My Maps identifiers. Use it with ms and msa=0 to show
particular My Maps.
vp=
Activates Copyright Service mode. Returns information about the
copyright ownership in Javascript format. Only works when the spn= and
z= are set. Can also include t for map type and key for setting an API
key.
hl=
Controls the language. Can be set to:
- eu = Basque
- ca = Catalan
- hr = Croatian
- cs = Czech
- da = Danish
- nl = Dutch
- en = English
- fi = Finnish
- fr = French
- de = German
- gl = Galacian
- el = Greek
- hi = Hindi
- id = Indonesian
- it = Italian
- ja = Japanese
- no = Norwegian
- nn = Nyorsk
- pt = Portuguese
- rm = Raeto-Romance
- ru = Russian
- sr = Serbian
- sk = Slovak
- sl = Slovenian
- es = Spanish
- sv = Swedish
- th = Thai
- tr = Turkish
- uk = Ukrainian
- vi = Vietnamese