Remove remaining static members from Interaction
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import EventTarget from '../../../../src/ol/events/EventTarget.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
import Interaction, {zoomByDelta} from '../../../../src/ol/interaction/Interaction.js';
|
||||
|
||||
describe('ol.interaction.Interaction', function() {
|
||||
|
||||
@@ -64,16 +64,16 @@ describe('ol.interaction.Interaction', function() {
|
||||
resolutions: [4, 2, 1, 0.5, 0.25]
|
||||
});
|
||||
|
||||
Interaction.zoomByDelta(view, 1);
|
||||
zoomByDelta(view, 1);
|
||||
expect(view.getResolution()).to.be(0.5);
|
||||
|
||||
Interaction.zoomByDelta(view, -1);
|
||||
zoomByDelta(view, -1);
|
||||
expect(view.getResolution()).to.be(1);
|
||||
|
||||
Interaction.zoomByDelta(view, 2);
|
||||
zoomByDelta(view, 2);
|
||||
expect(view.getResolution()).to.be(0.25);
|
||||
|
||||
Interaction.zoomByDelta(view, -2);
|
||||
zoomByDelta(view, -2);
|
||||
expect(view.getResolution()).to.be(1);
|
||||
});
|
||||
|
||||
@@ -84,16 +84,16 @@ describe('ol.interaction.Interaction', function() {
|
||||
resolutions: [4, 2, 1, 0.5, 0.25]
|
||||
});
|
||||
|
||||
Interaction.zoomByDelta(view, 1, [10, 10]);
|
||||
zoomByDelta(view, 1, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([5, 5]);
|
||||
|
||||
Interaction.zoomByDelta(view, -1, [0, 0]);
|
||||
zoomByDelta(view, -1, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([10, 10]);
|
||||
|
||||
Interaction.zoomByDelta(view, 2, [0, 0]);
|
||||
zoomByDelta(view, 2, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
Interaction.zoomByDelta(view, -2, [0, 0]);
|
||||
zoomByDelta(view, -2, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([10, 10]);
|
||||
});
|
||||
|
||||
@@ -105,16 +105,16 @@ describe('ol.interaction.Interaction', function() {
|
||||
resolutions: [4, 2, 1, 0.5, 0.25]
|
||||
});
|
||||
|
||||
Interaction.zoomByDelta(view, 1, [10, 10]);
|
||||
zoomByDelta(view, 1, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
Interaction.zoomByDelta(view, -1, [0, 0]);
|
||||
zoomByDelta(view, -1, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
Interaction.zoomByDelta(view, 2, [10, 10]);
|
||||
zoomByDelta(view, 2, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
Interaction.zoomByDelta(view, -2, [0, 0]);
|
||||
zoomByDelta(view, -2, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user