From: Tom Hughes Date: Thu, 5 Dec 2013 09:48:53 +0000 (+0000) Subject: Always use controller computed zoom when starting Potlatch X-Git-Tag: live~4581 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7a3500438906e55bdce461c208bbba1a2d8fdb75 Always use controller computed zoom when starting Potlatch 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. --- diff --git a/app/views/site/_potlatch.html.erb b/app/views/site/_potlatch.html.erb index 7c16b40b8..e360dcad0 100644 --- a/app/views/site/_potlatch.html.erb +++ b/app/views/site/_potlatch.html.erb @@ -51,10 +51,10 @@ // 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 -%> diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 69940c8ea..3aeafa9cf 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -70,10 +70,10 @@ } } - 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 -%>