This documentation guides you through some of the core functionality available from our JavaScript Library. If you plan to do anything more than put a simple map on a webpage, check out the Location Readme before you begin.
Hello Map
When you insert a map with the JavaScript API, you're inserting a fully interactive component with its own user interface: effectively a mini-application operating inside your web page.
All that with little more than a line of code.
1. Include the EMS API. You'll need your token for authentication.
<script type="text/javascript" src="<ENDPOINT>/web/js/ems/?token=####################"></script>
2. Insert a div somewhere in the HTML to display the map.
<div id="MapDiv"></div>
3. Write a one-line function - this one runs when the page loads.
<script type="text/javascript">
window.onload = function() {
var map = new EMS.Map("MapDiv");
}
</script>
The default map shows the whole of Australia (zoom=0) and is sized to fit the current browser window. It has a full set of controls, including mouse and keyboard controls, and scalebar, copyright symbol, northing arrow, ZoomBar, panning arrows, a keymap, "map" and "photo" buttons.
If you have not yet been provided with a token and password, please contact ems-support@ems.sensis.com.au.