google Map codes URL variables explained
From Google Mapki
Jump to: navigation, search
Here's a list of some of the parameters that can be passed to maps.google.com. (and .co.uk/.be etc) You might want to pass such parameters if you want to get Google Maps to display driving directions, which are not available under the API.
* q= Query - anything passed in this parameter is treated as if it had been typed into the query box on the maps.google.com page. In particular:
A precise address is looked up and a marker and info box is displayed at the specified point.
A town name, or the first half of a postcode causes the region to be displayed with to marker or info box.
An exact location can be specified as latitude,longitude, in decimal form (52.123N,2.456W or 52.123,-2.456) or as degrees, minutes and seconds (52 7 22.8N,2 27 21.6W or 52 7 22.8,-2 27 21.6) or as degrees and minutes (52 7.38N,2 27.36W or 52 7.38,-2 27.36).
Any text added in parentheses () is displayed in the info window and sidebar in bold. You can use %A0 as a "no break space" to prevent line breaks happening where you don't want them. You can also use %A0 to force a line break by appending enough of them (this will vary based on the lengths of the lines before and after these breaks) to the end of a line, followed immediately by a space ('+' in the URL). An example would be the following URL: http://maps.google.com?q=New+York,+NY+(Mapki%A0is%A0a%A0very%A0good%A0Wiki%A0for%A0Google%A0Maps!%A0%A0%A0%A0%A0%A0%A0%A0+The%A0previous%A0line%A0is%A0now%A0sufficiently%A0long!)
The words "to" and "from" cause the driving directions function to be activated.
The word "near" or "loc:" causes the local search function to be activated.
space-ampersand-space (use +%26+ or %20%26%20 in URLs, not +&+ or +&+ otherwise the ampersand gets treated as a separator) can be used between the names of two streets to specify an intersection.
A location can also be specified after an @, in decimal form (@52.123,-2.456). This gives a lower zoom level than using the same values without the at sign. Using this format interferes with other options of the query parameter. The @ sign instead of "near" or "loc:" tends to cause only a single business result to be displayed, compare (Church near Hallows Road Blackpool, Lancashire) which returns over 1000 results to (Church @ Hallows Road Blackpool, Lancashire) which returns one result.
To place a custom labeled marker at an arbitrary location, q=10+Downing+Stremail@example.com,-0.227721
The label can't be a country name, or no marker will be shown; but it can be empty, when the co-ordinates will be used.
prefix the query with "sky:" to search KML content created for Sky, q=sky:Leo, designed for use with Google Sky and KML output.
The full URL of a Google Earth .KML/.KMZ file or a RSS feed that includes GeoRSS data, can be used, and the contained information will be displayed on the map.
* near= Can be used as the location part of a query instead of putting the whole thing into q=.
* g= a address/location, provides extra context for the q param. Google Maps itself stores the last run search here. NOTE: if its the first search it can contain your starting location. This is a potential information leak, check you do in fact mean to share the content of this parameter.
* mrt= Specifies a type of search (blank for everything (default).
o mrt=all Specifically request everything.
o mrt=loc Locations search. Needs the q= param.
o mrt=yp Businesses search (aka yellowpages). Will need the q= param, and optionally a location.
o mrt=kmlkmz User-Contributed 'Community' Content collected from the GeoWeb. Only works if the query contains a location and something to search for. E.g. q=hotel&near=london&mrt=kmlkmz or q=hotel+in+london&mrt=kmlkmz.
o mrt=websearch Mapped Web Pages. Webpages that GoogleBot has been able to assign a geographical position.
o mrt=realestate Real Estate search.
o mrt=ds Related Maps - Googles index of GeoRSS feeds (and possibly KML?)
* start= Skips the first (start-1) matches.
* num= Display, at most, this number of matches. The valid range is 0 to 20 (but 0 is a bit pointless).
* ll= Latitude,longitude of map centre - Note the order. Only decimal format is accepted.
If this is used without a query, then the map is centred at the point but no marker or info window is displayed.
* sll= Latitude,longitude of the point from which the business search should be performed. You could use this to perform an off-centre busness search. Google use it so "link to this page" can record a map that has had the centre moved after performing a business search. When requesting a route map.getBounds().getSouthWest().toUrlValue() returns the same value maps.google.com uses.
* spn= Approximate lat/long span. The zoom level will be adjusted to fit if there's no z= parameter. Use this Mapki tool to find a lat and long.
* sspn= Stands for "Screen span". Map bounds dimensions in Degrees, to calculate this use:
newGLatLng(map.getBounds().getNorthEast().lat() - map.getBounds().getSouthWest().lat(),map.getBounds().getNorthEast().lng() - map.getBounds().getSouthWest().lng()).toUrlValue()
* latlng= This is a weird one. It takes three numbers separated by commas. The first two numbers (presumably representing latitude and longitude multiplied by 1000000) are ignored. The third number seems to be a Google internal "Company ID" number for a particular business. E.g. latlng=0,0,14944637421527611642 represents Blackpool Community Church. Specifying this parameter performs a Google Search for pages that reference that business, and displays a tiny map. Other parameters, in particular q=, must have valid contents (but need not relate to the target business) for this to work.
* cid= Similar to latlng, but generating a different map size. It takes three numbers separated by commas. The first two numbers (presumably representing latitude and longitude multiplied by 1000000) are ignored. The third number seems to be a Google internal "Company ID" number for a particular business. E.g. cid=0,0,14944637421527611642 represents Blackpool Community Church. Specifying this parameter displays a large map of the identified company location. Other parameters, in particular q=, must have valid contents (but need not relate to the target business) for this to work.
* geocode= Concatination of "geocode" encoded values for waypoints used in Directions. Appears when waypoints in "from: blah to: blah" are potentially ambigious. E.g, &saddr=Were+St&daddr=Kings+Hwy+to:Princes+Hwy+to:Princes+Hwy+to:Monaro+Hwy+to:-35.43483,149.112175&hl=en&geocode=FbBP4_0dSEXjCA%3BFWIj4_0dpMDtCA%3BFe4g3_0dunvzCA%3BFfBf0P0dEGzuCA%3BFSoL1_0dtorjCA%3B is the end result from joining the "geocode" values for each waypoint with %3B.
* radius= Localizes results to a certain radius. Requires sll or similar center point to work. Units are in miles, but it may be in km for metric countries. Useful in preventing Google from branching out across a city for results, and keeps it confined into the area.
* t= Map Type. The available options are "m" map, "k" satellite, "h" hybrid, "p" terrain.
* z= Sets the zoom level.
* layer= Activates overlay. Current option is "t" traffic.
* lci= Activates layers of tiles, comma-separated.
o com.panoramio.all Photos (from Panoromio)
o com.youtube.all Videos (from YouTube)
o org.wikipedia.en Wikipedia (English)
o com.google.ugc.c752d13e87c4fbd7 Webcams (from Webcams.travel)
o transit Transit
e.g. lci=com.panoramio.all,org.wikipedia.en for Photos and Wikipedia English.
* view= Can be used to select text view (view=text) or the normal map view (view=map).
* saddr= Source address. Use this when asking for driving directions.
Any text added in brackets is displayed in the sidebar in bold.
* daddr= Destination address(es). Use this when asking for driving directions
Any text added in brackets is displayed in the sidebar in bold.
"+to:" clauses can be appended to the destination to request multiple destination routing, like this daddr=Blackpool+to:Manchester+to:Leeds
Text in brackets can also be added to the "+to:" clauses.
* mra ?? what does mean this route parameter? known possible values=dm, dpe, cc, ls, ...
* mrcr ?? what does mean this route parameter? known possible values=0
* mrsp ?? what does mean this route parameter? known possible values=0,1
* mrad= Additional destination address.
If you've got three points in your trip you can use saddr=, daddr= and mrad= instead of "+to:" clauses.
* dirflg Route type.
o dirflg=h Switches on "Avoid Highways" route finding mode.
o dirflg=t Switches on "Avoid Tolls" route finding mode.
o dirflg=r Switches on "Public Transit" - only works in some areas.
o dirflg=w Switches to walking directions - still in beta.
* via= Comma separated list of intermediate addresses for directions, that should be 'via points'. In the example via=1,3 addresses 1 and 3 will be via points without their own entry in the sidebar. The start (0), the 2nd intermediate (2) and the end (4) will be full addresses.
* doflg= Distance Units. (Defaults to prevalent units in country of origin.)
o doflg=ks ??
o doflg=ptk Outputs directions in metric (km).
o doflg=ptm Outputs directions in imperial (miles).
* cbll= Latitude,longitude for Street View.
* cbp= Street View window that accepts 5 parameters:
1. Street View/map arrangement, 11=upper half Street View and lower half map, 12=mostly Street View with corner map
2. Rotation angle/bearing (in degrees)
3. Tilt angle, -90 (straight up) to 90 (straight down)
4. Zoom level, 0-2
5. Pitch (in degrees) -90 (straight up) to 90 (straight down), default 5
* panoid= Panorama ID. The ID of the current nearby panorama object. Panorama objects ids are used in the little arrows you can click on in Street View to move you to the next object/property. Eg panoid=eTnPNGoy4bxR9LpjjfFuOw
* hl= Host language. Only a few languages are supported, e.g. hl=fr for French.
* om= The presence of this parameter with a value other than 1 causes the overview map to be closed. If the parameter is omitted, or present with the value 1, then the overview map is open.
* ie= Can be used to specify the input character encoding set. e.g. ie=UTF8.
* oe= Can be used to specify the output character encoding set. e.g. oe=UTF8.
* output= Output format (blank (default) is a standard webpage for user)
o output=html Uses the old style Google Local page format from before it merged with Google Maps, with the small map and large sidebar.
o output=kml Outputs a KML file containing information representing the current map. (works with Normal Searches, Directions and MyMaps)
o output=nl Outputs a small KML file containing a NetworkLink wrapper linking to a URL from which Google Earth and Google Maps can obtain the information (only known to work with MyMaps).
o output=embed Outputs HTML suitable for embedding in third party sites, only works with the presence of the encrypted s= param, presumably to stop arbitrary content being included.
o output=dragdir returns a JSON object that contains the reverse geocode and a an encoded polyline for a given saddr (start point of the route) and daddr (endpoint of the route)
o output=georss (Geo)RSS output for the current map - probably only MyMaps
* f= Controls the style of query form to be displayed.
o f=d Displays the "directions" form (two input boxes: from, to).
o f=l Displays the "local" form (two input boxes: what, where).
o f=q (or no parameter) The default search form is displayed (single input).
* pw= Activates print mode and initiates printing. There seems to be a problem at the moment with pw=1, but using settings like pw=2 is OK.
* iwloc= Specifies where the infowindow will be displayed. In a business search iwloc=A to iwloc=J will open the info window over the corresponding business marker, and iwloc=near will place it over the big green arrow if that's currently displayed. iwloc=addr can be used on map search to explicitly request the info window to be open on the address, but that's the default anyway. Directions search supports iwloc=start, iwloc=end and iwloc=pause1 etc. In My Maps can open the info window on specific feature, eg iwloc=0004567f01f0152385b6b.
* iwd=1 Specifies that the infowindow displayed (iwloc=) will be a detailed (expanded) view.
* iwstate1=ssaddfeatureinstructioncard Specifies that the infowindow is in add place mode. Use with ssp=addf and iwloc=SS.
* iwstate1=sscorrectthiscard Specifies the infowindow is in edit mode.
* iwstate1=sscorrectthiscard:ssmovemarkercard The infowindow is in Move marker mode, with the marker bouncing and draggable.
* iwstate1=sscorrectthiscard:ssedithistorycard The infowindow is in View history mode, displaying a graphical list of marker moves.
* msa= Involved in My Maps processing. It does nothing without the "/ms" and "/ms" does nothing without the msa=.
o msa=0 Used with msid= to show a particular My Map.
o msa=b Activates the "My Maps" sidebar when used in conjunction with "maps.google.com/ms". (Possibly doesn't work anymore.)
o msa=1 Seems to just show the My Maps tab directly (like msa=b did).
o msa=2 Jumps directly to create new My Map form.
* msid= Specifies a My Maps identifier. When used in conjunction with "maps.google.com/ms" and msa=0, the corresponding My Map is displayed.