From 61faea262a5b75ddca7035daa68239a1f0c54d05 Mon Sep 17 00:00:00 2001 From: marc tobias Date: Thu, 25 Jul 2019 03:25:02 +0200 Subject: [PATCH] Pass viewbox to Nominatim when geocoding routing endpoints Fixes #2327 Closes #2328 --- app/assets/javascripts/index/directions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 4f79ca471..4c39d6781 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -105,7 +105,9 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = true; - $.getJSON(OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json", function (json) { + var viewbox = map.getBounds().toBBoxString(); // ,,, + + $.getJSON(OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json&viewbox=" + viewbox, function (json) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { -- 2.39.5