Appearance
PolylinePrimitive (Line Primitive Vector Object)
Line primitive vector object.
Constructor
ts
new ge3d.feature.PolylinePrimitive(options?: any): PolylinePrimitiveParameters
StyleOptions
| Parameter | Type | Default | Description |
|---|---|---|---|
| width | Number | 4 | Line width |
| materialType | String | "Color" | Fill material type, options: MaterialType |
| material | Material | - | Material used for filling |
| color | String/Cesium.Color | "#3388ff" | Color |
| opacity | Number | 1.0 | Opacity, range 0.0-1.0 |
| randomColor | Boolean | false | Whether to use random color |
| closure | Boolean | false | Whether to close |
| distanceDisplayCondition | Boolean/Cesium.DistanceDisplayCondition | false | Whether to display by distance |
| distanceDisplayCondition_far | Number | 100000 | Maximum distance |
| distanceDisplayCondition_near | Number | 0 | Minimum distance |
| hasShadows | Boolean | false | Whether to cast shadows |
| shadows | Cesium.ShadowMode | Cesium.ShadowMode.DISABLED | Specify whether object casts or receives shadows from light sources |
| clampToGround | Boolean | false | Whether to clamp to ground |
| classificationType | Cesium.ClassificationType | Cesium.ClassificationType.BOTH | Specify coverage type when clamped to ground |
| setHeight | Number/Number[] | 0 | Specify coordinate height value, or array to specify height of each point |
| addHeight | Number/Number[] | 0 | Height value added to existing coordinates, or array to specify height added to each point |
| highlight | PolylineSimplePrimitive.StyleOptions | - | Highlight style on hover or click |
| label | LabelPrimitive.StyleOptions | - | Support for additional text display |
Constructor Parameters
| Parameter | Type | Description |
|---|---|---|
| positions | LatLngPoint[]/Cesium.Cartesian3[] | Coordinate position |
| style | PolylinePrimitive.StyleOptions | Style information |
| attr | Object | Additional attribute information, can add any attributes |
Properties
| Property | Type | Description |
|---|---|---|
| area | number | Area (unit: square meters) |
| attr | any | Attribute information |
| center | any | Center point coordinates (Cartesian coordinates) |
| centerOfLine | any | Center point coordinates of edge line |
| centerPoint | LatLngPoint | Center point coordinates (latitude and longitude coordinates) |
| distance | number | Distance (unit: meters) |
| id | any | Object id identifier |
| isAdded | boolean | Whether added to layer |
| isDestroy | boolean | Whether destroyed |
| label | any | Additional label text object |
| name | any | Name (can be repeated) |
| points | LatLngPoint[] | Position coordinate array |
| rectangle | Rectangle | Rectangle boundary corresponding to coordinate data |
| show | any | Show/hide state |
| style | any | Style information |
Methods
addEventListener
Add feature events
ts
addEventListener(types: any, fn: any, context?: any): thisclampToGround
Asynchronously calculate and update coordinates for ground clamping (or model clamping)
ts
clampToGround(options?: any): BillboardPrimitiveclear
Clear features
ts
clear(): voidcloseHighlight
Clear selected highlight
ts
closeHighlight(): voiddestroy
Destroy features
ts
destroy(noDel?: boolean): voidflyTo
Fly to view angle where data is located
ts
flyTo(options?: any): undefined | BillboardPrimitivegetCenterOfMass
Internal center point coordinates of enclosed surface
ts
getCenterOfMass(): anygetCoordinates
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(): anyonce
Event that is destroyed after being executed once
ts
once(types: any, fn: any, context?: any): thisremoveEventListener
Remove feature events
ts
removeEventListener(types: any, fn: any, context?: any): thissetOptions
Set options parameters
ts
setOptions(options: { attr: any; position: any; positions: any; style: any }): thissetPositions
Set position coordinates (Cartesian coordinates), can pass LatLngPoint object when assigning
ts
setPositions(value: any): voidsetStyle
Set style information
ts
setStyle(newStyle: any): thistoGeoJSON
Convert to GeoJSON data
ts
toGeoJSON(options: any): objecttoWKT
Convert to WKT data
ts
toWKT(options: any): anyremove
Remove object
ts
remove(): void