Use named exports from ol/index.js
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
// FIXME handle date line wrap
|
||||
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
import _ol_css_ from '../css.js';
|
||||
@@ -139,7 +139,7 @@ var _ol_control_Attribution_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_Attribution_, _ol_control_Control_);
|
||||
inherits(_ol_control_Attribution_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/Control
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import _ol_MapEventType_ from '../MapEventType.js';
|
||||
import _ol_Object_ from '../Object.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
@@ -67,7 +67,7 @@ var _ol_control_Control_ = function(options) {
|
||||
/**
|
||||
* @type {function(ol.MapEvent)}
|
||||
*/
|
||||
this.render = options.render ? options.render : _ol_.nullFunction;
|
||||
this.render = options.render ? options.render : nullFunction;
|
||||
|
||||
if (options.target) {
|
||||
this.setTarget(options.target);
|
||||
@@ -75,7 +75,7 @@ var _ol_control_Control_ = function(options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_Control_, _ol_Object_);
|
||||
inherits(_ol_control_Control_, _ol_Object_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,7 @@ _ol_control_Control_.prototype.setMap = function(map) {
|
||||
var target = this.target_ ?
|
||||
this.target_ : map.getOverlayContainerStopEvent();
|
||||
target.appendChild(this.element);
|
||||
if (this.render !== _ol_.nullFunction) {
|
||||
if (this.render !== nullFunction) {
|
||||
this.listenerKeys.push(_ol_events_.listen(map,
|
||||
_ol_MapEventType_.POSTRENDER, this.render, this));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/FullScreen
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
import _ol_css_ from '../css.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
@@ -90,7 +90,7 @@ var _ol_control_FullScreen_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_FullScreen_, _ol_control_Control_);
|
||||
inherits(_ol_control_FullScreen_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/**
|
||||
* @module ol/control/MousePosition
|
||||
*/
|
||||
// FIXME should listen on appropriate pane, once it is defined
|
||||
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import _ol_Object_ from '../Object.js';
|
||||
@@ -82,7 +81,7 @@ var _ol_control_MousePosition_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_MousePosition_, _ol_control_Control_);
|
||||
inherits(_ol_control_MousePosition_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/OverviewMap
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {OVERVIEWMAP_MAX_RATIO, OVERVIEWMAP_MIN_RATIO, inherits} from '../index.js';
|
||||
import _ol_Collection_ from '../Collection.js';
|
||||
import _ol_PluggableMap_ from '../PluggableMap.js';
|
||||
import _ol_MapEventType_ from '../MapEventType.js';
|
||||
@@ -188,7 +188,7 @@ var _ol_control_OverviewMap_ = function(opt_options) {
|
||||
});
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_OverviewMap_, _ol_control_Control_);
|
||||
inherits(_ol_control_OverviewMap_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -336,10 +336,10 @@ _ol_control_OverviewMap_.prototype.validateExtent_ = function() {
|
||||
var ovmapWidth = ovmapSize[0];
|
||||
var ovmapHeight = ovmapSize[1];
|
||||
|
||||
if (boxWidth < ovmapWidth * _ol_.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxHeight < ovmapHeight * _ol_.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxWidth > ovmapWidth * _ol_.OVERVIEWMAP_MAX_RATIO ||
|
||||
boxHeight > ovmapHeight * _ol_.OVERVIEWMAP_MAX_RATIO) {
|
||||
if (boxWidth < ovmapWidth * OVERVIEWMAP_MIN_RATIO ||
|
||||
boxHeight < ovmapHeight * OVERVIEWMAP_MIN_RATIO ||
|
||||
boxWidth > ovmapWidth * OVERVIEWMAP_MAX_RATIO ||
|
||||
boxHeight > ovmapHeight * OVERVIEWMAP_MAX_RATIO) {
|
||||
this.resetExtent_();
|
||||
} else if (!_ol_extent_.containsExtent(ovextent, extent)) {
|
||||
this.recenter_();
|
||||
@@ -353,7 +353,7 @@ _ol_control_OverviewMap_.prototype.validateExtent_ = function() {
|
||||
* @private
|
||||
*/
|
||||
_ol_control_OverviewMap_.prototype.resetExtent_ = function() {
|
||||
if (_ol_.OVERVIEWMAP_MAX_RATIO === 0 || _ol_.OVERVIEWMAP_MIN_RATIO === 0) {
|
||||
if (OVERVIEWMAP_MAX_RATIO === 0 || OVERVIEWMAP_MIN_RATIO === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -371,8 +371,8 @@ _ol_control_OverviewMap_.prototype.resetExtent_ = function() {
|
||||
// box sizes using the min and max ratio, pick the step in the middle used
|
||||
// to calculate the extent from the main map to set it to the overview map,
|
||||
var steps = Math.log(
|
||||
_ol_.OVERVIEWMAP_MAX_RATIO / _ol_.OVERVIEWMAP_MIN_RATIO) / Math.LN2;
|
||||
var ratio = 1 / (Math.pow(2, steps / 2) * _ol_.OVERVIEWMAP_MIN_RATIO);
|
||||
OVERVIEWMAP_MAX_RATIO / OVERVIEWMAP_MIN_RATIO) / Math.LN2;
|
||||
var ratio = 1 / (Math.pow(2, steps / 2) * OVERVIEWMAP_MIN_RATIO);
|
||||
_ol_extent_.scaleFromCenter(extent, ratio);
|
||||
ovview.fit(extent);
|
||||
};
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/**
|
||||
* @module ol/control/Rotate
|
||||
*/
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import _ol_ from '../index.js';
|
||||
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
import _ol_css_ from '../css.js';
|
||||
import _ol_easing_ from '../easing.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import {inherits} from '../index.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -93,7 +94,7 @@ var _ol_control_Rotate_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_Rotate_, _ol_control_Control_);
|
||||
inherits(_ol_control_Rotate_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/ScaleLine
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Object_ from '../Object.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
@@ -94,7 +94,7 @@ var _ol_control_ScaleLine_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_ScaleLine_, _ol_control_Control_);
|
||||
inherits(_ol_control_ScaleLine_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/Zoom
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
@@ -77,7 +77,7 @@ var _ol_control_Zoom_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_Zoom_, _ol_control_Control_);
|
||||
inherits(_ol_control_Zoom_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
// FIXME should possibly show tooltip when dragging?
|
||||
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_ViewHint_ from '../ViewHint.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
import _ol_css_ from '../css.js';
|
||||
@@ -133,7 +133,7 @@ var _ol_control_ZoomSlider_ = function(opt_options) {
|
||||
});
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_ZoomSlider_, _ol_control_Control_);
|
||||
inherits(_ol_control_ZoomSlider_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/control/ZoomToExtent
|
||||
*/
|
||||
import _ol_ from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import _ol_control_Control_ from '../control/Control.js';
|
||||
@@ -54,7 +54,7 @@ var _ol_control_ZoomToExtent_ = function(opt_options) {
|
||||
});
|
||||
};
|
||||
|
||||
_ol_.inherits(_ol_control_ZoomToExtent_, _ol_control_Control_);
|
||||
inherits(_ol_control_ZoomToExtent_, _ol_control_Control_);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user