3D globe web maps with MapLibre GL
Globe Maps
v1.0 · 2026-07 · 7 KB
Teaches Claude to build spinning 3D globe maps, or turn a flat Leaflet map into one, with MapLibre.
- Globe projection setup: projection, atmosphere, and light in a MapLibre v5 style
- The gotchas: line densification, [lng, lat] order, style.load vs load, CSP worker/connect-src, vendoring, headless WebGL testing
- Data-driven GeoJSON layers: category colors, selection dimming, filters, popups
- A Leaflet-to-MapLibre porting table and a self-contained starter page
Client-side GIS in the browser
Turf Analysis
v1.0 · 2026-07 · 3 KB
Teaches Claude to measure, buffer, and cluster map data in the browser with Turf.js. No server.
- The GeoJSON-in, GeoJSON-out pipeline: Turf computes, the map library draws
- A pick-the-function table across measurement, transformation, joins, grids, and interpolation
- Canonical patterns: buffer + spatial join, hexGrid + collect, Voronoi with bbox
- The gotchas: [lng, lat] order, planar-ish math at planet scale, explicit units, caching heavy ops
Exact geodesy as 3D vectors
Spherical Geometry
v1.0 · 2026-07 · 11 KB
Teaches Claude exact earth-curve math for maps: shortest paths, constant-bearing lines, and circles that wrap the planet.
- The discipline: compute as unit vectors, convert to lat/lon at the edge, split at ±180°
- One-liner constructions: great circles as plane normals, midpoints, equidistant loci, antipodes
- Curve sampling: great circles, small circles, loxodromes, isoazimuthals
- The rendering pipeline: antimeridianSplit + polar clipping, plus the numerical edge cases
Maps under a strict Content-Security-Policy
Map CSP
v1.0 · 2026-07 · 3 KB
Teaches Claude to run Leaflet and MapLibre on a locked-down site, including the exact security headers each library needs.
- A per-library directive table: tile hosts, MapLibre's blob: workers, fonts
- The vendoring convention: self-hosted libraries with versioned, licensed READMEs
- Cloudflare Pages _headers patterns: detach-first CSP overrides, forced downloads
- A debugging checklist for blank maps and silently dead workers
Area maps that don't lie
Choropleth
v1.0 · 2026-07 · 3 KB
Teaches Claude to color regions by a number without lying. Projection, rates instead of raw counts, and honest no-data.
- Projection-first: EPSG:5070 for the US, Equal Earth for the world, and why Mercator lies
- Normalize, never map raw counts — and FIPS/GEOID as strings with zfill
- Classification: quantiles vs Jenks, 5–7 classes, diverging ramps centered on meaning
- MAUP, small-denominator instability, and honest no-data styling
ACS, TIGER, and GEOIDs decoded
Census Data
v1.0 · 2026-07 · 3 KB
Teaches Claude to pull US Census numbers and shapes the reliable way, then join them without dropping leading zeros.
- API query anatomy: datasets, get/for/in, and decoding B19013_001E-style variable codes
- The geography hierarchy with GEOID digit counts, from state to block group
- TIGER/Line vs cartographic boundary files — and which one maps should use
- Join hygiene: strings with leading zeros, vintage matching, sentinel values, MOEs
Getting features out of OpenStreetMap
Overpass OSM
v1.0 · 2026-07 · 3 KB
Teaches Claude to pull cafes, rail lines, or building footprints out of OpenStreetMap without the query timing out.
- Overpass QL anatomy: area-first bounding, nwr tag filters, out center vs geom
- The route-relation pattern: pulling named train/bus/hiking routes and stitching members
- The timeout escalation path, and when to switch to Geofabrik/osmium/osm2pgsql
- ODbL license rules: attribution, share-alike databases, freely-licensed produced works
The last mile: map to share-ready graphic
Map Poster
v1.0 · 2026-07 · 3 KB
Teaches Claude the last mile from a correct map to a picture you can post or print.
- Canvas-first sizing for Instagram, stories, and print, with DPI rules
- The QGIS print-layout workflow and the SVG → Illustrator handoff
- Design rules: visual hierarchy, margins, two-font discipline, dark vs editorial identity
- A pre-publish checklist from legend honesty to thumbnail readability