X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/4be0e9bd103292a22bd2ca7c8f2744f33c4457d3..098f8e98f2f6dbb5a3906a2355a244cef9d8b812:/app/assets/javascripts/index/directions.js.erb diff --git a/app/assets/javascripts/index/directions.js.erb b/app/assets/javascripts/index/directions.js.erb index 72299ea1d..faa922635 100644 --- a/app/assets/javascripts/index/directions.js.erb +++ b/app/assets/javascripts/index/directions.js.erb @@ -73,7 +73,7 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = true; - $.getJSON('<%= NOMINATIM_URL %>search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) { + $.getJSON(document.location.protocol + '<%= NOMINATIM_URL %>search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length == 0) { @@ -163,6 +163,7 @@ OSM.Directions = function (map) { d = endpoints[1].latlng; if (!o || !d) return; + $("header").addClass("closed"); var precision = OSM.zoomPrecision(map.getZoom()); @@ -295,7 +296,6 @@ OSM.Directions = function (map) { $(".directions_form").on("submit", function(e) { e.preventDefault(); - $("header").addClass("closed"); getRoute(); });