Two issues discovered during testing:
1. data-effect expressions for signal-backed markers short-circuited
before reading $signalID when the map hadn't loaded yet. Datastar
never tracked those signals as dependencies, so the effect never
re-ran. Fix: read signal values unconditionally before the guard.
2. prepareSignalsForPatch never reset changed=false on regular signals
(only computed ones), causing every SyncSignals() call to re-push
all signals — including stale server-side values for the draggable
pin, overwriting the client-side drag position.
Three related bugs in the maplibre reactive signal plumbing:
1. Draggable marker coordinates never updated because dragendHandlerJS
queries for hidden inputs matching LngSignal/LatSignal IDs, but
Element() never rendered those inputs. Add them after the marker
data-effect divs.
2. Click-to-place marker didn't appear until moveend because Element()
rendered a bare hidden input for each event signal, colliding with
the user's action-bearing input (same data-bind, querySelector finds
the bare one first). Remove the internal event inputs — the user
provides their own via MapEvent.Input().
3. The moveend handler dispatched 'input' on ALL data-bind inputs in
the wrapper, accidentally triggering event inputs. Add an else-return
so only the 5 viewport signal inputs get dispatched.
- Export Signal type (signal → Signal) so subpackages can reference it
- Expose viewport signals as public fields (CenterLng, CenterLat, Zoom,
Bearing, Pitch) for .Text() display and .Bind() usage
- Add signal-backed marker positions (LngSignal/LatSignal) with
data-effect reactivity for server push and dragend writeback
- Add event system (MapEvent, OnClick, OnLayerClick, OnMouseMove,
OnContextMenu) using hidden inputs + action triggers
- Add Source interface replacing type-switch, with RawSource escape hatch
- Add CameraOptions for FlyTo/EaseTo/JumpTo/FitBounds/Stop
- Add Control interface with NavigationControl, ScaleControl,
GeolocateControl, FullscreenControl
- Expand Options with interaction toggles, MaxBounds, and Extra map
- Add effectspike example to validate data-effect with server-pushed signals
- Update maplibre example to showcase all new features
Provides a Go API for interactive maps within Via applications:
- Plugin serves vendored MapLibre GL JS v4.7.1 assets
- Map struct with pre/post-render source, layer, marker, popup management
- Viewport signal sync (center, zoom, bearing, pitch) via hidden inputs
- FlyTo, SetCenter, SetZoom and other viewport setters via ExecScript
- Idempotent init script with SPA cleanup via MutationObserver
- Example app demonstrating markers, GeoJSON layers, and FlyTo actions