New Google Maps URLs – Map Positioning

When viewing a simple map (including those with place, search, or directions requests), the MAP_POSITION section is used to center the map and specify the desired zoom level. If no MAP_POSITION is specified, Maps will position the map based on the DISPLAY_REQUEST if one was specified; otherwise it will use a default location (which appears to be the user’s location, to the degree Maps can determine it).

Maps will preferentially use MAP_POSITION to center and zoom the map, even if this causes the requested place or directions to be “off-map”. Also, if a search is done with the search term specifying one location while MAP_POSITION specifies another, the map will display the results of the search in the MAP_POSITION area while the dropdown box on the left shows results from the search-specified area.

The format used for MAP_POSITION is:

Example (Gateway Arch, St. Louis):

LATITUDE is expressed in decimal degrees. The map can extend from -85° to +85°, so the specified latitude cannot be a value which would cause the map to display outside that range (what that value is will depend on the zoom level and the map height). If the URL specifies a latitude outside the allowable range, Maps will move it the smallest distance towards zero necessary to make it valid.

LONGITUDE is also expressed in decimal degrees. The map extends from -180° to +180° and wraps around; if longitude is set to a value less than -180° or greater than 180°, Maps will convert it to the equivalent angle within that range (i.e., 350.2 would become -9.8).

ZOOM can be expressed either as a zoom “level”, or as the distance in meters represented by the vertical extent of the map (i.e., the distance from map bottom to map top). Zoom level is indicated by the letter ‘z’; distance in meters by the letter ‘m’.

According to my testing, zoom levels can range from 3z (maximum zoom-out) to 21z (maximum zoom-in). A level greater than 21 is treated as 21; a level less than 3 but greater than 0 is treated as 3. A level which is 0 or negative causes the position section to be ignored. A fractional level between 3 and 21 is truncated unless it is within about 0.05 of the next higher level, in which case it is rounded up. Classic Maps would allow higher zoom levels in certain areas, but my tests of a couple of these areas in new Maps shows a maximum zoom of 21.

Distances will always get rounded to the appropriate distance for a given zoom level. So, for example, if 12z is equivalent to 26211m and 11z is equivalent to 52422m, you can’t use 37068m to get the equivalent of 11.5z; it will automatically get rounded out to 52422m/11z. However, if the distance were within about 3.53% of the lower value, it would get rounded down (in this example, 27135m would round in to 26211m/12z, but 27136m would round out to 52422m/11z).

By default, Maps uses zoom levels for street maps and distance in meters for satellite view, but the URL will accept either form for either type of map.

When viewing a Street View image, the MAP_POSITION section has a different format:

Example (Top of Gateway Arch viewed from Leonor K Sullivan Blvd):

LATITUDE and LONGITUDE are the same as described above for simple maps.

3a just is. I have never seen anything else here, and when I’ve attempted to use other values they have either caused problems or been changed back to ‘3a’ by Maps.

FOCUS is like a zoom level. It can range from a maximum zoom-in of 15y to a maximum zoom-out of 90y; Street View normally starts at 75y. While the map controls will set this in multiples of 15, any value between 15 and 90 can be set in the URL and it will only be rounded to the nearest 0.1 (so, 15.5y zooms out just a touch compared to 15y). Setting the value outside the range of 0-180 produces an “invalid” image; 0-15 is treated as 15 and 90-180 is treated as 90. I do not know what the numbers represent specifically.

DIRECTION is the compass direction in degrees that the camera viewpoint is pointing in. 0 is North, 90 is East, and so on. Values are rounded to the nearest 0.01 degrees. Setting the value outside the range 0-360 produces an invalid image.

ANGLE is the elevation angle of the camera. 0 is pointing straight down, 180 is pointing straight up. Values are rounded to the nearest 0.01 degrees. Setting the value outside the range 0-180 produces an invalid image.

Return to New Google Maps URLs introduction

This entry was posted in Google Maps, Online Maps and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s