//= require_tree ./directions_engines
OSM.Directions = function (map) {
+ $(".directions_form a.directions_close").on("click", function(e) {
+ e.preventDefault();
+ var route_from = $(e.target).parent().parent().parent().find("input[name=route_from]").val();
+ if (route_from) {
+ OSM.router.route("/?query=" + encodeURIComponent(route_from) + OSM.formatHash(map));
+ } else {
+ OSM.router.route("/" + OSM.formatHash(map));
+ }
+ });
+
var awaitingGeocode; // true if the user has requested a route, but we're waiting on a geocode result
var awaitingRoute; // true if we've asked the engine for a route and are waiting to hear back
var dragging; // true if the user is dragging a start/end point