Close directions
This commit is contained in:
parent
ad01a61b6d
commit
fd991a0201
2 changed files with 12 additions and 3 deletions
|
@ -347,6 +347,8 @@ $(document).ready(function () {
|
||||||
map.getCenter().lng.toFixed(precision)));
|
map.getCenter().lng.toFixed(precision)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
|
||||||
|
|
||||||
$(".get_directions").on("click",function(e) {
|
$(".get_directions").on("click",function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(".search").hide();
|
$(".search").hide();
|
||||||
|
@ -358,9 +360,8 @@ $(document).ready(function () {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(".search").show();
|
$(".search").show();
|
||||||
$(".routing").hide();
|
$(".routing").hide();
|
||||||
|
OSM.routing.close();
|
||||||
$(".query_wrapper.search [name=query]").focus();
|
$(".query_wrapper.search [name=query]").focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
*** click each part
|
*** click each part
|
||||||
*** translation (including all alerts and presentation)
|
*** translation (including all alerts and presentation)
|
||||||
*** export GPX
|
*** export GPX
|
||||||
|
*** URL history (or do we consciously not want to support that?)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var TURN_INSTRUCTIONS=["",
|
var TURN_INSTRUCTIONS=["",
|
||||||
|
@ -96,7 +97,7 @@ OSM.Routing=function(map,name,jqSearch) {
|
||||||
r.setItinerary=function(steps) {
|
r.setItinerary=function(steps) {
|
||||||
$("#content").removeClass("overlay-sidebar");
|
$("#content").removeClass("overlay-sidebar");
|
||||||
$('#sidebar_content').empty();
|
$('#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>";
|
html+="<table>";
|
||||||
for (var i=0; i<steps.length; i++) {
|
for (var i=0; i<steps.length; i++) {
|
||||||
var step=steps[i];
|
var step=steps[i];
|
||||||
|
@ -124,6 +125,13 @@ OSM.Routing=function(map,name,jqSearch) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Close all routing UI
|
||||||
|
|
||||||
|
r.close=function() {
|
||||||
|
$("#content").addClass("overlay-sidebar");
|
||||||
|
if (r.polyline) map.removeLayer(r.polyline);
|
||||||
|
};
|
||||||
|
|
||||||
// Add engines
|
// Add engines
|
||||||
|
|
||||||
r.engines=[];
|
r.engines=[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue