X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cdf12b7a33334fefe58ed140c2874217591ac69e..56065cd1548b0d430d90665ae4de3b19319b52c8:/app/views/site/index.rhtml
diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml
index a79ea10c3..0c6488129 100644
--- a/app/views/site/index.rhtml
+++ b/app/views/site/index.rhtml
@@ -21,17 +21,15 @@
-
-
-http://creativecommons.org/licenses/by-sa/2.0/ |
-http://openstreetmap.org/ |
-
-
-
-Licensed under the Creative Commons Attribution-Share Alike 2.0 license
-by the OpenStreetMap project and its contributors.
- |
-
+
+
+ http://creativecommons.org/licenses/by-sa/2.0/ |
+ http://openstreetmap.org/ |
+
+
+ Licensed under the Creative Commons Attribution-Share Alike 2.0 license by the OpenStreetMap project and its contributors. |
+
+
<% if params['mlon'] and params['mlat'] %>
@@ -94,6 +92,12 @@ by the OpenStreetMap project and its contributors.
function mapInit(){
map = createMap("map");
+ <% unless OSM_STATUS == :api_offline or OSM_STATUS == :database_offline %>
+ map.dataLayer = new OpenLayers.Layer("Data", { "visibility": false });
+ map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
+ map.addLayer(map.dataLayer);
+ <% end %>
+
<% if bbox %>
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
@@ -126,6 +130,14 @@ by the OpenStreetMap project and its contributors.
handleResize();
}
+ function toggleData() {
+ if (map.dataLayer.visibility) {
+ <%= remote_function :url => { :controller => 'browse', :action => 'start' } %>
+ } else {
+ closeSidebar();
+ }
+ }
+
function getPosition() {
return getMapCenter();
}