Skip to content

KmlDataSource

KmlDataSource provides the way to load and show KML data into the scene. Both KML and KMZ are supported, and can be loaded from a URL, string or raw object.

Inside Viewer or CesiumWidget components.

PropertyTypeDescription
showboolean
clusteringEntityCluster
namestring
PropertyTypeDescription
ellipsoidEllipsoid | undefined
canvasHTMLCanvasElement | undefined
cameraCamera | undefined
creditCredit
sourceUristring | undefined
clampToGroundboolean | undefined
screenOverlayContainerstring | Element | undefined
PropertyTypeDescription
onChange((kmlDataSource: KmlDataSource) => void) | undefined
onError((kmlDataSource: KmlDataSource, error: any) => void) | undefined
onLoading((kmlDataSource: KmlDataSource, isLoaded: boolean) => void) | undefined
onRefresh((kmlDataSource: KmlDataSource, urlComponent: string) => void) | undefined
onUnsupportedNode((kmlDataSource: KmlDataSource) => void) | undefined
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.
onLoad((kmlDataSouce: KmlDataSource) => void) | undefinedCalls when the Promise for loading data is fullfilled.
datastring | Resource | Document | Blob | undefined