diff --git a/assets/js/map.ts b/assets/js/map.ts index 9c0d640..d43fcb3 100644 --- a/assets/js/map.ts +++ b/assets/js/map.ts @@ -1393,6 +1393,15 @@ let MapAPRSMap = { self.clearRfPathLines(); }); + // Resize map when slideover toggles (class changes handled by LiveView JS commands) + self.el.addEventListener("phx:map-resize", () => { + setTimeout(() => { + if (self.map) { + self.map.invalidateSize(); + } + }, 350); + }); + // Handle bounds-based marker filtering self.handleEvent( "filter_markers_by_bounds", diff --git a/lib/aprsme_web/live/map_live/index.ex b/lib/aprsme_web/live/map_live/index.ex index 43ab276..f70327c 100644 --- a/lib/aprsme_web/live/map_live/index.ex +++ b/lib/aprsme_web/live/map_live/index.ex @@ -11,7 +11,6 @@ defmodule AprsmeWeb.MapLive.Index do import Phoenix.LiveView, only: [connected?: 1, get_connect_params: 1, push_event: 3, push_patch: 2, put_flash: 3] - # Import the new components module alias Aprsme.Packets alias Aprsme.Packets.Clustering alias AprsmeWeb.Endpoint @@ -30,6 +29,9 @@ defmodule AprsmeWeb.MapLive.Index do alias AprsmeWeb.MapLive.RfPath alias AprsmeWeb.MapLive.UrlParams alias AprsmeWeb.TimeUtils + alias Phoenix.LiveView.JS + + # Import the new components module alias Phoenix.LiveView.Socket alias Phoenix.Socket.Broadcast @@ -1087,7 +1089,7 @@ defmodule AprsmeWeb.MapLive.Index do defp toggle_button(assigns) do ~H"""