Constructor
new Gltf(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Gltf.ConstructorOptions | 创建glTF/glb模型实例所需的初始参数选项 |
Members
(readonly) layer :string
- Description:
获取glTF模型所属图层的ID
获取glTF模型所属图层的ID
Type:
- string
layer
- Description:
设置glTF模型所属图层的ID
设置glTF模型所属图层的ID
(readonly) type :SourceType
- Description:
获取当前矢量数据的类型
获取当前矢量数据的类型
Type:
Methods
data() → {m3d.Model}
- Description:
获取glTF模型数据
- Returns:
-
m3d.Model
-
返回模型glTF实例对象中的模型数据
getModel() → {m3d.Model}
- Description:
获取glTF模型数据
- Returns:
-
m3d.Model
-
返回模型glTF实例对象
hide()
- Description:
隐藏glTF模型
setColor(color)
- Description:
设置模型的颜色
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<number> | 模型的颜色,RGBA格式 |
(async) setPosition(position)
- Description:
设置模型的位置
Parameters:
Name | Type | Description |
---|---|---|
position |
number | 模型的位置,[lng, lat, height]格式的数组 |
show()
- Description:
显示glTF模型
Type Definitions
ConstructorOptions
- Description:
创建glTF/glb模型实例所需的初始参数选项,包含以下字段:
Properties:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
<optional> |
''
|
模型名称 |
|||||||||||||||||||||||||||||||||||
url |
string | glTF模型的地址 |
|||||||||||||||||||||||||||||||||||||
visible |
boolean |
<optional> |
true
|
设置加载完glTF模型后,默认是否显示 |
|||||||||||||||||||||||||||||||||||
style |
Object |
<optional> |
模型渲染的偏好设置,包括以下属性字段: Properties
|
创建glTF/glb模型实例所需的初始参数选项,包含以下字段:
Type:
- Object