]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions-endpoint.js
Remove endpoint markers in disable method
[rails.git] / app / assets / javascripts / index / directions-endpoint.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) {