Rename _ol_control_Zoom_ to Zoom
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
import _ol_Collection_ from './Collection.js';
|
import _ol_Collection_ from './Collection.js';
|
||||||
import Attribution from './control/Attribution.js';
|
import Attribution from './control/Attribution.js';
|
||||||
import Rotate from './control/Rotate.js';
|
import Rotate from './control/Rotate.js';
|
||||||
import _ol_control_Zoom_ from './control/Zoom.js';
|
import Zoom from './control/Zoom.js';
|
||||||
var _ol_control_ = {};
|
var _ol_control_ = {};
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ _ol_control_.defaults = function(opt_options) {
|
|||||||
|
|
||||||
var zoomControl = options.zoom !== undefined ? options.zoom : true;
|
var zoomControl = options.zoom !== undefined ? options.zoom : true;
|
||||||
if (zoomControl) {
|
if (zoomControl) {
|
||||||
controls.push(new _ol_control_Zoom_(options.zoomOptions));
|
controls.push(new Zoom(options.zoomOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
var rotateControl = options.rotate !== undefined ? options.rotate : true;
|
var rotateControl = options.rotate !== undefined ? options.rotate : true;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {easeOut} from '../easing.js';
|
|||||||
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
|
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_control_Zoom_ = function(opt_options) {
|
var Zoom = function(opt_options) {
|
||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
_ol_events_.listen(inElement, _ol_events_EventType_.CLICK,
|
_ol_events_.listen(inElement, _ol_events_EventType_.CLICK,
|
||||||
_ol_control_Zoom_.prototype.handleClick_.bind(this, delta));
|
Zoom.prototype.handleClick_.bind(this, delta));
|
||||||
|
|
||||||
var outElement = document.createElement('button');
|
var outElement = document.createElement('button');
|
||||||
outElement.className = className + '-out';
|
outElement.className = className + '-out';
|
||||||
@@ -55,7 +55,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
_ol_events_.listen(outElement, _ol_events_EventType_.CLICK,
|
_ol_events_.listen(outElement, _ol_events_EventType_.CLICK,
|
||||||
_ol_control_Zoom_.prototype.handleClick_.bind(this, -delta));
|
Zoom.prototype.handleClick_.bind(this, -delta));
|
||||||
|
|
||||||
var cssClasses = className + ' ' + _ol_css_.CLASS_UNSELECTABLE + ' ' +
|
var cssClasses = className + ' ' + _ol_css_.CLASS_UNSELECTABLE + ' ' +
|
||||||
_ol_css_.CLASS_CONTROL;
|
_ol_css_.CLASS_CONTROL;
|
||||||
@@ -77,7 +77,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_control_Zoom_, Control);
|
inherits(Zoom, Control);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +85,7 @@ inherits(_ol_control_Zoom_, Control);
|
|||||||
* @param {Event} event The event to handle
|
* @param {Event} event The event to handle
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_control_Zoom_.prototype.handleClick_ = function(delta, event) {
|
Zoom.prototype.handleClick_ = function(delta, event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.zoomByDelta_(delta);
|
this.zoomByDelta_(delta);
|
||||||
};
|
};
|
||||||
@@ -95,7 +95,7 @@ _ol_control_Zoom_.prototype.handleClick_ = function(delta, event) {
|
|||||||
* @param {number} delta Zoom delta.
|
* @param {number} delta Zoom delta.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_control_Zoom_.prototype.zoomByDelta_ = function(delta) {
|
Zoom.prototype.zoomByDelta_ = function(delta) {
|
||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
if (!view) {
|
if (!view) {
|
||||||
@@ -120,4 +120,4 @@ _ol_control_Zoom_.prototype.zoomByDelta_ = function(delta) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default _ol_control_Zoom_;
|
export default Zoom;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import _ol_control_Zoom_ from '../../../../src/ol/control/Zoom.js';
|
import Zoom from '../../../../src/ol/control/Zoom.js';
|
||||||
|
|
||||||
describe('ol.control.Zoom', function() {
|
describe('ol.control.Zoom', function() {
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
|
|
||||||
it('can be constructed without arguments', function() {
|
it('can be constructed without arguments', function() {
|
||||||
var instance = new _ol_control_Zoom_();
|
var instance = new Zoom();
|
||||||
expect(instance).to.be.an(_ol_control_Zoom_);
|
expect(instance).to.be.an(Zoom);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user