Appearance
PolylineEntity (Line Entity Vector Data)
Create and manage line Entity objects.
Constructor
ts
new ge3d.feature.PolylineEntity(options?: any): PolylineEntityParameters (StyleOptions)
| Parameter | Type | Default | Description |
|---|---|---|---|
| materialType | String | "Color" | Line type, options: |
| materialParameters | * | - | Determined by specific |
| material | Cesium.MaterialProperty | Cesium.Color | Cesium.Color.WHITE | Material used for filling, overrides materialType and material parameters when specified |
| width | Number | 4 | Line width |
| color | String | Cesium.Color | "#3388ff" | Color |
| opacity | Number | 1.0 | Opacity, range 0.0-1.0 |
| randomColor | Boolean | false | Whether to use random color |
| depthFailMaterial | Cesium.MaterialProperty | Color | - | Specify material used to draw polyline when it is below terrain |
| closure | Boolean | false | Whether to close |
| outline | Boolean | false | Whether to have outline |
| outlineColor | String | Cesium.Color | "#ffffff" | Outline color |
| outlineWidth | Number | 2 | Outline width |
| depthFail | Boolean | false | Whether to show occlusion |
| depthFailColor | String | "#ff0000" | Occlusion color |
| depthFailOpacity | Number | 0.2 | Occlusion opacity |
| distanceDisplayCondition | Boolean | Cesium.DistanceDisplayCondition | false | Whether to display by distance or specify at what distance from camera this will be displayed |
| distanceDisplayCondition_far | Number | 100000 | Maximum distance |
| distanceDisplayCondition_near | Number | 0 | Minimum distance |
| arcType | Cesium.ArcType | Cesium.ArcType.GEODESIC | Line type that polyline segments must follow |
| granularity | number | Cesium.Math.RADIANS_PER_DEGREE | If arcType is not arcType.none, specify numeric property of angular distance between each latitude and longitude |
| 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, whether only terrain, 3dtiles, or both |
| zIndex | Number | 0 | Z-order, specify zIndex for sorting ground geometry. Only effective when 'clampToGround' is true and polyline on terrain is supported |
| setHeight | Number | Number[] | 0 | Specify coordinate height value, or array to specify height of each point (commonly used in layer configuration) |
| addHeight | Number | Number[] | 0 | Height value added to existing coordinates, or array to specify height added to each point (commonly used in layer configuration) |
| highlight | PolylineEntity.StyleOptions | - | Highlight style on hover or click (type:'click'), can also be toggled via openHighlight/closeHighlight methods after creating Graphic |
| label | LabelEntity.StyleOptions | - | Support for additional text display |
| label.position | String | 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.showAll | Boolean | - | For MultiPolygon and MultiLineString, whether to display all annotations, default only displays on surface or line with maximum coordinates |
Properties
| Property | Type | Description |
|---|---|---|
| _layer | any | Belonging layer |
| _events | any | Bound events. Pass data through callback methods |
| centerOfMass | any | Polygon center |
| area | number | Area |
| attr | any | Input attribute information |
| center | any | Center point coordinates (Cartesian coordinates) |
| distance | number | Polygon length |
| entityGraphic | any | Specific type object of Cesium internal object corresponding to vector data |
| hasEdit | boolean | Whether editable |
| isAdded | boolean | Whether added to layer |
| isDestroy | boolean | Whether destroyed |
| isEditing | any | Whether in editing state |
| label | any | Additional label text object |
| minOuterRectangle | void | Minimum outer rectangle |
| show | any | Show/hide state |
| style | any | Style information |
Methods
| Method | Parameters | Return Value | Description |
|---|---|---|---|
| addEventListener | (types: any, fn: any, context?: any) | this | Event binding |
| clear | () | void | Clear elements |
| destroy | (noDel?: boolean) | void | Destroy elements |
| flyTo | (options?: any) | undefined | PolygonEntity | Fly to view angle where data is located |
| getCenterOfMass | () | any | Internal center point coordinates of enclosed surface |
| getCoordinates | (noAlt?: undefined, closure?: undefined) | any[][] | Get latitude and longitude coordinates |
| getPositions | () | any | Position coordinate array (Cartesian coordinates), can pass LatLngPoint array object or Cesium.PolygonHierarchy when assigning |
| getPositionsShow | () | any | Actually displayed coordinate array (Cartesian coordinates), when plotting, positions may correspond to control point coordinates or CallbackProperty properties |
| removeEventListener | (types: any, fn: any, context?: any) | this | Remove event binding |
| setOpacity | (value: number) | void | Set opacity |
| setOptions | (options: { attr: any; position: any; positions: any; style: any }) | this | Set Options parameters |
| setPositions | (value: any) | void | Set coordinates |
| setStyle | (newStyle: any) | this | Set style |
| toGeoJSON | (options: any) | object | Convert to geojson |
| toWKT | (options: any) | any | Convert to wkt |