Skip to content

Resolve the data-layer anchor against the running style - #278

Merged
yorickdewid merged 1 commit into
mainfrom
fix/layer-anchor
Jul 25, 2026
Merged

Resolve the data-layer anchor against the running style#278
yorickdewid merged 1 commit into
mainfrom
fix/layer-anchor

Conversation

@yorickdewid

Copy link
Copy Markdown
Contributor

Follow-up to #273/#277: data layers were inserted before: 'building-number-label-hover' — a layer id that only existed in the legacy Mapbox Studio style. After the basemap swap every addLayer threw ("Cannot add layer … before non-existing layer") and no data layers rendered. The anchor now resolves at runtime: VITE_FUNDERMAPS_NUMBER_LAYER if set and present, else the purple boundary lines, else the first symbol layer, else top-of-stack.

Data layers land below boundaries and labels — text stays readable over extrusions.

🤖 Generated with Claude Code

The hardcoded 'building-number-label-hover' beforeId only existed in the
legacy Mapbox style; after the basemap swap every addLayer threw and no
data layers rendered. Resolve the anchor at runtime instead: env
override, then the purple boundary lines, then the first symbol layer,
then on top - a missing id degrades placement, never the mapset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yorickdewid
yorickdewid merged commit 626d19b into main Jul 25, 2026
4 checks passed
@yorickdewid
yorickdewid deleted the fix/layer-anchor branch July 25, 2026 11:21
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