- <% unless OSM_STATUS == :api_offline or OSM_STATUS == :database_offline %>
- map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", { "visibility": false });
- map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
- map.addLayer(map.dataLayer);
+ <% unless STATUS == :api_offline or STATUS == :database_offline %>
+ map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", { "visibility": false });
+ map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
+ map.addLayer(map.dataLayer);
+
+ map.osbLayer = new OpenLayers.Layer.OpenStreetBugs("OpenStreetBugs", {
+ serverURL : "/api/0.6/",
+ iconOpen : new OpenLayers.Icon("/images/open_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
+ iconClosed : new OpenLayers.Icon("/images/closed_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
+ readonly : false,
+ setCookie : false,
+ cookieLifetime : 1000,
+ cookiePath : "/my/map/",
+ permalinkURL : "http://www.openstreetmap.org/",
+ theme : "/stylesheets/openstreetbugs.css"
+ });
+
+ map.addLayer(map.osbLayer);
+
+ map.osbControl = new OpenLayers.Control.OpenStreetBugs(map.osbLayer);
+
+ map.addControl(map.osbControl);
+
+ var lBug = document.getElementById('ReportBug');
+ lBug.addEventListener('click',function (e) {
+ map.osbControl.activate(); document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "crosshair" },false);
+
+ map.events.register("zoomend",map,function () { var zoom = map.getZoom(); var lBug = document.getElementById('ReportBug')
+ if (zoom > 11) { lBug.style.visibility = 'visible';} else {lBug.style.visibility = "hidden";}});
+
+