This class represents the data model of the map. It holds a list of layers
that are rendered by map's RenderEngine. The class listens to
update events from layers and dispatches them to the
RenderEngine.
| Name | Type | Description |
|---|---|---|
opt_layers |
Array |
optional
An array of layers to be added to the data model |
Extends
Methods
-
This method adds a layer to the data model, ensuring that layers are displayed on the map following the order in which they were added.
Name Type Description layerH.map.layer.Layer The Layer to add
opt_idxnumber optional index The index at which the new element should be inserted
Fires:
Throws:
-
if the given layer does not inherit
H.map.layer.Layer
-
-
addEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method adds a listener for a specific event.
Note that to prevent potential memory leaks, you must either call
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
addOnDisposeCallback (callback, opt_scope) inherited
-
This method adds a callback which is triggered when the
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject optional An optional scope for the callback function
-
asArray ()Array.<*> inherited
-
This method retrieves all the entries held in the list as an array.
Returns:
Type Description Array.<*> An array holding all the entries in the list -
This method dispatches an event on the
EventTargetobject.Name Type Description evtH.util.Event | string An object representing the event or a string with the event name
-
dispose () inherited
-
This method removes listeners from the given object. Classes that extend
EventTargetmay need to override this method in order to remove references to DOM Elements and additional listeners. -
This method removes all layers from the data model.
-
get (idx)? inherited
-
This method retrieves the entry at the specified index.
Name Type Description idxnumber The index of the entry to get, a negative index is treated as relative from the end of the list
Throws:
-
If the given index is out of bounds
Returns:
Type Description ? The element at the index provided by the caller -
-
getLength ()number inherited
-
This method retrieves the length of the list.
Returns:
Type Description number A value indicating the length of the list as a number of items. -
indexOf (entry)number inherited
-
This method retrieves the index of the first object in this list that is identical to the object supplied by the caller.
Name Type Description entry? The entry for which to return the index
Returns:
Type Description number The index of the first matching entry in this list or -1 if the entry provided by the caller is not found in the list -
This method removes a layer, which means that the layer is removed from the map.
Name Type Description layerH.map.layer.Layer The layer to be removed
Fires:
Returns:
Type Description boolean A value indicating whether the layer has been found and removed ( true) or not (false) -
removeAt (idx)H.map.layer.Layer inherited overrides
-
This method removes layer with the given index. This will effectively remove the layer from the map.
Name Type Description idxnumber index of the layer to be removed
Throws:
-
if the given index is out of bounds
- Type
- Error
Returns:
Type Description H.map.layer.Layer -
-
removeEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method removes a previously added listener from the
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
set (idx, layer)H.map.layer.Layer inherited overrides
-
This method sets (replaces) a layer at the index specified by the caller.
Name Type Description idxnumber The index at which to set the layer
layerH.map.layer.Layer A layer object to set
Fires:
Throws:
-
if the given layer does not inherit
H.map.layer.Layer
Returns:
Type Description H.map.layer.Layer An object representing the replacement layer -