geovisearth / Exports / TileLayer
# Class: TileLayer
Tile图层
Description
具备添加、删除Tile图层对象等功能
# Hierarchy
GvolLayer
↳
TileLayer
# Table of contents
# Methods
# Methods
# add
▸ add(item
): GvolObject
添加对象
# Parameters
Name | Type |
---|---|
item | GvolObject |
# Returns
GvolObject
# Overrides
GvolLayer.add
# Defined in
LayerManager/TileLayer/TileLayer.ts:21
# fire
▸ fire(type
, data
): TileLayer
激活对象的某个监听事件,可以附件数据,并可以传递给父对象(事件对象基础方法)
Method
fire
# Parameters
Name | Type | Description |
---|---|---|
type | string | 事件名称 |
data | any | 监听时(on)收到的数据 |
# Returns
示例代码:
const info = {} //监听时(on)收到的数据
event.fire('add',info);
# Inherited from
GvolLayer.fire
# Defined in
Core/Event.ts:145
# getItemById
▸ getItemById(itemid
): GvolObject
根据id获得对象
# Parameters
Name | Type | Description |
---|---|---|
itemid | string | 对象id |
# Returns
GvolObject
# Inherited from
GvolLayer.getItemById
# Defined in
Core/GvolLayer.ts:46
# getItemByName
▸ getItemByName(itemName
): GvolObject
根据name获得对象
# Parameters
Name | Type | Description |
---|---|---|
itemName | string | 对象名称 |
# Returns
GvolObject
# Inherited from
GvolLayer.getItemByName
# Defined in
Core/GvolLayer.ts:59
# listens
▸ listens(type
): boolean
查询是否有指定类型的监听器(事件对象基础方法)
# Parameters
Name | Type | Description |
---|---|---|
type | string | 事件类型 |
# Returns
boolean
示例代码:
const hasListens = event.listens('add');
# Inherited from
GvolLayer.listens
# Defined in
Core/Event.ts:172
# off
▸ off(type
, fn
, context?
): void
移除对象的事件监听方法(事件对象基础方法)
# Parameters
Name | Type | Description |
---|---|---|
type | string | 要删除的监听事件类型 |
fn | Function | 要删除的监听回调函数,为空时清空所有回调函数 |
context? | any | 上下文 |
# Returns
void
代码示例:
event.off('add',fun);
# Inherited from
GvolLayer.off
# Defined in
Core/Event.ts:73
# on
▸ on(type
, fn
, context?
): TileLayer
添加对象的事件监听方法(事件对象基础方法)
# Parameters
Name | Type | Description |
---|---|---|
type | string | 监听事件类型 |
fn | Function | 监听回调函数 |
context? | any | 上下文 示例代码: const fun = function(info) { console.log('监听事件'); console.log(info); } event.on('add', fun); //监听添加事件 |
# Returns
# Inherited from
GvolLayer.on
# Defined in
Core/Event.ts:23
# parseJson
▸ parseJson(json
): void
解析json
# Parameters
Name | Type | Description |
---|---|---|
json | any | 解析 |
# Returns
void
# Overrides
GvolLayer.parseJson
# Defined in
LayerManager/TileLayer/TileLayer.ts:51
# remove
▸ remove(value
): GvolObject
删除对象
# Parameters
Name | Type |
---|---|
value | any |
# Returns
GvolObject
# Overrides
GvolLayer.remove
# Defined in
LayerManager/TileLayer/TileLayer.ts:32