Examples

D3.js maps built with the mapjson API

countries
World Countries
A world map in Equal Earth projection with dark ocean, graticule, hover tooltips, and zoom + pan. Uses properties=name to attach country names.
countries
Simple World
The minimal mapjson call — no parameters needed. Returns 110m world countries as geometry-only topojson. The fastest starting point for any world map.
countries
Europe with Hover
Filtered to European countries at medium resolution with country names as properties. Hover to inspect each country.
countries
Caribbean Islands
The Caribbean zoomed in at medium detail — each territory appears as its own polygon. Aruba, Martinique, Guadeloupe, Bonaire and others all hover correctly with their own ISO codes.
regions
USA States
US administrative regions using the regions layer filtered to a single country. AlbersUsa projection for clean continental rendering.
countries · globe
Globe
World countries on an orthographic (perspective) projection — the view from space. Land in sage green, ocean in slate blue, 30° graticule in white. Drag to rotate.
globe · cities
Capitals on the Globe
Every national capital on a large orthographic globe — drag to spin, scroll to zoom. Each dot is coloured coastal or inland, measured against the coastlines layer.
physical
Physical Features
Three API calls composed into one map — countries as the base layer, overlaid with rivers and lakes. Shows how to build up a richer world map from independent layers.
physical
Earth's Rivers
Every river and lake on the planet on a dark canvas — no borders, no labels. A glowing river network over a faint coastline, so the continents read as their own circulatory system.
art
World Mandala
Every country's outline drawn ten times, each copy rotated further around the centre and lit with additive colour — the borders you know spin into a symmetrical kaleidoscope.
art
The World, Engraved
The continents filled with fine directional hatching, a different line angle and ink tone per continent, like an old banknote or copperplate map. Pure line, no fills.
art
Halftone Earth
The continents as a printer's halftone screen — solid ink inland, dissolving into a scatter of fine dots along every coast.
art
Crystalline Earth
Points scattered over the land and Delaunay-triangulated into a glowing low-poly wireframe, each facet tinted by its continent — the continents crystallised into faceted constellations.
art
Every Country, One Bloom
All ~195 national outlines scaled to the same size and stacked on one point, tinted by continent and drawn in ink that darkens where the lines overlap — a composite of every shape on Earth at once.
art
Op-Art Earth
Parallel black lines that ripple into optical waves wherever there's land, in the spirit of Bridget Riley. No coastline is ever drawn.
art
Op-Art Earth: Rings
Every landmass drawn as nested topographic contour rings — a distance transform plus d3.contours steps each ring inward from the coast, so big continents fill with rings and the map reads as relief.
art
Op-Art Earth: Spectrum
The optical idea in color — flowing spectral bands that lie flat over ocean and swell over land, so the continents rise as bands of chromatic turbulence. Riley's later mode, on a map.
art
Typographic Earth
No borders at all — every country is filled with its own name, tiled to its exact shape. Russia a slab of RUSSIA, Chile a ribbon of CHILE. Read the planet, literally.
art
Dorling Earth
Throw away the shapes — every nation a bubble sized by land area (areakm2), force-packed near its real position. A world map you read by weight, not by outline.
art
Constellation Earth
Countries as stars on a see-through, graticuled globe you can spin — each joined to its nearest neighbours by great-circle arcs, far-side stars glimmering through the grid.
art
Stained-Glass Earth
The continents as luminous Voronoi panels held in thick black leading, clipped to the real coastlines and lit like a cathedral window over a dark sea.
art
Composition with Continents
The world reduced to Mondrian's grammar — the plane split into rectangles with thick black rules, red/blue/yellow pooling only where the land is, ocean cells left white. Squint and the continents hide inside a De Stijl composition. Recompose for a new one.
art
The World in Red, Blue and Yellow
The Mondrian idea, but readable — and the color means something: real countries ruled in heavy black and filled by land area (giants red, large blue, mid yellow, small white), using mapjson's areakm2. A De Stijl painting that's also a size atlas.
live data
30 Days of Earthquakes
Every magnitude-4.5+ earthquake of the past month, pulled live from the USGS feed and plotted on a mapjson world basemap — sized by magnitude, coloured by depth. The Ring of Fire draws itself.
live data · cities
Live Capital Temperatures
The current temperature in every national capital, fetched from Open-Meteo in a single call and joined to mapjson capital coordinates — a different map every hour, from freezing blue to scorching red.
choropleth · live data
Renewable Electricity
An Our World in Data choropleth joined to the map by the dataset's plain country names via /v1/resolve — which quietly fixes Turkey→Türkiye, East Timor→Timor-Leste and others a text match would drop.
countries
Africa
Countries colored by subregion — Northern, Eastern, Western, Middle, and Southern Africa. Capital cities plotted from capitalLat and capitalLng properties. Labels use a force simulation to avoid overlapping.
postal
Massachusetts ZIP Areas
All 539 Massachusetts ZIP code areas from the new postal layer, colored by 3-digit prefix. Every feature's gid is the bare ZIP code — join your ZIP-keyed data with a dictionary lookup.
regions
Poland Voivodeships
Poland's 16 first-level administrative divisions at high detail. Uses fitSize to auto-fit the projection to the returned geometry — the same pattern works for any country.
countries
Aruba
Aruba is 180 km² — invisible at standard resolutions. When filter is an ISO country code and detail=high, the API automatically serves a high-resolution file for small countries and territories.
countries
Strait of Gibraltar
Gibraltar (ISO GI) is ~7 km² and only exists at detail=high. Three filter calls — Spain, Morocco, Gibraltar — frame the strait as separate polygons. Ceuta, a Spanish city with no ISO code, is a marker rather than a polygon.
tiles · live data
Local Weather Radar
Asks the browser for your location, reverse-geocodes it against mapjson geometry to name and highlight the region you're standing in, then lays live open-source radar (RainViewer) and current weather (Open-Meteo) over a local map.
tiles · regions
Country Spotlight
An OpenStreetMap basemap dimmed everywhere except one country — a vector mask with a country-shaped hole — and that country's administrative regions overlaid with hover names. Regions load at the right tier via detail=auto.
tiles · countries
Strait of Hormuz
All eight Persian Gulf states, each from its own high-detail filter call, framed on the Strait of Hormuz. Dashed lines measure the narrows — and show that the famous “33 km” chokepoint is measured to Great Quoin Island, an Omani islet too small for the base map to even carry.
countries
Italy's Enclaves
San Marino and Vatican City — two sovereign countries entirely inside Italy, both only present at detail=high. Fitted to Italy the Vatican is under a pixel, so the map zooms to 400× with buttons that fly you to each enclave.
choropleth
World Cup 2022 Elimination
The 32 nations of the 2022 World Cup shaded by how far they went — light for a group-stage exit, darkest for champions Argentina. A hardcoded result table joined to the map by ISO2 code over one /v1/geo call.
countries · cities
The 2026 Tennis Season
Every ATP Grand Slam, Masters 1000, and ATP 500 of 2026, dropped onto the world map by host city and colored by level — with a date-sorted schedule beside it. An embedded calendar joined onto one /v1/geo basemap.
cities
Cities & Capitals
The /v1/points?type=city endpoint — major cities plus every national capital as GeoJSON points, sized by population with capitals in gold. Each point is pre-tagged with country and admin1 region, so one filter narrows to a continent, country, or state.
countries
Been - Visited Countries
Pick a color and click countries (or choose from a dropdown) to mark where you've been, then download a PNG. Loads at low detail for a fast paint and upgrades to high detail on zoom — unlocking all 265 territories, marks preserved across the swap.
game
Flag Guess Game
A geography game — a flag appears, you click the country it belongs to. Zoom and pan to reach the smaller countries, keep score, and skip when stumped. Only quizzes countries large enough to click (filtered by areakm2). Flags pulled live from flagpedia.net by ISO2 code.
game
Map Shape Guess Game
A country silhouette appears — pick its name from four choices. The decoys are countries of similar area (chosen with areakm2) so the scale gives nothing away. Both the shape and the answer options come from a single /v1/geo call.
choropleth
Languages
World countries colored by official language, using the opt-in languages property. One language means a solid fill; several means diagonal stripes, one band per color.
choropleth
USD vs Euro
The world's two biggest currency zones from one currencies property — dollar users in green (Ecuador, Panama, Timor-Leste…), euro users in blue (the eurozone plus Kosovo and Montenegro), and Zimbabwe's basket counting for both.
countries
Country Details
World countries on the Patterson projection. Hover any country for every opt-in property, plus its centroid and bounding box (d3.geoCentroid/d3.geoBounds) and neighboring countries (topojson.neighbors) — all computed client-side.
countries
Martinique
A French Caribbean territory filtered by full country name — filter=Martinique is resolved to ISO code MQ server-side. At detail=high the 10m dataset resolves the island clearly.
countries
Disputed Territories
World countries including disputed and partially-recognized territories — Kosovo, Western Sahara, Palestine, and others — highlighted separately.
countries
Landlocked Countries
The 44 countries carrying the always-on landlocked: true flag, shaded on a world map. The two doubly landlocked states — every neighbour landlocked too — are found live from shared-border topology with topojson.neighbors().
districts · choropleth
Massachusetts Counties
14 counties fetched with filter=US-MA — only this state's districts, not all 3224 US counties. Population choropleth joined via 5-digit FIPS gid — the same code used by Census, BLS, and CDC data.
districts · live data
US Counties — Depression Rates
Continental US counties colored by depression prevalence from the CDC PLACES 2023 dataset — joined to county geometry by FIPS code via a client-side Socrata API call. State borders drawn with topojson.mesh.
cities
World Capitals — Node.js
Every capital city plotted from capital, capitalLat and capitalLng properties. The live map is client-side, but the code shown is a complete Node.js script producing the same SVG server-side — no browser, no DOM, no headless Chrome.