abstract ZoneMarker(markerOptions)

一个标记圈出一个区域的一些标记用于描述

new abstract ZoneMarker(markerOptions)

Parameters:
Name Type Description
markerOptions object

创建选项

Properties
Name Type Attributes Default Description
volume object

几何体的描述

Properties
Name Type Attributes Default Description
points Array.<LngLatAlt> | Array.<object>

点圈出该地区

top number <optional>
1

栅栏的顶部

bottom number <optional>
0

栅栏的底部

color number <optional>
0xffffff

卷的颜色以十六进制数字表示

opacity number <optional>
0.1

音量的不透明度

depthTest bool <optional>
true

是否打开材质的深度测试

tagOrientation number <optional>
ZoneMarker.TAG_ORIENTATION.HORIZONTAL

标签的方向 只能是ZoneMarker.TAG_ORIENTATION.HORIZONTAL或ZoneMarker.TAG_ORIENTATION.VERTICAL其中之一

tagScale number <optional>
1

标签的比例

textOptions object

文本选项用于在标签上绘制文本

imgUrl string

图像文件的url,如果textOptions没有提供,图像将被加载到标签上

See:
Example

construction

 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

Change depthTest

 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

change the tagOrientation

 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

set the texture of the tag

 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,...}