X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/95360d9fbfb32b53bf5220dc54dc6dc10bada3bd..ec1667fc093976cb9a69e5aba675ee4281d7ff64:/app/views/user/_map.html.erb diff --git a/app/views/user/_map.html.erb b/app/views/user/_map.html.erb index eb99f4372..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 then %> - zoom = scaleToZoom(<%= params['scale'].to_f() %>); - <% end %> + <% end -%> var map = createMap("map");