OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
+ function createBugCallBack() {
+ map.osbControl.deactivate();
+ document.getElementById("map_OpenLayers_Container").style.cursor = "default";
+ }
+
function mapInit(){
map = createMap("map");
map.addLayer(map.dataLayer);
map.osbLayer = new OpenLayers.Layer.OpenStreetBugs("OpenStreetBugs", {
- serverURL : "/api/0.6/bugs/",
+ serverURL : "/api/0.6/",
iconOpen : new OpenLayers.Icon("http://openstreetbugs.schokokeks.org/client/open_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
iconClosed : new OpenLayers.Icon("http://openstreetbugs.schokokeks.org/client/closed_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
readonly : false,
if(!bounds) return false;
bounds.transform(this.map.getProjectionObject(), this.apiProjection);
- this.apiRequest("getBugs"
- + "?t="+this.round(bounds.top, 5)
- + "&r="+this.round(bounds.right, 5)
- + "&b="+this.round(bounds.bottom, 5)
- + "&l="+this.round(bounds.left, 5));
+ this.apiRequest("bugs"
+ + "?bbox="+this.round(bounds.left, 5)
+ + ","+this.round(bounds.bottom, 5)
+ + ","+this.round(bounds.right, 5)
+ + ","+this.round(bounds.top, 5));
},
/**
* @param String description
*/
createBug: function(lonlat, description) {
- this.apiRequest("addPOIexec"
+ this.apiRequest("bug/create"
+ "?lat="+encodeURIComponent(lonlat.lat)
+ "&lon="+encodeURIComponent(lonlat.lon)
- + "&text="+encodeURIComponent(description + " [" + this.getUserName() + "]")
+ + "&text="+encodeURIComponent(description)
+ + "&name="+encodeURIComponent(this.getUserName())
+ "&format=js"
);
+ createBugCallBack();
},
/**
* @param String comment
*/
submitComment: function(id, comment) {
- this.apiRequest("editPOIexec"
- + "?id="+encodeURIComponent(id)
- + "&text="+encodeURIComponent(comment + " [" + this.getUserName() + "]")
+ this.apiRequest("bug/"+encodeURIComponent(id)+"/comment"
+ + "?text="+encodeURIComponent(comment)
+ + "&name="+encodeURIComponent(this.getUserName())
+ "&format=js"
);
},
* @param Number id
*/
closeBug: function(id) {
- this.apiRequest("closePOIexec"
- + "?id="+encodeURIComponent(id)
- + "&format=js"
+ this.apiRequest("bug/"+encodeURIComponent(id)+"/close"
+ + "?format=js"
);
},