From: Anton Khorev Date: Mon, 19 Aug 2024 15:54:50 +0000 (+0300) Subject: Remove endpoint markers in disable method X-Git-Tag: live~310^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/c9f495cb18ac70b0b31822c9aac2a1c95f7d626e?hp=dad6bca7530f0f7d240dc21d3369cf71edcf41bb 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 e0463ef8d..04298d125 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -325,9 +325,7 @@ OSM.Directions = function (map) { map .removeLayer(popup) - .removeLayer(polyline) - .removeLayer(endpoints[0].marker) - .removeLayer(endpoints[1].marker); + .removeLayer(polyline); }; return page;