Add zoomDelta option to MapOptions

This commit is contained in:
Éric Lemoine
2012-09-27 15:48:04 +02:00
parent 4f116c2e5b
commit 0535a31bc6
4 changed files with 46 additions and 4 deletions

View File

@@ -92,6 +92,31 @@ describe('ol.MapOptions', function() {
});
});
});
});
describe('create double click interaction', function() {
beforeEach(function() {
options.doubleClickZoom = true;
});
describe('default zoomDelta', function() {
it('create double click interaction with default delta', function() {
var interactions = ol.MapOptions.createInteractions_(options);
expect(interactions.getLength()).toEqual(1);
expect(interactions.getAt(0)).toBeA(ol.interaction.DblClickZoom);
expect(interactions.getAt(0).delta_).toEqual(4);
});
});
describe('set mouseWheelZoomDelta', function() {
it('create double click interaction with set delta', function() {
options.zoomDelta = 7;
var interactions = ol.MapOptions.createInteractions_(options);
expect(interactions.getLength()).toEqual(1);
expect(interactions.getAt(0)).toBeA(ol.interaction.DblClickZoom);
expect(interactions.getAt(0).delta_).toEqual(7);
});
});
});
});
});