Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Force fresh=true on fetched styles #2121

Open
tordans opened this issue Feb 15, 2023 · 0 comments
Open

[Feat] Force fresh=true on fetched styles #2121

tordans opened this issue Feb 15, 2023 · 0 comments
Labels

Comments

@tordans
Copy link
Contributor

tordans commented Feb 15, 2023

Target Use Case

When using a Mapbox Style URL like mapStyle="mapbox://styles/foo/123" the results are cached.

I am looking for a way to force a fresh version of the styles.

The Mapbox Style API has the (undocumented) fresh=true param for this use case (see mapbox/mapbox-sdk-js#364 (comment)).

However, I don't see any way to pass this to mapbox-gl or maplibre-gl.

I tried manually fetching the same style URL that I see being fetched from the console and appending ?fresh=true, but it looked like that was not picket up by the map. Maybe because I change the URL when adding the flag?

Proposal

Ideally, I would be able to call <Map mapStyle="" fresh={true} /> (with true being evaluated by some condition (like a debug flag) internally).

@tordans tordans changed the title [Feat] Force fresh=true on styles [Feat] Force fresh=true on fetched styles Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant