Appearance
LabelEntity (Text Entity Object)
Create and manage text Entity objects.
Constructor
ts
new ge3d.feature.LabelEntity(options?: any): LabelEntityParameters (StyleOptions)
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | String | "Text" | Text content, line breaks can use newline character '\n' |
| scale | number | 1.0 | Specify scale ratio |
| horizontalOrigin | Cesium.HorizontalOrigin | - | Horizontal positioning |
| verticalOrigin | Cesium.VerticalOrigin | - | Vertical positioning |
| font_family | String | "KaiTi" | Font family, options: Microsoft YaHei, SimSun, KaiTi, LiSu, SimHei, etc. |
| font_size | Number | 30 | Font size |
| font_weight | String | "normal" | Whether bold, options: bold (yes), normal (no) |
| font_style | String | "normal" | Whether italic, options: italic (yes), normal (no) |
| font | string | '30px normal normal KaiTi' | One-time specification of CSS font properties for the above 4 attributes |
| fill | Boolean | true | Whether to fill |
| color | String | "#ffffff" | Text color |
| opacity | Number | 1.0 | Opacity, range 0.0-1.0 |
| outline | Boolean | false | Whether to outline |
| outlineColor | String | Cesium.Color | "#000000" | Outline color |
| outlineOpacity | Number | 0.6 | Outline opacity |
| outlineWidth | Number | 2.0 | Outline width |
| background | Boolean | false | Whether to have background |
| backgroundColor | String | Cesium.Color | "#000000" | Background color |
| backgroundOpacity | Number | 0.5 | Background opacity |
| backgroundPadding | Number | Cesium.Cartesian2 | new Cesium.Cartesian2(7, 5) | Background padding, specify space between text and fill boundary content (in pixels) |
| hasPixelOffset | Boolean | false | Whether pixel offset exists |
| pixelOffsetX | Number | 0 | Horizontal offset pixels |
| pixelOffsetY | Number | 0 | Vertical offset pixels |
| pixelOffset | Cesium.Cartesian2 | Number[] | Cartesian2.ZERO | Specify pixel offset |
| pixelOffsetScaleByDistance | Cesium.NearFarScalar | - | Used to set pixelOffset based on distance from camera |
| eyeOffset | Cesium.Cartesian3 | Cartesian3.ZERO | Eye offset |
| scaleByDistance | Boolean | Cesium.NearFarScalar | false | Whether to scale by distance or set scale based on camera distance |
| scaleByDistance_far | Number | 1000000 | Upper limit |
| scaleByDistance_farValue | Number | 0.1 | Scale value |
| scaleByDistance_near | Number | 1000 | Lower limit |
| scaleByDistance_nearValue | Number | 1 | Scale value |
| 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 |
| clampToGround | Boolean | false | Whether to clamp to ground |
| heightReference | Cesium.HeightReference | Cesium.HeightReference.NONE | Property specifying what the height is relative to |
| visibleDepth | Boolean | true | Whether to be occluded |
| disableDepthTestDistance | number | - | Specify distance from camera to disable depth testing |
| translucencyByDistance | Cesium.NearFarScalar | - | Used to set translucency based on distance from camera |
| setHeight | Number | 0 | Specify coordinate height value (commonly used in layer configuration) |
| addHeight | Number | 0 | Height value added to existing coordinates (commonly used in layer configuration) |