From 954e8c4500518b5bc2d812a2226bd29f03f623c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonia=20P=C3=A9rez-Cerezo?= Date: Mon, 10 Mar 2025 15:51:17 +0100 Subject: [PATCH] remove the geojson path if less than two markers are present --- frontend/common/map.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/common/map.js b/frontend/common/map.js index f065954..6cc636a 100644 --- a/frontend/common/map.js +++ b/frontend/common/map.js @@ -69,7 +69,10 @@ let geojsons = []; let geojson; async function updateBrouter () { - if (markers.length < 1) { + if (markers.length < 2) { + if (geojson != undefined) { + map.removeLayer(geojson); + } return; } geojsons = [];