fix(geojson-layer): enable wrapLongitude for antimeridian crossing polygons - #3332
Closed
pierreeurope wants to merge 1 commit into
Closed
fix(geojson-layer): enable wrapLongitude for antimeridian crossing polygons#3332pierreeurope wants to merge 1 commit into
pierreeurope wants to merge 1 commit into
Conversation
Enable deck.gl's wrapLongitude option in the geojson layer so polygons crossing the -180/180 longitude boundary are rendered correctly on both sides of the antimeridian. Updated test expectations to match the new default. Fixes keplergl#2668 Signed-off-by: pierreeurope <pierre.europe@pm.me>
pierreeurope
force-pushed
the
fix/antimeridian-wrap-longitude-2668
branch
from
February 12, 2026 07:32
e3bd938 to
94c8cb2
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a rendering issue where polygons crossing the antimeridian (-180/180 longitude boundary) could not be displayed simultaneously in GeoJSON layers. The fix enables deck.gl's built-in wrapLongitude feature, aligning the GeoJSON layer with the base layer's default behavior.
Changes:
- Changed
wrapLongitudefromfalsetotruein GeoJSON layer rendering to enable antimeridian wrapping - Updated test expectations to reflect the new
wrapLongitude: truevalue
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/layers/src/geojson-layer/geojson-layer.ts | Enabled wrapLongitude for both main and hover GeoJSON layers, allowing proper rendering of polygons crossing the antimeridian |
| test/browser/layer-tests/geojson-layer-specs.js | Updated test expectations to verify wrapLongitude: true is correctly set on polygon fill and stroke layers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lixun910
approved these changes
Feb 24, 2026
lixun910
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, @pierreeurope !
Collaborator
|
This caused issues before |
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.
Summary
Enable
wrapLongitudeon GeoJSON layers so that polygons crossing the -180/180 longitude boundary (antimeridian) are rendered correctly and can be displayed simultaneously.Problem
Two polygons on opposite sides of the antimeridian cannot be viewed at the same time (#2668). This is because the GeoJSON layer explicitly sets
wrapLongitude: false, overriding the base layer's default oftrue.Fix
Change
wrapLongitudefromfalsetotruein the GeoJSON layer's deck.gl layer configuration. This enables deck.gl's built-in antimeridian wrapping support, which correctly handles geometries that cross the -180/180 boundary.The base layer (
base-layer.ts) already useswrapLongitude: true— the GeoJSON layer was inconsistently overriding it tofalsewithout a documented reason.Fixes #2668