This defines the mobile optimised EMS map. Instances of EMS.MobileMap are interactive maps embedded in a web page.
<script type="text/javascript" src="<baseURL>/js/ems/?token=<token>&libraries=mobile"></script>
then use the following command to create a map.
map = new EMS.MobileMap('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.
map = new EMS.MobileMap('map-div', {controls: []});would initialize the map with no default controls.
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.
| EMS. | This defines the mobile optimised EMS map. |
| Constructor | |
| EMS. | Constructs a map. |
Constructs a map.
| 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: |
| onInit | a callback function to which the map object should be passed once initialised. |
| controls | specifies 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. |