Home Reference Source
import {GroupLayer} from 'guide4you/src/layers/GroupLayer.js'
public class | source

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
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

Returns all attributions of all visible layers.

public

getIds(): number[]

Returns all ids of all contained layers and its own.

public

gives an object with ids as keys and visibility as value

public

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

The provideMap methods of all contained children are called recursively

public

calls callback for every terminal, non-group Layer

public

removeLayer(layer: ol.layer.Base): *

removes layer

public

Remove layer by id

public

Sets the visibility of the layers to the given visibility

Public Constructors

public constructor(options: object) source

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}

Public Methods

public containsLayer(layer: ol.layer.Layer): boolean source

Checks if the group contains the layer

Params:

NameTypeAttributeDescription
layer ol.layer.Layer

Return:

boolean

public countChildren(): * source

Return:

*

public countChildrenVisible(): number source

Checks how many children are visible. Doesn't check visibility of the group layer

Return:

number

public findLayer(cb: Function): * source

Find layer with callback

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
eventType *
listener *

public getAttributions(): number[] source

Returns all attributions of all visible layers.

Return:

number[]

public getIds(): number[] source

Returns all ids of all contained layers and its own.

Return:

number[]

public getIdsVisibilities(): Object<string|number, boolean> source

gives an object with ids as keys and visibility as value

public getLayerById(id: string | number): * source

Get layer by id

Params:

NameTypeAttributeDescription
id string | number

Return:

*

public getLayersArray(): ol.layer.Base[] source

Returns the layers inside as an array.

Return:

ol.layer.Base[]

public getLength(): number source

Returns the number of direct child layers

Return:

number

public isParentOf(layer: ol.layer.Base): boolean source

checks if the given layer is a child of the grouplayer

Params:

NameTypeAttributeDescription
layer ol.layer.Base

Return:

boolean

public provideMap(map: G4UMap) source

The provideMap methods of all contained children are called recursively

Params:

NameTypeAttributeDescription
map G4UMap

public recursiveForEach(callback: Function) source

calls callback for every terminal, non-group Layer

Params:

NameTypeAttributeDescription
callback Function

public removeLayer(layer: ol.layer.Base): * source

removes layer

Params:

NameTypeAttributeDescription
layer ol.layer.Base

Return:

*

public removeLayerById(id: string | number): * source

Remove layer by id

Params:

NameTypeAttributeDescription
id string | number

Return:

*

public setIdsVisibilities(visibilities: Object<string|number, boolean>) source

Sets the visibility of the layers to the given visibility

Params:

NameTypeAttributeDescription
visibilities Object<string|number, boolean>