]> 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 17:30:51 +0000 (20:30 +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 44b64a525636d5d3d153b2a2f68600ea6e101b29..7e8c18fb8cdaafd6d0d0ace0542a8a780d5eadb3 100644 (file)
@@ -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;