]> git.openstreetmap.org Git - rails.git/commitdiff
Always use controller computed zoom when starting Potlatch
authorTom Hughes <tom@compton.nu>
Thu, 5 Dec 2013 09:48:53 +0000 (09:48 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 5 Dec 2013 09:48:53 +0000 (09:48 +0000)
The value of mapParams.zoom may have come from the cookie and be
unrelated to the actual view the user came from with this click, so
just use the default zoom set by the controller.

Fixes #621.

app/views/site/_potlatch.html.erb
app/views/site/_potlatch2.html.erb

index 7c16b40b802b95fb0f8c82c2b5c70fc0ef539ef1..e360dcad00dcb891597b438a60eaab36f8092d48 100644 (file)
     // 700,600 for fixed size, 100%,100% for resizable
   }
 
-  var mapParams = OSM.mapParams();
 <% if @lat && @lon -%>
-  doSWF(<%= @lat %>, <%= @lon %>, mapParams.zoom || <%= @zoom %>);
+  doSWF(<%= @lat %>, <%= @lon %>, <%= @zoom %>);
 <% else -%>
+  var mapParams = OSM.mapParams();
   doSWF(mapParams.lat, mapParams.lon, mapParams.zoom || 17);
 <% end -%>
 </script>
index 69940c8eaf8593ff7149843fffa5285c5c97fc00..3aeafa9cf08c4cedac6a483da66e06d28c328ca3 100644 (file)
     }
   }
 
-  var mapParams = OSM.mapParams();
 <% if @lat && @lon -%>
-  doSWF(<%= @lat %>, <%= @lon %>, mapParams.zoom || <%= @zoom %>);
+  doSWF(<%= @lat %>, <%= @lon %>, <%= @zoom %>);
 <% else -%>
+  var mapParams = OSM.mapParams();
   doSWF(mapParams.lat, mapParams.lon, mapParams.zoom || 17);
 <% end -%>