Rename ol.Collection#getAt to ol.Collection#item
TouchList, DOMStringList, DOMTokenList, NodeList all have an `item(index)` function to retrieve an item from a list. We should do the same.
This commit is contained in:
@@ -144,9 +144,9 @@ ol.Collection.prototype.getArray = function() {
|
||||
* Get the element at the provided index.
|
||||
* @param {number} index Index.
|
||||
* @return {*} Element.
|
||||
* @todo api
|
||||
* @todo api stable
|
||||
*/
|
||||
ol.Collection.prototype.getAt = function(index) {
|
||||
ol.Collection.prototype.item = function(index) {
|
||||
return this.array_[index];
|
||||
};
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
||||
}, undefined, this.layerFilter_);
|
||||
if (goog.isDef(feature) &&
|
||||
features.getLength() == 1 &&
|
||||
features.getAt(0) == feature) {
|
||||
features.item(0) == feature) {
|
||||
// No change
|
||||
} else {
|
||||
if (features.getLength() !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user