跳到正文
DEV Community· Kenji Yoshida·· 3 小時前AI 評分56

Ortho Earth 推出支援 MapLibre 和 CesiumJS 程式碼的 WebGPU 地球引擎

Ortho Earth: a WebGPU globe where MapLibre and CesiumJS code run unchanged

AI 導讀

Kenji Yoshida 推出 Ortho Earth,一款以 WebGPU 為先的瀏覽器 3D 地球引擎,可直接執行未修改的 MapLibre GL JS 和 CesiumJS 程式碼。

正文

I've been building Ortho Earth, a 3D globe map engine that runs in the browser.

maplibre × cesium − mercator + α

That line is the whole idea:

  • maplibre — code written for MapLibre GL JS runs on it, unchanged, after one import.
  • cesium — code written for CesiumJS runs on it too.
  • − mercator — there is no flat Mercator mode. The map is always a round globe, from the whole planet down to a street corner. When you do want a flat world map, it uses Equal Earth, which keeps every country's area true.
  • + α — an architecture of its own: WebGPU first, and all the drawing done off the main thread.

👉 https://www.ortho-earth.com/

Your MapLibre code, on a globe

import * as maplibregl from "@ortho-earth/globe/maplibre"; // was "maplibre-gl"

const map = new maplibregl.Map({
  container: "map",
  style: "https://demotiles.maplibre.org/style.json",
  center: [139.77, 35.68],
  zoom: 4,
});

"Runs unchanged" is easy to claim, so I measured it. Every official MapLibre GL JS example runs, unmodified, next to the real MapLibre GL JS 6.11.2, and a script compares the two. Of 137 graded examples, 91 draw the same picture, 43 give the same answers with a different picture, 3 run only in part, and none fail to run. Every example is on one page with its score, its source and a Run button:

https://www.ortho-earth.com/maplibre/

The official MapLibre example "Display buildings in 3D": real MapLibre GL JS on the left, the same code on Ortho Earth on the right

Your CesiumJS code, too

import * as Cesium from "@ortho-earth/cesium"; // was "cesium"

const viewer = new Cesium.Viewer("cesiumContainer");

Here CesiumJS itself still does the time, orbits, camera and data loading. Ortho Earth only takes over the drawing. I compared all 304 Sandcastle examples with real CesiumJS 1.146.0, same clock and same camera: 264 draw the same picture, 40 give the same answers, none fail to run.

https://www.ortho-earth.com/sandcastle/

The CesiumJS Sandcastle example "3D Tiles Photogrammetry Classification": real CesiumJS on the left, the same code on Ortho Earth on the right

Why dropping Mercator made this possible

Most web maps are flat Mercator maps first, with a 3D globe added on top. Ortho Earth has only the sphere and one camera. Because of that, MapLibre's flat-map code and Cesium's 3D-Earth code end up drawing into the same world. It is one engine, not two glued together.

The same MapLibre heatmap code: a flat map in MapLibre GL JS on the left, a round globe in Ortho Earth on the right

It also means a few things just come out right: countries keep their real sizes side by side, the shortest route between two cities is drawn as the arc it really is, and terrain is shown at true scale, never exaggerated.

Made to work with AI agents

Today a lot of map code is written by AI coding agents, and they often guess. So Ortho Earth tries to leave them nothing to guess:

  • They already know the API. It speaks MapLibre GL JS and CesiumJS, which agents have seen in years of public code.
  • One recipe, tested. Build with Ortho Earth is written for people and agents alike, and every step is run by an automated test against the published npm packages.
  • No keys. No API key, no account, no tile server. Public data is read straight from the browser.
  • An MCP server. Add https://www.ortho-earth.com/mcp to Claude Code, Cursor or VS Code (or run npx -y @ortho-earth/mcp). Seven read-only tools give the agent the current version, the tested setup, exact TypeScript declarations, the docs, and the graded answer to "does this official MapLibre or CesiumJS example actually run here?"
claude mcp add --transport http ortho-earth https://www.ortho-earth.com/mcp

To be clear about its scope: it is a reference server for writing code with Ortho Earth. It does not drive a live map or analyse data.

How it was built

I'm a retired engineer in Yokohama, Japan. My career was in semiconductors, but I have loved astronomy and maps since I was a child.

I started Ortho Earth on April 15, 2026, and I have not written a single line of its code by hand. My part was the core idea, the design decisions, and judging whether the picture on screen was right. Implementation and verification were done together with an AI (Claude).

An AI will happily write code all day, but it cannot decide what not to build. Exaggerated terrain, flashy colours, quick patches: those I turned down one by one. Dropping Mercator was one of those decisions.

+ α: its own architecture

The last term matters as much as the first three.

  • WebGPU first. The globe is drawn with WebGPU, and falls back to WebGL2 automatically where WebGPU isn't available. Shadows, ambient occlusion, atmospheric scattering and post effects (reflections, contact shadows, height fog, god rays, rain, a toon look) use WebGPU.
  • The main thread stays free. All drawing runs in a Web Worker on an OffscreenCanvas, and file conversion runs in workers too. Your page's own code and UI never wait for the map.
  • No server. Data stays as plain files and the browser reads them directly: 18 GIS formats in (Shapefile, GeoPackage and others), 14 out, plus 3D buildings, terrain and point clouds. No tile server, no account, no API key.

Things to try

Every recorded earthquake since 1967 on the Ortho Earth globe

Where it is behind

It is young (first commit in April 2026) and made by one person. The engine is GPL-3.0 (a commercial license is available), while MapLibre and CesiumJS use permissive licenses. There is no native mobile SDK. Shadows, ambient occlusion and the post effects need WebGPU.

Try it

npm i @ortho-earth/globe

Source: https://github.com/kenjiyoshidahome2026-bit/ortho-earth

If you run your own MapLibre or CesiumJS code on it and something looks different, I'd really like to hear about it.

來源:DEV Community · dev.to