The standalone Earth application. It composes independent globe, rendering, UI,
toolbar, scene and image libraries through their public packages. This repository
also keeps the foss-earth application and compatibility exports used by Campus
and Flight while they adopt the split libraries. Shared implementations live in
their own repositories.
The landing page is in
foss-earth.github.io, which
assembles this application's compiled build at /app/. Known application UX
follow-ups are in the TODO list.
Open + → Browser data to review clearing this site's saved settings, window layout, stored media and app caches, then reload. Keep API keys starts checked; uncheck it to remove the saved Google Maps and CARTO keys too. The review runs on a separate page before deleting data. This clears data for the current site origin, including other apps hosted on that origin.
After two failed or stalled starts, the page offers Download crash log and then
Clear browser data as a recovery option. The crash log is a .txt file of the failed
starts, the last failure's message and each visit's trail kept on the device; clearing
deletes those, so the review page offers the download again before its clear button.
The recovery code is included in the HTML, so the option can appear even
when the application bundle fails to load. You can also open the app address with
?resetBrowserData=1 to reach the review directly. A successful start resets the
failure count; data is cleared only after confirmation.
The browser's HTTP cache and cookies hidden from JavaScript require the browser's own site-data controls. The review explains this and reports any storage it could not clear.
Clone the Earth repositories side by side in a foss-earth folder, with
gamepad-tools in a Felipegalind0 folder next to it:
foss-earth/
app/ ui/ images/ weather/ about/ dev/ renderer/ sky/ toolbar/
cubemap/ equirectangular/ tiled-cubemap/ preview-sheets/ engine/ 360/
scenes/ browser-testing/
Felipegalind0/
gamepad-tools/
Then, in app/:
npm install
npm run devand open https://localhost:3600/app/. Development and preview default to port
3600 and stop if it is occupied; use -- --port <number> to choose another
port explicitly. Dev and preview share that port, so override one to run both
together. The sibling apps use 7470 (0SFS) and 8660 (UMN Tour). Restart an
existing server to use the new default; browser settings saved on an old port
remain on that old origin. npm run dev serves it
on the LAN by default and prints network links and terminal QR codes, over HTTPS with a self-signed certificate (vite/networkHttps.ts),
so a phone on the same Wi-Fi can open https://<this-machine>:3600/app/. Its
browser warns once per address; in Chrome, tap Advanced, then Proceed. After that
the page is secure, so it can use WebGPU, and with FOSS_EARTH_ISOLATION=enforce
it can share memory. FOSS_EARTH_DEV_HTTPS=off keeps plain HTTP. That page has
neither, and crypto.randomUUID is missing there. randomId in
src/app/randomId.ts uses crypto.getRandomValues instead, and startup depends
on that. The other commands are npm run typecheck,
npm run lint, npm test, npm run build (output in dist/, built for the
/app/ route) and npm run preview.
For local-only development use npm run dev -- --host localhost. HTTPS setup
requires openssl; startup fails clearly if a certificate cannot be created.
Use npm run llm-dev for automated checks, or npm run dev -- --no-qr,
to omit QR art while keeping HTTPS and network links.
The -- passes the flag through npm. Other Vite options still work, for example
npm run llm-dev -- --port 9000.
Normal npm run dev also reads GOOGLE_3D_TILES_KEY from the environment or
.env.local (this app first, then the linked FOSS Earth app). It appends
?gkey=YOUR_GOOGLE_MAPS_API_KEY to the printed startup URLs and the QR code.
Opening the link saves the key on that device and removes it from the address
bar. Use npm run dev -- --no-gkey to omit the key (--no-key also works).
npm run llm-dev omits both the key and QR output.
Manual ?gkey=YOUR_GOOGLE_MAPS_API_KEY links save a key on the device and remove
it from the address bar. Existing ?key= / ?googleKey= links and saved keys
still work; gkey takes precedence. Existing FOSS_EARTH_GOOGLE_KEY environment
setups are accepted as a legacy fallback.
QR codes appear automatically in interactive terminals and are omitted from
captured output and CI logs. FOSS_EARTH_DEV_QR=on npm run dev forces a QR when
output is redirected; --no-qr takes precedence. Agents stop their temporary
servers after checking; to test a change yourself, run npm run dev in this
repo in your own terminal.
Publishing https://foss-earth.github.io/ is a separate step, from any directory:
cd ~/gh/foss-earth/app && npm run build
cd ../foss-earth.github.io && npm run build && npm run deployThe campus tour links this checkout, so it is published on its own afterwards
with cd ~/gh/UMN-VR/tour && npm run deploy. The steps are in
Deploying to GitHub Pages.
npm run dev serves an emulated headset, Meta's Immersive Web Emulation
Runtime (iwer), to a page opened with ?headsetEmulator=quest2 (or quest3,
questPro, visionpro). An unknown name is refused. Quest profiles have
controllers. visionpro has none: a pinch is the only pointer, and only while
the pinch lasts. The VR tab lists the controls of the headset that is
presenting. A page such as https://localhost:3600/app/?headsetEmulator=quest2
then runs as it does on a headset: the VR tab opens, and Enter VR draws both
eyes side by side over the page. From the console,
__fossEarthHeadsetEmulator moves the headset and controllers and presses
their buttons, e.g.
__fossEarthHeadsetEmulator.remote.dispatch("set_transform", { device: "headset", orientation: { x: 0, y: 0.383, z: 0, w: 0.924 } })
turns the head 45° to the left, and
__fossEarthHeadsetEmulator.controllers.right.updateButtonValue("trigger", 1)
pulls the right trigger. A build never contains it (vite/headsetEmulator.ts,
src/dev/headsetEmulator.ts).
npm run check:headset is the controller visit on Quest 2, in headless Chrome:
Enter VR, both eyes, a snap turn, a photograph opened with the trigger, a link
followed, the grip back to the map, and the session ended. --device=visionpro
is the controllerless visit: a pinch opens a photograph, follows a link, and
presses the toolbar.
--comprehensive runs Quest 2, Quest 3, and Vision Pro. The check starts its
own dev server and writes a report and screenshots to build/headset/<time>/.
--url= checks another page that mounts the app from a dev server with
headsetEmulator(), such as the tour's; --scene=page keeps that page's own
scene:
cd ~/gh/UMN-VR/tour && npm run dev
cd ~/gh/foss-earth/app && npm run check:headset -- --url=https://localhost:8660/tour/minneapolis/ --scene=pageThe emulator is not a headset: it checks what the page does with WebXR, not how a real device's browser, frame rate or lenses treat it.
The app uses every Earth library straight from its checkout. package.json links
each one (file:../ui), and Vite compiles their TypeScript, so a change in
../ui/src shows up in the running app without building or installing anything
in ui/. Only app/ has a node_modules: the libraries' imports of Babylon,
React and the rest resolve from it, so there is one copy of each.
- Each library's
package.jsonexports have asourcecondition that points at its TypeScript entry. vite.config.tsand the tsconfigs select that condition. During development, thelocalSource()Vite plugin resolves linked packages to their actual checkout files, so Vite watches edits and serves them without a cached dependency bundle. It still resolves their dependencies through this app'snode_modules. Public CSS exports also resolve to their source stylesheets, in development and production builds, including nested CSS@imports that otherwise select built files..npmrcpasses the same condition to Node, which loads the libraries' Vite plugins from source;vite/sourceImports.mjslets their.jsimport names find the.tsfiles.
Apps using the linked foss-earth checkout should import localSource from
foss-earth/vite and add localSource() to their Vite plugins too. Selecting
the source condition alone does not prevent Vite from caching linked packages
under node_modules.
A library's own tests and build don't run on their own yet: the libraries still
name each other by version, and those versions are not published. Linking them
to their siblings the same way is the next step. If a library has its own
node_modules, its own tests and build use that installation; localSource()
keeps the development app on its shared installation. Using pinned releases or
GitHub-hosted builds of the libraries instead of local source is planned but not
available yet.
mountGlobeApp creates the app and composes the shared overlay. createGlobeApp
exposes the host integration handle. The foss-earth/runtime, /shell,
/scenes, /settings, /input, /diagnostics and /vite exports are
compatibility surfaces; new integrations should use the owning package and
explicit host ports. The Vite plugins keep app-file caching and build
descriptions. The compatibility source exports need a TypeScript-aware bundler;
they are not native Node JavaScript entries.
Hosts add their own controls through hostTabs on mountGlobeApp or
createGlobeApp. They appear in the existing + menu and use the shared
windows' docking and saved layout:
import { mountGlobeApp } from "foss-earth";
const makerspaces = document.createElement("section");
makerspaces.textContent = "Choose a makerspace";
await mountGlobeApp(document.querySelector<HTMLElement>("#app")!, {
hostTabs: [{ id: "host:makerspaces", label: "Makerspaces", element: makerspaces }],
});Use a unique host: ID followed by letters, digits, dots, hyphens or underscores.
Each element must belong to the app's document and be separate from its root and
every other host tab's content. Create and wire it before mounting; metadata is
snapshotted at startup. The shared tabs move the original element, preserving
its state and listeners when closed and reopened.
The app owns URL and saved-setting policy, page identity, browser ports, example content and feature composition. The libraries own the rest:
-
Engine: Map, Location and globe input.
-
Renderer: presentation and lifecycle.
-
Sky: Sky and Date and time.
-
Scenes: scene documents and placements.
-
360: sphere viewing.
-
Image structures and preview preparation each have their own library.
-
About and Dev receive application data and contributions.
?dev=1enables Dev.
Image links are editable in Scenes → Image links in local development or with
?dev=1. Choose source and destination photographs, add a one-way or two-way
connection, and follow it immediately. Nearby destinations appear first, with
their distance. Hotspots point toward the destination's capture location. Edits
are saved per scene URL in this browser and also apply on ordinary visits.
Download links or Copy JSON exports foss-earth-link-overrides version 1 for a
scene's build tools to import; hosts can set linkExportPrefix on mountGlobeApp.
Remove and Reset this scene affect local additions; authored scene links remain.
Once a loaded scene authors a saved addition, the browser forgets that addition.
Inside a sphere, the position readout uses the picture's capture coordinates and height, with live heading, pitch and vertical FOV in degrees. Unknown capture height shows a dash. Clicking the readout opens the picture's tab; leaving the picture restores the globe's position, camera altitude and zoom distance.
Weather currently provides manual wind only. Forecast, provider, cloud and extra turbulence features are not implemented. For the full ownership, tab and image specifications and the UI and rendering guidance, see the documentation repository.
Keep NOTICE, commercial licensing and asset-specific provenance with the original materials. The application's license does not relicense third-party imagery, data or fork assets.