Proper getAttributes method
With a59aa9bb37 we can now provide an object with user set attributes.
This commit is contained in:
@@ -28,17 +28,15 @@ goog.inherits(ol.Feature, ol.Object);
|
||||
* @return {Object} Attributes object.
|
||||
*/
|
||||
ol.Feature.prototype.getAttributes = function() {
|
||||
// TODO: see https://github.com/openlayers/ol3/pull/217
|
||||
// var keys = this.getKeys(),
|
||||
// len = keys.length,
|
||||
// attributes = {},
|
||||
// i, key
|
||||
// for (var i = 0; i < len; ++ i) {
|
||||
// key = keys[i];
|
||||
// attributes[key] = this.get(key);
|
||||
// }
|
||||
// return attributes;
|
||||
return this;
|
||||
var keys = this.getKeys(),
|
||||
len = keys.length,
|
||||
attributes = {},
|
||||
i, key;
|
||||
for (i = 0; i < len; ++ i) {
|
||||
key = keys[i];
|
||||
attributes[key] = this.get(key);
|
||||
}
|
||||
return attributes;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user