Add ol.Object#getProperties

This commit is contained in:
Tom Payne
2013-12-04 17:02:31 +01:00
parent 3d4199193f
commit 72cf6e03cd

View File

@@ -287,6 +287,23 @@ ol.Object.prototype.getKeys = function() {
};
/**
* Get an object of all property names and values.
* @return {Object.<string, *>} Object.
*/
ol.Object.prototype.getProperties = function() {
var properties = {};
var key;
for (key in this.values_) {
properties[key] = this.values_[key];
}
for (key in ol.Object.getAccessors(this)) {
properties[key] = this.get(key);
}
return properties;
};
/**
* Notify all observers of a change on this property. This notifies both
* objects that are bound to the object's property as well as the object