You can render a live planet in the browser at 60 frames per second — even with tens of thousands of points on it — if you treat the map as a WebGL scene with a strict 16.6 ms frame budget, not as a pile of DOM elements. The trick is sending the GPU one big buffer, clustering aggressively at low zoom, and never doing layout work inside the render loop.

I learned this building WorldEye, a real-time globe layering 74,229 live public cameras with flights, satellites, weather, earthquakes and fires. Browsing is free — spin and explore without an account; unlimited camera opens require an upgrade. Either way, a mid-range phone must draw a textured sphere and live tiles without dropping to a slideshow.

The frame budget is not a metaphor

At 60 FPS you have 16.6 ms per frame for everything: JavaScript, layout, paint, GPU work. On a phone at devicePixelRatio 2 or 3, that budget disappears fast.

Two numbers framed every decision:

  • 74,229 — camera points in the dataset. You never draw all of them as individual icons.
  • ~200–800 — features that should be on screen as distinct symbols at a typical zoom. Everything above that is a cluster count or culled.

If your code path is "create a marker per point," you have already lost. The browser will create 74k DOM nodes, run layout on them, and give you 4 FPS and a hot phone. MapLibre GL JS avoids this by rendering GeoJSON sources in WebGL — your job is to feed it data it can batch.

Why a globe is harder than a flat map

A flat map is forgiving. A globe adds three problems:

1. Projection cost. Vertices are transformed on the GPU every frame as you rotate. Cheap for tiles — expensive if you also re-project thousands of points in JavaScript on every mousemove.

2. The horizon cull. Half the planet is behind the planet. Far-side points must not draw or intercept clicks. MapLibre handles this for its own layers; custom HTML markers do not get it for free.

3. Density at world zoom. Cameras clump in cities and along coasts. Without clustering, Europe becomes a solid blob of overlapping icons and the GPU wastes its budget on overdraw. Overdraw, not vertex count, kills globe performance first.

One source, one buffer, no DOM markers

The core pattern is one GeoJSON source per live layer, updated whole and styled declaratively:

import maplibregl from "maplibre-gl"; const map = new maplibregl.Map({ container: "map", style: "https://demotiles.maplibre.org/style.json", center: [0, 20], zoom: 1.5, }); // Globe projection (MapLibre GL JS v5+) map.on("style.load", () => { map.setProjection({ type: "globe" }); }); map.on("load", () => { map.addSource("cameras", { type: "geojson", data: { type: "FeatureCollection", features: [] }, cluster: true, clusterMaxZoom: 14, // beyond this, show individual cameras clusterRadius: 50, // px — tune this; it IS your low-zoom perf knob }); map.addLayer({ id: "clusters", type: "circle", source: "cameras", filter: ["has", "point_count"], paint: { "circle-color": "#2563eb", "circle-radius": ["step", ["get", "point_count"], 16, 100, 22, 1000, 30], "circle-opacity": 0.85, }, }); map.addLayer({ id: "cluster-count", type: "symbol", source: "cameras", filter: ["has", "point_count"], layout: { "text-field": "{point_count_abbreviated}", "text-size": 12, }, paint: { "text-color": "#ffffff" }, }); map.addLayer({ id: "camera-points", type: "circle", source: "cameras", filter: ["!", ["has", "point_count"]], paint: { "circle-color": "#f59e0b", "circle-radius": 5, "circle-stroke-width": 1, "circle-stroke-color": "#111827", }, }); }); 

What matters here: cluster: true moves aggregation into MapLibre's worker (supercluster), off the main thread — a few hundred cluster features at world zoom instead of 74k points. Styling is data-driven (step on point_count) so the GPU evaluates it, with no per-feature callbacks in the render path. And there are exactly three layers for the whole dataset — layer count drives style recalculation cost when users toggle flights or weather on top.

When data arrives, replace the source once, throttled — never mutate features one by one:

let pending = null; let scheduled = false; function queueCameraUpdate(featureCollection) { pending = featureCollection; if (scheduled) return; scheduled = true; // Coalesce bursts: at most one source swap per animation frame requestAnimationFrame(() => { scheduled = false; if (!pending) return; map.getSource("cameras")?.setData(pending); pending = null; }); } 

setData re-uploads a buffer to the GPU. Calling it 60 times a second because a feed trickled in point-by-point thrashes that buffer. Batch on the network side, coalesce on the client side, and for moving layers like flights, interpolate from a velocity vector instead of demanding a network update for every visual step.

Clustering is a product decision, not just a perf trick

clusterRadius looks like a tuning knob. It is actually three decisions at once:

Honesty. A cluster labelled "1,240" over a metro area tells the truth — you cannot meaningfully pick one camera at this zoom. Drawing 1,240 overlapping dots would be less honest, not more detailed.

Click targets. On touch, a cluster is a 32–44 px target that zooms on tap. A 10 px dot at world zoom is un-tappable. Clustering is an accessibility feature.

Cost curve. At zoom 2, clustering collapses 74,229 points to ~300 features — a 99.6% reduction in symbols drawn. At zoom 12, clusterMaxZoom stops clustering, but the viewport only holds a few hundred points anyway. Cost stays roughly flat across zoom, which is exactly what you want.

Tune by measuring: log map.querySourceFeatures("cameras").length at zooms 2, 6 and 12. If zoom 2 returns thousands of unclustered features, your radius is wrong.

Tiles, textures and the other layers

Cameras are only one layer. A real globe stacks basemap tiles, radar tiles, labels and live vectors:

  • Raster tiles (radar, imagery) are texture fetches — the budget is network + GPU memory. Let the tile cache do its job, cap maxTileCacheSize on mobile, and fade radar in to hide pop-in.
  • Vector tiles (basemap) are parsed in workers and cached as GPU buffers. Style changes are the expensive moment, not panning — toggling ten layers at once triggers a full recalculation, so stagger non-urgent visibility by a frame or two.
  • Atmosphere and sky cost a fragment-shader pass over the whole canvas. On low-end devices that pass plus a dense radar overlay can halve your frame rate. Ship a reduced-effects path for weak GPUs.

Rule of thumb: if a layer updates less than once a minute (earthquakes, fires), it does not belong in the same update loop as flights. Separate cadences, separate budgets.

Teardown matters: destroy the map last

One production lesson that cost us a crash: if you tear down framework state that the map's handlers still reference before you call map.remove(), navigation away from the globe page can throw inside a half-destroyed WebGL context. The fix is absolute — remove listeners, call map.remove() to release the context, then unmount the surrounding UI.

A WebGL canvas also holds GPU memory until you release it. Navigating to a globe page repeatedly without teardown leaks contexts — browsers cap you at roughly 8–16 live contexts — and the symptom is a blank map on the seventh visit that nobody can reproduce on the first.

Measure on a real phone, not your workstation

Desktop Chrome forgives almost anything. Our checklist before calling a globe change "fast":

  1. Mid-range Android, 4× CPU throttling — does a 5-second spin stay above 50 FPS?
  2. Cold load on throttled 4G — is the globe interactive before every tile arrives? It should be: sphere and clusters first, detail streamed in.
  3. Memory after 3 minutes of panning — flat, or climbing with every fetch? A climb means a leak.
  4. Toggle every layer on at once — the worst case a user can create in two taps. If that case is 20 FPS, that is your real frame rate.

If a single setData shows up as a 40 ms long task in the Performance panel, batch it smaller or move it to a worker. The frame chart does not lie.

The takeaway stack

The shortest path to smooth:

  1. MapLibre GL JS with the globe projection, all bulk data in WebGL layers — no DOM markers.
  2. One clustered source per dataset, data-driven styling, batched setData via requestAnimationFrame.
  3. Client-side interpolation for moving objects; separate cadences per layer.
  4. Explicit teardown (map.remove() last) and a reduced-effects path for weak GPUs.

Do those four and a planet fits in a browser tab — 74,229 cameras included.

Go look

Spin the globe on worldeye.app and zoom from world view into a city: watch cluster counts break into individual cameras without the frame rate falling off a cliff. That flat cost curve — not any single optimisation — is the whole trick. Throttle the CPU 4× in devtools and try to make it jank; if you find a zoom level where it does, tell me in the comments.

Building a MapLibre globe and hitting a wall — antimeridian seams, cluster styling, tile-cache tuning? Ask below.