Simplified api

This commit is contained in:
simonseyock
2016-12-07 11:14:59 +01:00
parent 8edc2be103
commit 55ec0af072
6 changed files with 18 additions and 33 deletions

View File

@@ -111,7 +111,7 @@ describe('ol.renderer.canvas.Map', function() {
map.addLayer(layer);
map.renderSync();
var cb = sinon.spy();
map.forEachFeatureAtPixel(map.getPixelFromCoordinate([0, 0]), cb, null, {
map.forEachFeatureAtPixel(map.getPixelFromCoordinate([0, 0]), cb, {
layerFilter: function() {
return false;
}
@@ -151,13 +151,13 @@ describe('ol.renderer.canvas.Map', function() {
];
for (var i = 0; i < 4; i++) {
map.forEachFeatureAtPixel(pixelsInside[i], cb1, null, {hitTolerance:10});
map.forEachFeatureAtPixel(pixelsInside[i], cb1, {hitTolerance:10});
}
expect(cb1.callCount).to.be(4);
expect(cb1.firstCall.args[1]).to.be(layer);
for (var j = 0; j < 4; j++) {
map.forEachFeatureAtPixel(pixelsOutside[j], cb2, null, {hitTolerance:10});
map.forEachFeatureAtPixel(pixelsOutside[j], cb2, {hitTolerance:10});
}
expect(cb2).not.to.be.called();
});