Reference Source
public class | source

LayerTree

Extends:

L~L.Evented → LayerTree

Direct Subclass:

MapLayerTree

Layer tree class

Constructor Summary

Public Constructor
public

Constructor

Method Summary

Public Methods
public

addToMapView(mapview: Object): Null

Set the MapView of the layer tree object

public

Sets the status of all selected layers as unchecked

public

Returns the key value of the active layer(key format: sourceName@@layerId)

public

Returns the maximum number of layers can selected

public

selectedLayers(layers: Array): Null

Sets the status of the layers as selected

public

Limit the maximum number of layers selected(default:20).

public

setOpacity(key: Object, opacity: Number): Null

Sets the opacity of the layer (notice: in config.xml,Set the is_history attribute of the layer tag to 1)

Public Constructors

public constructor() source

Constructor

Public Methods

public addToMapView(mapview: Object): Null source

Set the MapView of the layer tree object

Params:

NameTypeAttributeDescription
mapview Object

MapView object

Return:

Null

public clearSelectedLayers(): Null source

Sets the status of all selected layers as unchecked

Return:

Null

public getActiveLayerKey(): String source

Returns the key value of the active layer(key format: sourceName@@layerId)

Return:

String

public getMaxLayerSelectedNumber(): Number source

Returns the maximum number of layers can selected

Return:

Number

public selectedLayers(layers: Array): Null source

Sets the status of the layers as selected

Params:

NameTypeAttributeDescription
layers Array

The layer that you want to set to the selected state(layer format:{sourceName, layerId})

Return:

Null

public setMaxLayerSelectedNumber(number: Number): Null source

Limit the maximum number of layers selected(default:20).

Params:

NameTypeAttributeDescription
number Number

maximum number layers can selected

Return:

Null

public setOpacity(key: Object, opacity: Number): Null source

Sets the opacity of the layer (notice: in config.xml,Set the is_history attribute of the layer tag to 1)

Params:

NameTypeAttributeDescription
key Object

layer's key (format: sourceName@@layerId)

opacity Number

opacity

Return:

Null