/mapview/addLayer

The module exports the addLayer method which is bound to the mapview.

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 layer to be added to be added to the mapview is clone created from the JSON layer being merged into the locale.layer.

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 renderComplete event will be assigned to the Openlayers mapview.Map{}. This promise will resolve once after all layer to be shown in the addLayer method have completed their render.

Parameters:
NameTypeDescription
layersobject

A single JSON layer or an array of JSON layer to be added to the mapview.

Returns:

The array of decorated layers is returned.

Type: 
array