Overview
Section titled “Overview”CZMLPlugin shows CZML documents whose shapes stay in place while their style or their visibility changes over time: extruded polygons whose height and color are sampled, polylines whose color is sampled, and polygons, polylines, labels, points and billboards shown only during the availability of their packet.
load() reads a document, adds its polygons, polylines, labels, points and billboards as layers, and returns a CZMLDocument, which keeps the document’s clock. While the document plays, each value moves from one sample to the next as a transition blended on the GPU. Its features are evaluated again only when the playback passes a sample time or the start or stop of an availability, and when it is paused, moved or changes speed.
Only part of CZML is supported. See Supported CZML.
import ThreeView from "@navaramap/three";import { DefaultPlugin } from "@navaramap/three-default-plugin";import { CZMLPlugin } from "@navaramap/three-plugins";
const view = new ThreeView({ container });
const czml = new CZMLPlugin();
view.addPlugin(new DefaultPlugin());view.addPlugin(czml);await view.init();
// Polygons are shaded by the scene lightsview.atmosphere.date = new Date("2026-07-16T03:00:00Z");view.addLight({ ambient: { intensity: 0.6 } });view.addLight({ sun: { intensity: 1.8 } });
const doc = await czml.load({ url: "https://example.com/population.czml" });
// Play one hour of the document per seconddoc.play({ speed: 60 * 60 });Supported CZML
Section titled “Supported CZML”| CZML | Shown as |
|---|---|
polygon with an extrudedHeight, constant or sampled | A polygon extruded from the ellipsoid up to extrudedHeight |
polygon with perPositionHeight | A polygon at the heights of its positions |
polygon with perPositionHeight and an extrudedHeight | A polygon filled from a flat bottom at extrudedHeight up to the heights of its positions |
polyline | A polyline at the heights of its positions |
polyline with clampToGround | A polyline draped on the surface |
label with a constant position | A text label at the height of its position, in a registered font |
point with a constant position | A circle at the height of its position, pixelSize across |
billboard with a constant position and image | The image at the height of its position, facing the screen |
material.solidColor.color as rgba or rgbaf, constant or sampled | Color and opacity. An unset material is opaque white |
availability of one interval | The packet is hidden outside the interval |
clock of the document packet | CZMLDocument.clock |
Positions are constant, given as cartographicDegrees or cartographicRadians. Polygons can have holes.
Supported CZML lists the status of every packet property, graphics type and graphics property, together with what is left out with a console warning.
Related Resources
Section titled “Related Resources”- API: the methods and properties of
CZMLPluginandCZMLDocument - Showing CZML: labels, points and billboards, flood polygons and how the shapes are drawn
- FeatureEvaluator: the transitions the plugin plays the samples with
- Supported CZML: the status of every CZML property
- Layer: the handles in
CZMLDocument.layers - three_flood_mesh: flood simulations played with a continuous water surface
- About three_plugins: Package overview