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();
}
@@ -125,7 +145,7 @@ by the OpenStreetMap project and it's contributors.
function setPosition(lat, lon, zoom) {
var centre = new OpenLayers.LonLat(lon, lat);
- map.setCenter(centre, zoom);
+ setMapCenter(centre, zoom);
if (marker)
removeMarkerFromMap(marker);
@@ -180,5 +200,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 %>
// -->