From 58a0184fc00ad85103367fe9877ab5af3a9aeb03 Mon Sep 17 00:00:00 2001 From: Jamie Guthrie Date: Wed, 14 Feb 2018 19:54:53 +0000 Subject: [PATCH] Fix route path 'hovering' when marker positions are changed Closes #1755 --- app/assets/javascripts/index/directions.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 1ad7f9cb7..1a3e0d4ec 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -54,6 +54,8 @@ OSM.Directions = function (map) { }); input.on("change", function (e) { + awaitingGeocode = true; + // make text the same in both text boxes var value = e.target.value; endpoint.setValue(value); @@ -88,12 +90,9 @@ OSM.Directions = function (map) { return; } - input.val(json[0].display_name); + endpoint.setLatLng(L.latLng(json[0])); - endpoint.latlng = L.latLng(json[0]); - endpoint.marker - .setLatLng(endpoint.latlng) - .addTo(map); + input.val(json[0].display_name); if (awaitingGeocode) { awaitingGeocode = false; -- 2.39.5