new Model(position, modelUrl)
overlay/model/Model.js, line 39
Name | Type | Description |
---|---|---|
position |
Position |
模型位置 |
modelUrl |
String |
模型地址 |
Extends
Classes
Members
-
attr
-
覆盖物的额外属性设置
-
readonlydelegate
-
覆盖物的代理对象
-
id
-
设置覆盖物的业务 id
-
readonlyoverlayEvent
-
覆盖物的事件对象
-
readonlyoverlayId
-
覆盖物唯一标识
-
show
-
覆盖物的可见性
-
readonlystate
-
覆盖物的状态
Methods
-
staticModel.fromEntity(entity){any}
overlay/model/Model.js, line 161 -
从 entity 中解析出 Model
Name Type Description entity
Entity Returns:
Type Description any -
添加到指定图层
Name Type Description layer
EntityLayer 指定图层
Returns:
Type Description Overlay -
触发事件
Name Type Description type
* params
* Returns:
Type Description Overlay -
注销事件
Name Type Description type
* 事件类型
callback
* 监听回调
context
* Returns:
Type Description Overlay -
注册事件
Name Type Description type
* 事件类型
callback
* 监听回调
context
* Returns:
Type Description Overlay -
从图层上移出
Returns:
Type Description Overlay -
设置文字标签
Name Type Description text
Property | string 指定文本的属性。支持显式换行符'\ n'。
textStyle
Object text 样式
Returns:
Type Description Overlay -
setStyle(style){Model}
overlay/model/Model.js, line 145 -
设置 Model 的样式
Name Type Description style
Object 样式可选属性
// 样式参数(可选) { "scale": 1, //比例 "minimumPixelSize": 0, //指定模型的最小像素大小,而不考虑缩放 "maximumScale": 0, //指定模型的最大比例 "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 "silhouetteColor": Color.RED, //轮廓颜色 "silhouetteSize": 0, //轮廓宽度 "lightColor": Color.RED, //模型着色时指定灯光颜色 "distanceDisplayCondition": { "near": 0, //最近距离 "far": Number.MAX_VALUE //最远距离 } //根据距离设置可见 }
Returns:
Type Description Model