Reference Source
public class | source

LayerTree

Extends:

L~L.Evented → LayerTree

Direct Subclass:

MapLayerTree

图层树

Constructor Summary

Public Constructor
public

构造函数

Method Summary

Public Methods
public

activeNode(key: String): FancytreeNode

设置图层树关联的MapView

public

addToMapView(mapview: Object): Null

设置图层树关联的MapView

public

appendLayer(source: *, layer: *)

public

async bindKQMapboxGL()

public

清除所有选中图层的选中状态

public
public

返回活动图层的键值(键值的形式: sourceName@@layerId)

public
public

返回可以同时选中的最大图层数

public

通过节点的key得到原始数据名称

public

getSource(): *

public
public

layerCount(): *

public

moveLayerToTop(key: *)

public

selectedLayers(layers: Array): Null

设置图层为选中状态

public

定制右键菜单函数

public

设置图层树可以横向滚动

public

setKQMapboxGL(kqmapboxgl: *)

public

setLayerOpacity(key: *, title: *)

public

设置可以同时选中的最大图层数(默认值:20)

public

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

设置图层的透明度(注意:需要在config.xml配置文件中,将layer标签的is_history属性设置为1)

public

unselectedLayers(uncheckedLayers: Array): Null

设置图层为非选中状态

Public Constructors

public constructor() source

构造函数

Public Methods

public activeNode(key: String): FancytreeNode source

设置图层树关联的MapView

Params:

NameTypeAttributeDescription
key String

node的key值

Return:

FancytreeNode

public addToMapView(mapview: Object): Null source

设置图层树关联的MapView

Params:

NameTypeAttributeDescription
mapview Object

MapView对象

Return:

Null

public appendLayer(source: *, layer: *) source

Params:

NameTypeAttributeDescription
source *
layer *

public async bindKQMapboxGL() source

public clearSelectedLayers(): Null source

清除所有选中图层的选中状态

Return:

Null

public clearTopLayer() source

public getActiveLayerKey(): String source

返回活动图层的键值(键值的形式: sourceName@@layerId)

Return:

String

public getKQMapboxGL(): * source

Return:

*

public getMaxLayerSelectedNumber(): Number source

返回可以同时选中的最大图层数

Return:

Number

可以同时选中的最大图层数

public getOriginSourceNameFromKey(key: String): String source

通过节点的key得到原始数据名称

Params:

NameTypeAttributeDescription
key String

格式为:sourceName@@layerId

Return:

String

public getSource(): * source

Return:

*

public isVectorTileLayer(node: *): boolean source

Params:

NameTypeAttributeDescription
node *

Return:

boolean

public layerCount(): * source

Return:

*

public moveLayerToTop(key: *) source

Params:

NameTypeAttributeDescription
key *

public selectedLayers(layers: Array): Null source

设置图层为选中状态

Params:

NameTypeAttributeDescription
layers Array

需要设置为选中状态的图层(图层格式:{sourceName, layerId})

Return:

Null

public setContextmenuCustomFunction(customFuns: Object): String source

定制右键菜单函数

Params:

NameTypeAttributeDescription
customFuns Object

设置需要定制的右键菜单函数: 格式{key: fun, key: fun} key的种类:"stick","clearStick", "legend", "opacity", "zoomToLayer", "clearAllSelected"

Return:

String

public setHorizontalScroll(): Null source

设置图层树可以横向滚动

Return:

Null

public setKQMapboxGL(kqmapboxgl: *) source

Params:

NameTypeAttributeDescription
kqmapboxgl *

public setLayerOpacity(key: *, title: *) source

Params:

NameTypeAttributeDescription
key *
title *

public setMaxLayerSelectedNumber(number: Number): Null source

设置可以同时选中的最大图层数(默认值:20)

Params:

NameTypeAttributeDescription
number Number

可以同时选中的最大图层数

Return:

Null

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

设置图层的透明度(注意:需要在config.xml配置文件中,将layer标签的is_history属性设置为1)

Params:

NameTypeAttributeDescription
key Object

图层的键值(格式: sourceName@@layerId)

opacity Number

透明度的值

Return:

Null

public unselectedLayers(uncheckedLayers: Array): Null source

设置图层为非选中状态

Params:

NameTypeAttributeDescription
uncheckedLayers Array

需要设置为非选中状态的图层(图层格式:{sourceName, layerId})

Return:

Null