From: Anton Khorev Date: Mon, 19 Aug 2024 15:54:50 +0000 (+0300) Subject: Remove endpoint markers in disable method X-Git-Tag: live~301^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a8838b37277c47e8d1bc295bd39db467092685a2 Remove endpoint markers in disable method --- 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;