Skip to content

Releases: dimfeld/svelte-maplibre

v1.0.0 - Svelte 5 Rewrite and Other Upgrades

20 Mar 19:35
Compare
Choose a tag to compare

1.0 of svelte-maplibre is released! This rewrites a lot of the internal functionality to work with Svelte 5 runes, and contains many other enhancements for better feature support and performance. Most users of the package won't need to change their code much, if at all, to upgrade.

Major Changes

  • #262 547e5e1 Thanks @dimfeld! - Set loaded = true on style.load instead of load.

    This greatly improves responsiveness of setting up the initial sources and layers.
    The MapLibre component also no longer gates rendering its children snippet on loaded.
    The Layer and various source-based components included with this library will wait for it, but if you have a custom component you may need to wait for loaded yourself using a pattern like this:

    const { map, loaded } = $derived(getMapContext())
    
    $effect(() => {
        if(map && loaded) {
            map.addSource(...);
        }
    })
  • #214 eadb5a4 Thanks @dimfeld! - Update to deck.gl v9

  • #214 0485a6a Thanks @dimfeld! - Remove map attribute from events. It was already present as target

  • #214 0485a6a Thanks @dimfeld! - Upgrade internal code to Svelte 5 runes

  • #214 0485a6a Thanks @dimfeld! - Internal: Change context structure used to pass info down the component hierarchy

  • #214 0485a6a Thanks @dimfeld! - Use undefined instead of null in many places. This improves ergonomics with Svelte component props.

  • 77c50dd Thanks @dimfeld! - Update dependency spec for compatibility with maplibgre-gl 5

Minor Changes

  • #214 0485a6a Thanks @dimfeld! - Add generics for Features on many components to permit better type safety

  • #214 0485a6a Thanks @dimfeld! - Only add event handlers to the map when something is actually listening

  • #244 49af3f3 Thanks @Tintow! - Exposed the bearingSnap property in the maps props to allow control over the default automatic snap-to-north

  • #246 2db55af Thanks @dimfeld! - Add canOpen property to a Popup which allows per-feature control over whether to show a popup or not

  • #262 547e5e1 Thanks @dimfeld! - Add BackgroundLayer component

  • #262 547e5e1 Thanks @dimfeld! - Add projection support

  • #262 547e5e1 Thanks @dimfeld! - Add anchor property to markers

  • #245 c1e8a00 Thanks @dimfeld! - Allow Popups to inherit lngLat from a parent Marker

  • fbadf74 Thanks @dimfeld! - Pass bound bounds prop out of component in same format it was passed in

Patch Changes

v1.0.0-next.13

20 Mar 19:05
Compare
Choose a tag to compare
v1.0.0-next.13 Pre-release
Pre-release

Breaking Changes

  • #262 547e5e1 Thanks @dimfeld! - Set loaded = true on style.load instead of load.

    This greatly improves responsiveness of setting up the initial sources and layers.
    The MapLibre component also no longer gates rendering its children snippet on loaded.

    For most users this will not be a breaking change, since the Layer and various source-based components
    included with this library will wait for it. If you have a custom component you may need to wait for loaded yourself using a pattern like this:

    const { map, loaded } = $derived(getMapContext())
    
    $effect(() => {
        if(map && loaded) {
            map.addSource(...);
        }
    })

Improvements

Fixes

v1.0.0-next.12

06 Feb 18:38
Compare
Choose a tag to compare
v1.0.0-next.12 Pre-release
Pre-release
  • Fix more type name conflicts when a component has the same name as a type it imports. Thanks @viernullvier for the PR!

v1.0.0-next.11

27 Jan 20:47
Compare
Choose a tag to compare
v1.0.0-next.11 Pre-release
Pre-release
  • #244 49af3f3 Thanks @Tintow! - Exposed the bearingSnap property in the maps props to allow control over the default automatic snap-to-north

v1.0.0-next.10

23 Jan 18:45
Compare
Choose a tag to compare
v1.0.0-next.10 Pre-release
Pre-release
  • 77c50dd Thanks @dimfeld! - Update dependency spec for compatibility with maplibgre-gl 5

  • 6715e61 Thanks @dimfeld! - Fix standalone popups not appearing

  • 87692e4 Thanks @dimfeld! - Default marker offset is unset instead of [0, 0]

v1.0.0-next.9

04 Jan 00:32
Compare
Choose a tag to compare
v1.0.0-next.9 Pre-release
Pre-release

FullscreenControl was not showing up when container was not specified. Thanks @0gust1 for the fix!

v1.0.0-next.8

12 Dec 18:35
Compare
Choose a tag to compare
v1.0.0-next.8 Pre-release
Pre-release

Set a z-index on Popup so it shows up above DeckGlLayer, which changed with the upgrade to DeckGl's new Maplibre integration.

v1.0.0-next.7

03 Dec 18:36
Compare
Choose a tag to compare
v1.0.0-next.7 Pre-release
Pre-release

Work around sveltejs/kit#13098 on VectorTileSource import.

v1.0.0-next.6

02 Dec 18:37
Compare
Choose a tag to compare
v1.0.0-next.6 Pre-release
Pre-release

Always attach an error handler to the map, even if onerror is not provided.

If onerror is provided, the handler will just call it. Otherwise it will print the error to the console, except for AbortError, which seems to always happen when loading a remote geojson source, and isn't useful to log.

v1.0.0-next.4

02 Dec 18:07
Compare
Choose a tag to compare
v1.0.0-next.4 Pre-release
Pre-release

Export all the new functions in context.svelte.ts from the top-level export file. You can still also reference these by importing from svelte-maplibre/context.svelte.js.