fix(directions): drawResult no longer clears the result state, so turn-by-turn/distance remain visible after calculating
All checks were successful
CI / test-and-build (push) Successful in 41s

This commit is contained in:
hermes-explorigin 2026-08-10 20:48:41 +00:00
parent 000b892202
commit 2ce71b8955

View File

@ -157,15 +157,18 @@
} }
// --- clear / route drawing --- // --- clear / route drawing ---
function clearRoute() { function clearMap() {
if (routeLayer) { routeLayer.remove(); routeLayer = null; } if (routeLayer) { routeLayer.remove(); routeLayer = null; }
}
function clearRoute() {
clearMap();
result = null; result = null;
status = 'idle'; status = 'idle';
errorMsg = null; errorMsg = null;
} }
async function drawResult(r: RouteResult) { async function drawResult(r: RouteResult) {
const L = (await import('leaflet')).default; const L = (await import('leaflet')).default;
clearRoute(); clearMap();
if (!map) return; if (!map) return;
routeLayer = L.layerGroup().addTo(map); routeLayer = L.layerGroup().addTo(map);
const drawPath = r.path ?? []; const drawPath = r.path ?? [];