Fix route path 'hovering' when marker positions are changed

Closes #1755
This commit is contained in:
Jamie Guthrie 2018-02-14 19:54:53 +00:00 committed by Tom Hughes
parent 4a9f20a485
commit 58a0184fc0

View file

@ -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;