feat: refactor maplibre for reactive signals and Via-native API

- 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
This commit is contained in:
Ryan Hamamura
2026-02-20 05:11:22 -10:00
parent 47dcab8fea
commit 7eb86999b2
12 changed files with 724 additions and 146 deletions

View File

@@ -27,7 +27,7 @@ func TestSignalReturnAsString(t *testing.T) {
for _, testcase := range testcases {
t.Run(testcase.desc, func(t *testing.T) {
t.Parallel()
var sig *signal
var sig *Signal
v := New()
v.Page("/", func(c *Context) {
sig = c.Signal(testcase.given)
@@ -57,7 +57,7 @@ func TestSignalReturnAsStringComplexTypes(t *testing.T) {
for _, testcase := range testcases {
t.Run(testcase.desc, func(t *testing.T) {
t.Parallel()
var sig *signal
var sig *Signal
v := New()
v.Page("/", func(c *Context) {
c.View(func() h.H { return nil })