Skip to content

GeoJsonPrimitive

GeoJsonPrimitive is a high-throughput companion to GeoJsonDataSource that loads GeoJSON directly into BufferPointCollection/BufferPolylineCollection/ BufferPolygonCollection, bypassing the entity/DataSource layer.

This API is experimental and subject to change without standard deprecation.

Inside Viewer or CesiumWidget component. A GeoJsonPrimitive object will be attached to the PrimitiveCollection of the Viewer or CesiumWidget.

Property Type Description
show boolean
Property Type Description
ellipsoid Ellipsoid | undefined Ellipsoid used to project GeoJSON coordinates. Fixed at creation time.
allowPicking boolean | undefined Whether features in the primitive can be picked. Fixed at creation time.
pickObjectFactory ((…params: any[]) => any) | undefined Factory invoked to build the picked-object payload. Fixed at creation time.

N/A

Property Type Description
onClick ((movement: CesiumMovementEvent, target: T) => void) | undefined
onDoubleClick ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMouseDown ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMouseUp ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMiddleClick ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMiddleDown ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMiddleUp ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMouseMove ((movement: CesiumMovementEvent, target: T) => void) | undefined
onPinchEnd ((movement: CesiumMovementEvent, target: T) => void) | undefined
onPinchMove ((movement: CesiumMovementEvent, target: T) => void) | undefined
onPinchStart ((movement: CesiumMovementEvent, target: T) => void) | undefined
onRightClick ((movement: CesiumMovementEvent, target: T) => void) | undefined
onRightDown ((movement: CesiumMovementEvent, target: T) => void) | undefined
onRightUp ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMouseEnter ((movement: CesiumMovementEvent, target: T) => void) | undefined
onMouseLeave ((movement: CesiumMovementEvent, target: T) => void) | undefined
suspense boolean | undefined Opt in to React Suspense for async loading. When enabled and the data is aURL or Resource, it is fetched during render so a parent <Suspense>boundary can show a fallback and a parent error boundary can catch failures.
cacheKey string | undefined Overrides the Suspense cache key (defaults to the resolved URL). Change it tobust the cache when the content at a stable URL changes, or share it acrosscomponents to dedupe a fetch. Only used when suspense is enabled.
url string | Resource | undefined URL to fetch GeoJSON from. Mutually exclusive with data — if both are set, url wins.
data object | undefined Inline GeoJSON FeatureCollection. Mutually exclusive with url.
onReady ((primitive: GeoJsonPrimitiveShape) => void) | undefined Fires once the primitive is constructed, before it is attached to the scene’s primitive collection.
onError ((err: unknown) => void) | undefined Fires if fromUrl rejects or the inline GeoJSON fails to parse.