Multimap logo Multimap API V1.2 JavaScript Example

Using the Multimap Open API Geocoder

This example shows how to work directly with the geocoding features of the Multimap Open API. It shows how to work directly with the MMGeocoder class, including the handling of multiple results from the geocoder.

The geocoder returns results in UTF-8 format. You should ensure that the encoding of your HTML page is set to UTF-8 using a header similar to the following:

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

Single-line geocoding *new*

The Multimap Open API now allows you to geocode an address by processing it as a single string; in this example, this is done via the qs parameter (abbreviated from "quick search").

Function(s) introduced:

MultimapViewer: getAutoScaleLocation()
MMGeocoder: geocode()

What You Should See

If you view this in your browser you should see a Multimap draggable map centered on Carrington Street, Sydney, Australia, at zoom factor 15. To the right of this map is a column of labelled data-entry fields.

If you enter an address into the form (as either a single-line address or a combination of separate address elements) and click on the appropriate Geocode button, you will be presented with a map of your address, a list of possible matches or an error message (which is the typical result if no matches have been found).

Please note that the list of countries presented in this example is purely for demonstration purposes and is not an exhaustive list.
For details of permissible values for countries, states and regions, please see Multimap's Countries and States web page and, for further information on the list of address parameters that the Multimap Open API recognizes, please see the Multimap Open API Geocoding web service documentation.

The Map

Geocode address:
... or:



Messages and results will be placed here

The Code

There are three parts to the code below. The first part shows the headers that you should have in your page, to ensure your page uses UTF-8 encoding, and to link 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...
Sorry, JavaScript required...
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