Replace the navigation control by two controls, namely DragPan and MouseWheelZoom. DragPan is the map default drag control. MouseWheelZoom is the map default mouse wheel control.
This commit is contained in:
@@ -61,13 +61,12 @@ describe('ol.handler.Drag', function() {
|
||||
});
|
||||
|
||||
it('calls the default action on the default control', function() {
|
||||
var control = new ol.control.DefaultControl();
|
||||
spyOn(control, 'defaultDrag');
|
||||
map.setDefaultControl(control);
|
||||
var control = {handleEvent: jasmine.createSpy()};
|
||||
map.setDefaultDragControl(control);
|
||||
var handler = new ol.handler.Drag(map, {});
|
||||
|
||||
handler.dragger_.dispatchEvent({type: 'drag'});
|
||||
expect(control.defaultDrag).toHaveBeenCalled();
|
||||
expect(control.handleEvent).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,13 +32,12 @@ describe('ol.handler.MouseWheel', function() {
|
||||
});
|
||||
|
||||
it('calls the default action on the default control', function() {
|
||||
var control = new ol.control.DefaultControl();
|
||||
spyOn(control, 'defaultMouseWheel');
|
||||
map.setDefaultControl(control);
|
||||
var control = {handleEvent: jasmine.createSpy()};
|
||||
map.setDefaultMouseWheelControl(control);
|
||||
var handler = new ol.handler.MouseWheel(map, {});
|
||||
|
||||
handler.handleMouseWheel(new goog.events.MouseWheelEvent(1, 'foo', 0, 1));
|
||||
expect(control.defaultMouseWheel).toHaveBeenCalled();
|
||||
expect(control.handleEvent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user