Skip to content

Map: stop countries crossing the 180th meridian drawing bars across every map - #35

Merged
davd-gzl merged 5 commits into
mainfrom
fix-map-antimeridian
Sep 30, 2026
Merged

davd-gzl merged 5 commits into
mainfrom
fix-map-antimeridian

Conversation

@davd-gzl

Copy link
Copy Markdown
Collaborator

The world map shows straight lines across the whole width near 70°N and in the southern ocean, a land-coloured block over the North Atlantic, and another over the bottom right, with no place visited. The country outlines come from world-atlas in longitude and latitude, so a shape crossing the 180th meridian, Russia's far east, Fiji or the Aleutians, jumps from +180 to −180 between two points, and Antarctica's coast runs round the pole. Drawn flat, each jump becomes an edge spanning the map.

The rings are now unwrapped once when the geometry loads, so a shape crossing 180 continues past it and MapLibre wraps it round the world. They are not cut at 180, which drew a border line down the meridian through Chukotka and Antarctica. Antarctica's coast is closed through the pole instead of being kept as a hole in a zero-area ring.

The same fix reaches the other surfaces drawing that geometry: the trip route map and the stats coverage card, which share one land loader, the published reader's journey map, whose outline file is regenerated, and the passport poster, which now fills Antarctica down to the pole.

Two small marks remain. A short stub at 180 on Antarctica shows below 84°S when zoomed in there. The globe view draws one circle at 85°S where main drew two, and removing it needs a separate outline source.

The country outlines come from world-atlas in spherical coordinates, so a
ring crossing the antimeridian jumps from +180 to -180 between two vertices
and Antarctica's coast wraps the pole. Drawn on a plane, that jump became an
edge spanning the whole map. The rings are now unwrapped, closed through the
pole when they circle one, and cut at ±180 once when the geometry loads.
Cutting the unwrapped country rings at ±180 left an edge on the meridian,
which the country outline and the land fill's outline drew as a border
through Chukotka, Fiji and Antarctica. The rings are now left whole past
180: MapLibre wraps a shape running off the world into the next copy
itself, clipping it outside the tile. Antarctica's outline in world-atlas
is a zero-area circle just off the pole with the coast as its hole; that
circle is dropped, so the coast becomes the outline, closed through the
pole.
The composer's route map and the Stats coverage card read the same
world-atlas land through getLand, raw, so Russia, Fiji and Antarctica
drew edges spanning the map: two lines across the route map and a stroke
across the Fiji card. The land is now unwrapped once when it loads. The
coverage card also unwraps a country whose land runs past 180, so
Chukotka's towns stay on Russia's card.
The reader's embedded land outline kept world-atlas's jump at the
antimeridian. The reader starts a new sub-path there, but the fill closed
Eurasia's ring back to its start, painting a wedge from Chukotka to South
Africa across any journey map over Asia, and Antarctica stopped at 84°S.
The generator now unwraps the land before simplifying it, and the outline
is regenerated.
The poster unwrapped each ring on its own, so Antarctica's coast closed
straight across at 84°S and the bottom of the poster showed sea under the
continent. It now draws the geometry unwrapped once at load, closed
through the pole.
@davd-gzl
davd-gzl merged commit 93df40a into main Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant