Skip to content

PolylineEntity (Line Entity Vector Data)

Create and manage line Entity objects.

Constructor

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

Parameters (StyleOptions)

ParameterTypeDefaultDescription
materialTypeString"Color"Line type, options:
materialParameters*-Determined by specific
materialCesium.MaterialProperty | Cesium.ColorCesium.Color.WHITEMaterial used for filling, overrides materialType and material parameters when specified
widthNumber4Line width
colorString | Cesium.Color"#3388ff"Color
opacityNumber1.0Opacity, range 0.0-1.0
randomColorBooleanfalseWhether to use random color
depthFailMaterialCesium.MaterialProperty | Color-Specify material used to draw polyline when it is below terrain
closureBooleanfalseWhether to close
outlineBooleanfalseWhether to have outline
outlineColorString | Cesium.Color"#ffffff"Outline color
outlineWidthNumber2Outline width
depthFailBooleanfalseWhether to show occlusion
depthFailColorString"#ff0000"Occlusion color
depthFailOpacityNumber0.2Occlusion opacity
distanceDisplayConditionBoolean | Cesium.DistanceDisplayConditionfalseWhether to display by distance or specify at what distance from camera this will be displayed
distanceDisplayCondition_farNumber100000Maximum distance
distanceDisplayCondition_nearNumber0Minimum distance
arcTypeCesium.ArcTypeCesium.ArcType.GEODESICLine type that polyline segments must follow
granularitynumberCesium.Math.RADIANS_PER_DEGREEIf arcType is not arcType.none, specify numeric property of angular distance between each latitude and longitude
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, whether only terrain, 3dtiles, or both
zIndexNumber0Z-order, specify zIndex for sorting ground geometry. Only effective when 'clampToGround' is true and polyline on terrain is supported
setHeightNumber | Number[]0Specify coordinate height value, or array to specify height of each point (commonly used in layer configuration)
addHeightNumber | Number[]0Height value added to existing coordinates, or array to specify height added to each point (commonly used in layer configuration)
highlightPolylineEntity.StyleOptions-Highlight style on hover or click (type:'click'), can also be toggled via openHighlight/closeHighlight methods after creating Graphic
labelLabelEntity.StyleOptions-Support for additional text display
label.positionString | LatLngPoint-Text position, default is center property value of vector object itself. Support 'center': internal center point coordinates of enclosed surface, '{xxxx}' configure attribute field, or directly specify coordinate values
label.showAllBoolean-For MultiPolygon and MultiLineString, whether to display all annotations, default only displays on surface or line with maximum coordinates

Properties

PropertyTypeDescription
_layeranyBelonging layer
_eventsanyBound events. Pass data through callback methods
centerOfMassanyPolygon center
areanumberArea
attranyInput attribute information
centeranyCenter point coordinates (Cartesian coordinates)
distancenumberPolygon length
entityGraphicanySpecific type object of Cesium internal object corresponding to vector data
hasEditbooleanWhether editable
isAddedbooleanWhether added to layer
isDestroybooleanWhether destroyed
isEditinganyWhether in editing state
labelanyAdditional label text object
minOuterRectanglevoidMinimum outer rectangle
showanyShow/hide state
styleanyStyle information

Methods

MethodParametersReturn ValueDescription
addEventListener(types: any, fn: any, context?: any)thisEvent binding
clear()voidClear elements
destroy(noDel?: boolean)voidDestroy elements
flyTo(options?: any)undefined | PolygonEntityFly to view angle where data is located
getCenterOfMass()anyInternal center point coordinates of enclosed surface
getCoordinates(noAlt?: undefined, closure?: undefined)any[][]Get latitude and longitude coordinates
getPositions()anyPosition coordinate array (Cartesian coordinates), can pass LatLngPoint array object or Cesium.PolygonHierarchy when assigning
getPositionsShow()anyActually displayed coordinate array (Cartesian coordinates), when plotting, positions may correspond to control point coordinates or CallbackProperty properties
removeEventListener(types: any, fn: any, context?: any)thisRemove event binding
setOpacity(value: number)voidSet opacity
setOptions(options: { attr: any; position: any; positions: any; style: any })thisSet Options parameters
setPositions(value: any)voidSet coordinates
setStyle(newStyle: any)thisSet style
toGeoJSON(options: any)objectConvert to geojson
toWKT(options: any)anyConvert to wkt