Skip to content

RectanglePrimitive (Rectangle Primitive Vector Object) ​

Rectangle primitive vector object.

Constructor ​

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

Parameters ​

StyleOptions ​

ParameterTypeDefaultDescription
materialTypeString"Color"Fill material type, options: MaterialType
materialMaterial-Material used for filling
colorString/Cesium.Color"#3388ff"Color
opacityNumber1.0Opacity, range 0.0-1.0
imageString-URL of texture when using texture mapping
outlineBooleanfalseWhether to have outline
outlineColorString/Cesium.Color"#ffffff"Outline color
outlineOpacityNumber0.6Outline opacity
heightNumber0Elevation, height of rectangle relative to ellipsoid surface
diffHeightNumber100Height difference (corridor's own height), mutually exclusive with extrudedHeight
extrudedHeightnumber-Specify height of extruded surface relative to ellipsoid
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
hasShadowsBooleanfalseWhether to cast shadows
shadowsCesium.ShadowModeCesium.ShadowMode.DISABLEDSpecify whether object casts or receives shadows from light sources
clampToGroundBooleanfalseWhether to clamp to ground
classificationTypeCesium.ClassificationTypeCesium.ClassificationType.BOTHSpecify coverage type when clamped to ground
classificationBooleanfalseWhether it is ClassificationPrimitive
setHeightNumber0Specify coordinate height value (commonly used in layer configuration)
addHeightNumber0Height value added to existing coordinates (commonly used in layer configuration)
labelLabelPrimitive.StyleOptions-Support for additional text display

Constructor Parameters ​

ParameterTypeDescription
positionsLatLngPoint[]/Cesium.Cartesian3[]Coordinate position
rectangleCesium.Rectangle/Cesium.PositionPropertyRectangle extent, mutually exclusive with positions
styleRectanglePrimitive.StyleOptionsStyle information
attrObjectAdditional attribute information, can add any attributes

Properties ​

PropertyTypeDescription
areanumberArea (unit: square meters)
attranyAttribute information
centeranyCenter point coordinates (Cartesian coordinates)
centerOfLineanyCenter point coordinates of edge line
centerPointLatLngPointCenter point coordinates (latitude and longitude coordinates)
distancenumberDistance (unit: meters)
idanyObject id identifier
isAddedbooleanWhether added to layer
isDestroybooleanWhether destroyed
labelanyAdditional label text object
nameanyName (can be repeated)
pointsLatLngPoint[]Position coordinate array
rectangleRectangleRectangle boundary corresponding to coordinate data
showanyShow/hide state
styleanyStyle information

Methods ​

addEventListener ​

Add feature events

ts
addEventListener(types: any, fn: any, context?: any): this

clampToGround ​

Asynchronously calculate and update coordinates for ground clamping (or model clamping)

ts
clampToGround(options?: any): BillboardPrimitive

clear ​

Clear features

ts
clear(): void

closeHighlight ​

Clear selected highlight

ts
closeHighlight(): void

destroy ​

Destroy features

ts
destroy(noDel?: boolean): void

flyTo ​

Fly to view angle where data is located

ts
flyTo(options?: any): undefined | BillboardPrimitive

getCenterOfMass ​

Internal center point coordinates of enclosed surface

ts
getCenterOfMass(): any

getCoordinates ​

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(): any

once ​

Event that is destroyed after being executed once

ts
once(types: any, fn: any, context?: any): this

isInPoly ​

Determine if point is inside polygon formed by current object's coordinate points

ts
isInPoly(position: any): boolean

removeEventListener ​

Remove feature events

ts
removeEventListener(types: any, fn: any, context?: any): this

setOptions ​

Set options parameters

ts
setOptions(options: { attr: any; position: any; positions: any; style: any }): this

setPositions ​

Set position coordinates (Cartesian coordinates), can pass LatLngPoint object when assigning

ts
setPositions(value: any): void

setStyle ​

Set style information

ts
setStyle(newStyle: any): this

toGeoJSON ​

Convert to GeoJSON data

ts
toGeoJSON(options: any): object

toWKT ​

Convert to WKT data

ts
toWKT(options: any): any

remove ​

Remove object

ts
remove(): void