abstract layer~ModelInstanceLayer(options)

模型实例图层。目前在部分电脑上,chrome版本低于89时,拖动地图瞬间存在cpu占用率高的现象,升级到89版本之后该现象消失。

Summary

Methods:
addModelInstance

指定模型添加一个实例

getModelInstanceById

通过模型Id和模型实例化对象的Id,查找模型实例化对象

removeModelAllInstances

移除一个模型的所有实例

removeModelInstance

移除一个模型实例

updateModelInstance

更新一个模型实例,如果该实例尚未添加到图层中,不做变化。

Constructor

new abstract ModelInstanceLayer(options)

Parameters:
Name Type Description
options Object

图层可选项,继承基类

Members

depthTest

获取图层的深度测试属性
return {Boolean} 深度测试属性

Overrides:

Methods

addModelInstance(model, modelInstance)

指定模型添加一个实例

Parameters:
Name Type Description
model module~gltf

模型,目前只支持gltf模型。

modelInstance module~ModelInstance

模型实例对象

getModelInstanceById(modelId, modelInstanceId) → {null|module~ModelInstance}

通过模型Id和模型实例化对象的Id,查找模型实例化对象

Parameters:
Name Type Description
modelId String

模型Id

modelInstanceId String

模型实例化对象Id

Returns:
null | module~ModelInstance -

空对象或者模型实例化对象。

removeModelAllInstances(modelId)

移除一个模型的所有实例

Parameters:
Name Type Description
modelId string

模型ID

removeModelInstance(modelInstance)

移除一个模型实例

Parameters:
Name Type Description
modelInstance module~ModelInstance

模型实例对象

updateModelInstance(modelInstance)

更新一个模型实例,如果该实例尚未添加到图层中,不做变化。

Parameters:
Name Type Description
modelInstance module~ModelInstance

模型实例对象