Add ol.Collection.extend

This commit is contained in:
Tom Payne
2013-03-06 13:18:34 +01:00
parent c9cce57895
commit 23f0097517
2 changed files with 22 additions and 0 deletions

View File

@@ -99,6 +99,17 @@ ol.Collection.prototype.clear = function() {
};
/**
* @param {Array} arr Array.
*/
ol.Collection.prototype.extend = function(arr) {
var i;
for (i = 0; i < arr.length; ++i) {
this.push(arr[i]);
}
};
/**
* @param {Function} f Function.
* @param {Object=} opt_obj Object.