Add viewbox-bounded search and enable Dutch quick-search chips

- Pass the currently visible map bounds as a Nominatim viewbox so
  results are restricted to what the user can see (bounded=1).
- Increase default result limit from 8 to 20.
- Enable the quick-search chip row with localized Dutch labels
  (Supermarkt, Café, Kroeg, Camping, Park, Restaurant, Vegan,
  Hotel, Parkeerplek).
This commit is contained in:
2026-08-21 14:10:30 +02:00
parent 51f2eb8e1d
commit 439d389a44
2 changed files with 72 additions and 16 deletions

View File

@@ -699,51 +699,72 @@
<div class="bottom-ui">
<!--<div class="chips">
<div class="chips">
<button
class="chip"
data-search="restaurants"
data-search="supermarket"
>
🍴 Restaurants
🛒 Supermarkt
</button>
<button
class="chip"
data-search="hotels"
data-search="cafe"
>
🛏 Hotels
☕ Café
</button>
<button
class="chip"
data-search="attractions"
data-search="pub"
>
📷 Attractions
🍺 Kroeg
</button>
<button
class="chip"
data-search="museums"
data-search="camping"
>
🏛 Museums
⛺ Camping
</button>
<button
class="chip"
data-search="public transport"
data-search="park"
>
🚆 Public transport
🌳 Park
</button>
<button
class="chip"
data-search="pharmacies"
data-search="restaurant"
>
💊 Pharmacies
🍴 Restaurant
</button>
</div>-->
<button
class="chip"
data-search="vegan restaurant"
>
🥗 Vegan
</button>
<button
class="chip"
data-search="hotel"
>
🛏 Hotel
</button>
<button
class="chip"
data-search="parking"
>
🅿️ Parkeerplek
</button>
</div>
<div class="search-box">
@@ -944,6 +965,18 @@
clearMarkers();
// Build a viewbox from the currently visible map area so
// results are restricted to what the user can see.
const visibleBounds = map.getBounds();
const viewbox = [
visibleBounds.getWest(),
visibleBounds.getNorth(),
visibleBounds.getEast(),
visibleBounds.getSouth()
].join(",");
try {
const response =
@@ -951,7 +984,9 @@
"/search?q=" +
encodeURIComponent(
query + ", "
)
) +
"&viewbox=" +
encodeURIComponent(viewbox)
);