Add method for getting keys

This commit is contained in:
Tim Schaub
2013-02-19 14:47:49 -07:00
parent d6ff58305d
commit 2919906ba6
2 changed files with 67 additions and 0 deletions

View File

@@ -190,6 +190,18 @@ ol.Object.prototype.get = function(key) {
};
/**
* Get a list of object property names.
* @return {Array.<string>} List of property names.
*/
ol.Object.prototype.getKeys = function() {
var keys = goog.object.getKeys(ol.Object.getAccessors(this)).concat(
goog.object.getKeys(this.values_));
goog.array.removeDuplicates(keys);
return keys;
};
/**
* @param {string} key Key.
*/