diff --git a/assets/js/features/trail_manager.ts b/assets/js/features/trail_manager.ts index e8152cd..b7e6b8b 100644 --- a/assets/js/features/trail_manager.ts +++ b/assets/js/features/trail_manager.ts @@ -48,7 +48,6 @@ export class TrailManager { if (!trailState) { trailState = { positions: [] }; this.trails.set(baseCallsign, trailState); - console.log(`TrailManager: Created new trail for ${baseCallsign}`); } // Check if this position already exists (avoid duplicates) @@ -124,10 +123,6 @@ export class TrailManager { className: "historical-trail-line", }).addTo(this.trailLayer); - console.log( - `TrailManager: Created trail line for ${baseCallsign} with ${trailState.positions.length} positions`, - ); - // Don't create additional dots here since historical positions are now shown as markers trailState.dots = []; } diff --git a/lib/aprs_web/live/map_live/callsign_view.ex b/lib/aprs_web/live/map_live/callsign_view.ex index 341806e..e4a1ee2 100644 --- a/lib/aprs_web/live/map_live/callsign_view.ex +++ b/lib/aprs_web/live/map_live/callsign_view.ex @@ -946,7 +946,7 @@ defmodule AprsWeb.MapLive.CallsignView do "data_type" => to_string(Map.get(packet, :data_type, Map.get(packet, "data_type", "unknown"))), "path" => Map.get(packet, :path, Map.get(packet, "path", "")), "comment" => comment, - "data_extended" => data_extended || %{}, + "data_extended" => convert_tuples_to_strings(data_extended || %{}), "symbol_table_id" => symbol_table_id, "symbol_code" => symbol_code, "symbol_description" => symbol_description, @@ -998,6 +998,26 @@ defmodule AprsWeb.MapLive.CallsignView do end end + defp convert_tuples_to_strings(map) when is_map(map) do + if Map.has_key?(map, :__struct__) do + map + else + Map.new(map, fn {k, v} -> + {k, convert_tuples_to_strings(v)} + end) + end + end + + defp convert_tuples_to_strings(list) when is_list(list) do + Enum.map(list, &convert_tuples_to_strings/1) + end + + defp convert_tuples_to_strings(tuple) when is_tuple(tuple) do + to_string(inspect(tuple)) + end + + defp convert_tuples_to_strings(other), do: other + defp load_callsign_packets(socket, callsign) do # Load only the latest packet for this specific callsign latest_packet =