Multimap logo Multimap Open API V1.2 Example

Introduction

This example gives you an overview of how to design a page to incorporate a simple map. It does not describe the JavaScript used, but ensures you know how to link to the Multimap Open API correctly and how to set your page up to include an interactive map.

Firstly, you need to include a link to the Multimap Open API. There are two ways in which you can link to the Multimap Open API. To link to a particular release of the Multimap Open API, for example, Version 1.2, use this URL:

http://developer.multimap.com/API/maps/1.2/[api_key]

We recommend that you use this method, especially when linking to the Multimap Open API from your live applications. This ensures that your code will not break if the Multimap Open API changes, but it does mean that you may not have the latest features in your viewer. We also recommend that you update your website regularly to ensure that it remains connected to the correct version of the Multimap Open API.

Please note that you must replace [api_key] with your Open API key as assigned by Multimap.

Alternatively you can link directly to the most recent version of the Multimap Open API; to do so, use this URL:

http://developer.multimap.com/API/maps/[api_key]

When you have linked to the Multimap Open API, you will need to make sure that there is a suitable location in the HTML code to receive the map. This will usually be a DIV that you have styled to be in the correct size and location. You should also assign an identifier to the container so that you can easily retrieve a reference to it in your JavaScript.

It is good practice to use UTF-8 encoding on your page, but it is also a pre-requisite for using other Multimap Open API modules such as the Geocoding API. Enabling UTF-8 can be done with the following header in your HTML:

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

Please note that the Multimap Open API does not currently support SSL protocols: you should always use http:// instead of https:// when loading the Open API.

<meta http-equiv="content-type" content="text/html;charset=UTF-8">

Function(s) introduced:

MultimapViewer: goToPosition()

What You Should See

If you view this in your browser you should see a Multimap draggable map centered on Boston, Massachusetts, USA.

The Map

The Code

There are three parts to the code below. The first is the line that links to the Multimap Open 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.

The header code

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

The body code

Sorry, JavaScript required...

The JavaScript code

Sorry, JavaScript required...

For more information on the subject of Multimap Open API JavaScript code, please read the Multimap Open API documentation at: http://clients.multimap.com/share/documentation/openapi/1.2/classes/.

Back to examples.

Further Help

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 general account enquiries or further services, please contact the Multimap Sales team:

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