X-GIS

Introducing X-GIS

A language for
cartography

Declare what your map should look like. The compiler emits the WGSL shaders, buffer layouts, and projection math.

source land {
  type: geojson
  url: "data/land.geojson"
}

layer continents {
  source: land
  | fill-zinc-200
}
Compiling…
Source · land.geojsonProjectionGlobe

Drag, zoom, explore.  See more examples

WebGPU  ·  Seven projections  ·  MIT

02 ·  What It Is

A language, a compiler, and a globe.

X-GIS is three things in one project: a way to describe a map, the compiler that turns that description into GPU programs, and the engine that draws it — flat or on a globe.

Language

A declarative language.

Write fill-zinc-200, stroke-1, opacity-80 — the source reads like the map you see. No imperative setter chains, no callback graph. A .xgis file is the whole style.

Compiler

A GPU compiler.

X-GIS compiles that source to WGSL shaders, buffer layouts, projection math, and a render plan — optimized at compile time. You never hand-write a vertex shader.

Engine

A real 3D globe.

It renders to a true ellipsoidal globe and seven projections. One source goes from a flat Mercator map to an orthographic globe on a uniform write — no re-tessellation.

03 ·  Show The Compiler

From source to shader.

The hero globe above is not a video — it is this exact source, compiled in your browser. Here is what the compiler does with it.

Input · land.xgis source
source land {
  type: geojson
  url: "data/land.geojson"
}

background { fill: #0a0a0a }

layer continents {
  source: land
  | fill-zinc-200
}
The pipeline
  1. lexer
  2. parser
  3. IR
  4. optimizer
  5. WGSL + GLSL

The source is tokenized, parsed, and lowered to one typed IR, optimized, then emitted as WGSL (WebGPU) and GLSL ES 3.00 (WebGL2) — all at compile time, before a single frame draws.

Watch it compile, live

Real tokens → AST → IR → plan → WGSL, recompiled as you type.

04 ·  It Becomes Shaders

One IR. Two GPU targets.

TypeScript becomes JavaScript. X-GIS becomes GPU shaders. A single typed shader IR is optimized once, then emitted to two backends — so the same map runs on WebGPU and falls back to WebGL2 without a rewrite.

Source

One typed IR.

The compiler builds a single intermediate representation of every shader — typed, backend-agnostic, optimized before either target is touched.

const-foldcopy-propCSELICMDCE
WebGPU

WGSL

The primary path — the modern GPU API. Emitted from the IR, byte-stable across builds.

WebGL2 fallback

GLSL ES 3.00

The same IR, the same program — re-emitted as #version 300 es so the map still runs where WebGPU is absent.

05 ·  Mapbox-Compatible

Bring your Mapbox style.

The converter reads a real Mapbox Style Spec document and emits .xgis. It is not a full reimplementation — it is honest about what it covers, and it covers most of it.

176
Properties supported
of 236 applicable · 75%
+18
Partial
lossy or runtime gap
119
Layer basemap
OpenFreeMap, rendered today
Sources
  • GeoJSON
  • PMTiles (MVT)
  • Raster XYZ
  • Inline data
Layer types
  • fill
  • line
  • symbol
  • circle
  • text (SDF)
  • heatmap
  • fill-extrusion
Projections
  • Mercator
  • Natural Earth
  • Orthographic
  • Equirectangular
  • Stereographic
  • Azimuthal eq.
  • Oblique Mercator
Expressions
  • interpolate(zoom)
  • interpolate(.prop)
  • match()
  • filter:
  • preset / apply

06 ·  Roadmap

Where it's headed.

Honest direction — what's shipping and what's next, no dated promises.

01

Google-Earth-class 3D globe

Terrain, 3D tiles, streaming + LOD, and a fly-to camera on top of the ECEF globe that renders today.

In progress
02

Custom layers

Draw your own three.js / Babylon.js / raw-WebGPU content on the map — the engine already exposes the render-pass seam to plug into.

Planned
03

Full Mapbox parity

Close the gap from 176 supported to all 236 applicable style-spec properties.

In progress
04

Embeddable engine

The @xgis/engine + @xgis/map packages exist — harden the boundary so the renderer drops into any app.

In progress
See the full roadmap

08 · Get Started

Clone, install, run.

npm release is in flight; for now the playground is the way in.

$ git clone https://github.com/X-GIS/X-GIS cd X-GIS bun install bun run dev

Bun workspace · dev server boots the playground at localhost:3000

import { XGISMap } from "@xgis/runtime"

const map = new XGISMap(canvas)
await map.run(source, baseUrl)

Requires a WebGPU-capable browser — Chrome, Edge, or Safari 18+