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.

PropertyTypeDescription
showboolean
PropertyTypeDescription
ellipsoidEllipsoid | undefinedEllipsoid used to project GeoJSON coordinates. Fixed at creation time.
allowPickingboolean | undefinedWhether features in the primitive can be picked. Fixed at creation time.
pickObjectFactory((…params: any[]) => any) | undefinedFactory invoked to build the picked-object payload. Fixed at creation time.

N/A

PropertyTypeDescription
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
suspenseboolean | undefinedOpt 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.
cacheKeystring | undefinedOverrides 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.
urlstring | Resource | undefinedURL to fetch GeoJSON from. Mutually exclusive with data — if both are set, url wins.
dataobject | undefinedInline GeoJSON FeatureCollection. Mutually exclusive with url.
onReady((primitive: GeoJsonPrimitiveShape) => void) | undefinedFires once the primitive is constructed, before it is attached to the scene’s primitive collection.
onError((err: unknown) => void) | undefinedFires if fromUrl rejects or the inline GeoJSON fails to parse.