Multimap logo Multimap API V1.2 JavaScript Example

Searching - Searching by Travel Distance or Duration *new*

The Multimap API now allows you to make a search of the records that have been geocoded and stored in the table of addresses that we provide as part of your your Multimap service, and to display on a map the locations that the table contains.

You should manage your table of addresses through Multimap's Client Zone extranet portal; for details of how to use this, please see Multimap's Client Zone documentation.

This example focuses on spatial searches based on Travel Distance or Duration. Spatial searches are based on location (such as 'Where's my nearest...?' or 'What's within the area...?').

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 is a column of data entry fields into which you can enter selection criteria to search your data and filter the results.

When you click on the "Search" button, the map changes to show all possible matching search results on the map as markers; a list of their locations appears below the map. (If no results are found, or if any other problem occurs, the API displays a message to this effect.)

When you click on any of the results in the list, its marker on the map expands to show its details in an info box.

Please note that the availability of walking or driving routes depends on regional geographic coverage and is controlled by the route_modes field of the Multimap API's MMSearch class.

'Logging' selection of markers

Please see the corresponding section of the topic on non-spatial searching.

The Map

Search:



Messages and results will be placed here

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

<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...

For more information on the subject of Multimap API JavaScript code, 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 Client Zone 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