/mapview/addLayer
The module exports the addLayer method which is bound to the mapview.
- Source
Methods
(inner) addLayer(layers) → {array}
A single or an array of JSON layer can be added to the mapview with the addLayer method.
A default zIndex is assigned to layer without an implicit zIndex.
The mapview [this] to which the addLayer method is bound will be assigned to the layer object.
A layer with a valid format property will be decorated and added to the mapview.layers{} object.
Layer with a display flag will shown in the mapview.
A mapview.renderComplete promise is assigned which resolves on the next rendercomplete event of the Openlayers mapview.Map{}. The Openlayers Map dispatches the rendercomplete event once the tiles have loaded and no visible layer source is loading. Vector layer sources are loading until the features of their latest request have been set. The promise will therefore resolve once all layers shown in the addLayer method have loaded their data and completed their render.
| Name | Type | Description |
|---|---|---|
layers | object | A single JSON layer or an array of JSON layer to be added to the mapview. |
- Source
The array of decorated layers is returned.
- Type:
- array