diff --git a/lib/aprs_web/live/map_live/index.ex b/lib/aprs_web/live/map_live/index.ex
index 699ec90..897b82e 100644
--- a/lib/aprs_web/live/map_live/index.ex
+++ b/lib/aprs_web/live/map_live/index.ex
@@ -52,7 +52,11 @@ defmodule AprsWeb.MapLive.Index do
pending_geolocation: nil,
bounds_update_timer: nil,
pending_bounds: nil,
- initial_bounds_loaded: false
+ initial_bounds_loaded: false,
+ # Overlay controls
+ overlay_callsign: "",
+ trail_duration: "1",
+ historical_hours: "1"
)
end
@@ -201,6 +205,33 @@ defmodule AprsWeb.MapLive.Index do
{:noreply, socket}
end
+ @impl true
+ def handle_event("update_callsign", %{"callsign" => callsign}, socket) do
+ {:noreply, assign(socket, overlay_callsign: callsign)}
+ end
+
+ @impl true
+ def handle_event("update_trail_duration", %{"target" => %{"value" => duration}}, socket) do
+ {:noreply, assign(socket, trail_duration: duration)}
+ end
+
+ @impl true
+ def handle_event("update_historical_hours", %{"target" => %{"value" => hours}}, socket) do
+ {:noreply, assign(socket, historical_hours: hours)}
+ end
+
+ @impl true
+ def handle_event("search_callsign", %{"callsign" => callsign}, socket) do
+ trimmed_callsign = callsign |> String.trim() |> String.upcase()
+
+ if trimmed_callsign == "" do
+ {:noreply, socket}
+ else
+ # Navigate to the callsign-specific route
+ {:noreply, push_navigate(socket, to: "/#{trimmed_callsign}")}
+ end
+ end
+
@spec handle_bounds_update(map(), Socket.t()) :: {:noreply, Socket.t()}
defp handle_bounds_update(bounds, socket) do
# Update the map bounds from the client
@@ -425,9 +456,8 @@ defmodule AprsWeb.MapLive.Index do
position: absolute;
top: 0;
left: 0;
- right: 0;
+ right: 352px;
bottom: 0;
- width: 100%;
height: 100vh;
z-index: 1;
}
@@ -526,6 +556,176 @@ defmodule AprsWeb.MapLive.Index do
+ + How long should position trails be displayed +
++ + How many hours of historical packets to load +
+