Rename _ol_interaction_Interaction_ to Interaction
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
import EventTarget from '../../../../src/ol/events/EventTarget.js';
|
||||
import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
|
||||
describe('ol.interaction.Interaction', function() {
|
||||
|
||||
@@ -9,11 +9,11 @@ describe('ol.interaction.Interaction', function() {
|
||||
var interaction;
|
||||
|
||||
beforeEach(function() {
|
||||
interaction = new _ol_interaction_Interaction_({});
|
||||
interaction = new Interaction({});
|
||||
});
|
||||
|
||||
it('creates a new interaction', function() {
|
||||
expect(interaction).to.be.a(_ol_interaction_Interaction_);
|
||||
expect(interaction).to.be.a(Interaction);
|
||||
expect(interaction).to.be.a(EventTarget);
|
||||
});
|
||||
|
||||
@@ -27,13 +27,13 @@ describe('ol.interaction.Interaction', function() {
|
||||
|
||||
it('retrieves the associated map', function() {
|
||||
var map = new _ol_Map_({});
|
||||
var interaction = new _ol_interaction_Interaction_({});
|
||||
var interaction = new Interaction({});
|
||||
interaction.setMap(map);
|
||||
expect(interaction.getMap()).to.be(map);
|
||||
});
|
||||
|
||||
it('returns null if no map', function() {
|
||||
var interaction = new _ol_interaction_Interaction_({});
|
||||
var interaction = new Interaction({});
|
||||
expect(interaction.getMap()).to.be(null);
|
||||
});
|
||||
|
||||
@@ -43,13 +43,13 @@ describe('ol.interaction.Interaction', function() {
|
||||
|
||||
it('allows a map to be set', function() {
|
||||
var map = new _ol_Map_({});
|
||||
var interaction = new _ol_interaction_Interaction_({});
|
||||
var interaction = new Interaction({});
|
||||
interaction.setMap(map);
|
||||
expect(interaction.getMap()).to.be(map);
|
||||
});
|
||||
|
||||
it('accepts null', function() {
|
||||
var interaction = new _ol_interaction_Interaction_({});
|
||||
var interaction = new Interaction({});
|
||||
interaction.setMap(null);
|
||||
expect(interaction.getMap()).to.be(null);
|
||||
});
|
||||
@@ -64,16 +64,16 @@ describe('ol.interaction.Interaction', function() {
|
||||
resolutions: [4, 2, 1, 0.5, 0.25]
|
||||
});
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 1);
|
||||
Interaction.zoomByDelta(view, 1);
|
||||
expect(view.getResolution()).to.be(0.5);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -1);
|
||||
Interaction.zoomByDelta(view, -1);
|
||||
expect(view.getResolution()).to.be(1);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 2);
|
||||
Interaction.zoomByDelta(view, 2);
|
||||
expect(view.getResolution()).to.be(0.25);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -2);
|
||||
Interaction.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]
|
||||
});
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 1, [10, 10]);
|
||||
Interaction.zoomByDelta(view, 1, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([5, 5]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -1, [0, 0]);
|
||||
Interaction.zoomByDelta(view, -1, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([10, 10]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 2, [0, 0]);
|
||||
Interaction.zoomByDelta(view, 2, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -2, [0, 0]);
|
||||
Interaction.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]
|
||||
});
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 1, [10, 10]);
|
||||
Interaction.zoomByDelta(view, 1, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -1, [0, 0]);
|
||||
Interaction.zoomByDelta(view, -1, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, 2, [10, 10]);
|
||||
Interaction.zoomByDelta(view, 2, [10, 10]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
|
||||
_ol_interaction_Interaction_.zoomByDelta(view, -2, [0, 0]);
|
||||
Interaction.zoomByDelta(view, -2, [0, 0]);
|
||||
expect(view.getCenter()).to.eql([2.5, 2.5]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user