ol 7.0.0-dev.1660149977800 → 7.0.0-dev.1660254591300

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Map.d.ts CHANGED
@@ -151,7 +151,7 @@ export type MapEventHandler<Return> = import("./Observable").OnSignature<import(
151
151
  export type MapOptions = {
152
152
  /**
153
153
  * Controls initially added to the map. If not specified,
154
- * {@link module :ol/control.defaults} is used.
154
+ * {@link module :ol/control/defaults.defaults} is used.
155
155
  */
156
156
  controls?: Collection<import("./control/Control.js").default> | import("./control/Control.js").default[] | undefined;
157
157
  /**
@@ -161,7 +161,7 @@ export type MapOptions = {
161
161
  pixelRatio?: number | undefined;
162
162
  /**
163
163
  * Interactions that are initially added to the map. If not specified,
164
- * {@link module :ol/interaction.defaults} is used.
164
+ * {@link module :ol/interaction/defaults.defaults} is used.
165
165
  */
166
166
  interactions?: Collection<import("./interaction/Interaction.js").default> | import("./interaction/Interaction.js").default[] | undefined;
167
167
  /**
package/Map.js CHANGED
@@ -34,8 +34,8 @@ import {
34
34
  getForViewAndSize,
35
35
  isEmpty,
36
36
  } from './extent.js';
37
- import {defaults as defaultControls} from './control.js';
38
- import {defaults as defaultInteractions} from './interaction.js';
37
+ import {defaults as defaultControls} from './control/defaults.js';
38
+ import {defaults as defaultInteractions} from './interaction/defaults.js';
39
39
  import {fromUserCoordinate, toUserCoordinate} from './proj.js';
40
40
  import {getUid} from './util.js';
41
41
  import {hasArea} from './size.js';
@@ -115,12 +115,12 @@ import {removeNode} from './dom.js';
115
115
  * @typedef {Object} MapOptions
116
116
  * @property {Collection<import("./control/Control.js").default>|Array<import("./control/Control.js").default>} [controls]
117
117
  * Controls initially added to the map. If not specified,
118
- * {@link module:ol/control.defaults} is used.
118
+ * {@link module:ol/control/defaults.defaults} is used.
119
119
  * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
120
120
  * physical pixels and device-independent pixels (dips) on the device.
121
121
  * @property {Collection<import("./interaction/Interaction.js").default>|Array<import("./interaction/Interaction.js").default>} [interactions]
122
122
  * Interactions that are initially added to the map. If not specified,
123
- * {@link module:ol/interaction.defaults} is used.
123
+ * {@link module:ol/interaction/defaults.defaults} is used.
124
124
  * @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
125
125
  * listen to keyboard events on. This determines when the `KeyboardPan` and
126
126
  * `KeyboardZoom` interactions trigger. For example, if this option is set to
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @typedef {Object} DefaultsOptions
3
+ * @property {boolean} [attribution=true] Include
4
+ * {@link module:ol/control/Attribution~Attribution}.
5
+ * @property {import("./Attribution.js").Options} [attributionOptions]
6
+ * Options for {@link module:ol/control/Attribution~Attribution}.
7
+ * @property {boolean} [rotate=true] Include
8
+ * {@link module:ol/control/Rotate~Rotate}.
9
+ * @property {import("./Rotate.js").Options} [rotateOptions] Options
10
+ * for {@link module:ol/control/Rotate~Rotate}.
11
+ * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
12
+ * @property {import("./Zoom.js").Options} [zoomOptions] Options for
13
+ * {@link module:ol/control/Zoom~Zoom}.
14
+ */
15
+ /**
16
+ * Set of controls included in maps by default. Unless configured otherwise,
17
+ * this returns a collection containing an instance of each of the following
18
+ * controls:
19
+ * * {@link module:ol/control/Zoom~Zoom}
20
+ * * {@link module:ol/control/Rotate~Rotate}
21
+ * * {@link module:ol/control/Attribution~Attribution}
22
+ *
23
+ * @param {DefaultsOptions} [opt_options] Options for the default controls.
24
+ * @return {Collection<import("./Control.js").default>} A collection of controls
25
+ * to be used with the {@link module:ol/Map~Map} constructor's `controls` option.
26
+ * @api
27
+ */
28
+ export function defaults(opt_options?: DefaultsOptions | undefined): Collection<import("./Control.js").default>;
29
+ export type DefaultsOptions = {
30
+ /**
31
+ * Include
32
+ * {@link module :ol/control/Attribution~Attribution}.
33
+ */
34
+ attribution?: boolean | undefined;
35
+ /**
36
+ * Options for {@link module :ol/control/Attribution~Attribution}.
37
+ */
38
+ attributionOptions?: import("./Attribution.js").Options | undefined;
39
+ /**
40
+ * Include
41
+ * {@link module :ol/control/Rotate~Rotate}.
42
+ */
43
+ rotate?: boolean | undefined;
44
+ /**
45
+ * Options
46
+ * for {@link module :ol/control/Rotate~Rotate}.
47
+ */
48
+ rotateOptions?: import("./Rotate.js").Options | undefined;
49
+ /**
50
+ * Include {@link module :ol/control/Zoom~Zoom}.
51
+ */
52
+ zoom?: boolean | undefined;
53
+ /**
54
+ * Options for
55
+ * {@link module :ol/control/Zoom~Zoom}.
56
+ */
57
+ zoomOptions?: import("./Zoom.js").Options | undefined;
58
+ };
59
+ import Collection from "../Collection.js";
60
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;GAYG;AACH,qEAJY,WAAW,OAAO,cAAc,EAAE,OAAO,CAAC,CA2BrD"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @module ol/control/defaults
3
+ */
4
+ import Attribution from './Attribution.js';
5
+ import Collection from '../Collection.js';
6
+ import Rotate from './Rotate.js';
7
+ import Zoom from './Zoom.js';
8
+
9
+ /**
10
+ * @typedef {Object} DefaultsOptions
11
+ * @property {boolean} [attribution=true] Include
12
+ * {@link module:ol/control/Attribution~Attribution}.
13
+ * @property {import("./Attribution.js").Options} [attributionOptions]
14
+ * Options for {@link module:ol/control/Attribution~Attribution}.
15
+ * @property {boolean} [rotate=true] Include
16
+ * {@link module:ol/control/Rotate~Rotate}.
17
+ * @property {import("./Rotate.js").Options} [rotateOptions] Options
18
+ * for {@link module:ol/control/Rotate~Rotate}.
19
+ * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
20
+ * @property {import("./Zoom.js").Options} [zoomOptions] Options for
21
+ * {@link module:ol/control/Zoom~Zoom}.
22
+ */
23
+
24
+ /**
25
+ * Set of controls included in maps by default. Unless configured otherwise,
26
+ * this returns a collection containing an instance of each of the following
27
+ * controls:
28
+ * * {@link module:ol/control/Zoom~Zoom}
29
+ * * {@link module:ol/control/Rotate~Rotate}
30
+ * * {@link module:ol/control/Attribution~Attribution}
31
+ *
32
+ * @param {DefaultsOptions} [opt_options] Options for the default controls.
33
+ * @return {Collection<import("./Control.js").default>} A collection of controls
34
+ * to be used with the {@link module:ol/Map~Map} constructor's `controls` option.
35
+ * @api
36
+ */
37
+ export function defaults(opt_options) {
38
+ const options = opt_options ? opt_options : {};
39
+
40
+ /** @type {Collection<import("./Control.js").default>} */
41
+ const controls = new Collection();
42
+
43
+ const zoomControl = options.zoom !== undefined ? options.zoom : true;
44
+ if (zoomControl) {
45
+ controls.push(new Zoom(options.zoomOptions));
46
+ }
47
+
48
+ const rotateControl = options.rotate !== undefined ? options.rotate : true;
49
+ if (rotateControl) {
50
+ controls.push(new Rotate(options.rotateOptions));
51
+ }
52
+
53
+ const attributionControl =
54
+ options.attribution !== undefined ? options.attribution : true;
55
+ if (attributionControl) {
56
+ controls.push(new Attribution(options.attributionOptions));
57
+ }
58
+
59
+ return controls;
60
+ }
package/control.d.ts CHANGED
@@ -1,33 +1,3 @@
1
- /**
2
- * @typedef {Object} DefaultsOptions
3
- * @property {boolean} [attribution=true] Include
4
- * {@link module:ol/control/Attribution~Attribution}.
5
- * @property {import("./control/Attribution.js").Options} [attributionOptions]
6
- * Options for {@link module:ol/control/Attribution~Attribution}.
7
- * @property {boolean} [rotate=true] Include
8
- * {@link module:ol/control/Rotate~Rotate}.
9
- * @property {import("./control/Rotate.js").Options} [rotateOptions] Options
10
- * for {@link module:ol/control/Rotate~Rotate}.
11
- * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
12
- * @property {import("./control/Zoom.js").Options} [zoomOptions] Options for
13
- * {@link module:ol/control/Zoom~Zoom}.
14
- * @api
15
- */
16
- /**
17
- * Set of controls included in maps by default. Unless configured otherwise,
18
- * this returns a collection containing an instance of each of the following
19
- * controls:
20
- * * {@link module:ol/control/Zoom~Zoom}
21
- * * {@link module:ol/control/Rotate~Rotate}
22
- * * {@link module:ol/control/Attribution~Attribution}
23
- *
24
- * @param {DefaultsOptions} [opt_options]
25
- * Defaults options.
26
- * @return {Collection<import("./control/Control.js").default>}
27
- * Controls.
28
- * @api
29
- */
30
- export function defaults(opt_options?: DefaultsOptions | undefined): Collection<import("./control/Control.js").default>;
31
1
  export { default as Attribution } from "./control/Attribution.js";
32
2
  export { default as Control } from "./control/Control.js";
33
3
  export { default as FullScreen } from "./control/FullScreen.js";
@@ -38,35 +8,5 @@ export { default as ScaleLine } from "./control/ScaleLine.js";
38
8
  export { default as Zoom } from "./control/Zoom.js";
39
9
  export { default as ZoomSlider } from "./control/ZoomSlider.js";
40
10
  export { default as ZoomToExtent } from "./control/ZoomToExtent.js";
41
- export type DefaultsOptions = {
42
- /**
43
- * Include
44
- * {@link module :ol/control/Attribution~Attribution}.
45
- */
46
- attribution?: boolean | undefined;
47
- /**
48
- * Options for {@link module :ol/control/Attribution~Attribution}.
49
- */
50
- attributionOptions?: import("./control/Attribution.js").Options | undefined;
51
- /**
52
- * Include
53
- * {@link module :ol/control/Rotate~Rotate}.
54
- */
55
- rotate?: boolean | undefined;
56
- /**
57
- * Options
58
- * for {@link module :ol/control/Rotate~Rotate}.
59
- */
60
- rotateOptions?: import("./control/Rotate.js").Options | undefined;
61
- /**
62
- * Include {@link module :ol/control/Zoom~Zoom}.
63
- */
64
- zoom?: boolean | undefined;
65
- /**
66
- * Options for
67
- * {@link module :ol/control/Zoom~Zoom}.
68
- */
69
- zoomOptions?: import("./control/Zoom.js").Options | undefined;
70
- };
71
- import Collection from "./Collection.js";
11
+ export { defaults } from "./control/defaults.js";
72
12
  //# sourceMappingURL=control.d.ts.map
package/control.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["control.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AACH,qEAJY,WAAW,OAAO,sBAAsB,EAAE,OAAO,CAAC,CA2B7D"}
1
+ {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["control.js"],"names":[],"mappings":""}
package/control.js CHANGED
@@ -1,11 +1,6 @@
1
1
  /**
2
2
  * @module ol/control
3
3
  */
4
- import Attribution from './control/Attribution.js';
5
- import Collection from './Collection.js';
6
- import Rotate from './control/Rotate.js';
7
- import Zoom from './control/Zoom.js';
8
-
9
4
  export {default as Attribution} from './control/Attribution.js';
10
5
  export {default as Control} from './control/Control.js';
11
6
  export {default as FullScreen} from './control/FullScreen.js';
@@ -16,58 +11,4 @@ export {default as ScaleLine} from './control/ScaleLine.js';
16
11
  export {default as Zoom} from './control/Zoom.js';
17
12
  export {default as ZoomSlider} from './control/ZoomSlider.js';
18
13
  export {default as ZoomToExtent} from './control/ZoomToExtent.js';
19
-
20
- /**
21
- * @typedef {Object} DefaultsOptions
22
- * @property {boolean} [attribution=true] Include
23
- * {@link module:ol/control/Attribution~Attribution}.
24
- * @property {import("./control/Attribution.js").Options} [attributionOptions]
25
- * Options for {@link module:ol/control/Attribution~Attribution}.
26
- * @property {boolean} [rotate=true] Include
27
- * {@link module:ol/control/Rotate~Rotate}.
28
- * @property {import("./control/Rotate.js").Options} [rotateOptions] Options
29
- * for {@link module:ol/control/Rotate~Rotate}.
30
- * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
31
- * @property {import("./control/Zoom.js").Options} [zoomOptions] Options for
32
- * {@link module:ol/control/Zoom~Zoom}.
33
- * @api
34
- */
35
-
36
- /**
37
- * Set of controls included in maps by default. Unless configured otherwise,
38
- * this returns a collection containing an instance of each of the following
39
- * controls:
40
- * * {@link module:ol/control/Zoom~Zoom}
41
- * * {@link module:ol/control/Rotate~Rotate}
42
- * * {@link module:ol/control/Attribution~Attribution}
43
- *
44
- * @param {DefaultsOptions} [opt_options]
45
- * Defaults options.
46
- * @return {Collection<import("./control/Control.js").default>}
47
- * Controls.
48
- * @api
49
- */
50
- export function defaults(opt_options) {
51
- const options = opt_options ? opt_options : {};
52
-
53
- /** @type {Collection<import("./control/Control.js").default>} */
54
- const controls = new Collection();
55
-
56
- const zoomControl = options.zoom !== undefined ? options.zoom : true;
57
- if (zoomControl) {
58
- controls.push(new Zoom(options.zoomOptions));
59
- }
60
-
61
- const rotateControl = options.rotate !== undefined ? options.rotate : true;
62
- if (rotateControl) {
63
- controls.push(new Rotate(options.rotateOptions));
64
- }
65
-
66
- const attributionControl =
67
- options.attribution !== undefined ? options.attribution : true;
68
- if (attributionControl) {
69
- controls.push(new Attribution(options.attributionOptions));
70
- }
71
-
72
- return controls;
73
- }
14
+ export {defaults} from './control/defaults.js';
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @typedef {Object} DefaultsOptions
3
+ * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is
4
+ * desired.
5
+ * @property {boolean} [onFocusOnly=false] Interact only when the map has the
6
+ * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
7
+ * useful when page scroll is desired for maps that do not have the browser's
8
+ * focus.
9
+ * @property {boolean} [doubleClickZoom=true] Whether double click zoom is
10
+ * desired.
11
+ * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.
12
+ * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.
13
+ * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.
14
+ * @property {boolean} [dragPan=true] Whether drag pan is desired.
15
+ * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.
16
+ * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.
17
+ * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.
18
+ * @property {number} [zoomDuration] Duration of the zoom animation in
19
+ * milliseconds.
20
+ */
21
+ /**
22
+ * Set of interactions included in maps by default. Specific interactions can be
23
+ * excluded by setting the appropriate option to false in the constructor
24
+ * options, but the order of the interactions is fixed. If you want to specify
25
+ * a different order for interactions, you will need to create your own
26
+ * {@link module:ol/interaction/Interaction~Interaction} instances and insert
27
+ * them into a {@link module:ol/Collection~Collection} in the order you want
28
+ * before creating your {@link module:ol/Map~Map} instance. Changing the order can
29
+ * be of interest if the event propagation needs to be stopped at a point.
30
+ * The default set of interactions, in sequence, is:
31
+ * * {@link module:ol/interaction/DragRotate~DragRotate}
32
+ * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}
33
+ * * {@link module:ol/interaction/DragPan~DragPan}
34
+ * * {@link module:ol/interaction/PinchRotate~PinchRotate}
35
+ * * {@link module:ol/interaction/PinchZoom~PinchZoom}
36
+ * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}
37
+ * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}
38
+ * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
39
+ * * {@link module:ol/interaction/DragZoom~DragZoom}
40
+ *
41
+ * @param {DefaultsOptions} [opt_options] Defaults options.
42
+ * @return {Collection<import("./Interaction.js").default>}
43
+ * A collection of interactions to be used with the {@link module:ol/Map~Map}
44
+ * constructor's `interactions` option.
45
+ * @api
46
+ */
47
+ export function defaults(opt_options?: DefaultsOptions | undefined): Collection<import("./Interaction.js").default>;
48
+ export type DefaultsOptions = {
49
+ /**
50
+ * Whether Alt-Shift-drag rotate is
51
+ * desired.
52
+ */
53
+ altShiftDragRotate?: boolean | undefined;
54
+ /**
55
+ * Interact only when the map has the
56
+ * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
57
+ * useful when page scroll is desired for maps that do not have the browser's
58
+ * focus.
59
+ */
60
+ onFocusOnly?: boolean | undefined;
61
+ /**
62
+ * Whether double click zoom is
63
+ * desired.
64
+ */
65
+ doubleClickZoom?: boolean | undefined;
66
+ /**
67
+ * Whether keyboard interaction is desired.
68
+ */
69
+ keyboard?: boolean | undefined;
70
+ /**
71
+ * Whether mousewheel zoom is desired.
72
+ */
73
+ mouseWheelZoom?: boolean | undefined;
74
+ /**
75
+ * Whether Shift-drag zoom is desired.
76
+ */
77
+ shiftDragZoom?: boolean | undefined;
78
+ /**
79
+ * Whether drag pan is desired.
80
+ */
81
+ dragPan?: boolean | undefined;
82
+ /**
83
+ * Whether pinch rotate is desired.
84
+ */
85
+ pinchRotate?: boolean | undefined;
86
+ /**
87
+ * Whether pinch zoom is desired.
88
+ */
89
+ pinchZoom?: boolean | undefined;
90
+ /**
91
+ * Zoom level delta when using keyboard or double click zoom.
92
+ */
93
+ zoomDelta?: number | undefined;
94
+ /**
95
+ * Duration of the zoom animation in
96
+ * milliseconds.
97
+ */
98
+ zoomDuration?: number | undefined;
99
+ };
100
+ import Collection from "../Collection.js";
101
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qEALY,WAAW,OAAO,kBAAkB,EAAE,OAAO,CAAC,CA0FzD"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * @module ol/interaction/defaults
3
+ */
4
+ import Collection from '../Collection.js';
5
+ import DoubleClickZoom from './DoubleClickZoom.js';
6
+ import DragPan from './DragPan.js';
7
+ import DragRotate from './DragRotate.js';
8
+ import DragZoom from './DragZoom.js';
9
+ import KeyboardPan from './KeyboardPan.js';
10
+ import KeyboardZoom from './KeyboardZoom.js';
11
+ import Kinetic from '../Kinetic.js';
12
+ import MouseWheelZoom from './MouseWheelZoom.js';
13
+ import PinchRotate from './PinchRotate.js';
14
+ import PinchZoom from './PinchZoom.js';
15
+
16
+ /**
17
+ * @typedef {Object} DefaultsOptions
18
+ * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is
19
+ * desired.
20
+ * @property {boolean} [onFocusOnly=false] Interact only when the map has the
21
+ * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
22
+ * useful when page scroll is desired for maps that do not have the browser's
23
+ * focus.
24
+ * @property {boolean} [doubleClickZoom=true] Whether double click zoom is
25
+ * desired.
26
+ * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.
27
+ * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.
28
+ * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.
29
+ * @property {boolean} [dragPan=true] Whether drag pan is desired.
30
+ * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.
31
+ * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.
32
+ * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.
33
+ * @property {number} [zoomDuration] Duration of the zoom animation in
34
+ * milliseconds.
35
+ */
36
+
37
+ /**
38
+ * Set of interactions included in maps by default. Specific interactions can be
39
+ * excluded by setting the appropriate option to false in the constructor
40
+ * options, but the order of the interactions is fixed. If you want to specify
41
+ * a different order for interactions, you will need to create your own
42
+ * {@link module:ol/interaction/Interaction~Interaction} instances and insert
43
+ * them into a {@link module:ol/Collection~Collection} in the order you want
44
+ * before creating your {@link module:ol/Map~Map} instance. Changing the order can
45
+ * be of interest if the event propagation needs to be stopped at a point.
46
+ * The default set of interactions, in sequence, is:
47
+ * * {@link module:ol/interaction/DragRotate~DragRotate}
48
+ * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}
49
+ * * {@link module:ol/interaction/DragPan~DragPan}
50
+ * * {@link module:ol/interaction/PinchRotate~PinchRotate}
51
+ * * {@link module:ol/interaction/PinchZoom~PinchZoom}
52
+ * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}
53
+ * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}
54
+ * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
55
+ * * {@link module:ol/interaction/DragZoom~DragZoom}
56
+ *
57
+ * @param {DefaultsOptions} [opt_options] Defaults options.
58
+ * @return {Collection<import("./Interaction.js").default>}
59
+ * A collection of interactions to be used with the {@link module:ol/Map~Map}
60
+ * constructor's `interactions` option.
61
+ * @api
62
+ */
63
+ export function defaults(opt_options) {
64
+ const options = opt_options ? opt_options : {};
65
+
66
+ /** @type {Collection<import("./Interaction.js").default>} */
67
+ const interactions = new Collection();
68
+
69
+ const kinetic = new Kinetic(-0.005, 0.05, 100);
70
+
71
+ const altShiftDragRotate =
72
+ options.altShiftDragRotate !== undefined
73
+ ? options.altShiftDragRotate
74
+ : true;
75
+ if (altShiftDragRotate) {
76
+ interactions.push(new DragRotate());
77
+ }
78
+
79
+ const doubleClickZoom =
80
+ options.doubleClickZoom !== undefined ? options.doubleClickZoom : true;
81
+ if (doubleClickZoom) {
82
+ interactions.push(
83
+ new DoubleClickZoom({
84
+ delta: options.zoomDelta,
85
+ duration: options.zoomDuration,
86
+ })
87
+ );
88
+ }
89
+
90
+ const dragPan = options.dragPan !== undefined ? options.dragPan : true;
91
+ if (dragPan) {
92
+ interactions.push(
93
+ new DragPan({
94
+ onFocusOnly: options.onFocusOnly,
95
+ kinetic: kinetic,
96
+ })
97
+ );
98
+ }
99
+
100
+ const pinchRotate =
101
+ options.pinchRotate !== undefined ? options.pinchRotate : true;
102
+ if (pinchRotate) {
103
+ interactions.push(new PinchRotate());
104
+ }
105
+
106
+ const pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
107
+ if (pinchZoom) {
108
+ interactions.push(
109
+ new PinchZoom({
110
+ duration: options.zoomDuration,
111
+ })
112
+ );
113
+ }
114
+
115
+ const keyboard = options.keyboard !== undefined ? options.keyboard : true;
116
+ if (keyboard) {
117
+ interactions.push(new KeyboardPan());
118
+ interactions.push(
119
+ new KeyboardZoom({
120
+ delta: options.zoomDelta,
121
+ duration: options.zoomDuration,
122
+ })
123
+ );
124
+ }
125
+
126
+ const mouseWheelZoom =
127
+ options.mouseWheelZoom !== undefined ? options.mouseWheelZoom : true;
128
+ if (mouseWheelZoom) {
129
+ interactions.push(
130
+ new MouseWheelZoom({
131
+ onFocusOnly: options.onFocusOnly,
132
+ duration: options.zoomDuration,
133
+ })
134
+ );
135
+ }
136
+
137
+ const shiftDragZoom =
138
+ options.shiftDragZoom !== undefined ? options.shiftDragZoom : true;
139
+ if (shiftDragZoom) {
140
+ interactions.push(
141
+ new DragZoom({
142
+ duration: options.zoomDuration,
143
+ })
144
+ );
145
+ }
146
+
147
+ return interactions;
148
+ }
package/interaction.d.ts CHANGED
@@ -1,50 +1,3 @@
1
- /**
2
- * @typedef {Object} DefaultsOptions
3
- * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is
4
- * desired.
5
- * @property {boolean} [onFocusOnly=false] Interact only when the map has the
6
- * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
7
- * useful when page scroll is desired for maps that do not have the browser's
8
- * focus.
9
- * @property {boolean} [doubleClickZoom=true] Whether double click zoom is
10
- * desired.
11
- * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.
12
- * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.
13
- * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.
14
- * @property {boolean} [dragPan=true] Whether drag pan is desired.
15
- * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.
16
- * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.
17
- * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.
18
- * @property {number} [zoomDuration] Duration of the zoom animation in
19
- * milliseconds.
20
- */
21
- /**
22
- * Set of interactions included in maps by default. Specific interactions can be
23
- * excluded by setting the appropriate option to false in the constructor
24
- * options, but the order of the interactions is fixed. If you want to specify
25
- * a different order for interactions, you will need to create your own
26
- * {@link module:ol/interaction/Interaction~Interaction} instances and insert
27
- * them into a {@link module:ol/Collection~Collection} in the order you want
28
- * before creating your {@link module:ol/Map~Map} instance. Changing the order can
29
- * be of interest if the event propagation needs to be stopped at a point.
30
- * The default set of interactions, in sequence, is:
31
- * * {@link module:ol/interaction/DragRotate~DragRotate}
32
- * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}
33
- * * {@link module:ol/interaction/DragPan~DragPan}
34
- * * {@link module:ol/interaction/PinchRotate~PinchRotate}
35
- * * {@link module:ol/interaction/PinchZoom~PinchZoom}
36
- * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}
37
- * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}
38
- * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
39
- * * {@link module:ol/interaction/DragZoom~DragZoom}
40
- *
41
- * @param {DefaultsOptions} [opt_options] Defaults options.
42
- * @return {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
43
- * A collection of interactions to be used with the {@link module:ol/Map~Map}
44
- * constructor's `interactions` option.
45
- * @api
46
- */
47
- export function defaults(opt_options?: DefaultsOptions | undefined): import("./Collection.js").default<import("./interaction/Interaction.js").default>;
48
1
  export { default as DoubleClickZoom } from "./interaction/DoubleClickZoom.js";
49
2
  export { default as DragAndDrop } from "./interaction/DragAndDrop.js";
50
3
  export { default as DragBox } from "./interaction/DragBox.js";
@@ -66,56 +19,5 @@ export { default as Pointer } from "./interaction/Pointer.js";
66
19
  export { default as Select } from "./interaction/Select.js";
67
20
  export { default as Snap } from "./interaction/Snap.js";
68
21
  export { default as Translate } from "./interaction/Translate.js";
69
- export type DefaultsOptions = {
70
- /**
71
- * Whether Alt-Shift-drag rotate is
72
- * desired.
73
- */
74
- altShiftDragRotate?: boolean | undefined;
75
- /**
76
- * Interact only when the map has the
77
- * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
78
- * useful when page scroll is desired for maps that do not have the browser's
79
- * focus.
80
- */
81
- onFocusOnly?: boolean | undefined;
82
- /**
83
- * Whether double click zoom is
84
- * desired.
85
- */
86
- doubleClickZoom?: boolean | undefined;
87
- /**
88
- * Whether keyboard interaction is desired.
89
- */
90
- keyboard?: boolean | undefined;
91
- /**
92
- * Whether mousewheel zoom is desired.
93
- */
94
- mouseWheelZoom?: boolean | undefined;
95
- /**
96
- * Whether Shift-drag zoom is desired.
97
- */
98
- shiftDragZoom?: boolean | undefined;
99
- /**
100
- * Whether drag pan is desired.
101
- */
102
- dragPan?: boolean | undefined;
103
- /**
104
- * Whether pinch rotate is desired.
105
- */
106
- pinchRotate?: boolean | undefined;
107
- /**
108
- * Whether pinch zoom is desired.
109
- */
110
- pinchZoom?: boolean | undefined;
111
- /**
112
- * Zoom level delta when using keyboard or double click zoom.
113
- */
114
- zoomDelta?: number | undefined;
115
- /**
116
- * Duration of the zoom animation in
117
- * milliseconds.
118
- */
119
- zoomDuration?: number | undefined;
120
- };
22
+ export { defaults } from "./interaction/defaults.js";
121
23
  //# sourceMappingURL=interaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["interaction.js"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qEALY,OAAO,iBAAiB,EAAE,OAAO,CAAC,OAAO,8BAA8B,EAAE,OAAO,CAAC,CA0F5F"}
1
+ {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["interaction.js"],"names":[],"mappings":""}
package/interaction.js CHANGED
@@ -1,18 +1,6 @@
1
1
  /**
2
2
  * @module ol/interaction
3
3
  */
4
- import Collection from './Collection.js';
5
- import DoubleClickZoom from './interaction/DoubleClickZoom.js';
6
- import DragPan from './interaction/DragPan.js';
7
- import DragRotate from './interaction/DragRotate.js';
8
- import DragZoom from './interaction/DragZoom.js';
9
- import KeyboardPan from './interaction/KeyboardPan.js';
10
- import KeyboardZoom from './interaction/KeyboardZoom.js';
11
- import Kinetic from './Kinetic.js';
12
- import MouseWheelZoom from './interaction/MouseWheelZoom.js';
13
- import PinchRotate from './interaction/PinchRotate.js';
14
- import PinchZoom from './interaction/PinchZoom.js';
15
-
16
4
  export {default as DoubleClickZoom} from './interaction/DoubleClickZoom.js';
17
5
  export {default as DragAndDrop} from './interaction/DragAndDrop.js';
18
6
  export {default as DragBox} from './interaction/DragBox.js';
@@ -34,137 +22,4 @@ export {default as Pointer} from './interaction/Pointer.js';
34
22
  export {default as Select} from './interaction/Select.js';
35
23
  export {default as Snap} from './interaction/Snap.js';
36
24
  export {default as Translate} from './interaction/Translate.js';
37
-
38
- /**
39
- * @typedef {Object} DefaultsOptions
40
- * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is
41
- * desired.
42
- * @property {boolean} [onFocusOnly=false] Interact only when the map has the
43
- * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is
44
- * useful when page scroll is desired for maps that do not have the browser's
45
- * focus.
46
- * @property {boolean} [doubleClickZoom=true] Whether double click zoom is
47
- * desired.
48
- * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.
49
- * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.
50
- * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.
51
- * @property {boolean} [dragPan=true] Whether drag pan is desired.
52
- * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.
53
- * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.
54
- * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.
55
- * @property {number} [zoomDuration] Duration of the zoom animation in
56
- * milliseconds.
57
- */
58
-
59
- /**
60
- * Set of interactions included in maps by default. Specific interactions can be
61
- * excluded by setting the appropriate option to false in the constructor
62
- * options, but the order of the interactions is fixed. If you want to specify
63
- * a different order for interactions, you will need to create your own
64
- * {@link module:ol/interaction/Interaction~Interaction} instances and insert
65
- * them into a {@link module:ol/Collection~Collection} in the order you want
66
- * before creating your {@link module:ol/Map~Map} instance. Changing the order can
67
- * be of interest if the event propagation needs to be stopped at a point.
68
- * The default set of interactions, in sequence, is:
69
- * * {@link module:ol/interaction/DragRotate~DragRotate}
70
- * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}
71
- * * {@link module:ol/interaction/DragPan~DragPan}
72
- * * {@link module:ol/interaction/PinchRotate~PinchRotate}
73
- * * {@link module:ol/interaction/PinchZoom~PinchZoom}
74
- * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}
75
- * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}
76
- * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
77
- * * {@link module:ol/interaction/DragZoom~DragZoom}
78
- *
79
- * @param {DefaultsOptions} [opt_options] Defaults options.
80
- * @return {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
81
- * A collection of interactions to be used with the {@link module:ol/Map~Map}
82
- * constructor's `interactions` option.
83
- * @api
84
- */
85
- export function defaults(opt_options) {
86
- const options = opt_options ? opt_options : {};
87
-
88
- /** @type {Collection<import("./interaction/Interaction.js").default>} */
89
- const interactions = new Collection();
90
-
91
- const kinetic = new Kinetic(-0.005, 0.05, 100);
92
-
93
- const altShiftDragRotate =
94
- options.altShiftDragRotate !== undefined
95
- ? options.altShiftDragRotate
96
- : true;
97
- if (altShiftDragRotate) {
98
- interactions.push(new DragRotate());
99
- }
100
-
101
- const doubleClickZoom =
102
- options.doubleClickZoom !== undefined ? options.doubleClickZoom : true;
103
- if (doubleClickZoom) {
104
- interactions.push(
105
- new DoubleClickZoom({
106
- delta: options.zoomDelta,
107
- duration: options.zoomDuration,
108
- })
109
- );
110
- }
111
-
112
- const dragPan = options.dragPan !== undefined ? options.dragPan : true;
113
- if (dragPan) {
114
- interactions.push(
115
- new DragPan({
116
- onFocusOnly: options.onFocusOnly,
117
- kinetic: kinetic,
118
- })
119
- );
120
- }
121
-
122
- const pinchRotate =
123
- options.pinchRotate !== undefined ? options.pinchRotate : true;
124
- if (pinchRotate) {
125
- interactions.push(new PinchRotate());
126
- }
127
-
128
- const pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
129
- if (pinchZoom) {
130
- interactions.push(
131
- new PinchZoom({
132
- duration: options.zoomDuration,
133
- })
134
- );
135
- }
136
-
137
- const keyboard = options.keyboard !== undefined ? options.keyboard : true;
138
- if (keyboard) {
139
- interactions.push(new KeyboardPan());
140
- interactions.push(
141
- new KeyboardZoom({
142
- delta: options.zoomDelta,
143
- duration: options.zoomDuration,
144
- })
145
- );
146
- }
147
-
148
- const mouseWheelZoom =
149
- options.mouseWheelZoom !== undefined ? options.mouseWheelZoom : true;
150
- if (mouseWheelZoom) {
151
- interactions.push(
152
- new MouseWheelZoom({
153
- onFocusOnly: options.onFocusOnly,
154
- duration: options.zoomDuration,
155
- })
156
- );
157
- }
158
-
159
- const shiftDragZoom =
160
- options.shiftDragZoom !== undefined ? options.shiftDragZoom : true;
161
- if (shiftDragZoom) {
162
- interactions.push(
163
- new DragZoom({
164
- duration: options.zoomDuration,
165
- })
166
- );
167
- }
168
-
169
- return interactions;
170
- }
25
+ export {defaults} from './interaction/defaults.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "7.0.0-dev.1660149977800",
3
+ "version": "7.0.0-dev.1660254591300",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '7.0.0-dev.1660149977800';
36
+ export const VERSION = '7.0.0-dev.1660254591300';