dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
283 stars 34 forks source link

Preserve images after changing basemap style #131

Closed dabreegster closed 4 months ago

dabreegster commented 4 months ago

Similar to #60, we need to re-add any extra images when changing the basemap. This is a draft PR because I haven't gotten the implementation to work yet, but at least a test has been started

changeset-bot[bot] commented 4 months ago

⚠️ No Changeset found

Latest commit: aa43f61b8f98381c2112f09d499ddc517ce310a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 4 months ago

Someone is attempting to deploy a commit to a Personal Account owned by @dimfeld on Vercel.

@dimfeld first needs to authorize it.

dimfeld commented 4 months ago

I'll take a look today or tomorrow as well and see if I can figure it out. Thanks!

dimfeld commented 4 months ago

Ok the tricky part here was that $mapInstance.loaded() returns false at the time when we try to reload the images, so it gets cancelled. But it's actually ok to trigger the load at that point. Fixed by adding a boolean flag to force reload in this case. Check out #132, I'll give the code one more look tonight and merge it if it looks good to you.

dimfeld commented 4 months ago

Closed by #132

dimfeld commented 4 months ago

Released v0.8.2 with the fix, thanks!