feat: add RotationSignal for reactive marker rotation
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:
@@ -122,13 +122,18 @@ func (m *Map) Element(extra ...h.H) h.H {
|
||||
}
|
||||
}
|
||||
|
||||
// Hidden inputs for signal-backed marker position writeback (drag → signal)
|
||||
// Hidden inputs for signal-backed marker position/rotation writeback
|
||||
for _, me := range m.markers {
|
||||
if me.marker.LngSignal != nil && me.marker.LatSignal != nil {
|
||||
children = append(children,
|
||||
h.Input(h.Type("hidden"), me.marker.LngSignal.Bind()),
|
||||
h.Input(h.Type("hidden"), me.marker.LatSignal.Bind()),
|
||||
)
|
||||
if me.marker.RotationSignal != nil {
|
||||
children = append(children,
|
||||
h.Input(h.Type("hidden"), me.marker.RotationSignal.Bind()),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user