Skip to content

v0.21.0

Choose a tag to compare

@ryanhamamura ryanhamamura released this 19 Feb 23:37
· 22 commits to main since this release

Features

  • New maplibre subpackage — Type-safe Go API for MapLibre GL JS maps within Via applications
    • maplibre.Plugin serves vendored MapLibre GL JS v4.7.1 assets and injects them into the document head
    • maplibre.New() creates a map bound to a Via context with viewport signal sync (center, zoom, bearing, pitch)
    • Pre-render accumulation for sources, layers, markers, and popups; post-render mutations via ExecScript
    • Viewport setters: FlyTo, SetCenter, SetZoom, SetBearing, SetPitch, SetStyle
    • Source management: AddSource, RemoveSource, UpdateGeoJSONSource (GeoJSON, Vector, Raster)
    • Layer management: AddLayer, RemoveLayer, SetPaintProperty, SetLayoutProperty
    • Marker and popup management: AddMarker, RemoveMarker, ShowPopup, ClosePopup
    • Exec() escape hatch for arbitrary JS with the map instance available as m
    • Idempotent init script with SPA cleanup via MutationObserver and auto-resize via ResizeObserver
    • Example app at internal/examples/maplibre/ demonstrating markers, GeoJSON layers, and FlyTo actions