X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/25fa17d6129adbbbd7bcd8533d24889b25fbf240..88105d9c643519e02082ba9cc5044bb0dfdcb7b9:/app/views/site/index.rhtml?ds=inline diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index fa31d848b..656db99c8 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -8,8 +8,15 @@ <%= render :partial => 'key' %> <%= render :partial => 'search' %> + +
-
@@ -22,7 +29,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. @@ -87,6 +94,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 %>); @@ -119,6 +130,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(); }