X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ad01a61b6d07fffff3dedfd476830699c8f50038..fd991a0201c83a639c585de3119c779fda761209:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 638be0dca..a3531eb30 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -347,6 +347,8 @@ $(document).ready(function () { 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(); @@ -358,9 +360,8 @@ $(document).ready(function () { 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')); - });