@ortho-earth/globe and @ortho-earth/core are now 2.2.
2.1 was about MapLibre. This release is about CesiumJS: the goal was to leave nothing that Cesium can do and Ortho Earth cannot.
Three packages are new: @ortho-earth/cesium, and the same idea for @ortho-earth/leaflet and @ortho-earth/gmaps.
1. CesiumJS code on the globe
@ortho-earth/cesium gives a namespace with the same names as CesiumJS 1.146's. Everything that does not draw (math, time, the camera, entities, CZML, the clock, ion, the widgets)
is Cesium's own code, unchanged. Only the drawing is the Ortho Earth globe. So Cesium code runs with only its import changed.
import * as Cesium from "@ortho-earth/cesium";
const viewer = new Cesium.Viewer("cesiumContainer");
The yardstick is Cesium's own 309 Sandcastle examples. Each one runs unchanged on real CesiumJS and on the globe, at the same time and from the same camera, and the two pictures are compared (297 of them are scored; the Moon and Mars, examples with no viewer and examples that start in 2D are left out). You can see every pair at /sandcastle.
| Level | First run (Oct 25) | 2.2 (Oct 31) |
|---|---|---|
| 3 Same picture | 23 | 190 |
| 2 Same answers | 120 | 107 |
| 1 Runs | 129 | 0 |
| 0 Does not run | 24 | 0 |
Every scored example now runs and gives the same answers as Cesium, and about two thirds draw the same picture. The last run was taken on a real GPU (WebGPU) with the same code that went to npm. To get there the engine itself learned a lot, and all of it is available from the plain globe API too:
- Model lighting with the sun, HDR and image-based light, shadows, and glTF features such as clearcoat and KTX2 textures.
- Screen effects (bloom, silhouettes, depth of field, lens flare, your own GLSL stages), particles, clouds and clustering.
- Terrain materials (elevation bands, contours, slope), ocean depths, a translucent globe and a camera that can go underground.
- 3D Tiles clipping by planes and polygons, imagery draped onto 3D Tiles, I3S, point-cloud and voxel data, Gaussian splats, and custom shaders (GLSL on WebGL2, translated to WGSL on WebGPU).
If you would rather move to the globe's own API, Coming from CesiumJS lists each Cesium call next to its counterpart.
2. Leaflet and Google Maps code, too
The same approach works for two more APIs. @ortho-earth/leaflet gives an L shaped like Leaflet 1.9's, and @ortho-earth/gmaps a google.maps.
Both draw on the globe, or on a flat MapLibre map if you prefer, and both change nothing but the import. The Google one needs no Google key for the map;
with your key it also relays Geocoder, Directions, Places and Street View to Google's own services.
Neither has a gallery of official examples yet, so Coming from Leaflet and Coming from Google Maps list exactly what is translated, and anything that is not is reported in the console when you run your code.
3. Same API as 2.1
Everything in 2.2 is added on top. Code written for 2.1 runs on 2.2 as it is.
npm i @ortho-earth/[email protected]
npm i @ortho-earth/cesium # CesiumJS code
npm i @ortho-earth/leaflet # Leaflet code
npm i @ortho-earth/gmaps # Google Maps code
Put together, it has started to look like a formula: Ortho Earth = MapLibre × Cesium − Mercator + α.