map.getCenter().lng.toFixed(precision)));
});
+ OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
+
$(".get_directions").on("click",function(e) {
e.preventDefault();
$(".search").hide();
e.preventDefault();
$(".search").show();
$(".routing").hide();
+ OSM.routing.close();
$(".query_wrapper.search [name=query]").focus();
});
- OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
-
});
*** click each part
*** translation (including all alerts and presentation)
*** export GPX
+ *** URL history (or do we consciously not want to support that?)
*/
var TURN_INSTRUCTIONS=["",
r.setItinerary=function(steps) {
$("#content").removeClass("overlay-sidebar");
$('#sidebar_content').empty();
- var html='<h2><a class="geolink" href="#"><span class="icon close"></span></a>Directions</h2>';
+ var html='<h2><a class="geolink" href="#" onclick="$(~.close_directions~).click();return false;"><span class="icon close"></span></a>Directions</h2>'.replace(/~/g,"'");
html+="<table>";
for (var i=0; i<steps.length; i++) {
var step=steps[i];
};
+ // Close all routing UI
+
+ r.close=function() {
+ $("#content").addClass("overlay-sidebar");
+ if (r.polyline) map.removeLayer(r.polyline);
+ };
+
// Add engines
r.engines=[];