Add Mapbox and OpenStreetMap attributions#65
Merged
ryanhamley merged 12 commits intomasterfrom Mar 19, 2026
Merged
Conversation
ryanhamley
commented
Mar 19, 2026
Comment on lines
+10
to
+13
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/wavespotter/mapbox-context.git" | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
npm said this change had to be made in order to publish? i ran npm pkg fix and this is what it spit out.
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.
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-reverseflex 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.
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.