Merge pull request #7625 from fredj/named_export_control_interaction_defaults
Named export for ol/control and ol/interaction
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
import {inherits} from './index.js';
|
||||
import _ol_PluggableMap_ from './PluggableMap.js';
|
||||
import _ol_PluginType_ from './PluginType.js';
|
||||
import _ol_control_ from './control.js';
|
||||
import _ol_interaction_ from './interaction.js';
|
||||
import {defaults as defaultControls} from './control.js';
|
||||
import {defaults as defaultInteractions} from './interaction.js';
|
||||
import _ol_obj_ from './obj.js';
|
||||
import _ol_plugins_ from './plugins.js';
|
||||
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
||||
@@ -76,10 +76,10 @@ var _ol_CanvasMap_ = function(options) {
|
||||
options = _ol_obj_.assign({}, options);
|
||||
delete options.renderer;
|
||||
if (!options.controls) {
|
||||
options.controls = _ol_control_.defaults();
|
||||
options.controls = defaultControls();
|
||||
}
|
||||
if (!options.interactions) {
|
||||
options.interactions = _ol_interaction_.defaults();
|
||||
options.interactions = defaultInteractions();
|
||||
}
|
||||
|
||||
_ol_PluggableMap_.call(this, options);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import {inherits} from './index.js';
|
||||
import _ol_PluggableMap_ from './PluggableMap.js';
|
||||
import _ol_PluginType_ from './PluginType.js';
|
||||
import _ol_control_ from './control.js';
|
||||
import _ol_interaction_ from './interaction.js';
|
||||
import {defaults as defaultControls} from './control.js';
|
||||
import {defaults as defaultInteractions} from './interaction.js';
|
||||
import _ol_obj_ from './obj.js';
|
||||
import _ol_plugins_ from './plugins.js';
|
||||
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
||||
@@ -87,10 +87,10 @@ _ol_plugins_.registerMultiple(_ol_PluginType_.LAYER_RENDERER, [
|
||||
var _ol_Map_ = function(options) {
|
||||
options = _ol_obj_.assign({}, options);
|
||||
if (!options.controls) {
|
||||
options.controls = _ol_control_.defaults();
|
||||
options.controls = defaultControls();
|
||||
}
|
||||
if (!options.interactions) {
|
||||
options.interactions = _ol_interaction_.defaults();
|
||||
options.interactions = defaultInteractions();
|
||||
}
|
||||
|
||||
_ol_PluggableMap_.call(this, options);
|
||||
|
||||
@@ -5,7 +5,6 @@ import _ol_Collection_ from './Collection.js';
|
||||
import Attribution from './control/Attribution.js';
|
||||
import Rotate from './control/Rotate.js';
|
||||
import Zoom from './control/Zoom.js';
|
||||
var _ol_control_ = {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,7 +19,7 @@ var _ol_control_ = {};
|
||||
* @return {ol.Collection.<ol.control.Control>} Controls.
|
||||
* @api
|
||||
*/
|
||||
_ol_control_.defaults = function(opt_options) {
|
||||
export function defaults(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -44,5 +43,4 @@ _ol_control_.defaults = function(opt_options) {
|
||||
|
||||
return controls;
|
||||
|
||||
};
|
||||
export default _ol_control_;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import _ol_interaction_KeyboardZoom_ from './interaction/KeyboardZoom.js';
|
||||
import _ol_interaction_MouseWheelZoom_ from './interaction/MouseWheelZoom.js';
|
||||
import _ol_interaction_PinchRotate_ from './interaction/PinchRotate.js';
|
||||
import _ol_interaction_PinchZoom_ from './interaction/PinchZoom.js';
|
||||
var _ol_interaction_ = {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,7 +37,7 @@ var _ol_interaction_ = {};
|
||||
* interactions to be used with the ol.Map constructor's interactions option.
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_.defaults = function(opt_options) {
|
||||
export function defaults(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -110,5 +109,4 @@ _ol_interaction_.defaults = function(opt_options) {
|
||||
|
||||
return interactions;
|
||||
|
||||
};
|
||||
export default _ol_interaction_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user