From a8838b37277c47e8d1bc295bd39db467092685a2 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 19 Aug 2024 18:54:50 +0300 Subject: [PATCH] Remove endpoint markers in disable method --- app/assets/javascripts/index/directions-endpoint.js | 2 ++ app/assets/javascripts/index/directions.js | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/index/directions-endpoint.js b/app/assets/javascripts/index/directions-endpoint.js index a9dc68305..3069eb651 100644 --- a/app/assets/javascripts/index/directions-endpoint.js +++ b/app/assets/javascripts/index/directions-endpoint.js @@ -24,6 +24,8 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch endpoint.marker.off("drag dragend", markerDragListener); input.off("keydown", inputKeydownListener); input.off("change", inputChangeListener); + + map.removeLayer(endpoint.marker); }; function markerDragListener(e) { diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 44b64a525..7e8c18fb8 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -326,9 +326,7 @@ OSM.Directions = function (map) { map .removeLayer(popup) - .removeLayer(polyline) - .removeLayer(endpoints[0].marker) - .removeLayer(endpoints[1].marker); + .removeLayer(polyline); }; return page; -- 2.39.5