Repository navigation
Map: stop countries crossing the 180th meridian drawing bars across every map - #35
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.