Skip to content

RectangleEntity (Rectangle Entity Vector Data)

Create and manage rectangle Entity objects.

Constructor

ts
new ge3d.feature.RectangleEntity(options?: {}): RectangleEntity

Parameters (StyleOptions)

ParameterTypeDefaultDescription
fillBooleantrueWhether to fill
materialTypeString"Color"Fill type, options:
materialParameters*-Determined by specific
materialCesium.MaterialProperty | Cesium.ColorCesium.Color.WHITEMaterial used for filling, overrides materialType and material parameters when specified
colorString | Cesium.Color"#3388ff"Color
opacityNumber1.0Opacity, range 0.0-1.0
outlineBooleanfalseWhether to have outline
outlineWidthNumber1Outline width
outlineColorString | Cesium.Color"#ffffff"Outline color
outlineOpacityNumber0.6Outline opacity
outlineStylePolylineEntity.StyleOptions-Complete custom style for outline, overrides outlineWidth, outlineColor and other parameters
heightNumber0Elevation, height of rectangle relative to ellipsoid surface
heightReferenceCesium.HeightReferenceCesium.HeightReference.NONEProperty specifying what the height is relative to
diffHeightNumber100Height difference (corridor's own height), mutually exclusive with extrudedHeight
extrudedHeightnumber-Specify height of extruded surface relative to ellipsoid
extrudedHeightReferenceCesium.HeightReferenceCesium.HeightReference.NONEProperty specifying what the extruded height is relative to
rotationNumber0Rotation angle (radians), 0 is north, counterclockwise
rotationDegreeNumber0Rotation angle (degrees, 0-360), mutually exclusive with rotation
stRotationNumber0Rectangle texture angle (radians), 0 is north, counterclockwise
stRotationDegreeNumber0Rectangle texture angle (degrees, 0-360), mutually exclusive with stRotation
distanceDisplayConditionBoolean | Cesium.DistanceDisplayConditionfalseWhether to display by distance or specify at what distance from camera this will be displayed
distanceDisplayCondition_farNumber100000Maximum distance
distanceDisplayCondition_nearNumber0Minimum distance
hasShadowsBooleanfalseWhether to cast shadows
shadowsCesium.ShadowModeCesium.ShadowMode.DISABLEDSpecify whether rectangle casts or receives shadows from light sources
granularitynumberCesium.Math.RADIANS_PER_DEGREESpecify angular distance between points on rectangle
clampToGroundStringfalseWhether 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 rectangle is constant and no height or extruded height is specified
setHeightNumber0Specify coordinate height value (commonly used in layer configuration)
addHeightNumber0Height value added to existing coordinates (commonly used in layer configuration)
highlightRectangleEntity.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

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
rectangleanyRectangle boundary corresponding to coordinate data

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