- endpoint.marker.on('drag dragend', function (e) {
- dragging = (e.type === 'drag');
- if (dragging && !chosenEngine.draggable) return;
- if (dragging && awaitingRoute) return;
- endpoint.setLatLng(e.target.getLatLng());
- if (map.hasLayer(polyline)) {
- getRoute();
- }
- });
-
- input.on("change", function (e) {
- // make text the same in both text boxes
- var value = e.target.value;
- endpoint.setValue(value);
- });
+ getRoute(false, !dragging);
+ };
+ var endpointChangeCallback = function () {
+ getRoute(true, true);
+ };