diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index cf244eef3c..5aa98e915e 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -12,6 +12,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.style.IconOrigin` to `ol.style.Icon.Origin` * rename `ol.format.IGCZ` to `ol.format.IGC.Z` * rename `ol.layer.GroupProperty` to `ol.layer.Group.Property` + * rename `ol.CollectionProperty` to `ol.Collection.Property` ### v3.18.0 diff --git a/src/ol/collection.js b/src/ol/collection.js index 27de4deb00..6132df8ab8 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -10,14 +10,6 @@ goog.require('ol.events.Event'); goog.require('ol.Object'); -/** - * @enum {string} - */ -ol.CollectionProperty = { - LENGTH: 'length' -}; - - /** * @classdesc * An expanded version of standard JS Array, adding convenience methods for @@ -121,7 +113,7 @@ ol.Collection.prototype.item = function(index) { * @api stable */ ol.Collection.prototype.getLength = function() { - return /** @type {number} */ (this.get(ol.CollectionProperty.LENGTH)); + return /** @type {number} */ (this.get(ol.Collection.Property.LENGTH)); }; @@ -227,7 +219,15 @@ ol.Collection.prototype.setAt = function(index, elem) { * @private */ ol.Collection.prototype.updateLength_ = function() { - this.set(ol.CollectionProperty.LENGTH, this.array_.length); + this.set(ol.Collection.Property.LENGTH, this.array_.length); +}; + + +/** + * @enum {string} + */ +ol.Collection.Property = { + LENGTH: 'length' };