]> git.openstreetmap.org Git - rails.git/commitdiff
Remove endpoint markers in disable method
authorAnton Khorev <tony29@yandex.ru>
Mon, 19 Aug 2024 15:54:50 +0000 (18:54 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 19 Aug 2024 16:39:53 +0000 (19:39 +0300)
app/assets/javascripts/index/directions-endpoint.js
app/assets/javascripts/index/directions.js

index a9dc683059946790f0aeaf395b73d3e8a3d923b6..3069eb651671b54840869ee48ebe506a0599d95c 100644 (file)
@@ -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) {
index e0463ef8de00d4306fa0f3c53069a8bbef9f322d..04298d125ebbf2aa6c019b8d855e1872a17783ac 100644 (file)
@@ -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;