Skip to content

LabelEntity (Text Entity Object)

Create and manage text Entity objects.

Constructor

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

Parameters (StyleOptions)

ParameterTypeDefaultDescription
textString"Text"Text content, line breaks can use newline character '\n'
scalenumber1.0Specify scale ratio
horizontalOriginCesium.HorizontalOrigin-Horizontal positioning
verticalOriginCesium.VerticalOrigin-Vertical positioning
font_familyString"KaiTi"Font family, options: Microsoft YaHei, SimSun, KaiTi, LiSu, SimHei, etc.
font_sizeNumber30Font size
font_weightString"normal"Whether bold, options: bold (yes), normal (no)
font_styleString"normal"Whether italic, options: italic (yes), normal (no)
fontstring'30px normal normal KaiTi'One-time specification of CSS font properties for the above 4 attributes
fillBooleantrueWhether to fill
colorString"#ffffff"Text color
opacityNumber1.0Opacity, range 0.0-1.0
outlineBooleanfalseWhether to outline
outlineColorString | Cesium.Color"#000000"Outline color
outlineOpacityNumber0.6Outline opacity
outlineWidthNumber2.0Outline width
backgroundBooleanfalseWhether to have background
backgroundColorString | Cesium.Color"#000000"Background color
backgroundOpacityNumber0.5Background opacity
backgroundPaddingNumber | Cesium.Cartesian2new Cesium.Cartesian2(7, 5)Background padding, specify space between text and fill boundary content (in pixels)
hasPixelOffsetBooleanfalseWhether pixel offset exists
pixelOffsetXNumber0Horizontal offset pixels
pixelOffsetYNumber0Vertical offset pixels
pixelOffsetCesium.Cartesian2 | Number[]Cartesian2.ZEROSpecify pixel offset
pixelOffsetScaleByDistanceCesium.NearFarScalar-Used to set pixelOffset based on distance from camera
eyeOffsetCesium.Cartesian3Cartesian3.ZEROEye offset
scaleByDistanceBoolean | Cesium.NearFarScalarfalseWhether to scale by distance or set scale based on camera distance
scaleByDistance_farNumber1000000Upper limit
scaleByDistance_farValueNumber0.1Scale value
scaleByDistance_nearNumber1000Lower limit
scaleByDistance_nearValueNumber1Scale value
distanceDisplayConditionBoolean | Cesium.DistanceDisplayConditionfalseWhether to display by distance or specify at what distance from camera this will be displayed
distanceDisplayCondition_farNumber100000Maximum distance
distanceDisplayCondition_nearNumber0Minimum distance
clampToGroundBooleanfalseWhether to clamp to ground
heightReferenceCesium.HeightReferenceCesium.HeightReference.NONEProperty specifying what the height is relative to
visibleDepthBooleantrueWhether to be occluded
disableDepthTestDistancenumber-Specify distance from camera to disable depth testing
translucencyByDistanceCesium.NearFarScalar-Used to set translucency based on distance from camera
setHeightNumber0Specify coordinate height value (commonly used in layer configuration)
addHeightNumber0Height value added to existing coordinates (commonly used in layer configuration)