X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f4fa8ed40e608105bac8fa06da3695c688327b51..4d8ea0eed0d47b3547f222fbc47524328bbd23a7:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 46bc3bdd7..bd114a6b3 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -21,7 +21,7 @@ Licensed under the Creative Commons Attribution-Share Alike 2.0 license -by the OpenStreetMap project and it's contributors. +by the OpenStreetMap project and its contributors. @@ -86,6 +86,10 @@ by the OpenStreetMap project and it's contributors. function mapInit(){ map = createMap("map"); + map.dataLayer = new OpenLayers.Layer("Data", { "visibility": false }); + map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData); + map.addLayer(map.dataLayer); + <% if bbox %> var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>); @@ -118,6 +122,14 @@ by the OpenStreetMap project and it's contributors. handleResize(); } + function toggleData() { + if (map.dataLayer.visibility) { + <%= remote_function :url => { :controller => 'browse', :action => 'start' } %> + } else { + closeSidebar(); + } + } + function getPosition() { return getMapCenter(); } @@ -180,5 +192,9 @@ by the OpenStreetMap project and it's contributors. window.onload = handleResize; window.onresize = handleResize; + + <% if params['action'] == 'export' %> + <%= remote_function :url => { :controller => 'export', :action => 'start' } %> + <% end %> // -->