feat: add RotationSignal for reactive marker rotation
All checks were successful
CI / Build and Test (push) Successful in 36s
CI / Build and Test (pull_request) Successful in 35s

Add RotationSignal field to Marker so rotation updates reactively via
signals, matching LngSignal/LatSignal. The markerEffectExpr now calls
setRotation() when RotationSignal is present.

Fix ship orientation in the example by subtracting 90 degrees from the
north-based heading to account for the east-facing SVG bow.
This commit is contained in:
Ryan Hamamura
2026-02-20 11:14:53 -10:00
parent 297808d4cc
commit f0a471a150
4 changed files with 37 additions and 16 deletions

View File

@@ -313,6 +313,7 @@ type Marker struct {
Anchor string
// Rotation is clockwise degrees. Useful for directional icons (ships, vehicles).
// Ignored when RotationSignal is set.
Rotation float64
// Signal-backed position. When set, signals drive marker position reactively.
@@ -320,6 +321,9 @@ type Marker struct {
// If Draggable is true, drag updates write back to these signals.
LngSignal *via.Signal
LatSignal *via.Signal
// RotationSignal drives marker rotation reactively. When set, Rotation is ignored.
RotationSignal *via.Signal
}
// Popup describes a map popup.