Named export for ol/interaction
This commit is contained in:
@@ -5,7 +5,7 @@ import _ol_View_ from '../src/ol/View.js';
|
|||||||
import LineString from '../src/ol/geom/LineString.js';
|
import LineString from '../src/ol/geom/LineString.js';
|
||||||
import Point from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import Polygon from '../src/ol/geom/Polygon.js';
|
import Polygon from '../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -145,7 +145,7 @@ var polygonFeature = new _ol_Feature_(
|
|||||||
|
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([new app.Drag()]),
|
interactions: defaultInteractions().extend([new app.Drag()]),
|
||||||
layers: [
|
layers: [
|
||||||
new _ol_layer_Tile_({
|
new _ol_layer_Tile_({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new _ol_source_TileJSON_({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js';
|
|||||||
import IGC from '../src/ol/format/IGC.js';
|
import IGC from '../src/ol/format/IGC.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
@@ -94,7 +94,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
|
interactions: defaultInteractions().extend([dragAndDropInteraction]),
|
||||||
layers: [
|
layers: [
|
||||||
new _ol_layer_Tile_({
|
new _ol_layer_Tile_({
|
||||||
source: new _ol_source_BingMaps_({
|
source: new _ol_source_BingMaps_({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import GeoJSON from '../src/ol/format/GeoJSON.js';
|
|||||||
import IGC from '../src/ol/format/IGC.js';
|
import IGC from '../src/ol/format/IGC.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -94,7 +94,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
|
interactions: defaultInteractions().extend([dragAndDropInteraction]),
|
||||||
layers: [
|
layers: [
|
||||||
new _ol_layer_Tile_({
|
new _ol_layer_Tile_({
|
||||||
source: new _ol_source_BingMaps_({
|
source: new _ol_source_BingMaps_({
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([
|
interactions: defaultInteractions().extend([
|
||||||
new DragRotateAndZoom()
|
new DragRotateAndZoom()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import * as _ol_extent_ from '../src/ol/extent.js';
|
import * as _ol_extent_ from '../src/ol/extent.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -142,7 +142,7 @@ var raster = new _ol_layer_Tile_({
|
|||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
interactions: _ol_interaction_.defaults().extend([new _ol_interaction_Select_({
|
interactions: defaultInteractions().extend([new _ol_interaction_Select_({
|
||||||
condition: function(evt) {
|
condition: function(evt) {
|
||||||
return evt.type == 'pointermove' ||
|
return evt.type == 'pointermove' ||
|
||||||
evt.type == 'singleclick';
|
evt.type == 'singleclick';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
import FullScreen from '../src/ol/control/FullScreen.js';
|
import FullScreen from '../src/ol/control/FullScreen.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
|
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
|
||||||
@@ -12,7 +12,7 @@ var map = new _ol_Map_({
|
|||||||
controls: defaultControls().extend([
|
controls: defaultControls().extend([
|
||||||
new FullScreen()
|
new FullScreen()
|
||||||
]),
|
]),
|
||||||
interactions: _ol_interaction_.defaults().extend([
|
interactions: defaultInteractions().extend([
|
||||||
new DragRotateAndZoom()
|
new DragRotateAndZoom()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
@@ -31,7 +31,7 @@ var modify = new _ol_interaction_Modify_({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([select, modify]),
|
interactions: defaultInteractions().extend([select, modify]),
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new _ol_View_({
|
view: new _ol_View_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -232,7 +232,7 @@ var modify = new _ol_interaction_Modify_({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([select, modify]),
|
interactions: defaultInteractions().extend([select, modify]),
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new _ol_View_({
|
view: new _ol_View_({
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_MouseWheelZoom_ from '../src/ol/interaction/MouseWheelZoom.js';
|
import _ol_interaction_MouseWheelZoom_ from '../src/ol/interaction/MouseWheelZoom.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults({mouseWheelZoom: false}).extend([
|
interactions: defaultInteractions({mouseWheelZoom: false}).extend([
|
||||||
new _ol_interaction_MouseWheelZoom_({
|
new _ol_interaction_MouseWheelZoom_({
|
||||||
constrainResolution: true // force zooming to a integer zoom
|
constrainResolution: true // force zooming to a integer zoom
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
|||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
import OverviewMap from '../src/ol/control/OverviewMap.js';
|
import OverviewMap from '../src/ol/control/OverviewMap.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
import DragRotateAndZoom from '../src/ol/interaction/DragRotateAndZoom.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
@@ -28,7 +28,7 @@ var map = new _ol_Map_({
|
|||||||
controls: defaultControls().extend([
|
controls: defaultControls().extend([
|
||||||
overviewMapControl
|
overviewMapControl
|
||||||
]),
|
]),
|
||||||
interactions: _ol_interaction_.defaults().extend([
|
interactions: defaultInteractions().extend([
|
||||||
new DragRotateAndZoom()
|
new DragRotateAndZoom()
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_PinchZoom_ from '../src/ol/interaction/PinchZoom.js';
|
import _ol_interaction_PinchZoom_ from '../src/ol/interaction/PinchZoom.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults({pinchZoom: false}).extend([
|
interactions: defaultInteractions({pinchZoom: false}).extend([
|
||||||
new _ol_interaction_PinchZoom_({
|
new _ol_interaction_PinchZoom_({
|
||||||
constrainResolution: true // force zooming to a integer zoom
|
constrainResolution: true // force zooming to a integer zoom
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js';
|
import _ol_interaction_Translate_ from '../src/ol/interaction/Translate.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
@@ -28,7 +28,7 @@ var translate = new _ol_interaction_Translate_({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([select, translate]),
|
interactions: defaultInteractions().extend([select, translate]),
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new _ol_View_({
|
view: new _ol_View_({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import EsriJSON from '../src/ol/format/EsriJSON.js';
|
import EsriJSON from '../src/ol/format/EsriJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import Draw from '../src/ol/interaction/Draw.js';
|
import Draw from '../src/ol/interaction/Draw.js';
|
||||||
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
|
||||||
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
|
||||||
@@ -77,7 +77,7 @@ var modify = new _ol_interaction_Modify_({
|
|||||||
modify.setActive(false);
|
modify.setActive(false);
|
||||||
|
|
||||||
var map = new _ol_Map_({
|
var map = new _ol_Map_({
|
||||||
interactions: _ol_interaction_.defaults().extend([draw, select, modify]),
|
interactions: defaultInteractions().extend([draw, select, modify]),
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new _ol_View_({
|
view: new _ol_View_({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {inherits} from './index.js';
|
|||||||
import _ol_PluggableMap_ from './PluggableMap.js';
|
import _ol_PluggableMap_ from './PluggableMap.js';
|
||||||
import _ol_PluginType_ from './PluginType.js';
|
import _ol_PluginType_ from './PluginType.js';
|
||||||
import {defaults as defaultControls} from './control.js';
|
import {defaults as defaultControls} from './control.js';
|
||||||
import _ol_interaction_ from './interaction.js';
|
import {defaults as defaultInteractions} from './interaction.js';
|
||||||
import _ol_obj_ from './obj.js';
|
import _ol_obj_ from './obj.js';
|
||||||
import _ol_plugins_ from './plugins.js';
|
import _ol_plugins_ from './plugins.js';
|
||||||
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
||||||
@@ -79,7 +79,7 @@ var _ol_CanvasMap_ = function(options) {
|
|||||||
options.controls = defaultControls();
|
options.controls = defaultControls();
|
||||||
}
|
}
|
||||||
if (!options.interactions) {
|
if (!options.interactions) {
|
||||||
options.interactions = _ol_interaction_.defaults();
|
options.interactions = defaultInteractions();
|
||||||
}
|
}
|
||||||
|
|
||||||
_ol_PluggableMap_.call(this, options);
|
_ol_PluggableMap_.call(this, options);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {inherits} from './index.js';
|
|||||||
import _ol_PluggableMap_ from './PluggableMap.js';
|
import _ol_PluggableMap_ from './PluggableMap.js';
|
||||||
import _ol_PluginType_ from './PluginType.js';
|
import _ol_PluginType_ from './PluginType.js';
|
||||||
import {defaults as defaultControls} from './control.js';
|
import {defaults as defaultControls} from './control.js';
|
||||||
import _ol_interaction_ from './interaction.js';
|
import {defaults as defaultInteractions} from './interaction.js';
|
||||||
import _ol_obj_ from './obj.js';
|
import _ol_obj_ from './obj.js';
|
||||||
import _ol_plugins_ from './plugins.js';
|
import _ol_plugins_ from './plugins.js';
|
||||||
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
import _ol_renderer_canvas_ImageLayer_ from './renderer/canvas/ImageLayer.js';
|
||||||
@@ -90,7 +90,7 @@ var _ol_Map_ = function(options) {
|
|||||||
options.controls = defaultControls();
|
options.controls = defaultControls();
|
||||||
}
|
}
|
||||||
if (!options.interactions) {
|
if (!options.interactions) {
|
||||||
options.interactions = _ol_interaction_.defaults();
|
options.interactions = defaultInteractions();
|
||||||
}
|
}
|
||||||
|
|
||||||
_ol_PluggableMap_.call(this, options);
|
_ol_PluggableMap_.call(this, options);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import _ol_interaction_KeyboardZoom_ from './interaction/KeyboardZoom.js';
|
|||||||
import _ol_interaction_MouseWheelZoom_ from './interaction/MouseWheelZoom.js';
|
import _ol_interaction_MouseWheelZoom_ from './interaction/MouseWheelZoom.js';
|
||||||
import _ol_interaction_PinchRotate_ from './interaction/PinchRotate.js';
|
import _ol_interaction_PinchRotate_ from './interaction/PinchRotate.js';
|
||||||
import _ol_interaction_PinchZoom_ from './interaction/PinchZoom.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.
|
* interactions to be used with the ol.Map constructor's interactions option.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_interaction_.defaults = function(opt_options) {
|
export function defaults(opt_options) {
|
||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
@@ -110,5 +109,4 @@ _ol_interaction_.defaults = function(opt_options) {
|
|||||||
|
|
||||||
return interactions;
|
return interactions;
|
||||||
|
|
||||||
};
|
}
|
||||||
export default _ol_interaction_;
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_Overlay_ from '../../../src/ol/Overlay.js';
|
|||||||
import _ol_View_ from '../../../src/ol/View.js';
|
import _ol_View_ from '../../../src/ol/View.js';
|
||||||
import Point from '../../../src/ol/geom/Point.js';
|
import Point from '../../../src/ol/geom/Point.js';
|
||||||
import _ol_has_ from '../../../src/ol/has.js';
|
import _ol_has_ from '../../../src/ol/has.js';
|
||||||
import _ol_interaction_ from '../../../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../../../src/ol/interaction.js';
|
||||||
import DoubleClickZoom from '../../../src/ol/interaction/DoubleClickZoom.js';
|
import DoubleClickZoom from '../../../src/ol/interaction/DoubleClickZoom.js';
|
||||||
import Interaction from '../../../src/ol/interaction/Interaction.js';
|
import Interaction from '../../../src/ol/interaction/Interaction.js';
|
||||||
import _ol_interaction_MouseWheelZoom_ from '../../../src/ol/interaction/MouseWheelZoom.js';
|
import _ol_interaction_MouseWheelZoom_ from '../../../src/ol/interaction/MouseWheelZoom.js';
|
||||||
@@ -480,7 +480,7 @@ describe('ol.Map', function() {
|
|||||||
describe('create mousewheel interaction', function() {
|
describe('create mousewheel interaction', function() {
|
||||||
it('creates mousewheel interaction', function() {
|
it('creates mousewheel interaction', function() {
|
||||||
options.mouseWheelZoom = true;
|
options.mouseWheelZoom = true;
|
||||||
var interactions = _ol_interaction_.defaults(options);
|
var interactions = defaultInteractions(options);
|
||||||
expect(interactions.getLength()).to.eql(1);
|
expect(interactions.getLength()).to.eql(1);
|
||||||
expect(interactions.item(0)).to.be.a(_ol_interaction_MouseWheelZoom_);
|
expect(interactions.item(0)).to.be.a(_ol_interaction_MouseWheelZoom_);
|
||||||
expect(interactions.item(0).constrainResolution_).to.eql(false);
|
expect(interactions.item(0).constrainResolution_).to.eql(false);
|
||||||
@@ -493,7 +493,7 @@ describe('ol.Map', function() {
|
|||||||
describe('create pinchZoom interaction', function() {
|
describe('create pinchZoom interaction', function() {
|
||||||
it('creates pinchZoom interaction', function() {
|
it('creates pinchZoom interaction', function() {
|
||||||
options.pinchZoom = true;
|
options.pinchZoom = true;
|
||||||
var interactions = _ol_interaction_.defaults(options);
|
var interactions = defaultInteractions(options);
|
||||||
expect(interactions.getLength()).to.eql(1);
|
expect(interactions.getLength()).to.eql(1);
|
||||||
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
||||||
expect(interactions.item(0).constrainResolution_).to.eql(false);
|
expect(interactions.item(0).constrainResolution_).to.eql(false);
|
||||||
@@ -505,7 +505,7 @@ describe('ol.Map', function() {
|
|||||||
options.pinchZoom = true;
|
options.pinchZoom = true;
|
||||||
options.mouseWheelZoom = true;
|
options.mouseWheelZoom = true;
|
||||||
options.constrainResolution = true;
|
options.constrainResolution = true;
|
||||||
var interactions = _ol_interaction_.defaults(options);
|
var interactions = defaultInteractions(options);
|
||||||
expect(interactions.getLength()).to.eql(2);
|
expect(interactions.getLength()).to.eql(2);
|
||||||
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
expect(interactions.item(0)).to.be.a(_ol_interaction_PinchZoom_);
|
||||||
expect(interactions.item(0).constrainResolution_).to.eql(true);
|
expect(interactions.item(0).constrainResolution_).to.eql(true);
|
||||||
@@ -522,7 +522,7 @@ describe('ol.Map', function() {
|
|||||||
|
|
||||||
describe('default zoomDelta', function() {
|
describe('default zoomDelta', function() {
|
||||||
it('create double click interaction with default delta', function() {
|
it('create double click interaction with default delta', function() {
|
||||||
var interactions = _ol_interaction_.defaults(options);
|
var interactions = defaultInteractions(options);
|
||||||
expect(interactions.getLength()).to.eql(1);
|
expect(interactions.getLength()).to.eql(1);
|
||||||
expect(interactions.item(0)).to.be.a(DoubleClickZoom);
|
expect(interactions.item(0)).to.be.a(DoubleClickZoom);
|
||||||
expect(interactions.item(0).delta_).to.eql(1);
|
expect(interactions.item(0).delta_).to.eql(1);
|
||||||
@@ -532,7 +532,7 @@ describe('ol.Map', function() {
|
|||||||
describe('set zoomDelta', function() {
|
describe('set zoomDelta', function() {
|
||||||
it('create double click interaction with set delta', function() {
|
it('create double click interaction with set delta', function() {
|
||||||
options.zoomDelta = 7;
|
options.zoomDelta = 7;
|
||||||
var interactions = _ol_interaction_.defaults(options);
|
var interactions = defaultInteractions(options);
|
||||||
expect(interactions.getLength()).to.eql(1);
|
expect(interactions.getLength()).to.eql(1);
|
||||||
expect(interactions.item(0)).to.be.a(DoubleClickZoom);
|
expect(interactions.item(0)).to.be.a(DoubleClickZoom);
|
||||||
expect(interactions.item(0).delta_).to.eql(7);
|
expect(interactions.item(0).delta_).to.eql(7);
|
||||||
|
|||||||
Reference in New Issue
Block a user