]> git.openstreetmap.org Git - rails.git/commitdiff
Remove "whereami" search parameter, use "lat" and "lon" instead
authorAnton Khorev <tony29@yandex.ru>
Sat, 6 Jul 2024 13:56:49 +0000 (16:56 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sat, 6 Jul 2024 13:56:49 +0000 (16:56 +0300)
app/assets/javascripts/index/contextmenu.js
app/assets/javascripts/index/search.js
app/controllers/geocoder_controller.rb

index cac5e6fbf8c8c145d57f427a599d423c8a3de773..ffc0eadb771d24810ba21c2e1344d20484726f27 100644 (file)
@@ -51,7 +51,7 @@ OSM.initializeContextMenu = function (map) {
           lat = latlng.lat.toFixed(precision),
           lng = latlng.lng.toFixed(precision);
 
-      OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(lat + "," + lng));
+      OSM.router.route("/search?lat=" + encodeURIComponent(lat) + "&lon=" + encodeURIComponent(lng));
     }
   });
 
index 94bb52a1be485b98cd6c8e87e208884f787d33fd..2f3882e3ae126e9486d7a9fd6929e0b182365102 100644 (file)
@@ -33,10 +33,11 @@ OSM.Search = function (map) {
   $(".describe_location").on("click", function (e) {
     e.preventDefault();
     var center = map.getCenter().wrap(),
-        precision = OSM.zoomPrecision(map.getZoom());
-    OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(
-      center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
-    ));
+        precision = OSM.zoomPrecision(map.getZoom()),
+        lat = center.lat.toFixed(precision),
+        lng = center.lng.toFixed(precision);
+
+    OSM.router.route("/search?lat=" + encodeURIComponent(lat) + "&lon=" + encodeURIComponent(lng));
   });
 
   $("#sidebar_content")
index ee3c3479c49bf260fb56d02db8fd4711d97f70ee..8ec0ab6b70acbb6c6e645e9a25229347ebfa0c9b 100644 (file)
@@ -221,7 +221,7 @@ class GeocoderController < ApplicationController
       elsif latlon = query.match(%r{^([+-]?\d+(\.\d*)?)(?:\s+|\s*[,/]\s*)([+-]?\d+(\.\d*)?)$})
         params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query)
 
-        params[:latlon_digits] = true unless params[:whereami]
+        params[:latlon_digits] = true
       end
     end