@antv/l7-map 2.9.33 → 2.9.35

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.
Files changed (56) hide show
  1. package/lib/camera.js +766 -508
  2. package/lib/earthmap.js +389 -223
  3. package/lib/geo/edge_insets.js +117 -64
  4. package/lib/geo/lng_lat.js +86 -65
  5. package/lib/geo/lng_lat_bounds.js +162 -123
  6. package/lib/geo/mercator.js +91 -62
  7. package/lib/geo/point.js +234 -171
  8. package/lib/geo/simple.js +93 -61
  9. package/lib/geo/transform.js +982 -472
  10. package/lib/handler/IHandler.js +4 -16
  11. package/lib/handler/blockable_map_event.js +84 -63
  12. package/lib/handler/box_zoom.js +201 -123
  13. package/lib/handler/click_zoom.js +63 -55
  14. package/lib/handler/events/event.js +20 -35
  15. package/lib/handler/events/index.js +28 -35
  16. package/lib/handler/events/map_mouse_event.js +85 -42
  17. package/lib/handler/events/map_touch_event.js +116 -45
  18. package/lib/handler/events/map_wheel_event.js +70 -34
  19. package/lib/handler/events/render_event.js +50 -31
  20. package/lib/handler/handler_inertia.js +158 -114
  21. package/lib/handler/handler_manager.js +640 -381
  22. package/lib/handler/handler_util.js +11 -29
  23. package/lib/handler/keyboard.js +155 -114
  24. package/lib/handler/map_event.js +133 -84
  25. package/lib/handler/mouse/index.js +28 -35
  26. package/lib/handler/mouse/mouse_handler.js +126 -90
  27. package/lib/handler/mouse/mousepan_handler.js +64 -46
  28. package/lib/handler/mouse/mousepitch_hander.js +64 -44
  29. package/lib/handler/mouse/mouserotate_hander.js +64 -44
  30. package/lib/handler/mouse/util.js +22 -40
  31. package/lib/handler/scroll_zoom.js +318 -176
  32. package/lib/handler/shim/dblclick_zoom.js +76 -42
  33. package/lib/handler/shim/drag_pan.js +98 -48
  34. package/lib/handler/shim/drag_rotate.js +82 -43
  35. package/lib/handler/shim/touch_zoom_rotate.js +127 -59
  36. package/lib/handler/tap/single_tap_recognizer.js +113 -84
  37. package/lib/handler/tap/tap_drag_zoom.js +111 -93
  38. package/lib/handler/tap/tap_recognizer.js +72 -60
  39. package/lib/handler/tap/tap_zoom.js +113 -88
  40. package/lib/handler/touch/index.js +36 -38
  41. package/lib/handler/touch/touch_pan.js +126 -98
  42. package/lib/handler/touch/touch_pitch.js +108 -74
  43. package/lib/handler/touch/touch_rotate.js +93 -59
  44. package/lib/handler/touch/touch_zoom.js +71 -49
  45. package/lib/handler/touch/two_touch.js +129 -90
  46. package/lib/hash.js +149 -100
  47. package/lib/index.js +43 -20
  48. package/lib/interface.js +4 -16
  49. package/lib/map.js +420 -240
  50. package/lib/util.js +88 -69
  51. package/lib/utils/Aabb.js +134 -81
  52. package/lib/utils/dom.js +162 -88
  53. package/lib/utils/performance.js +46 -54
  54. package/lib/utils/primitives.js +53 -59
  55. package/lib/utils/task_queue.js +104 -61
  56. package/package.json +3 -3
@@ -1,17 +1,5 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
14
2
 
15
- // src/handler/IHandler.ts
16
- var IHandler_exports = {};
17
- module.exports = __toCommonJS(IHandler_exports);
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,71 +1,92 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
4
 
19
- // src/handler/blockable_map_event.ts
20
- var blockable_map_event_exports = {};
21
- __export(blockable_map_event_exports, {
22
- default: () => BlockableMapEventHandler
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
23
7
  });
24
- module.exports = __toCommonJS(blockable_map_event_exports);
25
- var import_events = require("./events");
26
- var BlockableMapEventHandler = class {
27
- constructor(map) {
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _events = require("./events");
15
+
16
+ // @ts-ignore
17
+ var BlockableMapEventHandler = /*#__PURE__*/function () {
18
+ function BlockableMapEventHandler(map) {
19
+ (0, _classCallCheck2.default)(this, BlockableMapEventHandler);
28
20
  this.map = map;
29
21
  }
30
- reset() {
31
- this.delayContextMenu = false;
32
- delete this.contextMenuEvent;
33
- }
34
- mousemove(e) {
35
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
36
- }
37
- mousedown() {
38
- this.delayContextMenu = true;
39
- }
40
- mouseup() {
41
- this.delayContextMenu = false;
42
- if (this.contextMenuEvent) {
43
- this.map.emit("contextmenu", new import_events.MapMouseEvent("contextmenu", this.map, this.contextMenuEvent));
22
+
23
+ (0, _createClass2.default)(BlockableMapEventHandler, [{
24
+ key: "reset",
25
+ value: function reset() {
26
+ this.delayContextMenu = false; // @ts-ignore
27
+
44
28
  delete this.contextMenuEvent;
45
29
  }
46
- }
47
- contextmenu(e) {
48
- if (this.delayContextMenu) {
49
- this.contextMenuEvent = e;
50
- } else {
51
- this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
30
+ }, {
31
+ key: "mousemove",
32
+ value: function mousemove(e) {
33
+ // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active
34
+ this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
52
35
  }
53
- if (this.map.listeners("contextmenu")) {
54
- e.preventDefault();
36
+ }, {
37
+ key: "mousedown",
38
+ value: function mousedown() {
39
+ this.delayContextMenu = true;
55
40
  }
56
- }
57
- isEnabled() {
58
- return true;
59
- }
60
- isActive() {
61
- return false;
62
- }
63
- enable() {
64
- return true;
65
- }
66
- disable() {
67
- return false;
68
- }
69
- };
70
- // Annotate the CommonJS export names for ESM import in node:
71
- 0 && (module.exports = {});
41
+ }, {
42
+ key: "mouseup",
43
+ value: function mouseup() {
44
+ this.delayContextMenu = false;
45
+
46
+ if (this.contextMenuEvent) {
47
+ this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent)); // @ts-ignore
48
+
49
+ delete this.contextMenuEvent;
50
+ }
51
+ }
52
+ }, {
53
+ key: "contextmenu",
54
+ value: function contextmenu(e) {
55
+ if (this.delayContextMenu) {
56
+ // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake
57
+ this.contextMenuEvent = e;
58
+ } else {
59
+ // Windows: contextmenu fired on mouseup, so fire event now
60
+ this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
61
+ } // prevent browser context menu when necessary
62
+
63
+
64
+ if (this.map.listeners('contextmenu')) {
65
+ e.preventDefault();
66
+ }
67
+ }
68
+ }, {
69
+ key: "isEnabled",
70
+ value: function isEnabled() {
71
+ return true;
72
+ }
73
+ }, {
74
+ key: "isActive",
75
+ value: function isActive() {
76
+ return false;
77
+ }
78
+ }, {
79
+ key: "enable",
80
+ value: function enable() {
81
+ return true;
82
+ }
83
+ }, {
84
+ key: "disable",
85
+ value: function disable() {
86
+ return false;
87
+ }
88
+ }]);
89
+ return BlockableMapEventHandler;
90
+ }();
91
+
92
+ exports.default = BlockableMapEventHandler;
@@ -1,139 +1,217 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/handler/box_zoom.ts
23
- var box_zoom_exports = {};
24
- __export(box_zoom_exports, {
25
- default: () => box_zoom_default
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(box_zoom_exports);
28
- var import_dom = __toESM(require("../utils/dom"));
29
- var import_event = require("./events/event");
30
- var BoxZoomHandler = class {
31
- constructor(map, options) {
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _dom = _interopRequireDefault(require("../utils/dom"));
15
+
16
+ var _event = require("./events/event");
17
+
18
+ // @ts-ignore
19
+
20
+ /**
21
+ * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
22
+ * The bounding box is defined by clicking and holding `shift` while dragging the cursor.
23
+ */
24
+ var BoxZoomHandler = /*#__PURE__*/function () {
25
+ /**
26
+ * @private
27
+ */
28
+ function BoxZoomHandler(map, options) {
29
+ (0, _classCallCheck2.default)(this, BoxZoomHandler);
32
30
  this.map = map;
33
31
  this.el = map.getCanvasContainer();
34
32
  this.container = map.getContainer();
35
33
  this.clickTolerance = options.clickTolerance || 1;
36
34
  }
37
- isEnabled() {
38
- return !!this.enabled;
39
- }
40
- isActive() {
41
- return !!this.active;
42
- }
43
- enable() {
44
- if (this.isEnabled()) {
45
- return;
46
- }
47
- this.enabled = true;
48
- }
49
- disable() {
50
- if (!this.isEnabled()) {
51
- return;
52
- }
53
- this.enabled = false;
54
- }
55
- mousedown(e, point) {
56
- if (!this.isEnabled()) {
57
- return;
58
- }
59
- if (!(e.shiftKey && e.button === 0)) {
60
- return;
61
- }
62
- import_dom.default.disableDrag();
63
- this.startPos = this.lastPos = point;
64
- this.active = true;
65
- }
66
- mousemoveWindow(e, point) {
67
- if (!this.active) {
68
- return;
35
+ /**
36
+ * Returns a Boolean indicating whether the "box zoom" interaction is enabled.
37
+ *
38
+ * @returns {boolean} `true` if the "box zoom" interaction is enabled.
39
+ */
40
+
41
+
42
+ (0, _createClass2.default)(BoxZoomHandler, [{
43
+ key: "isEnabled",
44
+ value: function isEnabled() {
45
+ return !!this.enabled;
69
46
  }
70
- const pos = point;
71
- if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
72
- return;
47
+ /**
48
+ * Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
49
+ *
50
+ * @returns {boolean} `true` if the "box zoom" interaction is active.
51
+ */
52
+
53
+ }, {
54
+ key: "isActive",
55
+ value: function isActive() {
56
+ return !!this.active;
73
57
  }
74
- const p0 = this.startPos;
75
- this.lastPos = pos;
76
- if (!this.box) {
77
- this.box = import_dom.default.create("div", "l7-boxzoom", this.container);
78
- this.container.classList.add("l7-crosshair");
79
- this.fireEvent("boxzoomstart", e);
58
+ /**
59
+ * Enables the "box zoom" interaction.
60
+ *
61
+ * @example
62
+ * map.boxZoom.enable();
63
+ */
64
+
65
+ }, {
66
+ key: "enable",
67
+ value: function enable() {
68
+ if (this.isEnabled()) {
69
+ return;
70
+ }
71
+
72
+ this.enabled = true;
80
73
  }
81
- const minX = Math.min(p0.x, pos.x);
82
- const maxX = Math.max(p0.x, pos.x);
83
- const minY = Math.min(p0.y, pos.y);
84
- const maxY = Math.max(p0.y, pos.y);
85
- import_dom.default.setTransform(this.box, `translate(${minX}px,${minY}px)`);
86
- if (this.box) {
87
- this.box.style.width = `${maxX - minX}px`;
88
- this.box.style.height = `${maxY - minY}px`;
74
+ /**
75
+ * Disables the "box zoom" interaction.
76
+ *
77
+ * @example
78
+ * map.boxZoom.disable();
79
+ */
80
+
81
+ }, {
82
+ key: "disable",
83
+ value: function disable() {
84
+ if (!this.isEnabled()) {
85
+ return;
86
+ }
87
+
88
+ this.enabled = false;
89
89
  }
90
- }
91
- mouseupWindow(e, point) {
92
- if (!this.active) {
93
- return;
90
+ }, {
91
+ key: "mousedown",
92
+ value: function mousedown(e, point) {
93
+ if (!this.isEnabled()) {
94
+ return;
95
+ }
96
+
97
+ if (!(e.shiftKey && e.button === 0)) {
98
+ return;
99
+ }
100
+
101
+ _dom.default.disableDrag();
102
+
103
+ this.startPos = this.lastPos = point;
104
+ this.active = true;
94
105
  }
95
- if (e.button !== 0) {
96
- return;
106
+ }, {
107
+ key: "mousemoveWindow",
108
+ value: function mousemoveWindow(e, point) {
109
+ if (!this.active) {
110
+ return;
111
+ }
112
+
113
+ var pos = point;
114
+
115
+ if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
116
+ return;
117
+ }
118
+
119
+ var p0 = this.startPos;
120
+ this.lastPos = pos;
121
+
122
+ if (!this.box) {
123
+ this.box = _dom.default.create('div', 'l7-boxzoom', this.container);
124
+ this.container.classList.add('l7-crosshair');
125
+ this.fireEvent('boxzoomstart', e);
126
+ }
127
+
128
+ var minX = Math.min(p0.x, pos.x);
129
+ var maxX = Math.max(p0.x, pos.x);
130
+ var minY = Math.min(p0.y, pos.y);
131
+ var maxY = Math.max(p0.y, pos.y);
132
+
133
+ _dom.default.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
134
+
135
+ if (this.box) {
136
+ this.box.style.width = "".concat(maxX - minX, "px");
137
+ this.box.style.height = "".concat(maxY - minY, "px");
138
+ }
97
139
  }
98
- const p0 = this.startPos;
99
- const p1 = point;
100
- this.reset();
101
- import_dom.default.suppressClick();
102
- if (p0.x === p1.x && p0.y === p1.y) {
103
- this.fireEvent("boxzoomcancel", e);
104
- } else {
105
- this.map.emit("boxzoomend", new import_event.Event("boxzoomend", { originalEvent: e }));
106
- return {
107
- cameraAnimation: (map) => map.fitScreenCoordinates(p0, p1, this.map.getBearing(), {
108
- linear: true
109
- })
110
- };
140
+ }, {
141
+ key: "mouseupWindow",
142
+ value: function mouseupWindow(e, point) {
143
+ var _this = this;
144
+
145
+ if (!this.active) {
146
+ return;
147
+ }
148
+
149
+ if (e.button !== 0) {
150
+ return;
151
+ }
152
+
153
+ var p0 = this.startPos;
154
+ var p1 = point;
155
+ this.reset();
156
+
157
+ _dom.default.suppressClick();
158
+
159
+ if (p0.x === p1.x && p0.y === p1.y) {
160
+ this.fireEvent('boxzoomcancel', e);
161
+ } else {
162
+ this.map.emit('boxzoomend', new _event.Event('boxzoomend', {
163
+ originalEvent: e
164
+ }));
165
+ return {
166
+ cameraAnimation: function cameraAnimation(map) {
167
+ return map.fitScreenCoordinates(p0, p1, _this.map.getBearing(), {
168
+ linear: true
169
+ });
170
+ }
171
+ };
172
+ }
111
173
  }
112
- }
113
- keydown(e) {
114
- if (!this.active) {
115
- return;
174
+ }, {
175
+ key: "keydown",
176
+ value: function keydown(e) {
177
+ if (!this.active) {
178
+ return;
179
+ }
180
+
181
+ if (e.keyCode === 27) {
182
+ this.reset();
183
+ this.fireEvent('boxzoomcancel', e);
184
+ }
116
185
  }
117
- if (e.keyCode === 27) {
118
- this.reset();
119
- this.fireEvent("boxzoomcancel", e);
186
+ }, {
187
+ key: "reset",
188
+ value: function reset() {
189
+ this.active = false;
190
+ this.container.classList.remove('l7-crosshair');
191
+
192
+ if (this.box) {
193
+ _dom.default.remove(this.box);
194
+
195
+ this.box = null;
196
+ }
197
+
198
+ _dom.default.enableDrag(); // @ts-ignore
199
+
200
+
201
+ delete this.startPos; // @ts-ignore
202
+
203
+ delete this.lastPos;
120
204
  }
121
- }
122
- reset() {
123
- this.active = false;
124
- this.container.classList.remove("l7-crosshair");
125
- if (this.box) {
126
- import_dom.default.remove(this.box);
127
- this.box = null;
205
+ }, {
206
+ key: "fireEvent",
207
+ value: function fireEvent(type, e) {
208
+ return this.map.emit(type, new _event.Event(type, {
209
+ originalEvent: e
210
+ }));
128
211
  }
129
- import_dom.default.enableDrag();
130
- delete this.startPos;
131
- delete this.lastPos;
132
- }
133
- fireEvent(type, e) {
134
- return this.map.emit(type, new import_event.Event(type, { originalEvent: e }));
135
- }
136
- };
137
- var box_zoom_default = BoxZoomHandler;
138
- // Annotate the CommonJS export names for ESM import in node:
139
- 0 && (module.exports = {});
212
+ }]);
213
+ return BoxZoomHandler;
214
+ }();
215
+
216
+ var _default = BoxZoomHandler;
217
+ exports.default = _default;
@@ -1,59 +1,67 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
4
 
19
- // src/handler/click_zoom.ts
20
- var click_zoom_exports = {};
21
- __export(click_zoom_exports, {
22
- default: () => ClickZoomHandler
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
23
7
  });
24
- module.exports = __toCommonJS(click_zoom_exports);
25
- var ClickZoomHandler = class {
26
- constructor() {
27
- this.reset();
28
- }
29
- reset() {
30
- this.active = false;
31
- }
32
- dblclick(e, point) {
33
- e.preventDefault();
34
- return {
35
- cameraAnimation: (map) => {
36
- map.easeTo({
37
- duration: 300,
38
- zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
39
- around: map.unproject(point)
40
- }, { originalEvent: e });
41
- }
42
- };
43
- }
44
- enable() {
45
- this.enabled = true;
46
- }
47
- disable() {
48
- this.enabled = false;
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ // @ts-ignore
15
+ var ClickZoomHandler = /*#__PURE__*/function () {
16
+ function ClickZoomHandler() {
17
+ (0, _classCallCheck2.default)(this, ClickZoomHandler);
49
18
  this.reset();
50
19
  }
51
- isEnabled() {
52
- return this.enabled;
53
- }
54
- isActive() {
55
- return this.active;
56
- }
57
- };
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {});
20
+
21
+ (0, _createClass2.default)(ClickZoomHandler, [{
22
+ key: "reset",
23
+ value: function reset() {
24
+ this.active = false;
25
+ }
26
+ }, {
27
+ key: "dblclick",
28
+ value: function dblclick(e, point) {
29
+ e.preventDefault();
30
+ return {
31
+ cameraAnimation: function cameraAnimation(map) {
32
+ map.easeTo({
33
+ duration: 300,
34
+ zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
35
+ around: map.unproject(point)
36
+ }, {
37
+ originalEvent: e
38
+ });
39
+ }
40
+ };
41
+ }
42
+ }, {
43
+ key: "enable",
44
+ value: function enable() {
45
+ this.enabled = true;
46
+ }
47
+ }, {
48
+ key: "disable",
49
+ value: function disable() {
50
+ this.enabled = false;
51
+ this.reset();
52
+ }
53
+ }, {
54
+ key: "isEnabled",
55
+ value: function isEnabled() {
56
+ return this.enabled;
57
+ }
58
+ }, {
59
+ key: "isActive",
60
+ value: function isActive() {
61
+ return this.active;
62
+ }
63
+ }]);
64
+ return ClickZoomHandler;
65
+ }();
66
+
67
+ exports.default = ClickZoomHandler;