{t("addData.czml.hint")}
+- {t("style.selectedLayerType", { type: layer.type })} + {t("style.selectedLayerType", { type: isCzmlScene ? "czml" : layer.type })}
); diff --git a/apps/geolibre-desktop/src/i18n/locales/en.json b/apps/geolibre-desktop/src/i18n/locales/en.json index 79723a04a..7092209e8 100644 --- a/apps/geolibre-desktop/src/i18n/locales/en.json +++ b/apps/geolibre-desktop/src/i18n/locales/en.json @@ -351,6 +351,10 @@ "cesiumIon": { "label": "Add Cesium Ion Asset", "description": "Add a 3D Tiles tileset or imagery from Cesium Ion by asset id. Renders on the 3D globe with your Cesium Ion token." + }, + "czml": { + "label": "Add CZML Dynamic 3D Layer", + "description": "Load a dynamic Cesium Language (CZML) document describing orbits, trajectories, vehicle paths, and time-varying 3D scenes on the globe." } }, "shared": { @@ -420,6 +424,20 @@ "errorAltitude": "Enter the altitude offset as a number of metres.", "tokenMissing": "No Cesium Ion token is configured. Add one in Settings → Environment variables (VITE_CESIUM_TOKEN) or the asset will fail to load." }, + "czml": { + "defaultName": "CZML Dynamic Scene", + "url": "CZML URL", + "sourceModeUrl": "URL", + "sourceModeFile": "Local file", + "file": "File", + "quickPicks": "Sample dynamic scenes", + "hint": "CZML streams or files define dynamic 3D positions, animations, and orbits synchronized with the globe clock.", + "errorUrl": "Enter a valid CZML endpoint URL.", + "errorChooseFile": "Select a CZML (.czml or .json) file to load.", + "errorFileMissing": "The selected file could not be read.", + "errorInvalidCzml": "The file does not contain a valid CZML document (expected JSON array or packet object).", + "readError": "Failed to read CZML data." + }, "xyz": { "defaultName": "XYZ Layer", "sampleLabel": "USGS imagery", @@ -2508,6 +2526,7 @@ "video": "Video Layer", "deckglViz": "Deck.gl Layer", "cesiumIon": "Cesium Ion Asset", + "czml": "CZML Dynamic 3D Scene", "gltfModel": "3D Model (glTF)", "postgres": "PostgreSQL Layer", "iceberg": "Apache Iceberg Layer" diff --git a/apps/geolibre-desktop/src/lib/ui-profile.ts b/apps/geolibre-desktop/src/lib/ui-profile.ts index 0701d3f9d..55e75efbe 100644 --- a/apps/geolibre-desktop/src/lib/ui-profile.ts +++ b/apps/geolibre-desktop/src/lib/ui-profile.ts @@ -154,6 +154,12 @@ export const DATA_SOURCE_CATALOG: readonly DataSourceCatalogEntry[] = [ labelKey: "toolbar.layerType.cesiumIon", tier: "advanced", }, + { + id: "czml", + section: "threeD", + labelKey: "toolbar.layerType.czml", + tier: "advanced", + }, { id: "gltf-model", section: "threeD", diff --git a/docs/mcp.md b/docs/mcp.md index 0f3e37229..30c5bc37e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -104,6 +104,7 @@ Give it a directory meant for maps, not your home directory. | `add_ogc_layer` | WMS and WMTS endpoints. | | `add_3d_tiles_layer` | OGC 3D Tiles tilesets, by URL or Cesium Ion asset id. | | `add_cesium_ion_layer` | Cesium Ion assets (tileset or imagery) by id; rendered by the 3D globe only. | +| `add_czml_layer` | A CZML (Cesium Language) dynamic 3D scene, by URL or inline packets; rendered by the 3D globe only. | ### Editing diff --git a/docs/python.md b/docs/python.md index 91f84a025..990d36aec 100644 --- a/docs/python.md +++ b/docs/python.md @@ -296,6 +296,7 @@ m.on_layer_change(lambda e: print("layers", e["layerIds"])) | `add_raster(source, name=, bands=, colormap=, rescale=, array_args=, **style)` | Add a COG/GeoTIFF URL or path, or an xarray DataArray/Dataset (xarray needs `geolibre[raster]`). | | `add_3d_tiles(url=None, name=, ion_asset_id=, altitude_offset=, request_headers=, **style)` | Add a 3D Tiles `tileset.json` URL, or a Cesium Ion tileset by asset id (3D globe only). | | `add_cesium_ion(asset_id, name=, kind="3d-tiles", altitude_offset=, **style)` | Add a Cesium Ion asset by id: a 3D Tiles tileset or (`kind="imagery"`) an imagery layer. Renders on the 3D globe, with the app's Ion token. | +| `add_czml(url=None, name=, data=, source_path=, **style)` | Add a CZML (Cesium Language) dynamic 3D scene by URL or inline packets: orbits, vehicle tracks, moving models. Renders on the 3D globe, which follows the document's clock. | | `add_video(urls, coordinates, name=, **style)` | Add a georeferenced video (four `[lng, lat]` corners). | | `add_basemap(basemap)` | Set the background basemap. | | `split_map(left_layers=None, right_layers=None, orientation=, position=, control_position=)` | Add a swipe (split-map) comparison slider between two layer sets. | diff --git a/packages/core/src/cesium-ion.ts b/packages/core/src/cesium-ion.ts index aefd9a6ba..ac5605b36 100644 --- a/packages/core/src/cesium-ion.ts +++ b/packages/core/src/cesium-ion.ts @@ -1,3 +1,4 @@ +import { isCzmlLayer } from "./czml"; import { DEFAULT_LAYER_STYLE, type GeoLibreLayer } from "./types"; // Cesium Ion assets (issue #2290): 3D Tiles and imagery referenced by Ion @@ -57,7 +58,7 @@ export function cesiumIonAssetKind(layer: Pick