new abstract ZoneMarker(markerOptions)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markerOptions |
object | 创建选项 Properties
|
- See:
Example
let array0 = [
new altizure.LngLatAlt(114.21186101893935, 22.428228681061963, 0),
new altizure.LngLatAlt(114.21123177447554, 22.427335448692784, 0),
new altizure.LngLatAlt(114.21253196255999, 22.42643080548697, 0),
new altizure.LngLatAlt(114.21319580845478, 22.427249979470133, 0),
new altizure.LngLatAlt(114.21186101893935, 22.428228681061963, 0)
]
let array1 = [
new altizure.LngLatAlt(114.21187267609257, 22.42729036132955, 0),
new altizure.LngLatAlt(114.21213458987283, 22.427605782548987, 0),
new altizure.LngLatAlt(114.21248169394998, 22.427340893752923, 0),
new altizure.LngLatAlt(114.21222367269515, 22.427077350835003, 0),
new altizure.LngLatAlt(114.21187267609257, 22.42729036132955, 0)
]
let points = [
{array: array0, hole: false},
{array: array1, hole: true}
]
let zoneMarker = new altizure.ZoneMarker({
sandbox: sandbox,
volume: {
color: 0xffffff,
opacity: 1.0,
points: points,
top: 20,
bottom: 10
},
tagOrientation: altizure.ZoneMarker.TAG_ORIENTATION.HORIZONTAL,
tagScale: 1.0,
imgUrl: '../public/assets/img/meta_description.png', // here as textOptions is provided, the imgUrl won't work
textOptions: {
text: 'Zone 0',
fillStyle: 'red'
}
})
Extends
Members
-
bottom
-
更改ZoneMarker的底部(底部必须是数字)
- Overrides:
-
color
-
设置颜色
- Overrides:
-
depthTest
-
是否进行深度测试。如果错误,应该在前面。
- Overrides:
Example
polygonBaseMarker.depthTest = true // do depth test polygonBaseMarker.depthTest = !polygonBaseMarker.depthTest // flip the depth test status
-
hasBottomCover
-
hasBottomCover必须是false。覆盖PolygonBaseMarker设置器hasBottomCover
- Overrides:
-
hasTopCover
-
hasTopCover必须是false。覆盖PolygonBaseMarker设置器hasTopCover
- Overrides:
-
imgUrl
-
从图像url加载纹理
-
opacity
-
不透明度,[0,1]中的数字,0代表透明,1代表不透明
- Overrides:
-
tagOrientation
-
设置tagOrientation
Example
zoneMarker.tagOrientation = altizure.ZoneMarker.TAG_ORIENTATION.HORIZONTAL // it is equivalent to // zoneMarker.tagOrientation = 1 zoneMarker.tagOrientation = altizure.ZoneMarker.TAG_ORIENTATION.VERTICAL // it is equivalent to // zoneMarker.tatagOrientationgPose = 0
-
tagScale
-
设置标签的比例
-
tagTexture
-
设置标签的纹理
Example
zoneMarker.tagTexture = { texture: ..., // the texture aspectRatio: ... // a number, the corresponding aspect ratio }
-
textOptions
-
使用textOptions在标签的纹理上绘制文本
-
top
-
更改ZoneMarker的顶部(顶部必须是数字)
- Overrides:
Methods
-
destruct()
-
析构函数
- Overrides:
-
onCameraChange(pose)
-
根据当前相机姿态更改标签的状态
Parameters:
Name Type Description pose
object 相机的姿势{lng:...,lat:...,alt:...,north:...,tilt,...}