EMS.Map

This defines the standard WhereIs map.  Instances of EMS.Map are interactive maps embedded in a web page.

To create a basic map include the following in your document

<script type="text/javascript" src="<baseURL>/js/ems/?token=<token>"></script>

then use the following command to create a map.

map = new EMS.Map('map-div', options);

’map-div’ is the id of the div you want to place the map inside of.  You may also use a DOMElement as well.

By default EMS.Map will be initialized with the following controls

The set of controls that is initialized can be controled using the controls option.  For example

map = new EMS.Map('map-div', {controls: []});

would initialize the map with no default controls.

By default five layers are created

  • A street layer
  • A photo layer
  • A hybrid layer
  • A route layer
  • A markers layer

These maybe referenced through the method respectively

map.getLayerByName(EMS.Layer.STREET);
map.getLayerByName(EMS.Layer.PHOTO);
map.getLayerByName(EMS.Layer.HYBRID);
map.getLayerByName(EMS.Layer.ROUTE);
map.getLayerByName(EMS.Layer.MARKERS);

Much like with the controls the layers can be initialized manually.  It is not recommended you do this however.  Simply pass a layers option during the map creation.  eg:

map = new EMS.Map('map-div', {layers: []});

The following events are available.

  • ”addlayer” : called when a layer is added to a map
  • ”removelayer” : called when a layer is removed from a map
  • ”changelayer” : called when a layer is changed.
  • ”zoomend” : called when the map has been zoomed
  • ”popupopen” : called when a popup is opened.
  • ”popupclose” : called when a popup is closed.
  • ”addmarker” : called when a marker is added to a map.
  • ”removemarker” : called when a marker is removed from a map.
  • ”clearmarkers” : called when all markers are cleared from a map.
  • ”mouseover” : called when the cursor is moused into the map.
  • ”mouseout” : called when the cursor is moved out of the map rea.
  • ”mousemove” : called when the cursor moved in the map area.
  • ”dragstart” : called when a drag operation is started.
  • ”dragend” : called when a drag operation is ended.
  • ”changebaselayer” : called when the base layer is changed.
  • ”inactiveclick” : called is the map is inactive and the user clicks on the map area.
  • ”resize” : called if the map is resized.

Inherits from

Summary
EMS.MapThis defines the standard WhereIs map.
Constructor
EMS.MapConstructs a map.

Constructor

EMS.Map

Constructs a map.

Parameters

div{Mixed} is either a {String} which represents the HTML id or a {DOMElement} to place the map into.  This will also accept a {JQuery} object and inject the map into the first item in object.
options{Object} properties that can be used to override current map properties.  Available parameters include:
onInita callback function to which the map object should be passed once initialised.
controlsspecifies a list of controls that should be displayed.
zoom{Number} specifies a zoom level EMS.Zoom.MINIMUM and EMS.Zoom.MAXIMUM.
center{EMS.LonLat} specifies the maps center point
showMaxExtent{Boolean} When set to true (default) and no center is provided the full map of Australia will display.  If set to false no map will be displayed until a center point or bounds are set.  If you find Australia flashing up before going to your location set this to false.
fullsizeControls{Boolean} specifies if the default map controls should be used or the fullsize map controls.
Constructs a map.
Displays a zoombar.
A control for switching between various layers.
This control sets up mouse handling facilities for the map.
This is the pan buttons for panning north, south, east and west on the map.
Copyright indicator control.
Displays a scale control on the screen showing the current scale.
Displays a small overview map showing a zoomed out view of the current main map.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
Minimum (most zoomed out) value.
Maximum (most zoomed in) value.
Close