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:
Frederic Junod
2014-06-05 15:48:13 +02:00
parent ba060ccc50
commit 4525276c6e
5 changed files with 28 additions and 28 deletions

View File

@@ -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];
};

View File

@@ -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) {