@antv/l7-map 2.17.12 → 2.18.2

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 (168) hide show
  1. package/package.json +4 -4
  2. package/es/camera.d.ts +0 -85
  3. package/es/camera.js +0 -775
  4. package/es/css/l7.css +0 -98
  5. package/es/earthmap.d.ts +0 -66
  6. package/es/earthmap.js +0 -422
  7. package/es/geo/edge_insets.d.ts +0 -54
  8. package/es/geo/edge_insets.js +0 -118
  9. package/es/geo/lng_lat.d.ts +0 -18
  10. package/es/geo/lng_lat.js +0 -81
  11. package/es/geo/lng_lat_bounds.d.ts +0 -24
  12. package/es/geo/lng_lat_bounds.js +0 -167
  13. package/es/geo/mercator.d.ts +0 -29
  14. package/es/geo/mercator.js +0 -92
  15. package/es/geo/point.d.ts +0 -40
  16. package/es/geo/point.js +0 -231
  17. package/es/geo/simple.d.ts +0 -29
  18. package/es/geo/simple.js +0 -92
  19. package/es/geo/transform.d.ts +0 -198
  20. package/es/geo/transform.js +0 -971
  21. package/es/handler/IHandler.d.ts +0 -34
  22. package/es/handler/IHandler.js +0 -1
  23. package/es/handler/blockable_map_event.d.ts +0 -17
  24. package/es/handler/blockable_map_event.js +0 -83
  25. package/es/handler/box_zoom.d.ts +0 -59
  26. package/es/handler/box_zoom.js +0 -200
  27. package/es/handler/click_zoom.d.ts +0 -16
  28. package/es/handler/click_zoom.js +0 -59
  29. package/es/handler/events/event.d.ts +0 -4
  30. package/es/handler/events/event.js +0 -12
  31. package/es/handler/events/index.d.ts +0 -4
  32. package/es/handler/events/index.js +0 -4
  33. package/es/handler/events/map_mouse_event.d.ts +0 -34
  34. package/es/handler/events/map_mouse_event.js +0 -75
  35. package/es/handler/events/map_touch_event.d.ts +0 -57
  36. package/es/handler/events/map_touch_event.js +0 -105
  37. package/es/handler/events/map_wheel_event.d.ts +0 -33
  38. package/es/handler/events/map_wheel_event.js +0 -61
  39. package/es/handler/events/render_event.d.ts +0 -5
  40. package/es/handler/events/render_event.js +0 -39
  41. package/es/handler/handler_inertia.d.ts +0 -23
  42. package/es/handler/handler_inertia.js +0 -184
  43. package/es/handler/handler_manager.d.ts +0 -61
  44. package/es/handler/handler_manager.js +0 -684
  45. package/es/handler/handler_util.d.ts +0 -4
  46. package/es/handler/handler_util.js +0 -10
  47. package/es/handler/keyboard.d.ts +0 -36
  48. package/es/handler/keyboard.js +0 -162
  49. package/es/handler/map_event.d.ts +0 -29
  50. package/es/handler/map_event.js +0 -131
  51. package/es/handler/mouse/index.d.ts +0 -4
  52. package/es/handler/mouse/index.js +0 -4
  53. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  54. package/es/handler/mouse/mouse_handler.js +0 -131
  55. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  56. package/es/handler/mouse/mousepan_handler.js +0 -54
  57. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  58. package/es/handler/mouse/mousepitch_hander.js +0 -56
  59. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  60. package/es/handler/mouse/mouserotate_hander.js +0 -56
  61. package/es/handler/mouse/util.d.ts +0 -6
  62. package/es/handler/mouse/util.js +0 -12
  63. package/es/handler/scroll_zoom.d.ts +0 -93
  64. package/es/handler/scroll_zoom.js +0 -353
  65. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  66. package/es/handler/shim/dblclick_zoom.js +0 -72
  67. package/es/handler/shim/drag_pan.d.ts +0 -61
  68. package/es/handler/shim/drag_pan.js +0 -96
  69. package/es/handler/shim/drag_rotate.d.ts +0 -46
  70. package/es/handler/shim/drag_rotate.js +0 -80
  71. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  72. package/es/handler/shim/touch_zoom_rotate.js +0 -130
  73. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  74. package/es/handler/tap/single_tap_recognizer.js +0 -120
  75. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  76. package/es/handler/tap/tap_drag_zoom.js +0 -114
  77. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  78. package/es/handler/tap/tap_recognizer.js +0 -62
  79. package/es/handler/tap/tap_zoom.d.ts +0 -22
  80. package/es/handler/tap/tap_zoom.js +0 -115
  81. package/es/handler/touch/index.d.ts +0 -5
  82. package/es/handler/touch/index.js +0 -5
  83. package/es/handler/touch/touch_pan.d.ts +0 -30
  84. package/es/handler/touch/touch_pan.js +0 -128
  85. package/es/handler/touch/touch_pitch.d.ts +0 -13
  86. package/es/handler/touch/touch_pitch.js +0 -110
  87. package/es/handler/touch/touch_rotate.d.ts +0 -12
  88. package/es/handler/touch/touch_rotate.js +0 -88
  89. package/es/handler/touch/touch_zoom.d.ts +0 -12
  90. package/es/handler/touch/touch_zoom.js +0 -67
  91. package/es/handler/touch/two_touch.d.ts +0 -23
  92. package/es/handler/touch/two_touch.js +0 -138
  93. package/es/hash.d.ts +0 -14
  94. package/es/hash.js +0 -156
  95. package/es/index.d.ts +0 -4
  96. package/es/index.js +0 -4
  97. package/es/interface.d.ts +0 -34
  98. package/es/interface.js +0 -1
  99. package/es/map.d.ts +0 -70
  100. package/es/map.js +0 -464
  101. package/es/util.d.ts +0 -25
  102. package/es/util.js +0 -101
  103. package/es/utils/Aabb.d.ts +0 -12
  104. package/es/utils/Aabb.js +0 -133
  105. package/es/utils/dom.d.ts +0 -4
  106. package/es/utils/dom.js +0 -218
  107. package/es/utils/performance.d.ts +0 -17
  108. package/es/utils/performance.js +0 -62
  109. package/es/utils/primitives.d.ts +0 -6
  110. package/es/utils/primitives.js +0 -45
  111. package/es/utils/task_queue.d.ts +0 -13
  112. package/es/utils/task_queue.js +0 -106
  113. package/lib/camera.js +0 -801
  114. package/lib/css/l7.css +0 -98
  115. package/lib/earthmap.js +0 -445
  116. package/lib/geo/edge_insets.js +0 -129
  117. package/lib/geo/lng_lat.js +0 -94
  118. package/lib/geo/lng_lat_bounds.js +0 -177
  119. package/lib/geo/mercator.js +0 -121
  120. package/lib/geo/point.js +0 -239
  121. package/lib/geo/simple.js +0 -123
  122. package/lib/geo/transform.js +0 -1013
  123. package/lib/handler/IHandler.js +0 -5
  124. package/lib/handler/blockable_map_event.js +0 -92
  125. package/lib/handler/box_zoom.js +0 -217
  126. package/lib/handler/click_zoom.js +0 -67
  127. package/lib/handler/events/event.js +0 -23
  128. package/lib/handler/events/index.js +0 -31
  129. package/lib/handler/events/map_mouse_event.js +0 -87
  130. package/lib/handler/events/map_touch_event.js +0 -119
  131. package/lib/handler/events/map_wheel_event.js +0 -72
  132. package/lib/handler/events/render_event.js +0 -52
  133. package/lib/handler/handler_inertia.js +0 -193
  134. package/lib/handler/handler_manager.js +0 -714
  135. package/lib/handler/handler_util.js +0 -17
  136. package/lib/handler/keyboard.js +0 -172
  137. package/lib/handler/map_event.js +0 -140
  138. package/lib/handler/mouse/index.js +0 -31
  139. package/lib/handler/mouse/mouse_handler.js +0 -141
  140. package/lib/handler/mouse/mousepan_handler.js +0 -66
  141. package/lib/handler/mouse/mousepitch_hander.js +0 -67
  142. package/lib/handler/mouse/mouserotate_hander.js +0 -67
  143. package/lib/handler/mouse/util.js +0 -26
  144. package/lib/handler/scroll_zoom.js +0 -367
  145. package/lib/handler/shim/dblclick_zoom.js +0 -80
  146. package/lib/handler/shim/drag_pan.js +0 -105
  147. package/lib/handler/shim/drag_rotate.js +0 -88
  148. package/lib/handler/shim/touch_zoom_rotate.js +0 -139
  149. package/lib/handler/tap/single_tap_recognizer.js +0 -131
  150. package/lib/handler/tap/tap_drag_zoom.js +0 -124
  151. package/lib/handler/tap/tap_recognizer.js +0 -78
  152. package/lib/handler/tap/tap_zoom.js +0 -124
  153. package/lib/handler/touch/index.js +0 -39
  154. package/lib/handler/touch/touch_pan.js +0 -138
  155. package/lib/handler/touch/touch_pitch.js +0 -120
  156. package/lib/handler/touch/touch_rotate.js +0 -99
  157. package/lib/handler/touch/touch_zoom.js +0 -78
  158. package/lib/handler/touch/two_touch.js +0 -148
  159. package/lib/hash.js +0 -169
  160. package/lib/index.js +0 -57
  161. package/lib/interface.js +0 -5
  162. package/lib/map.js +0 -489
  163. package/lib/util.js +0 -135
  164. package/lib/utils/Aabb.js +0 -143
  165. package/lib/utils/dom.js +0 -233
  166. package/lib/utils/performance.js +0 -72
  167. package/lib/utils/primitives.js +0 -57
  168. package/lib/utils/task_queue.js +0 -115
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.RIGHT_BUTTON = exports.LEFT_BUTTON = exports.BUTTONS_FLAGS = void 0;
9
- exports.buttonStillPressed = buttonStillPressed;
10
-
11
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
-
13
- var _BUTTONS_FLAGS;
14
-
15
- var LEFT_BUTTON = 0;
16
- exports.LEFT_BUTTON = LEFT_BUTTON;
17
- var RIGHT_BUTTON = 2; // the values for each button in MouseEvent.buttons
18
-
19
- exports.RIGHT_BUTTON = RIGHT_BUTTON;
20
- var BUTTONS_FLAGS = (_BUTTONS_FLAGS = {}, (0, _defineProperty2.default)(_BUTTONS_FLAGS, LEFT_BUTTON, 1), (0, _defineProperty2.default)(_BUTTONS_FLAGS, RIGHT_BUTTON, 2), _BUTTONS_FLAGS);
21
- exports.BUTTONS_FLAGS = BUTTONS_FLAGS;
22
-
23
- function buttonStillPressed(e, button) {
24
- var flag = BUTTONS_FLAGS[button];
25
- return e.buttons === undefined || (e.buttons & flag) !== flag;
26
- }
@@ -1,367 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _lng_lat = _interopRequireDefault(require("../geo/lng_lat"));
17
-
18
- var _util = require("../util");
19
-
20
- var _dom = _interopRequireDefault(require("../utils/dom"));
21
-
22
- // @ts-ignore
23
- // deltaY value for mouse scroll wheel identification
24
- var wheelZoomDelta = 4.000244140625; // These magic numbers control the rate of zoom. Trackpad events fire at a greater
25
- // frequency than mouse scroll wheel, so reduce the zoom rate per wheel tick
26
-
27
- var defaultZoomRate = 1 / 100;
28
- var wheelZoomRate = 1 / 450; // upper bound on how much we scale the map in any single render frame; this
29
- // is used to limit zoom rate in the case of very fast scrolling
30
-
31
- var maxScalePerFrame = 2;
32
- /**
33
- * The `ScrollZoomHandler` allows the user to zoom the map by scrolling.
34
- */
35
-
36
- var ScrollZoomHandler = /*#__PURE__*/function () {
37
- // used for delayed-handling of a single wheel movement
38
- // used to delay final '{move,zoom}end' events
39
-
40
- /**
41
- * @private
42
- */
43
- function ScrollZoomHandler(map, handler) {
44
- var _this = this;
45
-
46
- (0, _classCallCheck2.default)(this, ScrollZoomHandler);
47
- (0, _defineProperty2.default)(this, "onScrollFrame", function () {
48
- if (!_this.frameId) {
49
- return;
50
- }
51
-
52
- _this.frameId = null;
53
-
54
- if (!_this.isActive()) {
55
- return;
56
- }
57
-
58
- var tr = _this.map.transform; // if we've had scroll events since the last render frame, consume the
59
- // accumulated delta, and update the target zoom level accordingly
60
-
61
- if (_this.delta !== 0) {
62
- // For trackpad events and single mouse wheel ticks, use the default zoom rate
63
- var zoomRate = _this.type === 'wheel' && Math.abs(_this.delta) > wheelZoomDelta ? _this.wheelZoomRate : _this.defaultZoomRate; // Scale by sigmoid of scroll wheel delta.
64
-
65
- var scale = maxScalePerFrame / (1 + Math.exp(-Math.abs(_this.delta * zoomRate)));
66
-
67
- if (_this.delta < 0 && scale !== 0) {
68
- scale = 1 / scale;
69
- }
70
-
71
- var fromScale = typeof _this.targetZoom === 'number' ? tr.zoomScale(_this.targetZoom) : tr.scale;
72
- _this.targetZoom = Math.min(tr.maxZoom, Math.max(tr.minZoom, tr.scaleZoom(fromScale * scale))); // if this is a mouse wheel, refresh the starting zoom and easing
73
- // function we're using to smooth out the zooming between wheel
74
- // events
75
-
76
- if (_this.type === 'wheel') {
77
- _this.startZoom = tr.zoom;
78
- _this.easing = _this.smoothOutEasing(200);
79
- }
80
-
81
- _this.delta = 0;
82
- }
83
-
84
- var targetZoom = typeof _this.targetZoom === 'number' ? _this.targetZoom : tr.zoom;
85
- var startZoom = _this.startZoom;
86
- var easing = _this.easing;
87
- var finished = false;
88
- var zoom;
89
-
90
- if (_this.type === 'wheel' && startZoom && easing) {
91
- var t = Math.min(((0, _util.now)() - _this.lastWheelEventTime) / 200, 1);
92
- var k = easing(t);
93
- zoom = (0, _util.interpolate)(startZoom, targetZoom, k);
94
-
95
- if (t < 1) {
96
- if (!_this.frameId) {
97
- _this.frameId = true;
98
- }
99
- } else {
100
- finished = true;
101
- }
102
- } else {
103
- zoom = targetZoom;
104
- finished = true;
105
- }
106
-
107
- _this.active = true;
108
-
109
- if (finished) {
110
- _this.active = false; // @ts-ignore
111
-
112
- _this.finishTimeout = setTimeout(function () {
113
- _this.zooming = false;
114
-
115
- _this.handler.triggerRenderFrame(); // @ts-ignore
116
-
117
-
118
- delete _this.targetZoom; // @ts-ignore
119
-
120
- delete _this.finishTimeout;
121
- }, 200);
122
- }
123
-
124
- return {
125
- noInertia: true,
126
- needsRenderFrame: !finished,
127
- zoomDelta: zoom - tr.zoom,
128
- around: _this.aroundPoint,
129
- originalEvent: _this.lastWheelEvent
130
- };
131
- });
132
- this.map = map;
133
- this.el = map.getCanvasContainer();
134
- this.handler = handler;
135
- this.delta = 0;
136
- this.defaultZoomRate = defaultZoomRate;
137
- this.wheelZoomRate = wheelZoomRate;
138
- }
139
- /**
140
- * Set the zoom rate of a trackpad
141
- * @param {number} [zoomRate=1/100] The rate used to scale trackpad movement to a zoom value.
142
- * @example
143
- * // Speed up trackpad zoom
144
- * map.scrollZoom.setZoomRate(1/25);
145
- */
146
-
147
-
148
- (0, _createClass2.default)(ScrollZoomHandler, [{
149
- key: "setZoomRate",
150
- value: function setZoomRate(zoomRate) {
151
- this.defaultZoomRate = zoomRate;
152
- }
153
- /**
154
- * Set the zoom rate of a mouse wheel
155
- * @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
156
- * @example
157
- * // Slow down zoom of mouse wheel
158
- * map.scrollZoom.setWheelZoomRate(1/600);
159
- */
160
-
161
- }, {
162
- key: "setWheelZoomRate",
163
- value: function setWheelZoomRate(zoomRate) {
164
- this.wheelZoomRate = zoomRate;
165
- }
166
- /**
167
- * Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.
168
- *
169
- * @returns {boolean} `true` if the "scroll to zoom" interaction is enabled.
170
- */
171
-
172
- }, {
173
- key: "isEnabled",
174
- value: function isEnabled() {
175
- return !!this.enabled;
176
- }
177
- /*
178
- * Active state is turned on and off with every scroll wheel event and is set back to false before the map
179
- * render is called, so _active is not a good candidate for determining if a scroll zoom animation is in
180
- * progress.
181
- */
182
-
183
- }, {
184
- key: "isActive",
185
- value: function isActive() {
186
- return !!this.active || this.finishTimeout !== undefined;
187
- }
188
- }, {
189
- key: "isZooming",
190
- value: function isZooming() {
191
- return !!this.zooming;
192
- }
193
- /**
194
- * Enables the "scroll to zoom" interaction.
195
- *
196
- * @param {Object} [options] Options object.
197
- * @param {string} [options.around] If "center" is passed, map will zoom around center of map
198
- *
199
- * @example
200
- * map.scrollZoom.enable();
201
- * @example
202
- * map.scrollZoom.enable({ around: 'center' })
203
- */
204
-
205
- }, {
206
- key: "enable",
207
- value: function enable(options) {
208
- if (this.isEnabled()) {
209
- return;
210
- }
211
-
212
- this.enabled = true;
213
- this.aroundCenter = options && options.around === 'center';
214
- }
215
- /**
216
- * Disables the "scroll to zoom" interaction.
217
- *
218
- * @example
219
- * map.scrollZoom.disable();
220
- */
221
-
222
- }, {
223
- key: "disable",
224
- value: function disable() {
225
- if (!this.isEnabled()) {
226
- return;
227
- }
228
-
229
- this.enabled = false;
230
- }
231
- }, {
232
- key: "wheel",
233
- value: function wheel(e) {
234
- if (!this.isEnabled()) {
235
- return;
236
- } // Remove `any` cast when https://github.com/facebook/flow/issues/4879 is fixed.
237
-
238
-
239
- var value = e.deltaMode === window.WheelEvent.DOM_DELTA_LINE ? e.deltaY * 40 : e.deltaY;
240
- var nowTime = (0, _util.now)();
241
- var timeDelta = nowTime - (this.lastWheelEventTime || 0);
242
- this.lastWheelEventTime = nowTime;
243
-
244
- if (value !== 0 && value % wheelZoomDelta === 0) {
245
- // This one is definitely a mouse wheel event.
246
- this.type = 'wheel';
247
- } else if (value !== 0 && Math.abs(value) < 4) {
248
- // This one is definitely a trackpad event because it is so small.
249
- this.type = 'trackpad';
250
- } else if (timeDelta > 400) {
251
- // This is likely a new scroll action.
252
- this.type = null;
253
- this.lastValue = value; // Start a timeout in case this was a singular event, and dely it by up to 40ms.
254
- // @ts-ignore
255
-
256
- this.timeout = setTimeout(this.onTimeout, 40, e);
257
- } else if (!this.type) {
258
- // This is a repeating event, but we don't know the type of event just yet.
259
- // If the delta per time is small, we assume it's a fast trackpad; otherwise we switch into wheel mode.
260
- this.type = Math.abs(timeDelta * value) < 200 ? 'trackpad' : 'wheel'; // Make sure our delayed event isn't fired again, because we accumulate
261
- // the previous event (which was less than 40ms ago) into this event.
262
-
263
- if (this.timeout) {
264
- clearTimeout(this.timeout);
265
- this.timeout = null;
266
- value += this.lastValue;
267
- }
268
- } // Slow down zoom if shift key is held for more precise zooming
269
-
270
-
271
- if (e.shiftKey && value) {
272
- value = value / 4;
273
- } // Only fire the callback if we actually know what type of scrolling device the user uses.
274
-
275
-
276
- if (this.type) {
277
- this.lastWheelEvent = e;
278
- this.delta -= value;
279
-
280
- if (!this.active) {
281
- this.start(e);
282
- }
283
- }
284
-
285
- e.preventDefault();
286
- }
287
- }, {
288
- key: "renderFrame",
289
- value: function renderFrame() {
290
- return this.onScrollFrame();
291
- }
292
- }, {
293
- key: "reset",
294
- value: function reset() {
295
- this.active = false;
296
- }
297
- }, {
298
- key: "onTimeout",
299
- value: function onTimeout(initialEvent) {
300
- this.type = 'wheel';
301
- this.delta -= this.lastValue;
302
-
303
- if (!this.active && this.start) {
304
- this.start(initialEvent);
305
- }
306
- }
307
- }, {
308
- key: "start",
309
- value: function start(e) {
310
- if (!this.delta) {
311
- return;
312
- }
313
-
314
- if (this.frameId) {
315
- this.frameId = null;
316
- }
317
-
318
- this.active = true;
319
-
320
- if (!this.isZooming()) {
321
- this.zooming = true;
322
- }
323
-
324
- if (this.finishTimeout) {
325
- clearTimeout(this.finishTimeout); // @ts-ignore
326
-
327
- delete this.finishTimeout;
328
- }
329
-
330
- var pos = _dom.default.mousePos(this.el, e);
331
-
332
- this.around = _lng_lat.default.convert(this.aroundCenter ? this.map.getCenter() : this.map.unproject(pos));
333
- this.aroundPoint = this.map.transform.locationPoint(this.around);
334
-
335
- if (!this.frameId) {
336
- this.frameId = true;
337
- this.handler.triggerRenderFrame();
338
- }
339
- }
340
- }, {
341
- key: "smoothOutEasing",
342
- value: function smoothOutEasing(duration) {
343
- var easing = _util.ease;
344
-
345
- if (this.prevEase) {
346
- var preEase = this.prevEase;
347
- var t = ((0, _util.now)() - preEase.start) / preEase.duration;
348
- var speed = preEase.easing(t + 0.01) - preEase.easing(t); // Quick hack to make new bezier that is continuous with last
349
-
350
- var x = 0.27 / Math.sqrt(speed * speed + 0.0001) * 0.01;
351
- var y = Math.sqrt(0.27 * 0.27 - x * x);
352
- easing = (0, _util.bezier)(x, y, 0.25, 1);
353
- }
354
-
355
- this.prevEase = {
356
- start: (0, _util.now)(),
357
- duration: duration,
358
- easing: easing
359
- };
360
- return easing;
361
- }
362
- }]);
363
- return ScrollZoomHandler;
364
- }();
365
-
366
- var _default = ScrollZoomHandler;
367
- exports.default = _default;
@@ -1,80 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
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
- /**
15
- * The `DoubleClickZoomHandler` allows the user to zoom the map at a point by
16
- * double clicking or double tapping.
17
- */
18
- var DoubleClickZoomHandler = /*#__PURE__*/function () {
19
- /**
20
- * @private
21
- */
22
- function DoubleClickZoomHandler(clickZoom, TapZoom) {
23
- (0, _classCallCheck2.default)(this, DoubleClickZoomHandler);
24
- this.clickZoom = clickZoom;
25
- this.tapZoom = TapZoom;
26
- }
27
- /**
28
- * Enables the "double click to zoom" interaction.
29
- *
30
- * @example
31
- * map.doubleClickZoom.enable();
32
- */
33
-
34
-
35
- (0, _createClass2.default)(DoubleClickZoomHandler, [{
36
- key: "enable",
37
- value: function enable() {
38
- this.clickZoom.enable();
39
- this.tapZoom.enable();
40
- }
41
- /**
42
- * Disables the "double click to zoom" interaction.
43
- *
44
- * @example
45
- * map.doubleClickZoom.disable();
46
- */
47
-
48
- }, {
49
- key: "disable",
50
- value: function disable() {
51
- this.clickZoom.disable();
52
- this.tapZoom.disable();
53
- }
54
- /**
55
- * Returns a Boolean indicating whether the "double click to zoom" interaction is enabled.
56
- *
57
- * @returns {boolean} `true` if the "double click to zoom" interaction is enabled.
58
- */
59
-
60
- }, {
61
- key: "isEnabled",
62
- value: function isEnabled() {
63
- return this.clickZoom.isEnabled() && this.tapZoom.isEnabled();
64
- }
65
- /**
66
- * Returns a Boolean indicating whether the "double click to zoom" interaction is active, i.e. currently being used.
67
- *
68
- * @returns {boolean} `true` if the "double click to zoom" interaction is active.
69
- */
70
-
71
- }, {
72
- key: "isActive",
73
- value: function isActive() {
74
- return this.clickZoom.isActive() || this.tapZoom.isActive();
75
- }
76
- }]);
77
- return DoubleClickZoomHandler;
78
- }();
79
-
80
- exports.default = DoubleClickZoomHandler;
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
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 _l7Utils = require("@antv/l7-utils");
15
-
16
- /**
17
- * The `DragPanHandler` allows the user to pan the map by clicking and dragging
18
- * the cursor.
19
- */
20
- var DragPanHandler = /*#__PURE__*/function () {
21
- /**
22
- * @private
23
- */
24
- function DragPanHandler(el, mousePan, touchPan) {
25
- (0, _classCallCheck2.default)(this, DragPanHandler);
26
- this.el = el;
27
- this.mousePan = mousePan;
28
- this.touchPan = touchPan;
29
- }
30
- /**
31
- * Enables the "drag to pan" interaction.
32
- *
33
- * @param {Object} [options] Options object
34
- * @param {number} [options.linearity=0] factor used to scale the drag velocity
35
- * @param {Function} [options.easing=bezier(0, 0, 0.3, 1)] easing function applled to `map.panTo` when applying the drag.
36
- * @param {number} [options.maxSpeed=1400] the maximum value of the drag velocity.
37
- * @param {number} [options.deceleration=2500] the rate at which the speed reduces after the pan ends.
38
- *
39
- * @example
40
- * map.dragPan.enable();
41
- * @example
42
- * map.dragPan.enable({
43
- * linearity: 0.3,
44
- * easing: bezier(0, 0, 0.3, 1),
45
- * maxSpeed: 1400,
46
- * deceleration: 2500,
47
- * });
48
- */
49
-
50
-
51
- (0, _createClass2.default)(DragPanHandler, [{
52
- key: "enable",
53
- value: function enable(options) {
54
- this.inertiaOptions = options || {};
55
- this.mousePan.enable();
56
- this.touchPan.enable();
57
-
58
- if (!_l7Utils.isMini) {
59
- this.el.classList.add('l7-touch-drag-pan');
60
- }
61
- }
62
- /**
63
- * Disables the "drag to pan" interaction.
64
- *
65
- * @example
66
- * map.dragPan.disable();
67
- */
68
-
69
- }, {
70
- key: "disable",
71
- value: function disable() {
72
- this.mousePan.disable();
73
- this.touchPan.disable();
74
-
75
- if (!_l7Utils.isMini) {
76
- this.el.classList.remove('l7-touch-drag-pan');
77
- }
78
- }
79
- /**
80
- * Returns a Boolean indicating whether the "drag to pan" interaction is enabled.
81
- *
82
- * @returns {boolean} `true` if the "drag to pan" interaction is enabled.
83
- */
84
-
85
- }, {
86
- key: "isEnabled",
87
- value: function isEnabled() {
88
- return this.mousePan.isEnabled() && this.touchPan.isEnabled();
89
- }
90
- /**
91
- * Returns a Boolean indicating whether the "drag to pan" interaction is active, i.e. currently being used.
92
- *
93
- * @returns {boolean} `true` if the "drag to pan" interaction is active.
94
- */
95
-
96
- }, {
97
- key: "isActive",
98
- value: function isActive() {
99
- return this.mousePan.isActive() || this.touchPan.isActive();
100
- }
101
- }]);
102
- return DragPanHandler;
103
- }();
104
-
105
- exports.default = DragPanHandler;
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
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
- /**
15
- * The `DragRotateHandler` allows the user to rotate the map by clicking and
16
- * dragging the cursor while holding the right mouse button or `ctrl` key.
17
- */
18
- var DragRotateHandler = /*#__PURE__*/function () {
19
- /**
20
- * @param {Object} [options]
21
- * @param {number} [options.bearingSnap] The threshold, measured in degrees, that determines when the map's
22
- * bearing will snap to north.
23
- * @param {bool} [options.pitchWithRotate=true] Control the map pitch in addition to the bearing
24
- * @private
25
- */
26
- function DragRotateHandler(options, mouseRotate, mousePitch) {
27
- (0, _classCallCheck2.default)(this, DragRotateHandler);
28
- this.pitchWithRotate = options.pitchWithRotate;
29
- this.mouseRotate = mouseRotate;
30
- this.mousePitch = mousePitch;
31
- }
32
- /**
33
- * Enables the "drag to rotate" interaction.
34
- *
35
- * @example
36
- * map.dragRotate.enable();
37
- */
38
-
39
-
40
- (0, _createClass2.default)(DragRotateHandler, [{
41
- key: "enable",
42
- value: function enable() {
43
- this.mouseRotate.enable();
44
-
45
- if (this.pitchWithRotate) {
46
- this.mousePitch.enable();
47
- }
48
- }
49
- /**
50
- * Disables the "drag to rotate" interaction.
51
- *
52
- * @example
53
- * map.dragRotate.disable();
54
- */
55
-
56
- }, {
57
- key: "disable",
58
- value: function disable() {
59
- this.mouseRotate.disable();
60
- this.mousePitch.disable();
61
- }
62
- /**
63
- * Returns a Boolean indicating whether the "drag to rotate" interaction is enabled.
64
- *
65
- * @returns {boolean} `true` if the "drag to rotate" interaction is enabled.
66
- */
67
-
68
- }, {
69
- key: "isEnabled",
70
- value: function isEnabled() {
71
- return this.mouseRotate.isEnabled() && (!this.pitchWithRotate || this.mousePitch.isEnabled());
72
- }
73
- /**
74
- * Returns a Boolean indicating whether the "drag to rotate" interaction is active, i.e. currently being used.
75
- *
76
- * @returns {boolean} `true` if the "drag to rotate" interaction is active.
77
- */
78
-
79
- }, {
80
- key: "isActive",
81
- value: function isActive() {
82
- return this.mouseRotate.isActive() || this.mousePitch.isActive();
83
- }
84
- }]);
85
- return DragRotateHandler;
86
- }();
87
-
88
- exports.default = DragRotateHandler;