1. Layer

1.1. 初始化 new Layer(options)

基础图层类,是 MapLayerTerrainLayerModelLayerS3MLayerGeoJsonLayerKMLLayerWFSLayerAreaLayerLineLayerPointLayerPointSymbolLayerPrimitiveLayerEntityLayerGridLayerClusterLayerEchartsLayerHtml2CanvasLayerHtmlLayer 等图层类的基类。

Param Type Default Description
options Object

包含以下参数的Object对象:

options.name String

图层名称;

options.show Boolean

是否显示;

options.customGroupId String

自定义分组的ID;

[options.order] Number 0

排序序号。

Example

var layer = new BOSGeo.Layer({
    name: '测试图层',
    show: true,
    customGroupId: '图层组1',
});

1.2. 属性

属性名 Type Default Description
order Number 0

排序序号

customGroupId String

分组id

1.3. 方法

1.3.1. layer.on(eventType, callBack)

绑定事件

Param Type Description
eventType String | LayerEventType

图层事件类型

callBack function

回调函数

Example

layer.on(BOSGeo.LayerEventType.ADD, (result) => {
    console.log(result);
});

1.3.2. layer.fire(eventType, value)

触发事件

Param Type Description
eventType String | LayerEventType

监听事件

value *

触发事件时可传入任意值

1.3.3. layer.hasOn(eventType, callBack)

判断该函数是否已绑定该事件

Returns : Boolean -

是否绑定了该事件

Param Type Description
eventType String | LayerEventType

监听事件

callBack function

回调函数

Example

var hasBind = layer.hasOn(BOSGeo.LayerEventType.ADD, callback);

1.3.4. layer.once(eventType, callBack)

绑定后该函数只执行一次

Param Type Description
eventType String | LayerEventType

监听事件

callBack function

回调函数

1.3.5. layer.off(eventType, callBack)

取消事件绑定

Param Type Description
eventType String

监听事件

callBack function

回调函数

版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-07-19 11:34:25

results matching ""

    No results matching ""