Multimap logo Multimap API V1.2 JavaScript Example

Searching along Route - Example

This example shows how to use the API's optional Search and Routing modules to find search results along a route between two or more locations within a specified distance from the route. This means that you can vary your search parameters to specify two or more locations, then find all the store records from your table of addresses that fall within a radius (of a specified size) centered on any point along that route.

The Routing module of the Multimap API can generate routes that link numerous locations: it achieves this by processing a list of locations, treating the list's:

This means that you can use the API to control the order of 'via' points of a route or to 'optimize' them by ordering them automatically.

What You Should See

If you view this in your browser you should see a Multimap draggable map centered on Fleet Street, London, Great Britain, at zoom factor 15.

To the right of the map are two text fields and a drop-down list.

To search along a route:

  1. Enter the details of the route's start point in the "Location 1:" field.
  2. Enter the details of the route's end point in the "Location 2:" field.
  3. Use the "Max distance:" drop-down list to specify the radius within which you wish to search for store locations along the length of the route.
  4. Click on the "Search" button to generate a route and search along its length.

A list of stores that are found within the specified radius appears below the map.

The Map

Search for:




The Code

There are four parts to the code below. The first is the line that links to the Multimap API. The second is an example of the HTML you must have in your page. The third is an example of the JavaScript required to implement the page. Finally, the fourth is the CSS code that you should add to your web page.

The header code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" >
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.2/demo"></script>

The body code

Sorry, JavaScript required...
Sorry, JavaScript required...
Sorry, JavaScript required...

The JavaScript code

Sorry, JavaScript required...

The CSS code

Sorry, JavaScript required...

Note on printing

Please note that you may not be able to print a highlighted route or a polyline from the Multimap API when using a Mozilla Firefox or an Opera browser. If you encounter such a problem, please try a different browser.

For more information on the subject of Multimap API JavaScript code (including error codes for the Routing module), please read the API documentation at: http://clients.multimap.com/share/documentation/api/1.2/classes/.

Back to examples.

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/demo">

instead of

<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.2/demo">

in the <HEAD> section of your web page.

For further details of your preview and live environments, please see Multimap's Client Zone documentation.


Further Help

If you require further help with your Multimap service implementation, additional Multimap services or general account enquiries, please contact Multimap:

Sales: +44 (0)20 7632 7800
Customer Support: +44 (0)20 7632 7777
email: mminform@microsoft.com