mapp.layer.decorate()
Decorates a layer object with additional properties and methods.
A mapview must be assigned to the layer object in order to decorate a layer.
The layer decorator passes the layer to a defined format method which assigns the Openlayers layer object (L).
Common interface methods such as layer.show, and hide are assigned to the layer object.
A blank layer.filter object will be set if the filter has not been defined in the JSON layer.
The first theme from the layer.style.themes array will be assigned as layer.style.theme if not already set.
Any plugins matching layer keys will be executed with the layer being passed as argument to the plugin method.
The layer object is returned from the decorator.
- Source
Methods
(async, inner) decorator(layer) → {layer}
The layer decorator method create mapp-layer typedef object from a json-layer.
Name | Type | Description |
---|---|---|
layer | object | JSON layer. |
- Source
Decorated Mapp Layer.
- Type:
- layer
(inner) geomCurrent() → {string}
Returns the current geometry associated with the layer.
- Source
The current geometry associated with the layer.
- Type:
- string
(inner) hide()
Hides the layer from the map.
- Source
(inner) show()
Shows the layer on the map.
- Source
(inner) tableCurrent() → {string}
Returns the current table associated with the layer.
- Source
The current table associated with the layer.
- Type:
- string
(async, inner) zoomToExtent(params) → {Promise.<boolean>}
Zooms to a specific extent on the map.
Name | Type | Description |
---|---|---|
params | Object | Parameters for zooming to extent. |
- Source
A promise that resolves with a boolean indicating the success of the operation.
- Type:
- Promise.<boolean>