getRoute(false, !dragging);
}
};
+ var endpointGeocodeCallback = function () {
+ getRoute(true, true);
+ };
var endpoints = [
- Endpoint($("input[name='route_from']"), OSM.MARKER_GREEN, endpointDragCallback),
- Endpoint($("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback)
+ Endpoint($("input[name='route_from']"), OSM.MARKER_GREEN, endpointDragCallback, endpointGeocodeCallback),
+ Endpoint($("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback, endpointGeocodeCallback)
];
var expiry = new Date();
select.append("<option value='" + i + "'>" + I18n.t("javascripts.directions.engines." + engine.id) + "</option>");
});
- function Endpoint(input, iconUrl, dragCallback) {
+ function Endpoint(input, iconUrl, dragCallback, geocodeCallback) {
var endpoint = {};
endpoint.marker = L.marker([0, 0], {
input.val(json[0].display_name);
- getRoute(true, true);
+ geocodeCallback();
});
};