Merge pull request #1333 from twpayne/object-get-properties
Add ol.Object#getProperties
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
@exportSymbol ol.Object
|
@exportSymbol ol.Object
|
||||||
@exportProperty ol.Object.prototype.bindTo
|
@exportProperty ol.Object.prototype.bindTo
|
||||||
@exportProperty ol.Object.prototype.get
|
@exportProperty ol.Object.prototype.get
|
||||||
|
@exportProperty ol.Object.prototype.getProperties
|
||||||
@exportProperty ol.Object.prototype.notify
|
@exportProperty ol.Object.prototype.notify
|
||||||
@exportProperty ol.Object.prototype.on
|
@exportProperty ol.Object.prototype.on
|
||||||
@exportProperty ol.Object.prototype.once
|
@exportProperty ol.Object.prototype.once
|
||||||
|
|||||||
@@ -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
|
* 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
|
* objects that are bound to the object's property as well as the object
|
||||||
|
|||||||
Reference in New Issue
Block a user