Class: Model

csvector~ Model


new Model(options)

模型
Parameters:
Name Type Description
options Object
Properties
Name Type Description
options Cartesian3 模型显示的坐标
url string 模型文件的url

Extends

Methods


getModelMatrix()

获取模型矩阵

setModelMatrix(matrix)

设置模型矩阵
Parameters:
Name Type Description
matrix Cesium.Matrix4 模型矩阵

getPosition()

获取模型的位置信息

setPosition(position)

设置模型的位置信息
Parameters:
Name Type Description
position Cartesian3 位置坐标

getUrl()

获取模型的文件路径

getHeadingPitchRoll()

获取模型的姿态

setHeadingPitchRoll(heading, pitch, roll)

设置模型的姿态
Parameters:
Name Type Description
heading Number
pitch Number
roll Number

getScale()

获取模型的缩放比例

setScale(scale)

设置模型的缩放比例
Parameters:
Name Type Description
scale Number 缩放比例

getFillColor()

获取模型的颜色

setFillColor(value)

设置模型的颜色
Parameters:
Name Type Description
value string 颜色值

toJson()

导出为json字符串
Overrides:

<static> fromJson(jsonObject, options)

从json对象中构造模型
Parameters:
Name Type Description
jsonObject Object json对象,保存的是模型对象
options Object
Properties
Name Type Argument Description
parentLayer HTMLElement | string <optional>
新图层所在的父图层组,如果存在,则自动将新图层添加到父图层组中
Returns:
Type
module:csvector.Model

<static> copy(object, newOptions)

拷贝模型对象,构造新的模型
Parameters:
Name Type Description
object * 模型对象
newOptions Object
Properties
Name Type Argument Description
parentLayer HTMLElement | string <optional>
新图层所在的父图层组,如果存在,则自动将新图层添加到父图层组中
Returns:
Type
module:csvector.Model

destroy()

销毁模型
Overrides:

getVectorLayer()

获取当前的矢量图层
Inherited From:
Overrides:

setVectorLayer(vectorLayer)

添加矢量图层
Parameters:
Name Type Description
vectorLayer module:csvector.VectorLayer 矢量图层
Inherited From:
Overrides:

bind(vector)

绑定二维矢量,一旦绑定之后,调用三维矢量的相关接口时,比如改变颜色、位置等,二维矢量会同步改变
Parameters:
Name Type Description
vector * 矢量图层
Inherited From:
Overrides:
See:

unbind()

解除绑定二维矢量
Inherited From:
Overrides:
See:

getUuid()

获取当前矢量的唯一标识(UUID)
Inherited From:
Overrides:

getPickId()

鼠标选取到当前矢量时返回的对象
Inherited From:
Overrides:

getVisible()

获取矢量图层的显示隐藏状态
Inherited From:
Overrides:

setVisible(visible)

设置矢量图层显示或隐藏
Parameters:
Name Type Description
visible Boolean 矢量图层显隐
Inherited From:
Overrides:

获取矢量图层闪烁的状态
Inherited From:
Overrides:

设置矢量图层是否闪烁
Parameters:
Name Type Description
value Boolean 矢量图层闪烁状态
Inherited From:
Overrides:

getPickable()

获取对象是否可以被选中
Inherited From:
Overrides:

setPickable(canPick)

设置对象是否可以被选中
Parameters:
Name Type Description
canPick Boolean 是否可以被选中
Inherited From:
Overrides:

getCustom()

获取用户自定义对象
Inherited From:
Overrides:

setCustom(customObj)

设置用户自定义对象
Parameters:
Name Type Description
customObj * 用户自定义对象
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: