Multimap Open API V1.2 Example
This example demonstrates markers. These are small images overlaid on a map to indicate something of interest at a location. Markers may be customized by developers by using a different image.
The Multimap Open API now allows you to calculate the distance between points or markers by using the getGreatCircleDistance() method.
This example explains how to add info boxes to a marker. Info boxes are small information windows that show up on the map to give information about a location. For instance, they might give prices for a car park that has been marked on the map, or a picture of a house that is for sale.
Info boxes expand to fit the content within but take the smallest width possible, so you may find that you need to use the CSS rule "white-space : nowrap;", non-breaking spaces, or an image, to force an acceptable width.
The Multimap Open API now allows you to create tabbed info boxes; this example shows how to effect this.
Info boxes can also be re-styled to change their appearance. For more information, please see the Re-styled Info Box page.
This example shows how to display an info box above a marker when a user clicks on the marker. It combines the marker and info box methods with the event-handling system. It also demonstrates how to add a text overlay on top of a marker.
MultimapViewer: createMarker() *updated*, getCurrentPosition(), getGreatCircleDistance() *new*, MMInfoBoxTab() *new*, openInfoBox() *new*, removeAllOverlays(), setInfoBoxContent() *new*
If you view this in your browser you should see a Multimap draggable map centered on Saint James Avenue, Boston, Massachusetts, USA, at zoom factor 15.
|
|
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.
<script type="text/javascript" src="http://developer.multimap.com/API/maps/1.2/OA08061815803962482"></script>
Sorry, JavaScript required...
Sorry, JavaScript required...
Sorry, JavaScript required...
For more information on the subject of Multimap Open API JavaScript code, please read the Multimap Open API documentation at: http://www.multimap.com/share/documentation/openapi/1.2/classes/.
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 |