X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e6de9accd215774a104497a7390943c9fa890a8b..f053c8472336b386eaff72acdcdb8f8e148a3340:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 94b24debf..656db99c8 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -8,6 +8,14 @@ <%= render :partial => 'key' %> <%= render :partial => 'search' %> + +
@@ -21,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. @@ -86,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 %>); @@ -118,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(); }