Skip to content

PolylinePrimitive (Line Primitive Vector Object)

Line primitive vector object.

Constructor

ts
new ge3d.feature.PolylinePrimitive(options?: any): PolylinePrimitive

Parameters

StyleOptions

ParameterTypeDefaultDescription
widthNumber4Line width
materialTypeString"Color"Fill material type, options: MaterialType
materialMaterial-Material used for filling
colorString/Cesium.Color"#3388ff"Color
opacityNumber1.0Opacity, range 0.0-1.0
randomColorBooleanfalseWhether to use random color
closureBooleanfalseWhether to close
distanceDisplayConditionBoolean/Cesium.DistanceDisplayConditionfalseWhether to display by distance
distanceDisplayCondition_farNumber100000Maximum distance
distanceDisplayCondition_nearNumber0Minimum distance
hasShadowsBooleanfalseWhether to cast shadows
shadowsCesium.ShadowModeCesium.ShadowMode.DISABLEDSpecify whether object casts or receives shadows from light sources
clampToGroundBooleanfalseWhether to clamp to ground
classificationTypeCesium.ClassificationTypeCesium.ClassificationType.BOTHSpecify coverage type when clamped to ground
setHeightNumber/Number[]0Specify coordinate height value, or array to specify height of each point
addHeightNumber/Number[]0Height value added to existing coordinates, or array to specify height added to each point
highlightPolylineSimplePrimitive.StyleOptions-Highlight style on hover or click
labelLabelPrimitive.StyleOptions-Support for additional text display

Constructor Parameters

ParameterTypeDescription
positionsLatLngPoint[]/Cesium.Cartesian3[]Coordinate position
stylePolylinePrimitive.StyleOptionsStyle information
attrObjectAdditional attribute information, can add any attributes

Properties

PropertyTypeDescription
areanumberArea (unit: square meters)
attranyAttribute information
centeranyCenter point coordinates (Cartesian coordinates)
centerOfLineanyCenter point coordinates of edge line
centerPointLatLngPointCenter point coordinates (latitude and longitude coordinates)
distancenumberDistance (unit: meters)
idanyObject id identifier
isAddedbooleanWhether added to layer
isDestroybooleanWhether destroyed
labelanyAdditional label text object
nameanyName (can be repeated)
pointsLatLngPoint[]Position coordinate array
rectangleRectangleRectangle boundary corresponding to coordinate data
showanyShow/hide state
styleanyStyle information

Methods

addEventListener

Add feature events

ts
addEventListener(types: any, fn: any, context?: any): this

clampToGround

Asynchronously calculate and update coordinates for ground clamping (or model clamping)

ts
clampToGround(options?: any): BillboardPrimitive

clear

Clear features

ts
clear(): void

closeHighlight

Clear selected highlight

ts
closeHighlight(): void

destroy

Destroy features

ts
destroy(noDel?: boolean): void

flyTo

Fly to view angle where data is located

ts
flyTo(options?: any): undefined | BillboardPrimitive

getCenterOfMass

Internal center point coordinates of enclosed surface

ts
getCenterOfMass(): any

getCoordinates

Position coordinates (array object), example [ [123.123456,32.654321,198.7], [111.123456,22.654321,50.7] ]

ts
getCoordinates(noAlt?: boolean): any[][]

getPositions

Position coordinates (Cartesian coordinates), can pass LatLngPoint object when assigning

ts
getPositions(): any

once

Event that is destroyed after being executed once

ts
once(types: any, fn: any, context?: any): this

removeEventListener

Remove feature events

ts
removeEventListener(types: any, fn: any, context?: any): this

setOptions

Set options parameters

ts
setOptions(options: { attr: any; position: any; positions: any; style: any }): this

setPositions

Set position coordinates (Cartesian coordinates), can pass LatLngPoint object when assigning

ts
setPositions(value: any): void

setStyle

Set style information

ts
setStyle(newStyle: any): this

toGeoJSON

Convert to GeoJSON data

ts
toGeoJSON(options: any): object

toWKT

Convert to WKT data

ts
toWKT(options: any): any

remove

Remove object

ts
remove(): void