]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.rhtml
Cope with not having a layer configuration at all.
[rails.git] / app / views / site / index.rhtml
index f924f7a1431e8f3a4b7b301eb0da0c6dfad2250c..e30dad1d026b73dcc7031b0de79fe901da2c6dc1 100644 (file)
@@ -8,9 +8,13 @@
 <%= render :partial => 'key' %>
 <%= render :partial => 'search' %>
 
-<noscript><div id="noscript"><p>You are either using a browser that doesn't support javascript, or you have disabled javascript.</p>
-<p>OpenStreetMap uses javascript for its slippy map.</p>
-<p>Try the <a href="http://tah.openstreetmap.org/Browse/">OpenStreetMap static tile browser</a>.</p></div></noscript>
+<noscript>
+  <div id="noscript">
+    <p>You are either using a browser that doesn't support javascript, or you have disabled javascript.</p>
+    <p>OpenStreetMap uses javascript for its slippy map.</p>
+    <p>You may want to try the <a href="http://tah.openstreetmap.org/Browse/">Tiles@Home static tile browser</a> if you are unable to enable javascript.</p>
+  </div>
+</noscript>
 
 <div id="map">
 <div id="permalink"><a href="/" id="permalinkanchor">Permalink</a></div>
@@ -72,8 +76,8 @@ by the OpenStreetMap project and its contributors.
 <% lon =  '-0.1' %>
 <% lat =  '51.5' %>
 <% zoom =  h(params['zoom'] || '5') %>
-<% layers = h(params['layers']) %>
 <% end %>
+<% layers = h(params['layers']) %>
 <% end %>
 
 <%= javascript_include_tag '/openlayers/OpenLayers.js' %>
@@ -105,7 +109,7 @@ by the OpenStreetMap project and its contributors.
     setMapCenter(centre, zoom);
     <% end %>
 
-    <% if layers %>
+    <% if !layers.nil? and !layers.empty? %>
     setMapLayers("<%= layers %>");
     <% end %>