Mapbox inset map
tool
stack: [observable, mapbox, journalism tools]
Context
This tool generates inset-map bounds for Mapbox visualizations while accounting for camera bearing and pitch, improving contextual framing in map storytelling.
My role
- Tool development
I designed and implemented the complete Observable prototype, including map interaction, extent extraction, and inset rendering logic.
Data and methodology
The notebook captures the viewport footprint by sampling edge vertices from the map canvas and converting them with `map.unproject` into a geographic polygon.
That polygon is drawn over a reference inset map, enabling accurate mini-map framing even when the main map uses tilted or rotated camera states.
Key decisions
- I added an autofly demo and multiple preset locations to stress-test the inset behavior across different bearings, zooms, and pitch values.
- The tool was intentionally kept simple and reusable, because this is a very interesting capability that currently has no native Mapbox utility equivalent.
- I exposed toggles like drop shadow and dynamic bounds so the inset output can be adapted quickly to newsroom styles.
Result
The final notebook provides a practical inset-map generator that works in camera configurations where default `getBounds`-based approaches fall short.
Impact and learnings
- It fills a real production gap in Mapbox workflows and has already been used in published coverage to improve geographic orientation for readers.