[openstreetmap/openstreetmap-website] Add viewbox param to Nominatim link in search results (PR #5863)

Anton Khorev notifications at github.com
Mon Mar 31 17:12:12 UTC 2025


@AntonKhorev commented on this pull request.



> @@ -18,9 +21,14 @@ OSM.Search = function (map) {
   $(".search_form").on("submit", function (e) {
     e.preventDefault();
     $("header").addClass("closed");
-    const query = $(this).find("input[name=query]").val();
-    let search = "/";
-    if (query) search = "/search?" + new URLSearchParams({ query });
+    const params = new URLSearchParams;
+    for (const paramName of ["query", "zoom", "minlon", "minlat", "maxlon", "maxlat"]) {

That was my attempt to remove `submit` listener. I thought about letting Turbo handling the entire thing. But since I didn't complete that, I'll get the zoom and bbox here.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5863#discussion_r2021422390
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5863/review/2729959090 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250331/41dce61b/attachment.htm>


More information about the rails-dev mailing list