feat(rover): clear selected candidate + path lines on recalculate
This commit is contained in:
parent
556967db5a
commit
2f46d49016
2 changed files with 11 additions and 1 deletions
|
|
@ -276,7 +276,16 @@ export const RoverMap: Partial<RoverMapHook> = {
|
|||
}
|
||||
) => {
|
||||
this.candidatePathLayer.clearLayers()
|
||||
if (!candidate || !paths || paths.length === 0) return
|
||||
|
||||
if (!candidate) {
|
||||
if (this.selectedCandidateMarker) {
|
||||
this.map.removeLayer(this.selectedCandidateMarker)
|
||||
this.selectedCandidateMarker = null
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (!paths || paths.length === 0) return
|
||||
|
||||
for (const p of paths) {
|
||||
L.polyline(
|
||||
|
|
|
|||
|
|
@ -320,6 +320,7 @@ defmodule MicrowavepropWeb.RoverLive do
|
|||
socket
|
||||
|> assign(top_candidates: cands, selected_candidate: nil, scoring_loading: false)
|
||||
|> apply_scoring_warnings(warnings)
|
||||
|> push_event("candidate_paths", %{candidate: nil, paths: []})
|
||||
|> push_event("rover_results", %{
|
||||
cells: cells,
|
||||
drive_radius_km: socket.assigns.drive_radius_km
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue