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

@@ -15,7 +15,7 @@ describe('ol.Map', function() {
expect(length).to.be.greaterThan(0);
for (var i = 0; i < length; ++i) {
expect(interactions.getAt(i).getMap()).to.be(map);
expect(interactions.item(i).getMap()).to.be(map);
}
});
});
@@ -209,7 +209,7 @@ describe('ol.Map', function() {
options.mouseWheelZoom = true;
var interactions = ol.interaction.defaults(options);
expect(interactions.getLength()).to.eql(1);
expect(interactions.getAt(0)).to.be.a(ol.interaction.MouseWheelZoom);
expect(interactions.item(0)).to.be.a(ol.interaction.MouseWheelZoom);
});
});
@@ -223,8 +223,8 @@ describe('ol.Map', function() {
it('create double click interaction with default delta', function() {
var interactions = ol.interaction.defaults(options);
expect(interactions.getLength()).to.eql(1);
expect(interactions.getAt(0)).to.be.a(ol.interaction.DoubleClickZoom);
expect(interactions.getAt(0).delta_).to.eql(1);
expect(interactions.item(0)).to.be.a(ol.interaction.DoubleClickZoom);
expect(interactions.item(0).delta_).to.eql(1);
});
});
@@ -233,8 +233,8 @@ describe('ol.Map', function() {
options.zoomDelta = 7;
var interactions = ol.interaction.defaults(options);
expect(interactions.getLength()).to.eql(1);
expect(interactions.getAt(0)).to.be.a(ol.interaction.DoubleClickZoom);
expect(interactions.getAt(0).delta_).to.eql(7);
expect(interactions.item(0)).to.be.a(ol.interaction.DoubleClickZoom);
expect(interactions.item(0).delta_).to.eql(7);
});
});
});