Multimap logo Multimap API V1.2 Web Services Documentation - Static Maps


Overview

Static maps are simple images of a map, normally shown within a web page, that do not provide rich functionality, such as dragging and smooth panning and zooming, found in Multimap API V1.2 JavaScript. Static maps are often used to display maps to those users who do not have the required browser software to display maps based on the JavaScript API.

In addition to static maps, the Multimap API allows you to add draggable maps to your implementations. You may wish to display a static map as a "fallback" for those users whose browser configuration does not support the Multimap API. For details of how to do this, please see the Static Maps "Fallback" JavaScript example.

The Multimap API allows you to embed static maps in your own web pages. You can vary these static maps' appearance and behavior by means of several parameters.


Basic Example

Here is an example of a URL for a basic example of a static map, with the map that it generates shown below it. If you view this in your browser you should see a Multimap static map centered on Constitution Avenue, Washington, DC, USA at zoom factor 15:

http://clients.multimap.com/API/map/1.2/[api_key]?lat=38.89207&lon=-77.0362
&zoomFactor=15&width=400&height=400

The Map

Terms of use


In all the example URLs shown on this page, [api_key] should be replaced with your own API key which your Multimap account manager has provided.

Requesting static maps via HTTPS

If you subscribe to the Secure module, you can request static maps via https://clients.multimap.com. To do so, you need to use slightly different code in your maps: in your URL, replace "http" with "https". The Secure module encrypts both the HTTP requests that the browsers that are viewing your web pages pass to Multimap servers, and the map deliveries that Multimap servers pass back in return. The HTTP requests and map deliveries that the standard request passes on a regular basis do not present any risk to the security of your web site, but the Secure module caters for websites that already have encryption in their pages.

Displaying a "Terms and Conditions" link

The maps and data used to provide this service represent copyrighted information, which is owned by Multimap's data partners. When implementing Multimap API Static Maps, you must display the link to Multimap's full Terms and Conditions of use near the map in your web pages: the URL for which is included in the code sample below:

<a href="http://www.multimap.com/about/terms_of_use/">Terms of use</a>

Top of page


General Parameters

The general parameters, their description and examples are as follows:

Parameter Name Description Example
bb This string specifies the bounding box for a search. bb=-0.1426,51.5086;-0.1264,51.5392
height This denotes the height in pixels of a static map. height=400
lat, lat_1, lat_2, etc. This denotes a latitude coordinate. lat=42.29857
lon, lon_1, lon_2, etc. This denotes a longitude coordinate. lon=-71.16817
locale This determines the appearance of labels and other text on a static map, based on settings for language and geographic area. locale=de-DE
mapType This controls whether your Multimap service shows a static map or a static aerial photograph. mapType=Map
moveMap This comma-separated pair denotes the distances in pixels to move a static map east and north respectively. moveMap=40.0
moveMapMeters This comma-separated pair denotes the distances in meters to move a static map east and north respectively. moveMapMeters=-100,0
output This parameter determines the type or file format of the map or image that the Multimap Static Maps service returns. output=png
width This denotes the width in pixels of a static map. width=400
zoom These 'delta parameters' denote the number of zoom factors to zoom a static map inwards (positive value) or outwards (negative value). zoom=1
zoomFactor This number denotes the zoom factor at which the map appears. zoomFactor=15

You can also control the static map type, filter your data, show static maps of earlier location-search results and overlay info boxes and markers on your static maps.

Top of page


Implementing Static Maps

Displaying static maps using latitude and longitude

You can specify one or more locations using coordinates of latitude and longitude:

Please note that static maps whose URLs contain coordinates for more than one location are automatically scaled to show all their locations by default: there is no need to specify a zoomFactor parameter. If a zoomFactor parameter is specified in a URL showing multiple coordinates, some of the locations' markers might not be visible if they are located outside the view of the static map.


Displaying static maps using addresses

You can specify an address to be shown on your static map using address input parameters:

Address input parameters

Parameter Name Description Permissible Values Example
city This parameter refers to the city, town or suburb for the input address. String city=Boston
countryCode This parameter refers to a two-letter ISO country code for the input address. If countryCode is not specified, it defaults to Great Britain. Two-letter ISO country code countryCode=GB
gcFirstAlt This parameter displays all possible matches as multiple locations on a single static map. The default value of this parameter is "1" so, if you wish your static map to display all possible results, you should specify this parameter with a value "0". Boolean ("1" (default) or "0") gcFirstAlt=0
postalCode This parameter refers to the postal (or ZIP) code for the input address. Any valid full or partial postal code postalCode=EC4A2DY
qs This parameter refers to an address or place name entered as a single string, preferably in combination with countryCode. String qs=EC4A2DY
region This parameter refers to the region or local area for the input address. String region=England
state This parameter refers to the state, province or territory for the input address. String state=MA
street This parameter refers to the street (optionally including a building name) for the input address. String street=Fleet%20Street
ZIP This parameter refers to the ZIP code for the input address; it is a synonym for postalCode. String ZIP=02116

Here is an example of an embedded URL showing the location of Fleet Street in London, Great Britain:

http://clients.multimap.com/API/map/1.2/[api_key]?qs=Fleet%20Street,London&countryCode=GB

Geocode 1

Terms of use


Multiple address results

When the result of a geocoding request returns more than one possible match, your static map's default behavior is to show the first alternative that it finds. If you wish to alter this behavior to show all possible matches as multiple locations on a single static map, please use the gcFirstAlt parameter. The default Boolean value of this parameter is "1" so, if you wish your static map to display all possible results, you should specify this parameter with the value "0".

Please note that you can also use the gcFirstAlt parameter to determine whether a result of a geocoding request is the only possible match or whether multiple matches exist.

Here is an example of an embedded URL showing all possible matches of "Clapham Road" in Great Britain:

http://clients.multimap.com/API/map/1.2/[api_key]
?street=Clapham%20Road&town=Clapham&countryCode=GB&gcFirstAlt=0

Geocode 2

Terms of use


Please note that:


Displaying static maps using your own data

You can show one or more locations on your static map using addresses you have uploaded in your table of addresses using Client Zone. For details of uploading and managing your own data, please see the separate Implementation Guidelines documentation which is available via Client Zone or from your Multimap account manager.

Please note that, if your data includes addresses that are located within the People's Republic of China, special rules apply; for details, please see the separate section entitled Exception - People's Republic of China.

Here is an example of a URL searching for a location within your Multimap service's table of addresses whose "client_id" field matches the value "21641":

http://clients.multimap.com/API/map/1.2/[api_key]
?fieldname_1=client_id&operator_1=eq&value_1=21641

Searching

Terms of use


Here is another example of a URL searching for all locations within your Multimap service's table of addresses have have car parks:

http://clients.multimap.com/API/map/1.2/[api_key]?width=400&height=400
&fieldname_1=has_car_park&operator_1=eq&value_1=true

Multiple filters

You can add multiple filters to your URLs by specifying the logic parameter, with a value of "AND" or "OR", which applies to two or more filter conditions:

http://clients.multimap.com/API/map/1.2/[api_key]?width=400&height=400
&fieldname_1=town&operator_1=eq&value_1=boston
&fieldname_2=client_id&operator_2=eq&value_2=621&logic=OR

Search input parameters

Parameter Name Description Permissible Values Example
count This parameter specifies the number of records returned in the results. Integer count=10
dataSource This parameter specifies the data source to use. It is possible to search multiple data sources in one request by specifying a comma-separated list. Comma-separated list dataSource=mm.clients.demo,mm.clients.demo_xml
fieldname_1, fieldname_2, etc. This parameter specifies the name of the field in the data source on which to filter.. String fieldname_1=client_id
logic This parameter specifies the logic operator to use if more than one field filter is provided ("AND" by default). 'AND' or 'OR' or comma-separated list logic=OR
operator_1, operator_2, etc. This parameter specifies the operator to be used in the field filter. Please see the relevant section of the Multimap API Searching web service documentation for a full list of available search operators. String operator_1=eq
value_1, value_2, etc. This parameter specifies the value used in the field filter search. String value_1=100


Preview and Live Environments

The Multimap API allows you to upload your store data via Multimap's Client Zone extranet and test it in a preview environment before making the data live. To view your preview data on a web page similar to this one, specify

<script type="text/javascript" src="http://preview.multimap.com/API/maps/1.2/[api_key]">

instead of

<script type="text/javascript" src="http://www.multimap.com/API/maps/1.2/[api_key]">

in the <HEAD> section of your web page.

For further details of your preview and live environments, please see Multimap's separate Geocoding and Data Management in Client Zone: Implementation Guidelines documentation which is available via Client Zone or from your Multimap account manager.


Displaying a route on a static map

You can display a route on your static map via a two-step process.

  1. Request a route from the Multimap API Routing module and retrieve the route key from the XML response.
  2. Include the route key within your static map request.

Here is an example of a URL displaying a single route in London, Great Britain on a static map:

http://clients.multimap.com/API/map/1.2/[api_key]
?routeKey=DC,-0.11102:51.51842;-0.14400:51.51638,0

The Route

Terms of use


Route input parameters

Parameter Name Description Permissible Values Example
routeColor This is a three- or six-digit hexadecimal code which determines the color in which the polyline or polygon representing a route appears on a static map. Any valid HTML hexadecimal color name routeColor=0000FF
routeEndMarker This marker is placed at the end of a route on a static map. The marker must have already been uploaded to your Client Zone account.
(Setting the marker's value to "none" completely disables that marker, including any label.)
Any valid file name that has been uploaded to your Client Zone account routeEndMarker=myendicon.png
routeEndLabel This label is displayed over the icon marking the end of the route. Any string of characters routeEndLabel=Finish
routeKey This is the unique route key that identifies a route from a previous enquiry. The COUNTER with this parameter should always start with "1", followed by "2" and so on. Any valid Multimap route key routeKey=DC,-0.97290:51.44850;-0.97069:51.45488,8
routeOpacity This attribute determines the degree of transparency of the polyline or polygon that represents a route on a static map. Any real number between 0 and 1 routeOpacity=0.75
routeStartMarker This marker is placed at the beginning of a route on a static map. The marker must have already been uploaded to your Client Zone account.
(Setting the marker's value to "none" completely disables that marker, including any label.)
Any valid file name that has been uploaded to your Client Zone account routeStartMarker=mystarticon.png
routeStartLabel This label is displayed over the icon marking the beginning of the route. Any string of characters routeStartLabel=Start
routeStepMarker These markers indicate individual steps along a route on a static map. The default value is "none". Any valid file name that has been uploaded to your Client Zone account routeStepMarker=mystepicon.png
routeThickness This attribute determines the thickness of the polyline or polygon that represents a route on a static map. Any real number (1.0 for default thickness, 2.0 for twice default thickness, 0.5 for half default thickness, etc.) routeThickness=0.5

You can adjust the exact positions of the start and end icons on your static maps by using the XML configuration file that is described in the Markers section of this web page.

Here is an example of a URL showing a single route in Florida, US using routeColor and routeOpacity parameters:

http://clients.multimap.com/API/map/1.2/[api_key]
?routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0
&width=400&height=400&routeColor=255,0,0&routeOpacity=1

The Route

Terms of use


Displaying local information on a static map

Multimap API V1.2 Static Maps support the optional Local Information module which allows you to display points of interest of various types within the bounds of a static map. For a list of all the types that are available, please contact your Multimap account manager.

Local Information parameters

Parameter Name Description Permissible Values Example
overlayCount This parameter specifies the number of records returned in the results. Integer or comma-separated list of integers overlayCount=10
overlayDataSource This parameter specifies the data source to use. It is possible to search multiple data sources in one request by specifying a comma-separated list. Comma-separated list overlayDataSource=mm.poi.global.general.atm, mm.poi.UK.premium.parking
overlayLabel This parameter is a list of labels that are displayed over the markers for the corresponding dataSources. Comma-separated list of strings of characters overlayLabel=%24,P
overlayMarker This parameter is a list of filenames for the Local Information markers that appear on a static map. The icon must have already been uploaded to your Client Zone account. Comma-separated list of valid file names that have been uploaded to your Client Zone account overlayMarker=atm,parking
overlayOpacity This parameter is a list of values that determine the degree of transparency of the markers for the corresponding data sources. Any real numbers between 0 and 1 overlayOpacity=0.8,1.0

Here is an example of a static map centered on the City of Westminster in London, Great Britain. The example displays local information markers for bank ATMs and parking spaces, where overlayLabel "ATM" denotes bank ATMs and "P" denotes parking spaces. The overlayCount parameter specifies the maximum number of markers to display for each of the data sources in the overlayDataSourcelist, mm.poi.global.general.atm and mm.poi.UK.premium.parking:

http://clients.multimap.com/API/map/1.2/[api_key]
?overlayCount=100,100&lat=51.50002&lon=-0.12618
&overlayDataSource=mm.poi.global.general.atm,mm.poi.UK.premium.parking
&zoomFactor=16&overlayLabel=ATM,P

Local Information

Terms of use


Static map dimensions (width and height)

You can specify the size of your static map by using the width and height parameters to specify the map's dimensions in pixels:

http://clients.multimap.com/API/map/1.2/[api_key]?lat=51.123&lon=-0.9911
&zoomFactor=15&width=400&height=400

If you do not specify the dimensions of your static map, it appears at a default size of 200 pixels wide by 200 pixels high.

Please note that Multimap's recommended limits on static map size are:


Panning and zooming

Panning

Multimap API V1.2 Static Maps support panning of a static map in any direction by means of the moveMap and moveMapMeters parameters.

Positive and negative static map coordinates

The coordinate system of the static map has its point of origin (0,0) at the top left-hand corner of the web page, with the positive x-axis increasing toward the right and the positive y-axis increasing in value as its position moves downwards. This is in accordance with several recognized standards for coordinate systems that are in use.

A graphic depiction is shown below.

Map coordinate diagram

You should specify panning directions in a comma-separated pair with positive values for south and east and negative values for north and west:

Please note that panning a static map by a fixed distance in meters becomes less noticeable for maps that are rendered at low zoom factors ('zoomed out').

A static map request with the parameter "output=xml" gives you URLs to pan your current static map in different directions. For details, please see the Multimap API V1.2 Static Maps XML documentation.

Zooming and zoom factors

Static maps can be zoomed in and out by means of the zoomFactor and zoom parameters. Maps are available between zoom factor 1 ("zoomed out") and zoom factor 18 ("zoomed in"), although not all zoom factors are available for all areas.

If you specify a static map without including a zoom factor in your URL, the map is automatically zoomed to an appropriate zoom factor. This behavior can be overridden by using the zoomFactor and zoom parameters.

(You could also zoom a static map from a specified zoom factor by combining the zoomFactor and zoom parameters.)

Here is an example of a URL showing a static map centered on Constitution Avenue, Washington, DC, USA at zoom factor 15, with controls added to allow users to pan and zoom the map:

http://clients.multimap.com/API/map/1.2/[api_key]?lat=38.89207&lon=-77.0362
&zoomFactor=15&width=500&height=300

The Map
From Constitution Avenue:





Terms of use



Static map types

You can use the mapType parameter to request a static map or a static aerial photograph: the default value is "map".

Map

http://clients.multimap.com/API/map/1.2/[api_key]?lat=51.123&lon=-0.9911
&zoomFactor=15&width=400&height=400&mapType=map

Aerial photograph

http://clients.multimap.com/API/map/1.2/[api_key]?lat=51.123&lon=-0.9911
&zoomFactor=15&width=400&height=400&mapType=aerial


Output formats

If required, you can use the optional output parameter to determine the file format in which a static map image is rendered:

The default output format is PNG for static maps and JPG for static aerial photographs. The XML output returns information about the static map and allows pan and zoom links to be easily constructed, in addition to the static map URL. For details, please see the Multimap API V1.2 Static Maps XML Documentation.



Changing Local Language Settings

The locale parameter lets you create different versions of the Multimap API that offer support in several different languages, by specifying the user's language and geographic area, for:

The default value is "en-US" for US-English, but other locales are possible:

Please follow this link to see a full list of permissible values for the locale parameter.

Top of page


Customizing Icons on Static Maps

Markers

Markers are overlaid on a static map to highlight the coordinates, addresses and other locations that you have specified. You can show your own image on your static map by uploading the image via Client Zone (in PNG, JPG or GIF format), then specifying it as the source image for a marker on your static map.

Please note that the Multimap API supports marker files in PNG, JPG or GIF formats; if you do not specify a suffix as part of the file name, the Multimap API assumes a default format of PNG.

List of marker options

Parameter Name Description Permissible Values Example
label, label_1, label_2, etc. These are the labels that are displayed over each of a static map's markers. Any string of characters label=my+custom+label
marker, marker_1, marker_2, etc. This is a list of file names for all the markers that appear on a static map. The icon must have already been uploaded to your Client Zone account. Any valid file name that has been uploaded to your Client Zone account marker=myicon.png
opacity, opacity_1, opacity_2, etc. This attribute determines the degree of transparency of each marker on a static map. Any real number between 0 and 1 opacity=0.75

The parameters marker, label and opacity apply to all markers on the static map (including markers for geocode, search and route results). The existence of the parameters marker_n, label_n and opacity_n overwrites the values set in the parameters marker, label and opacity for the n-th coordinate lon_n and lat_n.

Please note that you should encode spaces between characters in any marker option string using either the separator "+" or the combination "%20".

Example showing markers

Here is an example of an embedded URL for a static map that uses custom markers to show two locations, one identified by coordinates and the other by an address:

http://clients.multimap.com/API/map/1.2/[api_key]?width=500&height=500&lat=51.5139&lon=-0.10147
&marker=myicon.png&label=hi&opacity=0.5 &street=Fleet%20Street&city=London&countryCode=GB

Markers

Terms of use


Disabling markers

If you wish, you can prevent your static maps from showing markers by specifying "none" as the value for any marker:

http://clients.multimap.com/API/map/1.2/[api_key]?width=500&height=500
&lat=51.5139&lon=-0.10147&marker=none
&street=Fleet%20Street&city=London&countryCode=GB

Setting a marker's value to "none" completely disables that marker, including any label that it has.

XML configuration file

In addition to the URL parameters for markers, there is also an XML configuration file which can be uploaded into Client Zone along with your marker icon(s).

Each configuration file has a name that corresponds to the icon to which it relates, but with the extension ".xml" so that, for example, an icon called "default.png" relates to a configuration file called "default.xml". The configuration file for the default marker looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Marker xmlns="http://clients.multimap.com/API"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/map_marker.xsd">
    <Icon>
        <AnchorPoint>
            <X>9</X>
            <Y>20</Y>
        </AnchorPoint>
    </Icon>
    <Label>
        <AnchorPoint>
            <X>10</X>
            <Y>9</Y>
        </AnchorPoint>
        <Alignment>Center</Alignment>
        <TextSize>9</TextSize>
    </Label>
</Marker>

XML configuration schema

Element Name Description Permissible Values Example
Icon This may consists of an AnchorPoint element and/or an Opacity element. The AnchorPoint element denotes the top-left position of the icon, starting from the coordinate that is marked. N/A <Icon>
 <AnchorPoint>
  <X>9</X>
  <Y>20</X>
 </AnchorPoint>
 <Opacity>0.8</Opacity> </Icon>
AnchorPoint This is a point defined by a pair of pixel coordinates. It must contain an X element and a Y element. Any real number within the bounds of the static map <AnchorPoint>
  <X>9</X>
  <Y>20</X>
</AnchorPoint>
Label This may consist of a AnchorPoint element, an Alignment element and/or a TextSize element. The AnchorPoint element denotes the top-left position of the label text, starting from the top-left of the icon. N/A <Label>
 <AnchorPoint>
  <X>9</X>
  <Y>20</X>
 </AnchorPoint>
 <Alignment>Center</Alignment>
 <TextSize>9</TextSize>
</Label>
Alignment This denotes the placement of the label text. Center, Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight <Alignment>Center</Alignment>
TextSize This denotes the size of the label text. Any real number between 9 and 20 <TextSize>9</TextSize>
Opacity This denotes the degree of transparency of each marker on a static map. Any real number between 0 and 1 <Opacity>1</Opacity>

The values in the AnchorPoint attribute of the Icon element are pixel coordinates: in the default example shown above, the top-left corner of the icon is nine pixels to the left and twenty pixels upwards from the coordinate marked. An additional property in this is the Alignment attribute of the Label element: if this is set to "Center", the text label is centered horizontally and vertically on the anchor; if it is not set, the label is placed with its first letter at the anchor point.

If no configuration file exists for a marker and no URL parameters have been specified, any instance of that marker that appears on a static map is centered horizontally and vertically over its location.

Please validate your XML configuration file against the schema which is located at http://clients.multimap.com/Schema/map_marker.xsd


Exception - People's Republic of China

If you have a Multimap service that includes records for stores located in the People's Republic of China (PRC) that have been geocoded to street level, legal restrictions mean that Multimap cannot expose those stores' coordinates either to you or to your users by any means, whether via Client Zone, in downloaded files or in any customer-designed interface. Specifically, this means that you:

Street-level geocoding in the PRC is currently available via the Multimap API only. For further details of how this restriction affects your Multimap service(s), please see Multimap's separate Geocoding and Data Management in Client Zone: Implementation Guidelines documentation which is available via Client Zone or from your Multimap account manager.


Error Codes

In the event of a service failure or a failure to provide valid parameters, Multimap API V1.2 Static Maps return an error code.

Here is an example of a request which does not contain or could not be resolved to any valid coordinates (for example, if you specify "long" instead of "lon" in the input address):

http://clients.multimap.com/API/map/1.2/[api_key]?lat=-33.8684&long=151.20851

Instead of a static map, the output of this request is displayed as:

Error Messages

In order to view the corresponding XML output of a request, add output=xml anywhere in the request, for example:

http://clients.multimap.com/API/map/1.2/[api_key]?lat=-33.8684&long=151.20851&output=xml

Response

<?xml version="1.0" encoding="UTF-8" ?> 
 <Error xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation
="http://clients.multimap.com/API http://clients.multimap.com/Schema/error_1.2.xsd"> <ErrorCode>MM_MAP_ERROR_NO_COORDINATES</ErrorCode> <Explanation>We're sorry; you didn't specify any search criteria. Please try again.</Explanation> </Error>

For a complete list of error messages, please see XML Error Codes.

Top of page


Browser Limitation on Static Map URL

Some of the most commonly-used operating systems and browsers do not support URLs of more than 2083 characters. In order to display static maps correctly, the length of your URLs must remain within this limit. To ensure this, Multimap recommends that you do not specify more than 50 pairs of coordinates when creating a request for multiple locations.

Please note, also, that using long lists of paired coordinate parameters to show more than a few locations is inefficient and may affect the performance of your Multimap API service.

If you wish to show many locations on static maps on a regular basis, Multimap recommends that you upload your records into your table of addresses via Client Zone and display static maps using your own data.

(For details of uploading and managing your own data, please see the separate Implementation Guidelines documentation which is available via Client Zone or from your Multimap account manager.)

Multimap API V1.2 Static Maps XML Documentation

Web Services Home >> Geocoding >> Searching >> Routing

Top of page


Further Help

If you require further help with your map API implementation, please contact the Multimap Customer Support team:

London, Great Britain +44 (0)20 7632 7777
email: info@multimap.com

For general account enquiries or further services, please contact the Multimap Sales team:

London, Great Britain +44 (0)20 7632 7800
email: sales@multimap.com