Calculated layers

Layers whose data is worked out in the browser instead of fetched. A source url of internalfunc://day-night means “ask the code for it”: some data is a function of the moment rather than a document on a server, and fetching it would make it stale on arrival, unavailable offline, and a request for something a browser computes in a millisecond. The protocol is deliberately not http, so a reader of a config can see at a glance that nothing is downloaded.

Using one

Name it as a source’s data, and style the layer as you would any GeoJSON. Parameters ride along as a query string.

"sources": {
  "daylight": { "type": "geojson", "data": "internalfunc://day-night?refresh=auto" }
}

refresh=auto asks the layer to keep itself current as the wall clock runs — worth it for the ones that move visibly, wasted on the ones that are the same picture all year. Every computed layer is recomputed when the map’s clock jumps, refreshing or not. A url that pins its own moment with ?at= stops following the clock at all, which is how a story shows one instant while the rest of the map moves.

21 layers, listed as the build that made this page has them.

Sun

Where the sun is, and what that does to the day.

Day and night day-night

The bands of daylight, the three twilights and night, as they stand at the moment shown. The terminator is the edge between the first two.

Polygons, one band per light level. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
idWhich band this is: sunset, civil, nautical, astronomical or night.
descriptionThe band’s name, ready to show.
fromSun altitude at the band’s bright edge.degrees
toSun altitude at its dark edge.degrees
timestampThe moment the layer was computed for.ISO 8601
internalfunc://day-night?refresh=auto

Open the demo →

Sun position sun-position

The subsolar point: the one place on Earth with the sun straight overhead.

A single point. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat the point is.
declinationHow far the sun stands north or south of the equator today.degrees
equationOfTimeHow far a sundial runs ahead of or behind the clock.minutes
timestampThe moment the layer was computed for.ISO 8601
internalfunc://sun-position?refresh=auto

Open the demo →

Sun path sun-path

The track the subsolar point takes, a line per day — the figure that makes the sun’s yearly north–south swing one picture instead of a moving dot.

Lines, one per day drawn. The same picture whatever the moment.

ParameterWhat it does
spanHow wide a window to draw: day (just today), half-year (91 days either side of at), solstice-to-solstice (the half-cycle at sits in — snaps to the nearest solstices), or year (the calendar year at falls in). Left out: solstice-to-solstice.
stepDegrees between points along each line.
yearReplaces at’s year (as 1 July), independent of span — pair with span=year for the whole calendar year.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
dateThe day this line is the sun’s track for.YYYY-MM-DD
monthIts month, for colouring by season.1–12
declinationThe sun’s declination that day.degrees
solsticejune or december on the two extreme days, otherwise absent.
internalfunc://sun-path

Open the demo →

Day length day-length

Where the day is a given number of hours long today — the polar-night and midnight-sun lines are the 0 and 24 hour cases.

Lines, one per hour value. Redrawn whenever the map’s clock moves.

ParameterWhat it does
hoursComma-separated hour values to draw. Left out: a standard spread.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
hoursHow long the day is anywhere on this line.hours
descriptionThe same, in words.
dateThe day it applies to — these lines move all year.YYYY-MM-DD
internalfunc://day-length?hours=0,6,12,18,24

Open the demo →

Solar time solar-time

The meridians where the sun stands at each whole hour of local solar time — noon is the one under the sun.

Lines, one per hour. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
solarHourThe local solar hour along this meridian.0–23
noonTrue for the meridian directly under the sun.
timestampThe moment the layer was computed for.ISO 8601
internalfunc://solar-time?refresh=auto

Open the demo →

Analemma analemma

The figure-of-eight the sun traces when seen at the same clock time all year — the shape that shows a clock and the sun keep different time.

A line, with points for the days. The same picture whatever the moment.

ParameterWhat it does
yearWhich year to trace. Left out: the year of the current moment.
hourThe UTC hour to sample each day at.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat this point is: the sun’s place at that clock time on that date.
dateThe day.YYYY-MM-DD
dayOfYearIts number in the year, for animating along the figure.1–366
yearThe year traced.
hourUtcThe clock hour the sun was sampled at.UTC hour
longitudeWhere the sun stood.degrees
latitudeWhere the sun stood.degrees
equationOfTimeMinutesThe east–west half of the figure, which is what the equation of time measures.minutes
todayTrue on the day the map is showing.
internalfunc://analemma?year=2026&hour=12

Open the demo →

Moon

Where the moon is, how much of it is lit, and who can see it.

Moon position moon-position

The sublunar point: where the moon stands directly overhead.

A single point. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat the point is.
phaseWhere the moon is in its cycle.0–1
phaseNameThat phase in words.
illuminationHow much of the disc is lit.0–1
distanceKmHow far away the moon is now — it varies by some 40 000 km.km
timestampThe moment the layer was computed for.ISO 8601
internalfunc://moon-position?refresh=auto

Open the demo →

Moon phase moon-phase

The moon drawn as a disc, its lit part shaded and turned to face the sun. Without an observer the turn follows the ground bearing to the sun — a fact about geometry, the same everywhere. With one, it is a view: the same moon tilts to whatever that place’s horizon does to it, so the identical crescent stands upright for one observer and lies nearly on its back for another at the same moment. Demoed with observer={click}, so clicking the map moves the observer and visibly rotates the crescent — that is the tilt changing, not the moon.

Polygons — the disc and its lit part, plus the observer’s horizon and position once an observer is given. Redrawn whenever the map’s clock moves.

ParameterWhat it does
radiusRadius of the disc, in degrees.
observerA lon,lat to draw the phase as seen from there, tilted to that place’s horizon — {click} follows the last place clicked on the map, with any tool active, so this layer needs no tool of its own. Left out: drawn by the ground bearing to the sun, the same from anywhere.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
iddisc for the whole moon, lit for the sunlit part — or horizon/observer for the two extra shapes an observer adds.
descriptionWhat the shape is.
phaseWhere the moon is in its cycle — the same for every shape, since it is a fact about the moon, not about who is looking.0–1
phaseNameThat phase in words.
illuminationHow much of the disc is lit.0–1
timestampThe moment the layer was computed for.ISO 8601
observerLonThe observer’s longitude — only present once one is given.degrees
observerLatThe observer’s latitude — only present once one is given.degrees
tiltHow far the lit side is turned from straight up, as that observer sees it — the number that changes when you click elsewhere. Only present with an observer.degrees
altitudeHow high the moon stands above that observer’s horizon. Only present with an observer.degrees
sunAltitudeHow high the sun stands there, which is what daylight and belowHorizon are read from. Only present with an observer.degrees
belowHorizonTrue if the moon is under that observer’s feet — the disc is still drawn, but nobody there can see it. Only present with an observer.
daylightTrue where the sun is up for that observer. Only present with an observer.
nearZenithTrue where the moon stands almost directly overhead, where a tilt stops meaning much. Only present with an observer.
internalfunc://moon-phase?radius=7&observer={click}

Open the demo →

Moon visibility moon-visibility

The half of the world with the moon above the horizon at this moment.

A polygon. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat the band is.
phaseNameThe phase those people can see.
illuminationHow much of it is lit.0–1
timestampThe moment the layer was computed for.ISO 8601
internalfunc://moon-visibility?refresh=auto

Open the demo →

Moon in the sky moon-in-sky

The same moon at a row of latitudes on one meridian, each disc turned the way an observer standing there sees it — which is how the crescent comes to lie on its back at the equator and stand upright in the north. A row is drawn only where the moon is above that observer’s horizon: pin lon to a fixed meridian and the moon can be below the horizon at every one of the sampled latitudes at once — measured, for one full day at a fixed meridian, empty for 29% of the hours — which reads as nothing rendering rather than as night. Left unpinned, the meridian is chosen fresh each moment for where the moon has the best chance of being seen, which is what the demo does.

Polygons, one moon per latitude. Redrawn whenever the map’s clock moves.

ParameterWhat it does
lonMeridian to place the row on. Pinning it can leave the moon below the horizon at every sampled latitude at once, for hours at a time — the layer is not empty, that meridian just has no view of the moon right then. Left out: chosen fresh each moment for the best chance of a visible moon somewhere on it.
fromSouthernmost latitude.
toNorthernmost latitude.
stepDegrees of latitude between discs.
radiusRadius of each disc, in degrees.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
latitudeThe latitude this moon is drawn for.degrees
longitudeThe meridian the row stands on.degrees
tiltHow far the lit side is turned from up, as seen from there — the reason the crescent lies on its back at the equator.degrees
altitudeHow high the moon stands above the horizon there.degrees
sunAltitudeHow high the sun stands, which decides whether the moon is visible.degrees
daylightTrue where the sun is up.
nearZenithTrue where the moon is nearly overhead, where "turned" stops meaning much.
illuminationHow much of the disc is lit.0–1
phaseNameThe phase in words.
iddisc, lit or the horizon marker.
descriptionWhat the shape is.
timestampThe moment the layer was computed for.ISO 8601
internalfunc://moon-in-sky?from=-60&to=60&step=15

Open the demo →

Moon path moon-path

The track of the sublunar point over a month, which turns the moon’s north–south swing into one picture.

Lines. Redrawn whenever the map’s clock moves.

ParameterWhat it does
daysHow many days to trace. Left out: one orbit, 27.32 days.
stepHours between points. Left out: 1 hour.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat the track is.
daysHow many days it covers.days
northernmostThe furthest north the moon gets in this stretch.degrees
southernmostThe furthest south.degrees
timestampThe moment the layer was computed for.ISO 8601
internalfunc://moon-path?days=27.32&step=1

Open the demo →

Tides

The pull that raises the ocean, not the tide a harbour measures.

Equilibrium tide equilibrium-tide

The shape the ocean would take if water could keep up with the moon and the sun — two bulges, one under the moon and one opposite. It is the forcing, not a tide table: real tides lag it by hours and are shaped by coastlines.

Lines at each level, and points at the extremes. Redrawn whenever the map’s clock moves.

ParameterWhat it does
levelsComma-separated metre levels to contour.
stepDegrees between sample points.
extremesno to leave out the high and low points.
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
idlow, high, or the level for a contour.
descriptionThe level in words.
metresThe height of this contour above mean level.m
springFactorHow close this moment is to spring tide: 1 at full alignment.0–1
phaseThe moon’s phase now.0–1
phaseNameThat phase in words.
lunarAmplitudeThe moon’s share of the bulge.m
solarAmplitudeThe sun’s share, about half the moon’s.m
timestampThe moment the layer was computed for.ISO 8601
internalfunc://equilibrium-tide?levels=-0.2,0,0.3&refresh=auto

Open the demo →

Lines on the Earth

The grid and the circles a map is drawn against.

Graticule graticule

Meridians and parallels: the grid a projection is drawn against, and the quickest way to see what a projection does to it.

Lines. The same picture whatever the moment.

ParameterWhat it does
spacingDegrees between lines. Left out: 10.

Every feature carries:

AttributeWhat it holdsUnit
kindmeridian or parallel.
degreesIts longitude or latitude.degrees
labelReady to draw: 180° W, 45° N.
internalfunc://graticule?spacing=15

Open the demo →

Reference circles reference-circles

Equator, tropics and polar circles. The tropics and polar circles move with the Earth’s tilt, so they are computed for the moment shown rather than fixed at 23.5°.

Lines. Redrawn whenever the map’s clock moves.

ParameterWhat it does
atAn ISO instant to pin this layer to, so a time slider leaves it alone. Left out: the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
idequator, tropic-cancer, tropic-capricorn, arctic or antarctic.
descriptionIts name.
latitudeWhere it lies today — the tropics and polar circles move with the tilt.degrees
axialTiltThe Earth’s tilt on this date, which is what puts them there.degrees
dateThe date that tilt is for.YYYY-MM-DD
internalfunc://reference-circles

Open the demo →

What a projection does

Shapes whose true size is known, so the distortion becomes visible.

Tissot’s indicatrix tissot

Circles of equal ground radius, placed on a grid. Every one is a circle on the globe, so whatever the projection does to them is what it does to shape and area everywhere.

Polygons. The same picture whatever the moment.

ParameterWhat it does
spacingDegrees between circles.
radiusGround radius of each circle, in kilometres.

Every feature carries:

AttributeWhat it holdsUnit
centreWhere the circle sits.[lon, lat]
radiusKmIts true radius on the ground — every circle has the same one.km
descriptionRadius and position in words.
internalfunc://tissot?spacing=30&radius=500

Open the demo →

Distance and direction

Spherical geometry about a place: how far, which way, and what is opposite.

Range rings range-rings

Circles of equal ground distance around a place — true circles on the globe, so a projection bends them exactly as much as it distorts.

Polygons. The same picture whatever the moment.

ParameterWhat it does
atCentre, as lon,lat. Left out: 5,52.
radiiComma-separated radii in kilometres.

Every feature carries:

AttributeWhat it holdsUnit
radiusKmHow far from the centre this ring is.km
centreThe place the rings are drawn about.[lon, lat]
descriptionThe radius in words.
internalfunc://range-rings?at=4.9,52.4&radii=500,1000,2000

Open the demo →

Great circle great-circle

The shortest path between two places on the globe — the line that looks bent on a Mercator map and is not.

A line. The same picture whatever the moment.

ParameterWhat it does
fromStart, as lon,lat. Left out: 4.9,52.4.
toEnd, as lon,lat. Left out: 139.7,35.7.

Every feature carries:

AttributeWhat it holdsUnit
descriptionWhat the line is.
distanceKmThe distance along it — the number the picture cannot show.km
fromStart.[lon, lat]
toEnd.[lon, lat]
internalfunc://great-circle?from=4.9,52.4&to=139.7,35.7

Open the demo →

Antipode antipode

The point on the exact other side of the Earth from a place.

A single point. The same picture whatever the moment.

ParameterWhat it does
atThe place, as lon,lat. Left out: 5,52.

Every feature carries:

AttributeWhat it holdsUnit
descriptionHere or the antipode.
roleorigin or antipode, for styling the pair differently.
internalfunc://antipode?at=5,52

Open the demo →

Grids defined by rules

Zone systems that are a definition rather than a survey.

UTM zones utm-zones

The 60 UTM zones, including the widened and split ones off Norway and Svalbard that the rule alone does not give you.

Polygons. The same picture whatever the moment.

No parameters.

Every feature carries:

AttributeWhat it holdsUnit
designationZone and latitude band, as a grid reference gives it: 31U.
zoneThe zone number.1–60
bandThe latitude band letter.C–X
epsgThe EPSG code to project this zone in — the practical answer, invisible on the map.
centralMeridianThe meridian the zone is measured from.degrees
exceptionNames the widened or split zones off Norway and Svalbard; null elsewhere.
internalfunc://utm-zones

Open the demo →

Deep time

The world at an age, reconstructed from plate motions.

Palaeo coastlines paleo-coastlines

Today’s coastlines carried back to a chosen age on the plates they ride. Rigid rotation: crust since shortened or stretched is not shown, so continents meet later here than the rocks say.

Polygons. Redrawn whenever the map’s clock moves.

ParameterWhat it does
dataDirectory of the rotation model, resolved against the config.
maMillions of years ago — {ma} follows the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
plateIdWhich plate this piece rides on, in the model’s numbering.
continentThe continent it belongs to today.
fromAgeThe oldest age the model reconstructs this piece for.Ma
maThe age it is drawn at.Ma
internalfunc://paleo-coastlines?data=data/paleo/merdith2021&ma={ma}

Open the demo →

Palaeo plate boundaries paleo-plates

Plate boundaries and deforming networks at a chosen age. Snapshots rather than a reconstruction: boundaries are born, die and change in number, so there is nothing to interpolate between two ages.

Lines and polygons. Redrawn whenever the map’s clock moves.

ParameterWhat it does
dataDirectory of the plate snapshots, resolved against the config.
maMillions of years ago — {ma} follows the map’s clock.

Every feature carries:

AttributeWhat it holdsUnit
maThe age this snapshot is for.Ma
typeThe GPlates feature type, e.g. a topological closed plate boundary.
nameThe plate or network’s name.
pidIts plate id in the model.
deformingTrue for a deforming network — crust being squeezed rather than a rigid plate.
internalfunc://paleo-plates?data=data/paleo/muller2019/plates&ma={ma}

Open the demo →