GroupLayer
Expression Extends:
class GroupLayer extends mixin(Group, ProvideMapMixin)
This Class is a Wrap around {ol.layer.Group} providing some extra functionality. This class is normally used for a category of layers containing them.
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) |
Method Summary
Public Methods | ||
public |
containsLayer(layer: ol.layer.Layer): boolean Checks if the group contains the layer |
|
public |
countChildren(): * |
|
public |
Checks how many children are visible. |
|
public |
Find layer with callback |
|
public |
forEachOn(eventType: *, listener: *) Attachs a listener to each layer and to each newly added listener and removes the listener if the layer gets removed. |
|
public |
getAttributions(): number[] Returns all attributions of all visible layers. |
|
public |
Returns all ids of all contained layers and its own. |
|
public |
gives an object with ids as keys and visibility as value |
|
public |
getLayerById(id: string | number): * Get layer by id |
|
public |
getLayersArray(): ol.layer.Base[] Returns the layers inside as an array. |
|
public |
Returns the number of direct child layers |
|
public |
isParentOf(layer: ol.layer.Base): boolean checks if the given layer is a child of the grouplayer |
|
public |
provideMap(map: G4UMap) The provideMap methods of all contained children are called recursively |
|
public |
recursiveForEach(callback: Function) calls callback for every terminal, non-group Layer |
|
public |
removeLayer(layer: ol.layer.Base): * removes layer |
|
public |
removeLayerById(id: string | number): * Remove layer by id |
|
public |
setIdsVisibilities(visibilities: Object<string|number, boolean>) Sets the visibility of the layers to the given visibility |
Public Constructors
Public Methods
public containsLayer(layer: ol.layer.Layer): boolean source
Checks if the group contains the layer
Params:
Name | Type | Attribute | Description |
layer | ol.layer.Layer |
public countChildrenVisible(): number source
Checks how many children are visible. Doesn't check visibility of the group layer
public findLayer(cb: Function): * source
Find layer with callback
Params:
Name | Type | Attribute | Description |
cb | Function |
Return:
* |
public forEachOn(eventType: *, listener: *) source
Attachs a listener to each layer and to each newly added listener and removes the listener if the layer gets removed.
Params:
Name | Type | Attribute | Description |
eventType | * | ||
listener | * |
public getIdsVisibilities(): Object<string|number, boolean> source
gives an object with ids as keys and visibility as value
public getLayersArray(): ol.layer.Base[] source
Returns the layers inside as an array.
Return:
ol.layer.Base[] |
public isParentOf(layer: ol.layer.Base): boolean source
checks if the given layer is a child of the grouplayer
Params:
Name | Type | Attribute | Description |
layer | ol.layer.Base |
public provideMap(map: G4UMap) source
The provideMap methods of all contained children are called recursively
Params:
Name | Type | Attribute | Description |
map | G4UMap |
public recursiveForEach(callback: Function) source
calls callback for every terminal, non-group Layer
Params:
Name | Type | Attribute | Description |
callback | Function |
public removeLayer(layer: ol.layer.Base): * source
removes layer
Params:
Name | Type | Attribute | Description |
layer | ol.layer.Base |
Return:
* |