Class deCarta.Mobile.EventManager
The EventManager is a global object which is used to receive / issue
notifications regarding the status of the map.
Events that are currently supported are :
- 'zoomChange'
- 'zoomEnd'
- 'moveStart'
- 'move'
- 'moveEnd'
- 'doubleClick'
- 'resize'
- 'showPinText'
- 'hidePinText'
- 'tileLoad'
- 'longTouch'
- 'doubleTap'
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Implements Listen and Trigger methods for event notification.
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
deCarta.Mobile.EventManager.events
List of supported events
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
deCarta.Mobile.EventManager.listen(event:, callback:)
Registers a callback function with a specific event.
|
| <static> |
deCarta.Mobile.EventManager.trigger(event:, params:)
Triggers an event, executing all callbacks registered for it
|
Class Detail
deCarta.Mobile.EventManager()
Implements Listen and Trigger methods for event notification.
Field Detail
<static>
deCarta.Mobile.EventManager.events
List of supported events
Method Detail
<static>
deCarta.Mobile.EventManager.listen(event:, callback:)
Registers a callback function with a specific event.
- Parameters:
- {string} event:
- the event you wish to listen for.
- {function} callback:
- callback function that will be invoked when the event occurs
When defining the callback function, the callback function takes a single parameter, the
contents of which depends on the event being triggered. Here is a list of each
type of event, and the data structure passed to the callback function for each:
zoomchange, zoomend
- deCarta.Mobile.Map map: A pointer to the map
- (int) zoom: The starting zoom level
- (int) targetZoom: The new zoom level
- deCarta.Mobile.Position center: Geographic position at the center of the map at the start, during, or after a move operation (respectively)
- (int) zoom: The current zoom level of the map
- deCarta.Mobile.Map map: A pointer to the map
- deCarta.Mobile.Map map: A pointer to the map
- (int) zoom: The current zoom level of the map
- deCarta.Mobile.Position center: Geographic position at the center of the map
- size:
- (int) width: The new width of the map window after a resize operation, in pixels
- (int) height: The new height of the map window after a resize operation, in pixels
- {deCarta.Mobile.Pin} pin: A pointer to the pin object which is being shown or hidden
- deCarta.Mobile.Position position: Geographic position on which the user long-touched. This value, in turn, is comprised of:
- (int) x: Latitude
- (int) y: Longitude
- deCarta.Mobile.Position center: Geographic position at the center of the map
- (int) zoom: The current zoom level of the map
- deCarta.Mobile.Map map: A pointer to the map
- deCarta.Mobile.Position position: Geographic position on which the user clicked/tapped
- deCarta.Mobile.Position center: Geographic position at the center of the map
- (int) zoom: The current zoom level of the map after the doubletap has zoomed the map in
- deCarta.Mobile.Map map: A pointer to the map
<static>
deCarta.Mobile.EventManager.trigger(event:, params:)
Triggers an event, executing all callbacks registered for it
- Parameters:
- {string} event:
- the event you wish to trigger.
- {object} params:
- an object which will be passed to the registered callback with event parameters.