Rename _ol_interaction_DragZoom_ to DragZoom

This commit is contained in:
Marc Jansen
2017-12-15 10:29:14 +01:00
committed by Tim Schaub
parent ea08212df6
commit b92118b5ab
3 changed files with 13 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ import _ol_Kinetic_ from './Kinetic.js';
import DoubleClickZoom from './interaction/DoubleClickZoom.js';
import DragPan from './interaction/DragPan.js';
import DragRotate from './interaction/DragRotate.js';
import _ol_interaction_DragZoom_ from './interaction/DragZoom.js';
import DragZoom from './interaction/DragZoom.js';
import _ol_interaction_KeyboardPan_ from './interaction/KeyboardPan.js';
import _ol_interaction_KeyboardZoom_ from './interaction/KeyboardZoom.js';
import _ol_interaction_MouseWheelZoom_ from './interaction/MouseWheelZoom.js';
@@ -103,7 +103,7 @@ _ol_interaction_.defaults = function(opt_options) {
var shiftDragZoom = options.shiftDragZoom !== undefined ?
options.shiftDragZoom : true;
if (shiftDragZoom) {
interactions.push(new _ol_interaction_DragZoom_({
interactions.push(new DragZoom({
duration: options.zoomDuration
}));
}

View File

@@ -21,7 +21,7 @@ import DragBox from '../interaction/DragBox.js';
* @param {olx.interaction.DragZoomOptions=} opt_options Options.
* @api
*/
var _ol_interaction_DragZoom_ = function(opt_options) {
var DragZoom = function(opt_options) {
var options = opt_options ? opt_options : {};
var condition = options.condition ?
@@ -46,13 +46,13 @@ var _ol_interaction_DragZoom_ = function(opt_options) {
};
inherits(_ol_interaction_DragZoom_, DragBox);
inherits(DragZoom, DragBox);
/**
* @inheritDoc
*/
_ol_interaction_DragZoom_.prototype.onBoxEnd = function() {
DragZoom.prototype.onBoxEnd = function() {
var map = this.getMap();
var view = /** @type {!ol.View} */ (map.getView());
@@ -86,4 +86,4 @@ _ol_interaction_DragZoom_.prototype.onBoxEnd = function() {
});
};
export default _ol_interaction_DragZoom_;
export default DragZoom;

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_interaction_DragZoom_ from '../../../../src/ol/interaction/DragZoom.js';
import DragZoom from '../../../../src/ol/interaction/DragZoom.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_render_Box_ from '../../../../src/ol/render/Box.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
@@ -48,15 +48,15 @@ describe('ol.interaction.DragZoom', function() {
describe('constructor', function() {
it('can be constructed without arguments', function() {
var instance = new _ol_interaction_DragZoom_();
expect(instance).to.be.an(_ol_interaction_DragZoom_);
var instance = new DragZoom();
expect(instance).to.be.an(DragZoom);
});
it('sets "ol-dragzoom" as box className', function() {
var instance = new _ol_interaction_DragZoom_();
var instance = new DragZoom();
expect(instance.box_.element_.className).to.be('ol-box ol-dragzoom');
});
it('sets a custom box className', function() {
var instance = new _ol_interaction_DragZoom_({className: 'test-dragzoom'});
var instance = new DragZoom({className: 'test-dragzoom'});
expect(instance.box_.element_.className).to.be('ol-box test-dragzoom');
});
@@ -65,7 +65,7 @@ describe('ol.interaction.DragZoom', function() {
describe('#onBoxEnd()', function() {
it('centers the view on the box geometry', function(done) {
var interaction = new _ol_interaction_DragZoom_({
var interaction = new DragZoom({
duration: 10
});
map.addInteraction(interaction);
@@ -86,7 +86,7 @@ describe('ol.interaction.DragZoom', function() {
});
it('sets new resolution while zooming out', function(done) {
var interaction = new _ol_interaction_DragZoom_({
var interaction = new DragZoom({
duration: 10,
out: true
});