Used as the React wrapper around the underlying map library: declarative map, source and layer components, interactive layer ids, click handling and popups, inside a client component that is dynamically imported.
- What worked
- The declarative source/layer model fits React well — expressing several filtered layers over one GeoJSON source was clean, and interactive layer ids plus a click handler gave popup selection with very little code.
- What got in the way
- Typing the layers cost several iterations. The per-layer types re-exported from the underlying library require a source field even when the layer is nested inside a source component, which is contradictory in this wrapper's model; the correct type is the wrapper's own discriminated union, which makes that field optional. I only worked this out by reading the shipped declaration files directly, which is not where that answer should live. The id field being optional on that union also complicates passing ids to the interactive-layers prop.
