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

LayerSelector

Expression Extends:

class LayerSelector extends mixin(Control, ListenerOrganizerMixin)

This control shows Buttons to let you select the layer you want to see on the map. It supports categories and nested categories - each {GroupLayer}-Object will be interpreted as a category.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

layers_: *

public

menu_: *

public
Protected Members
protected

classNames

Private Members
private
private
private
private
private
private

Method Summary

Public Methods
public

addWindowToButton($button: *, layer: *)

public

used by positioning

public
public

build()

public

buildCategoryButton(categoryLayer: GroupLayer, $target: jQuery): *

builds a category button which collapses on click

public

buildLayerButton(layer: ol.layer.Base, $target: jQuery): *

this method builds a button for a layer.

public

buildWMSButton(wmsLayer: *, $target: *): *

public

chooseButtonBuilder(layer: ol.layer.Base, $target: jQuery): *

This method chooses the right builder function

public

clear()

public
public
public

isSqueezable(dimension: string): boolean

Returns true if the control is squeezable in the given dimension.

public
public

release(dimension: string)

Removes the squeeze.

public

setCollapsed(collapsed: boolean, silent: boolean)

public

squeezeBy(dimension: string, value: number): number

Squeezes the control in the given dimension by the provided value.

public

Public Constructors

public constructor(options: LayerSelectorOptions) source

Params:

NameTypeAttributeDescription
options LayerSelectorOptions

Public Members

public layers_: * source

public menu_: * source

public scrolled_: * source

Protected Members

protected classNames_: object<string, string> source

classNames

Private Members

private collapsed_: boolean source

private collapsible_: boolean source

private layerGroupName_: String source

private minLayerAmount_: number source

private minVisibleButtons_: number source

private visible_: boolean source

Public Methods

public addWindowToButton($button: *, layer: *) source

Params:

NameTypeAttributeDescription
$button *
layer *

public afterPositioning() source

used by positioning

public beforePositioning() source

public build() source

public buildCategoryButton(categoryLayer: GroupLayer, $target: jQuery): * source

builds a category button which collapses on click

Params:

NameTypeAttributeDescription
categoryLayer GroupLayer
$target jQuery

Return:

*

public buildLayerButton(layer: ol.layer.Base, $target: jQuery): * source

this method builds a button for a layer. It toggles visibility if you click on it

Params:

NameTypeAttributeDescription
layer ol.layer.Base
$target jQuery

Return:

*

public buildWMSButton(wmsLayer: *, $target: *): * source

Params:

NameTypeAttributeDescription
wmsLayer *
$target *

Return:

*

public chooseButtonBuilder(layer: ol.layer.Base, $target: jQuery): * source

This method chooses the right builder function

Params:

NameTypeAttributeDescription
layer ol.layer.Base
$target jQuery

Return:

*

public clear() source

public getCollapsed(): boolean source

Return:

boolean

public getCollapsible(): boolean source

Return:

boolean

public isSqueezable(dimension: string): boolean source

Returns true if the control is squeezable in the given dimension. Used by Positioning.

Params:

NameTypeAttributeDescription
dimension string

Return:

boolean

public rebuild() source

public release(dimension: string) source

Removes the squeeze. Used by Positioning.

Params:

NameTypeAttributeDescription
dimension string

public setCollapsed(collapsed: boolean, silent: boolean) source

Params:

NameTypeAttributeDescription
collapsed boolean
silent boolean

public squeezeBy(dimension: string, value: number): number source

Squeezes the control in the given dimension by the provided value. Used by Positioning Returns the value the control could get squeezed by.

Params:

NameTypeAttributeDescription
dimension string
value number

Return:

number

public updateDisabledButtons() source