new abstract ZoneMarker(markerOptions)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
markerOptions |
object | options for creation Properties
|
- 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
-
change the bottom of the ZoneMarker (the bottom must be a number)
- Overrides:
-
color
-
set the color
- Overrides:
-
depthTest
-
Do depth test or not. If false, it should be in front.
- Overrides:
Example
Change depthTest
polygonBaseMarker.depthTest = true // do depth test polygonBaseMarker.depthTest = !polygonBaseMarker.depthTest // flip the depth test status
-
hasBottomCover
-
hasBottomCover must be false. override PolygonBaseMarker setter hasBottomCover
- Overrides:
-
hasTopCover
-
hasTopCover must be false. override PolygonBaseMarker setter hasTopCover
- Overrides:
-
imgUrl
-
load a texture from an image url
-
opacity
-
Opacity, a number in [0, 1], 0 for transparent, 1 for opaque
- Overrides:
-
tagOrientation
-
set the 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
-
set the scale of the tag
-
tagTexture
-
set the texture of the tag
Example
set the texture of the tag
zoneMarker.tagTexture = { texture: ..., // the texture aspectRatio: ... // a number, the corresponding aspect ratio }
-
textOptions
-
draw the text on the texture of the tag using textOptions
-
top
-
change the top of the ZoneMarker (the top must be a number)
- Overrides:
Methods
-
destruct()
-
Destructor
- Overrides:
-
onCameraChange(pose)
-
change the status of the tag according to current camera pose
Parameters:
Name Type Description pose
object the pose of the camera, {lng: ..., lat: ..., alt: ..., north: ..., tilt, ...}