PolyFenceLineMarker(markerOptions)

new PolyFenceLineMarker(markerOptions)

Parameters:
Name Type Description
markerOptions object
Properties
Name Type Description
points array

点的位置数组

lineWidth number

线的宽度

color any

任何可以由THREE.Color解析的东西

depthTest bool

这个标记是否正在进行深度测试

textOptions object

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

labelVisible bool

标签是否可见

fenceHeight number

栅栏的高度

opacity number

围栏的不透明度,[0,1]中的实数

Example

construction

 let pts = [
   altizure.LngLatAlt(121.62207076772476, 31.215100709313937, 38.71264891175848),
   altizure.LngLatAlt(121.62223528048824, 31.215088706573, 19.093825215424204),
   altizure.LngLatAlt(121.62240077344717, 31.215081359056317, 39.37697345820135),
   altizure.LngLatAlt(121.62240150082697, 31.21530379856871, 38.812298225319545)
 ]
 let defaultTextOptions = {
   margin: 0,
   lineHeight: 0.1,
   align: 'center',
   fillStyle: 'red',
   font: 'bold 60px Times New Roman',
   outlineWidth: 2,
   outlineStyle: 'black',
   resetCursorY: true,
   trimText: true
 }
 // modify the text options to draw your desired labels
 let polyFenceLineMarker = new altizure.PolyFenceLineMarker({
   sandbox: sandbox,
   points: pts,
   lineWidth: 0.5,
   depthTest: true,
   color: 0xff111,
   labelsVisible: true,
   textOptions: defaultTextOptions,
   fenceHeight: 5,
   opacity: 0.3
 })

Extends

Members

color

设置颜色

Overrides:
Example

Change color

 polyFenceLineMarker.color = 0xff0000 // red

depthTest

设置深度测试

Overrides:
Example

Change depthTest

 polyFenceLineMarker.depthTest = false // shoule be in front now

euler :object

Eular角度表示中的方向。 {x:绕X轴以弧度为单位的旋转角度,  y:弧度,  z:弧度,  顺序:旋转顺序,默认'XYZ'}。  用这个代替方向 如果你不熟悉数学。

Inherited From:
See:
Example

Set orientation by Eular angles

 marker.euler = {x: Math.PI/6, y: Math.PI/4, z: Math.PI/3} // rotate around X-axis for 30 degree; Y for 45 degree; Z for 60 degree, in that order.
 marker.euler = {y: Math.PI/2} // rotate around Y-axis for 90 degree.

fenceHeight

设置围栏的高度

Example

Set fence height

 polyFenceLineMarker.fenceHeight = 10.3

readonly ID :string

获取唯一的ID。

Inherited From:

interactable :bool

如果标记是可交互的,则设置。设置为true以响应鼠标事件。

Inherited From:
Example

Set interactable

 marker.interactable = true // make this marker interactable
 marker.interactable = !marker.interactable // flip interactable status

labelScaleFunc

设置自定义标签缩放行为

Overrides:
Example

Define label scale function

 polyBaseLineMarker.labelScaleFunc = (number) => {
   return 1.0 // label scale not changing
 }

labelsVisible

设置标签的可见性

Overrides:
Example

Change visibility of the labels

 polyBaseLineMarker.labelsVisible = true // labels visible

readonly length

获取线的总长度。

Inherited From:
Example

Get total length

 let totalLength = polyBaseLineMarker.length

lineWidth

目前无用,因为围栏没有宽度。

name :string

一串名字。

Inherited From:
Example

Set name

 marker.name = 'this marker' // set name as 'this marker'
 marker.name = marker.name + ' suffix' // extend the name

opacity

设置围栏的不透明度

Example

Set opacity

 polyFenceLineMarker.opacity = 0.3

orientation :object

通过均匀四元数{x,y,z,w}设置旋转。 使用EULAR 相反,如果你不知道如何使用这个。

Inherited From:
See:
Example

Set orientation

 marker.orientation = {x: 0, y: 0, z: 0, w: 1}

readonly points

获取用于构建此标记的点的列表

Inherited From:

readonly pointsNumber

得到点列表的长度

Inherited From:

position :LngLatAlt

改变当前位置{lng,lat,alt}。

Inherited From:
Example

Set position

 marker.position = {
   lng: 113.93977612840078,
   lat: 22.5364271949327,
   alt: 12.3
 }

scale :number

设置标记的比例。

Inherited From:
Example

Set scale

 marker.scale = 2.0 // set scale to 2.0
 marker.scale = marker.scale * 2.0 // make it two times bigger

speed

set the speed of the movement of the animation

style

设置围栏的风格

Example

Set the style

 polyFenceLineMarker.style = {
   texture: 'fence', // 'fence', 'arrow' or an image file url
   mapping: 'linear', // 'linear' or 'repeat'
   color: 0xffffff,
   animation: 'horizontal', // or 'verticle', 'none'. default 'hortizontal'
   opacity: 1.0
 }

textOptions

设置文本选项

Overrides:
Example

Change text options

 polyBaseLineMarker.textOptions = {
   margin: 0,
   lineHeight: 0.1,
   align: 'center',
   fillStyle: 'red',
   font: 'bold 60px Times New Roman',
   outlineWidth: 2,
   outlineStyle: 'black',
   resetCursorY: true,
   trimText: true
 }

visible :bool

设置标记的可见性。

Inherited From:
Example

Set visible

 marker.visible = false // make this marker invisible
 marker.visible = !marker.visible // flip visible status

x :number

在x方向上设置标记的比例。

Inherited From:
Example

Set scale x

 marker.x = 2.0 // set scale x to 2.0
 marker.x = marker.x * 2.0 // make it two times bigger in x direction

y :number

在y方向上设置标记的比例。

Inherited From:
Example

Set scale y

 marker.y = 2.0 // set scale y to 2.0
 marker.y = marker.y * 2.0 // make it two times bigger in y direction

z :number

在z方向上设置标记的比例。

Inherited From:
Example

Set scale z

 marker.z = 2.0 // set scale z to 2.0
 marker.z = marker.z * 2.0 // make it two times bigger in z direction

Methods

addPoint(lngLatAlt)

添加一个点到最后。

Parameters:
Name Type Description
lngLatAlt altizure.LngLatAlt
Overrides:
Example

Add a point

 let pt = new altizure.LngLatAlt(121.62207076772476, 31.215100709313937, 42.71264891175848)
 polyFenceLineMarker.addPoint(pt)

abstract animate(options)

传播的事件,正在渲染的新帧。

Parameters:
Name Type Description
options object
Inherited From:

destruct()

析构函数

Overrides:

detachControl()

分离并隐藏标记的控件小控件

Inherited From:
Example

Detach control

 marker.detachControl()

dim()

Un-highlight the marker. (hide the blue fence of the marker)

Inherited From:
Example

Un-highlight

 marker.dim()

light()

Highlight the marker. (show the blue fence of the marker)

Inherited From:
Example

Highlight

 marker.light()

off(eventType, handler)

从事件中取消注册处理程序。

Parameters:
Name Type Description
eventType string
handler function
Inherited From:
Example

Un-register interaction events

 marker.off('click')
 marker.off('mouseover')
 marker.off('mouseenter')
 marker.off('mouseleave')

on(eventType, handler)

用处理程序注册一个事件。 注意:一个事件只能有一个处理程序。

Parameters:
Name Type Description
eventType string

'click','mouseover','mouseenter','mouseleave'

handler function

事件处理器

Inherited From:
Example

Register interaction events

 marker.on('click', function (event) {
   console.log('click on marker ', marker, event)
 })
 marker.on('mouseover', function (event) {
   console.log('mouse over marker ', marker, event)
 })
 marker.on('mouseenter', function (event) {
   console.log('mouse enter marker ', marker, event)
 })
 marker.on('mouseleave', function (event) {
   console.log('mouse leave marker ', marker, event)
 })
 marker.interactable = true // the marker must be interactable for events to take effects

orientationByHorizontalPoints(pts, flip) → {Quaternion}

从水平点得到重新定位的方向

Parameters:
Name Type Default Description
pts Array.<LngLatAlt>
flip bool false
Returns:
Quaternion
Inherited From:

abstract sceneUpdated(options)

传播的定期事件处理程序。当场景内容更新时触发。

Parameters:
Name Type Description
options object
Inherited From:

setControlMode(mode)

设置控件Gizmo的模式

Parameters:
Name Type Description
mode string

控件gizmo'translate','rotate'的模式

Inherited From:
Example

Set the mode of the control

 marker.setControlMode('translate')
 marker.setControlMode('rotate')

setPoint(index, lngLatAlt)

将索引点设置为lngLatAlt

Parameters:
Name Type Description
index integer
lngLatAlt altizure.LngLatAlt
Overrides:
Example

set the point

 let pt = new altizure.LngLatAlt(121.62207076772476, 31.215100709313937, 42.71264891175848)
 polyFenceLineMarker.setPoint(polyFenceLineMarker.pointsNumber - 1, pt) // set the last point to be pt
 // polyFenceLineMarker.setPoint(0, pt) // set first point to be pt
 // polyFenceLineMarker.setPoint(1, pt) // set second point to be pt

shapeToEarth() → {Matrix4}

从shapeHolder-space到地球空间的变换矩阵

Returns:
Matrix4
Inherited From:

shapeToScene() → {Matrix4}

从shapeHolder-space到scene-root的变换矩阵

Returns:
Matrix4
Inherited From:

showControl(mode)

播放标记的{index}巡视路线

Parameters:
Name Type Description
mode string

控件gizmo的模式:'translate','rotate'

Inherited From:
Example

Show control

 marker.showControl('translate') // show control used for translate
 marker.showControl('rotate') // show control used for rotate

abstract updateVisibility(options)

传播事件,屏幕可见性正在更新。

Parameters:
Name Type Description
options object
Inherited From: