Skip to content

Add Mapbox and OpenStreetMap attributions#65

Merged
ryanhamley merged 12 commits intomasterfrom
add-attributions
Mar 19, 2026
Merged

Add Mapbox and OpenStreetMap attributions#65
ryanhamley merged 12 commits intomasterfrom
add-attributions

Conversation

@ryanhamley
Copy link
Copy Markdown
Contributor

@ryanhamley ryanhamley commented Mar 19, 2026

We need to add the Mapbox/OpenStreetMap attribution to the map so that we're not in violation of Mapbox's license. The only place on the map that this would be easily visible and not covered by something in Wayfinder is the bottom-left. This however is also where the Mapbox logo (also required) is and this causes the attribution to stack on top of the logo, which is ugly. Instead, you can use column-reverse flex layout to put the attribution under the logo which visually makes more sense.

In order to include this CSS in the library and not force apps that consume this library to include custom CSS, I added a small CSS file and a Vite plugin that injects the CSS into the JS build. This ensures that any app consuming this library gets the correct styling with no changes needed on the consuming end.

We could inject the CSS manually since it's so small and avoided the new dependency, but I figured this is more future-proof and extensible for a fairly small price, complexity-wise.

Screenshot 2026-03-19 at 1 46 50 PM

I also plan to bump the minor version to 2.2.0 to publish this.

You can see this being used in Wayfinder here: https://deploy-preview-3129--sofar-tell-tale-staging.netlify.app/fleet

We'll also need a follow-up PR to add ECMWF attribution but there's ongoing discussion about what that should look like, so we'll get this change in for now.

Comment thread package.json
Comment on lines +10 to +13
"repository": {
"type": "git",
"url": "git+https://github.com/wavespotter/mapbox-context.git"
},
Copy link
Copy Markdown
Contributor Author

@ryanhamley ryanhamley Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm said this change had to be made in order to publish? i ran npm pkg fix and this is what it spit out.

@ryanhamley ryanhamley requested a review from juliusiv March 19, 2026 20:56
@ryanhamley ryanhamley changed the title Add attributions Add Mapbox and OpenStreetMap attributions Mar 19, 2026
Copy link
Copy Markdown
Collaborator

@juliusiv juliusiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet

@ryanhamley ryanhamley merged commit 6d19d37 into master Mar 19, 2026
5 checks passed
@ryanhamley ryanhamley deleted the add-attributions branch March 19, 2026 21:31
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.

2 participants