]> git.openstreetmap.org Git - rails.git/commitdiff
Get the location for "Where Am I?" from the view tab's link instead of
authorTom Hughes <tom@compton.nu>
Sun, 28 Feb 2010 16:04:30 +0000 (16:04 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 28 Feb 2010 16:04:30 +0000 (16:04 +0000)
by asking the map so that it works in edit mode as well. Closes #2383.

app/views/site/_search.html.erb

index 3750a7dc93191e97c6d6ecc55b50e0577208c580..0fea3793fa689c607804996d4e8e81e19b19f983 100644 (file)
@@ -5,12 +5,11 @@
   }
 
   function describeLocation() {
-    var position = getPosition();
-    var zoom = getZoom();
+    var args = getArgs($("viewanchor").href);
 
     <%= remote_function(:loading => "startSearch()",
                         :url => { :controller => :geocoder, :action => :description },
-                        :with => "'lat=' + position.lat + '&lon=' + position.lon + '&zoom=' + zoom") %>
+                        :with => "'lat=' + args['lat'] + '&lon=' + args['lon'] + '&zoom=' + args['zoom']") %>
   }
 
   function setSearchViewbox() {