The same things, written with Ortho Earth
3D Tiles · I3S · quantized-mesh terrain · glTF/GLB · WGS84 ellipsoid · CZML · the clock
Ortho Earth is a 3D globe map engine for the browser (WebGPU with a WebGL2 fallback) whose API follows MapLibre GL JS.
Many of the things you do in CesiumJS have a counterpart here. This page lists them side by side: what you write in CesiumJS, what you write in Ortho Earth,
and a page where you can see it running. All examples assume const map = await createGlobe({ target: "#map" })
from npm i @ortho-earth/globe.
If you would rather not rewrite anything, npm i @ortho-earth/cesium gives a namespace with the same names as CesiumJS 1.146's.
Everything that does not draw (math, time, Camera, Entity, CZML, GeoJSON and KML data sources, the clock, ion, the widgets) is Cesium's own code, unchanged;
only Viewer and what it draws are replaced with the Ortho Earth globe. Only the import changes:
import * as Cesium from "@ortho-earth/cesium";
const viewer = new Cesium.Viewer("cesiumContainer");
const tileset = await Cesium.Cesium3DTileset.fromUrl("tileset.json");
viewer.scene.primitives.add(tileset);
await viewer.zoomTo(tileset);
The yardstick is CesiumJS's own 309 Sandcastle examples, run unchanged on real Cesium and on the globe and compared picture by picture: see them side by side at /sandcastle.
What is not drawn yet is reported once in the console as [csshim] unsupported: …, and viewer.orthoMap is the globe underneath.
The tables below are for moving to the globe's own API instead.
| Topic | CesiumJS | Ortho Earth | See it |
|---|---|---|---|
| 3D Tiles | await Cesium3DTileset.fromUrl(url) + scene.primitives.add(tileset) | await map.add3DTiles(url) | The Netherlands in 3D (PDOK 3D Basisvoorziening tileset) |
| I3S scene layers | I3SDataProvider.fromUrl(url) | await map.addI3S(url) | — |
| quantized-mesh terrain | CesiumTerrainProvider.fromUrl(url) | map.setTerrain({ source: { type: "quantized-mesh", url: ".../layer.json" } }) | quantized-mesh example |
| Cesium ion terrain | CesiumTerrainProvider.fromIonAssetId(id) | map.setTerrain({ source: { type: "quantized-mesh", ion: { assetId, accessToken } } }) | — |
| Ellipsoidal vs orthometric heights | heights above the ellipsoid | heights: "ellipsoidal" (default; a bundled EGM96 geoid turns them into elevations) or "orthometric" | — |
| Draping onto 3D Tiles / terrain | new ClassificationPrimitive({ geometryInstances, classificationType: ClassificationType.CESIUM_3D_TILE }) / GroundPrimitive | map.addClassification(geojson, { color, type: "tiles3d" }) (type "both" (default), "terrain" or "tiles3d"; lines become width-metre ribbons; the handle has setStyle, setData, remove) | — |
| Height on 3D Tiles / models | scene.sampleHeightMostDetailed(cartos) / scene.clampToHeight(pos) | await map.sampleHeight([[lng, lat], …]) → { height, source: "tiles3d"|"model"|"terrain", id, featureId } (misses fall back to terrain; tiles without feature IDs need add3DTiles(url, { pickable: true }) to keep a CPU copy) | — |
| Polygon clipping | new ClippingPolygonCollection({ polygons: [new ClippingPolygon({ positions })], inverse }) | map.setClipping({ polygon: GeoJSON Polygon or ring array, inverse }) (removes the inside; inverse: true keeps only the inside; concave shapes OK; up to 64 vertices; combines with planes such as vertical). WebGL2 also clips terrain, buildings, models and the basemap (gint layers and overlays are WebGPU only) | — |
| Vertical exaggeration | scene.verticalExaggeration = 3 | map.setTerrainExaggeration(3) or map.setTerrain({ source, exaggeration: 3 }) (default 1 = true scale; buildings, models and labels on the terrain are lifted with the ground, their own heights are not stretched) | — |
| glTF / GLB models | Model.fromGltfAsync({ url, modelMatrix }) | await map.gadget.model(url, { at: [lon, lat], heading, scale }) — a CESIUM_RTC or ECEF placement in the file wins | GLB models |
| three.js in the scene | — | map.addThree({ three, module }) — runs in the render worker, on the same camera, hidden by terrain and buildings | 3D Tiles with three.js |
| Topic | CesiumJS | Ortho Earth | See it |
|---|---|---|---|
| WGS84 ellipsoid | Ellipsoid.WGS84 (always) | createGlobe({ ellipsoid: true }) or ?ell=1; "auto" (default) uses the ellipsoid on capable desktops. Measurements are always WGS84 | Japan on the ellipsoid |
| Fly the camera | camera.flyTo({ destination }) | map.flyTo({ center: [lon, lat], zoom, pitch, bearing }) | Globe |
| Set the camera | camera.setView({ destination, orientation }) | map.jumpTo({ … }) or map.setCamera({ lng, lat, height, heading, pitch, roll }) | — |
| Follow a moving object | viewer.trackedEntity = entity | map.follow(target) — a point, a function of time, or the id of a loaded CZML track | Satellites |
| Look at a point | camera.lookAt(target, offset) | await map.lookAt(target) | — |
| Topic | CesiumJS | Ortho Earth | See it |
|---|---|---|---|
| The clock | viewer.clock | map.clock — one clock for the night side, the stars, satellites and timed data | World clock |
| Clock range | clock.clockRange = ClockRange.LOOP_STOP | map.clock.setRange(start, end, "loop") — "clamped", "loop", "unbounded" (the CZML names are accepted too) | — |
| CZML | CzmlDataSource.load(url) | const h = await map.loadCZML(url | packets | file) (or drop a .czml file on the map): sampled positions play on map.clock with the same interpolation (ECEF, linear / Lagrange); points, billboards, labels and paths, model (static or moving; orientation as unitQuaternion or velocityReference, heading only), polyline (on the ground, or in 3D with height along great circles) and polygon / rectangle (color, outline, extrudedHeight) are drawn while available; the document clock is copied to the map clock. h.remove() clears it | ortho-japan (drop a file) |
| Sun and shadows | viewer.shadows = true | await map.sunShadow({ mode: "instant" }) or "duration" (hours of shadow) | — |
| Visibility analysis | — | map.viewshed() · map.lineOfSight(a, b) | — |
style.json, setPaintProperty and queryRenderedFeatures work as in MapLibre GL JS. If you also know MapLibre, see From MapLibre GL JS.map.overlay(module), map.addThree() or a custom layer with a url.
The full list of methods is in the package's type definitions (@ortho-earth/globe/globe.d.ts) and the
engine overview. Step-by-step setup is in Build with Ortho Earth.