Added pointCount method

This commit is contained in:
acanimal 2016-02-24 14:47:56 +01:00
parent 30bd226d71
commit 52cc4c663c

View File

@ -286,7 +286,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
this.setKeys([key], options);
},
/**
/**
* returns the array of keys being rendered
*/
getKeys: function() {
@ -472,6 +472,20 @@ L.TorqueLayer = L.CanvasLayer.extend({
return sum;
},
/** return the number of points for a step */
pointCount: function(step) {
var t, tile;
step = step === undefined ? this.key: step;
var c = 0;
for(t in this._tiles) {
tile = this._tiles[t];
if (tile) {
c += tile.timeCount[step];
}
}
return c;
},
invalidate: function() {
this.provider.reload();
},