Multimap API v1.1 Example

Copyright Bar Example

The copyright bar is used to display a copyright message related to the maps being displayed; it is also used to display a scale bar indicating distances on the map. The information in the bar is updated as the map is moved around the world, or if the zoom factor changes.

What You Should See

If you view this in your browser you should see a Multimap draggable map centered on Dover, England, at zoom factor 13. When you click on the first link the map pans smoothly to Calais, France. As the viewer pans across, the copyright message changes. The second link can be used to return to Dover to see the effect happen in reverse.

If you click on the third link, the zoom factor changes to zoom factor 14; please note that the scale bar is different from that at zoom factor 13.

The Map

Go to France

Go to England

Zoom Factor 14

Zoom Factor 13

The Code

There are three 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.

The header code

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

The body code

<!-- The Multimap Map-->
<div id="mapviewer" style="width : 500px; height : 420px;"></div>

<!-- The Panning Links -->
<p><a href="#" onclick="mapviewer.panToPosition( new MMLatLon( 50.957751,1.851883 ) ); return false;">Go to France</a></p>
<p><a href="#" onclick="mapviewer.panToPosition( new MMLatLon( 51.129381,1.311493 ) ); return false;">Go to England</a></p>
<p><a href="#" onclick="mapviewer.setZoomFactor( 14 ); return false;">Zoom Factor 14</a></p>
<p><a href="#" onclick="mapviewer.setZoomFactor( 13 ); return false;">Zoom Factor 13</a></p>

The JavaScript code

var mapviewer;

function onLoad()
{
   //Add the map 
   mapviewer = new MultimapViewer( document.getElementById( 'mapviewer' ) );
   mapviewer.drawAndPositionMap( new MMLocation( new MMLatLon( 51.129381,1.311493 ), 13 ) );
}

MMAttachEvent( window, 'load', onLoad );

For more information on the subject of Multimap API JavaScript code, please read the API documentation at: http://www.multimap.com/share/mapviewerapidocs/1.1/index.html.

Further Help

If you require further help with your map API implementation, please contact our Customer Support team:

Australia, Sydney + 61 (0) 2 9262 6551
Great Britain, London +44 (0)20 7632 7777
United States, Boston + 1 617 423 4510
email: info@multimap.com

For general account enquiries or further services, please contact your 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