geolocation debug

This commit is contained in:
Graham McIntire 2025-07-11 14:00:50 -05:00
parent 55b1a771e2
commit c40e85d47a
No known key found for this signature in database

View file

@ -547,6 +547,13 @@ defmodule AprsmeWeb.MapLive.Index do
@impl true @impl true
def handle_params(params, _url, socket) do def handle_params(params, _url, socket) do
# Check if we should skip this update (e.g., when using IP geolocation on initial load)
if Map.get(socket.assigns, :should_skip_initial_url_update, false) and
not Map.get(socket.assigns, :map_ready, false) do
# Skip the URL parameter update to preserve IP geolocation
socket = assign(socket, should_skip_initial_url_update: false)
{:noreply, socket}
else
# Parse new map state from URL parameters # Parse new map state from URL parameters
{map_center, map_zoom} = parse_map_params(params) {map_center, map_zoom} = parse_map_params(params)
@ -567,6 +574,7 @@ defmodule AprsmeWeb.MapLive.Index do
{:noreply, socket} {:noreply, socket}
end end
end
@impl true @impl true
def handle_info({:process_bounds_update, map_bounds}, socket), do: handle_info_process_bounds_update(map_bounds, socket) def handle_info({:process_bounds_update, map_bounds}, socket), do: handle_info_process_bounds_update(map_bounds, socket)