Multimap Open API V1.2 Web Services Documentation - Static Maps XML ResponseMultimap Open API V1.2 Web Services >> Multimap Open API V1.2 Static Maps Documentation
The Static Maps module can provide an XML output in addition to other image based formats. The XML format provides a map URL, as well as more information about the current map (such as its center, bounds and the position of any markers), and allows links for panning and zooming to be constructed easily.
Here is an example of a URL for a basic static map example and the XML output it generates:
http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15
&width=400&height=400
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.
The URL shown above returns the following response:
<?xml version="1.0" encoding="UTF-8"?> <Map xmlns="http://developer.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://developer.multimap.com/API http://developer.multimap.com/Schema/map_1.2.xsd"> <MapURL>http://developer.multimap.com/API/map/1.2/[api_key]?output=png&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400</MapURL> <PanURLs> <North>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=0,-240</North> <East>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=240,0</East> <South>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=0,240</South> <West>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=-240,0</West> <NorthEast>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=240,-240</NorthEast> <SouthEast>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=240,240</SouthEast> <SouthWest>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=-240,240</SouthWest> <NorthWest>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&moveMap=-240,-240</NorthWest> </PanURLs> <ZoomURLs> <In>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&zoom=1</In> <Out>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&lat=38.89207&lon=-77.0362&zoomFactor=15&width=400&height=400&zoom=-1</Out> </ZoomURLs> <MapCenter> <Lat>38.89207</Lat> <Lon>-77.0362</Lon> </MapCenter> <Bounds> <NorthEast> <Lat>38.90548</Lat> <Lon>-77.01903</Lon> </NorthEast> <SouthWest> <Lat>38.87865</Lat> <Lon>-77.05337</Lon> </SouthWest> </Bounds> <Marker> <IconName>default.png</IconName> <MetaData> <X>200</X> <Y>200</Y> </MetaData> <Point> <Lat>38.89207</Lat> <Lon>-77.0362</Lon> </Point> <Label>1</Label> </Marker> <Dimensions> <Width>400</Width> <Height>400</Height> </Dimensions> <ZoomFactor>15</ZoomFactor> </Map>
| Code | Notes |
|---|---|
<?xml version="1.0" encoding="UTF-8"?> |
The XML declaration specifies the XML version being used and makes a reference to UTF-8 (eight-bit Unicode Transformation Format), which supports any character in the Unicode standard. |
<Map xmlns="http://developer.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://developer.multimap.com/API http://developer.multimap.com/Schema/map_1.2.xsd"> |
This section refers to the parent element of the document and defines the XML name space. The |
<MapURL>http://developer.multimap.com/API/map/1.2/[api_key]? |
The |
|
The |
|
The |
|
The |
|
The |
|
There may be one or more |
|
The |
<ZoomFactor>15</ZoomFactor> |
The |
Here is an example of a URL for a single route in Florida, US:
http://developer.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&output=xml
The URL shown above returns the following response:
<?xml version="1.0" encoding="UTF-8"?> <Map xmlns="http://developer.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://developer.multimap.com/API http://developer.multimap.com/Schema/map_1.2.xsd"> <MapURL>http://developer.multimap.com/API/map/1.2/[api_key]?output=png&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1</MapURL> <PanURLs> <North>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=0,-240</North> <East>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=240,0</East> <South>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=0,240</South> <West>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=-240,0</West> <NorthEast>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=240,-240</NorthEast> <SouthEast>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=240,240</SouthEast> <SouthWest>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=-240,240</SouthWest> <NorthWest>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&moveMap=-240,-240</NorthWest> </PanURLs> <ZoomURLs> <In>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&zoom=1</In> <Out>http://developer.multimap.com/API/map/1.2/[api_key]?output=xml&routeKey=US,-80.28732:25.78210;-80.45884:25.07744,0&width=400&height=400&routeColor=255,0,0&routeOpacity=1&zoom=-1</Out> </ZoomURLs> <MapCenter> <Lat>25.43133</Lat> <Lon>-80.38177</Lon> </MapCenter> <Bounds> <NorthEast> <Lat>25.9291</Lat> <Lon>-79.83245</Lon> </NorthEast> <SouthWest> <Lat>24.93148</Lat> <Lon>-80.93109</Lon> </SouthWest> </Bounds> <Marker> <IconName>default.png</IconName> <MetaData> <X>234.3882</X> <Y>59.16647</Y> </MetaData> <Point> <Lat>25.78206</Lat> <Lon>-80.28732</Lon> </Point> <Label>S</Label> </Marker> <Marker> <IconName>default.png</IconName> <MetaData> <X>171.93967</X> <Y>341.68301</Y> </MetaData> <Point> <Lat>25.07744</Lat> <Lon>-80.45884</Lon> </Point> <Label>F</Label> </Marker> <RouteOverlay> <Opacity>1</Opacity> <Thickness>1</Thickness> <Color> <RGB>255,0,0</RGB> </Color> <MetaData> <StartPoint> <X>234</X> <Y>59</Y> </StartPoint> <EndPoint> <X>172</X> <Y>342</Y> </EndPoint> </MetaData> </RouteOverlay> <Dimensions> <Width>400</Width> <Height>400</Height> </Dimensions> <ZoomFactor>10</ZoomFactor> </Map>
In addition to the previous response, a RouteOverlay element is added when adding a route to a map:
| Code | Notes |
|---|---|
<Opacity>1</Opacity> |
The |
<Thickness>1</Thickness> |
The |
|
The |
|
The |
In the event of a service failure or a failure to provide valid parameters, error codes are returned in the XML output. These error codes are listed below:
| Error Code | Error Message | Description |
|---|---|---|
MM_API_ERROR_INTERNAL_ERROR | We're sorry; we couldn't complete your request. Please try again later. | An unexpected error occurred. |
MM_MAP_ERROR_INVALID_COORDINATES | We're sorry; we do not recognize the set of search criteria that you have entered. Please re-enter your search criteria and try again. | The request contained invalid coordinates. |
MM_API_ERROR_DIRECTION_REQUEST_FAILED | We're sorry; we are unable to generate this route. | A problem occurred with the route request. |
MM_MAP_ERROR_NO_COORDINATES | We're sorry; you didn't specify any search criteria. Please try again. | The request did not contain, or could not be resolved to, any valid coordinates. |
MM_SEARCH_NO_MATCHES | We're sorry; we found no results for this set of search terms. Please try again. | There are no records that match your search criteria. |
In response to a request which does not contain or could not be resolved to any valid coordinates (for example, if you specify "badparamname" instead of "lon" in the input address):
http://developer.multimap.com/API/map/1.2/[api_key]?lat=-33.8684&badparamname=151.20851&output=xml
<?xml version="1.0" encoding="UTF-8" ?> <Error xmlns="http://developer.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://developer.multimap.com/API http://developer.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>
Multimap Open API V1.2 Web Services >> Multimap Open API V1.2 Static Maps Documentation
If you require further help with your Multimap Open API implementation, please visit the Multimap Developer Forums.
For Open API news, announcements and other information, please see our blog.
For enquiries about further Multimap services, please contact the Multimap Sales team:
| Australia, Sydney | + 61 (0) 2 9262 6551 |
| Great Britain, London | +44 (0)20 7632 7800 |
| United States, Boston | + 1 617 423 4510 |
| email: | sales@multimap.com |