Pass viewbox to Nominatim when geocoding routing endpoints
Fixes #2327 Closes #2328
This commit is contained in:
parent
81f1e7982a
commit
61faea262a
1 changed files with 3 additions and 1 deletions
|
@ -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(); // <sw lon>,<sw lat>,<ne lon>,<ne lat>
|
||||
|
||||
$.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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue