X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/701325e9ef6720a16646c7218010e33b5c58d544..573991e5a9997d5ea14e430ae58a40ef0eaecd34:/app/views/user/_map.html.erb diff --git a/app/views/user/_map.html.erb b/app/views/user/_map.html.erb index 71f3ad9e5..2d886527c 100644 --- a/app/views/user/_map.html.erb +++ b/app/views/user/_map.html.erb @@ -24,11 +24,11 @@ end function init(){ var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>); + <% if params[:scale].to_f > 0 then -%> + var zoom = <%= scale_to_zoom params[:scale] %>; + <% else -%> var zoom = <%= zoom %>; - - <% if params[:scale] and params[:scale].length > 0 and params[:scale].to_f > 0 then %> - zoom = <%= Math.log(360.0 / (params[:scale].to_f * 512.0)) / Math.log(2.0) %>; - <% end %> + <% end -%> var map = createMap("map");