callsign map working
This commit is contained in:
parent
b60c554f80
commit
24b8627fd0
2 changed files with 21 additions and 6 deletions
|
|
@ -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 = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue