0

Add new Javascript observer

Output render progress onto the rendered map using Javascript
A minimum period between updates can be specified
This commit is contained in:
Thomas Lake
2012-04-08 23:03:26 +01:00
parent 56b91e67dc
commit 55df1bcf78
5 changed files with 122 additions and 3 deletions

View File

@@ -108,7 +108,26 @@ overviewer.views.CoordboxView = Backbone.View.extend({
}
});
overviewer.views.ProgressView = Backbone.View.extend({
initialize: function() {
this.el.id = 'progressDiv';
this.el.innerHTML = 'Current Render Progress';
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(this.el);
this.hidden = true;
},
updateProgress: function() {
e = this;
$.getJSON('progress.js', null, function(d){
e.el.hidden = false;
e.el.innerHTML = d['message'];
if (d.update > 0) {
setTimeout("e.updateProgress()", d.update);
} else {
e.el.hidden = true;
}
});
}
});
/* GoogleMapView is responsible for dealing with the GoogleMaps API to create the
*/