Class: WebMercatorTileLayer

csimage~ WebMercatorTileLayer


new WebMercatorTileLayer(options)

墨卡托投影的影像瓦片,第0层是一张瓦片
Parameters:
Name Type Description
options Object
Properties
Name Type Argument Default Description
url string 影像地址,具体参数请参考Cesium.UrlTemplateImageryProvider
minZoom number <optional>
0 最小层级
maxZoom number <optional>
18 最大层级

Extends

Methods


toJson()

导出为json字符串
Overrides:

<static> fromJson(jsonObject, options)

从json对象中构造图层
Parameters:
Name Type Description
jsonObject Object json对象,保存的是墨卡托投影的影像瓦片图层
options Object
Properties
Name Type Argument Default Description
parentLayer module:csview.Layer 新图层所在的父图层组,如果存在,则自动将新图层添加到父图层组中
name string <optional>
jsonObject.name 新图层名称
url string <optional>
jsonObject.url 新图层的url地址
minZoom string <optional>
jsonObject.minZoom 新图层的最小层级
maxZoom string <optional>
jsonObject.maxZoom 新图层的最大层级

<static> copy(object, newOptions)

从现有图层中拷贝构造新图层
Parameters:
Name Type Description
object Object 图层对象
newOptions Object
Properties
Name Type Argument Default Description
parentLayer module:csview.Layer 新图层所在的父图层组,如果存在,则自动将新图层添加到父图层组中
name string <optional>
jsonObject.name 新图层名称
url string <optional>
jsonObject.url 新图层的url地址
minZoom string <optional>
jsonObject.minZoom 新图层的最小层级
maxZoom string <optional>
jsonObject.maxZoom 新图层的最大层级

getView()

获取当前图层所在视图对象
Inherited From:
Overrides:

getParent()

获取当前图层所在的父图层组
Inherited From:
Overrides:

getName()

获取图层名称
Inherited From:
Overrides:

setName(value)

设置图层名称
Parameters:
Name Type Description
value string 图层名称
Inherited From:
Overrides:

getVisible()

获取当前图层的显隐状态
Inherited From:
Overrides:

setVisible(value)

设置当前图层的显隐状态
Parameters:
Name Type Description
value Boolean 显隐状态
Inherited From:
Overrides:

getActive()

获取当前图层是否处于激活状态
Inherited From:
Overrides:

setActive(value)

设置当前图层的激活状态
Parameters:
Name Type Description
value Boolean 激活状态
Inherited From:
Overrides:

getLocked()

获取当前图层是否处于锁定状态
Inherited From:
Overrides:

setLocked(value)

设置当前图层的锁定状态
Parameters:
Name Type Description
value Boolean 锁定状态
Inherited From:
Overrides:

initialize()

当图层被添加到视图中时,会调用此方法 继承csview.Layer的图层可以重写此方法,在图层被添加到视图中时初始化相关资源
Inherited From:
Overrides:

isImageryLayer()

判断当前图层是否是影像图层,默认返回false 继承csview.Layer的图层如果是影像图层必须重写此方法,指明当前图层是否是影像图层
Inherited From:
Overrides:

<abstract> getCsLayer()

获取cesium的图层对象,ImageryLayer或者Primitive或者PrimitiveCollection 继承csview.Layer的图层必须重写此方法
Inherited From:
Overrides:

dispatchEvent(event)

发送事件消息,每个事件消息都有类型(type),所有监听此对象对应类型事件的监听者都会接收到相应的事件消息
Parameters:
Name Type Description
event string | module:events.Event 事件对象
Inherited From:
Overrides:

on(type, listener [, opt_this])

指定监听器监听指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:
Returns:
监听器的唯一标识.
Type
Object

once(type, listener [, opt_this])

指定监听器只监听一次指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:
Returns:
监听器的唯一标识.
Type
Object

un(type, listener [, opt_this])

取消指定监听器监听指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:

unByKey(key)

根据监听器的唯一标识取消指定监听器监听事件,监听器的唯一标识通过`on()`或者`once()`返回得到
Parameters:
Name Type Description
key Object | Array.<Object> 监听器的唯一标识,通过`on()`或者`once()`返回得到,可以是多个监听器的唯一标识数组
Inherited From:
Overrides:

destroy()

销毁图层方法,不能由用户直接调用,如果要想销毁当前图层,请调用父图层组的removeLayer方法
Inherited From:
Overrides: