diff --git a/src/lib/components/DirectionsPanel.svelte b/src/lib/components/DirectionsPanel.svelte index 522ac9e..bdc594d 100644 --- a/src/lib/components/DirectionsPanel.svelte +++ b/src/lib/components/DirectionsPanel.svelte @@ -157,15 +157,18 @@ } // --- clear / route drawing --- - function clearRoute() { + function clearMap() { if (routeLayer) { routeLayer.remove(); routeLayer = null; } + } + function clearRoute() { + clearMap(); result = null; status = 'idle'; errorMsg = null; } async function drawResult(r: RouteResult) { const L = (await import('leaflet')).default; - clearRoute(); + clearMap(); if (!map) return; routeLayer = L.layerGroup().addTo(map); const drawPath = r.path ?? [];