]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/search.js
Merge remote-tracking branch 'upstream/pull/5017'
[rails.git] / app / assets / javascripts / index / search.js
index 2f3882e3ae126e9486d7a9fd6929e0b182365102..476ad30a1ac11de80ad555ecf430ca6ef61923b1 100644 (file)
@@ -118,8 +118,13 @@ OSM.Search = function (map) {
 
   page.pushstate = page.popstate = function (path) {
     var params = Qs.parse(path.substring(path.indexOf("?") + 1));
-    $(".search_form input[name=query]").val(params.query);
-    $(".describe_location").hide();
+    if (params.query) {
+      $(".search_form input[name=query]").val(params.query);
+      $(".describe_location").hide();
+    } else if (params.lat && params.lon) {
+      $(".search_form input[name=query]").val(params.lat + ", " + params.lon);
+      $(".describe_location").hide();
+    }
     OSM.loadSidebarContent(path, page.load);
   };