fix: improvements for globe view mode polygon tesselation#3548
Closed
igorDykhta wants to merge 0 commit into
Closed
fix: improvements for globe view mode polygon tesselation#3548igorDykhta wants to merge 0 commit into
igorDykhta wants to merge 0 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves polygon fill rendering in Globe mode by generating and rendering a refined (subdivided) triangulation for polygon fills, preventing long fill-triangle edges from bulging off the sphere and spilling past polygon outlines.
Changes:
- Add
@math.gl/polygonand useearcutto triangulate polygon rings, then refine triangles via midpoint subdivision for globe-safe fills. - Extend Arrow/WKB binary conversion to attach a separate
polygonsFillgeometry for globe fills while keeping original polygons for outlines. - Update GeoJsonLayer rendering in globe mode to use the refined fill mesh (with caching to keep
datareferences stable) and optionally render outlines via a second layer.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| yarn.lock | Adds lockfile metadata for the new @math.gl/polygon dependency. |
| src/layers/package.json | Adds @math.gl/polygon as a direct dependency of the layers package. |
| src/layers/src/layer-utils.ts | Builds refined polygon-fill mesh (polygonsFill) during WKB→binary conversion using earcut + triangle subdivision. |
| src/layers/src/geojson-layer/geojson-layer.ts | In globe mode, renders fill from polygonsFill and outline from original polygons, with a WeakMap cache for stable data references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
igorDykhta
force-pushed
the
igr/tesselation-adjustments
branch
from
July 23, 2026 23:08
7d51cb7 to
67216fa
Compare
12 tasks
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.
Some polygons are badly tesselated in Globe mode