Rename _ol_control_ZoomToExtent_ to ZoomToExtent
This commit is contained in:
@@ -17,7 +17,7 @@ import _ol_css_ from '../css.js';
|
||||
* @param {olx.control.ZoomToExtentOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_control_ZoomToExtent_ = function(opt_options) {
|
||||
var ZoomToExtent = function(opt_options) {
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
@@ -54,14 +54,14 @@ var _ol_control_ZoomToExtent_ = function(opt_options) {
|
||||
});
|
||||
};
|
||||
|
||||
inherits(_ol_control_ZoomToExtent_, Control);
|
||||
inherits(ZoomToExtent, Control);
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event} event The event to handle
|
||||
* @private
|
||||
*/
|
||||
_ol_control_ZoomToExtent_.prototype.handleClick_ = function(event) {
|
||||
ZoomToExtent.prototype.handleClick_ = function(event) {
|
||||
event.preventDefault();
|
||||
this.handleZoomToExtent();
|
||||
};
|
||||
@@ -70,10 +70,10 @@ _ol_control_ZoomToExtent_.prototype.handleClick_ = function(event) {
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
_ol_control_ZoomToExtent_.prototype.handleZoomToExtent = function() {
|
||||
ZoomToExtent.prototype.handleZoomToExtent = function() {
|
||||
var map = this.getMap();
|
||||
var view = map.getView();
|
||||
var extent = !this.extent ? view.getProjection().getExtent() : this.extent;
|
||||
view.fit(extent);
|
||||
};
|
||||
export default _ol_control_ZoomToExtent_;
|
||||
export default ZoomToExtent;
|
||||
|
||||
Reference in New Issue
Block a user