+ $(".directions_form .reverse_directions").on("click", function() {
+ var from = endpoints[0].latlng,
+ to = endpoints[1].latlng;
+
+ OSM.router.route("/directions?" + querystring.stringify({
+ from: $("#route_to").val(),
+ to: $("#route_from").val(),
+ route: to.lat + "," + to.lng + ";" + from.lat + "," + from.lng
+ }));
+ });
+
+ $(".directions_form .close").on("click", function(e) {