abstract ZoneMarker(markerOptions)

a marker that circles out an area by some fences with a tag for description

new abstract ZoneMarker(markerOptions)

Parameters:
Name Type Description
markerOptions object

options for creation

Properties
Name Type Attributes Default Description
volume object

the geometry volume description

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

points that circle out the area

top number <optional>
1

the top of the fence

bottom number <optional>
0

the bottom of the fence

color number <optional>
0xffffff

color of the volume in hex number

opacity number <optional>
0.1

opacity of the volume

depthTest bool <optional>
true

whether the depthTest of the material is turned on

tagOrientation number <optional>
ZoneMarker.TAG_ORIENTATION.HORIZONTAL

the orientation of the tag can only be one of ZoneMarker.TAG_ORIENTATION.HORIZONTAL or ZoneMarker.TAG_ORIENTATION.VERTICAL

tagScale number <optional>
1

the scale of the tag

textOptions object

the text options use to draw the text on tag

imgUrl string

the url of an image file, if textOptions not provided, the image will be loaded on tag

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