@antv/l7-map 2.9.21 → 2.9.23

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 (223) hide show
  1. package/es/camera.js +115 -85
  2. package/es/css/l7.css +98 -0
  3. package/es/earthmap.js +27 -43
  4. package/es/geo/edge_insets.js +44 -14
  5. package/es/geo/lng_lat.js +15 -11
  6. package/es/geo/lng_lat_bounds.js +6 -10
  7. package/es/geo/mercator.js +24 -12
  8. package/es/geo/point.js +2 -8
  9. package/es/geo/simple.js +24 -12
  10. package/es/geo/transform.js +421 -120
  11. package/es/handler/IHandler.js +1 -2
  12. package/es/handler/blockable_map_event.js +13 -14
  13. package/es/handler/box_zoom.js +43 -27
  14. package/es/handler/click_zoom.js +3 -8
  15. package/es/handler/events/event.js +3 -6
  16. package/es/handler/events/index.js +4 -5
  17. package/es/handler/events/map_mouse_event.js +30 -20
  18. package/es/handler/events/map_touch_event.js +55 -25
  19. package/es/handler/events/map_wheel_event.js +24 -15
  20. package/es/handler/events/render_event.js +3 -6
  21. package/es/handler/handler_inertia.js +10 -12
  22. package/es/handler/handler_manager.js +75 -72
  23. package/es/handler/handler_util.js +2 -2
  24. package/es/handler/keyboard.js +20 -15
  25. package/es/handler/map_event.js +23 -12
  26. package/es/handler/mouse/index.js +4 -5
  27. package/es/handler/mouse/mouse_handler.js +17 -21
  28. package/es/handler/mouse/mousepan_handler.js +5 -5
  29. package/es/handler/mouse/mousepitch_hander.js +7 -5
  30. package/es/handler/mouse/mouserotate_hander.js +7 -5
  31. package/es/handler/mouse/util.js +3 -3
  32. package/es/handler/scroll_zoom.js +103 -67
  33. package/es/handler/shim/dblclick_zoom.js +35 -8
  34. package/es/handler/shim/drag_pan.js +48 -12
  35. package/es/handler/shim/drag_rotate.js +39 -10
  36. package/es/handler/shim/touch_zoom_rotate.js +59 -16
  37. package/es/handler/tap/single_tap_recognizer.js +7 -17
  38. package/es/handler/tap/tap_drag_zoom.js +5 -18
  39. package/es/handler/tap/tap_recognizer.js +4 -15
  40. package/es/handler/tap/tap_zoom.js +4 -13
  41. package/es/handler/touch/index.js +5 -6
  42. package/es/handler/touch/touch_pan.js +9 -20
  43. package/es/handler/touch/touch_pitch.js +11 -23
  44. package/es/handler/touch/touch_rotate.js +15 -18
  45. package/es/handler/touch/touch_zoom.js +5 -19
  46. package/es/handler/touch/two_touch.js +14 -21
  47. package/es/hash.js +28 -16
  48. package/es/index.js +2 -3
  49. package/es/interface.js +1 -2
  50. package/es/map.js +26 -47
  51. package/es/util.js +15 -6
  52. package/es/utils/Aabb.js +11 -12
  53. package/es/utils/dom.js +30 -11
  54. package/es/utils/performance.js +10 -6
  55. package/es/utils/primitives.js +11 -10
  56. package/es/utils/task_queue.js +6 -13
  57. package/lib/camera.js +508 -721
  58. package/lib/css/l7.css +98 -0
  59. package/lib/earthmap.js +222 -392
  60. package/lib/geo/edge_insets.js +64 -83
  61. package/lib/geo/lng_lat.js +65 -81
  62. package/lib/geo/lng_lat_bounds.js +124 -165
  63. package/lib/geo/mercator.js +62 -78
  64. package/lib/geo/point.js +171 -239
  65. package/lib/geo/simple.js +61 -80
  66. package/lib/geo/transform.js +470 -653
  67. package/lib/handler/IHandler.js +17 -2
  68. package/lib/handler/blockable_map_event.js +63 -83
  69. package/lib/handler/box_zoom.js +123 -176
  70. package/lib/handler/click_zoom.js +56 -68
  71. package/lib/handler/events/event.js +35 -23
  72. package/lib/handler/events/index.js +35 -29
  73. package/lib/handler/events/map_mouse_event.js +42 -72
  74. package/lib/handler/events/map_touch_event.js +45 -80
  75. package/lib/handler/events/map_wheel_event.js +34 -58
  76. package/lib/handler/events/render_event.js +31 -52
  77. package/lib/handler/handler_inertia.js +113 -160
  78. package/lib/handler/handler_manager.js +379 -620
  79. package/lib/handler/handler_util.js +28 -10
  80. package/lib/handler/keyboard.js +114 -146
  81. package/lib/handler/map_event.js +84 -120
  82. package/lib/handler/mouse/index.js +35 -29
  83. package/lib/handler/mouse/mouse_handler.js +90 -123
  84. package/lib/handler/mouse/mousepan_handler.js +46 -65
  85. package/lib/handler/mouse/mousepitch_hander.js +44 -63
  86. package/lib/handler/mouse/mouserotate_hander.js +44 -63
  87. package/lib/handler/mouse/util.js +38 -20
  88. package/lib/handler/scroll_zoom.js +175 -258
  89. package/lib/handler/shim/dblclick_zoom.js +42 -48
  90. package/lib/handler/shim/drag_pan.js +48 -59
  91. package/lib/handler/shim/drag_rotate.js +43 -51
  92. package/lib/handler/shim/touch_zoom_rotate.js +58 -78
  93. package/lib/handler/tap/single_tap_recognizer.js +84 -117
  94. package/lib/handler/tap/tap_drag_zoom.js +92 -115
  95. package/lib/handler/tap/tap_recognizer.js +60 -78
  96. package/lib/handler/tap/tap_zoom.js +88 -119
  97. package/lib/handler/touch/index.js +38 -37
  98. package/lib/handler/touch/touch_pan.js +98 -132
  99. package/lib/handler/touch/touch_pitch.js +73 -117
  100. package/lib/handler/touch/touch_rotate.js +58 -94
  101. package/lib/handler/touch/touch_zoom.js +49 -84
  102. package/lib/handler/touch/two_touch.js +88 -128
  103. package/lib/hash.js +100 -133
  104. package/lib/index.js +19 -31
  105. package/lib/interface.js +17 -2
  106. package/lib/map.js +238 -420
  107. package/lib/util.js +67 -78
  108. package/lib/utils/Aabb.js +80 -132
  109. package/lib/utils/dom.js +84 -141
  110. package/lib/utils/performance.js +54 -42
  111. package/lib/utils/primitives.js +59 -51
  112. package/lib/utils/task_queue.js +61 -108
  113. package/package.json +11 -8
  114. package/es/camera.js.map +0 -1
  115. package/es/earthmap.js.map +0 -1
  116. package/es/geo/edge_insets.js.map +0 -1
  117. package/es/geo/lng_lat.js.map +0 -1
  118. package/es/geo/lng_lat_bounds.js.map +0 -1
  119. package/es/geo/mercator.js.map +0 -1
  120. package/es/geo/point.js.map +0 -1
  121. package/es/geo/simple.js.map +0 -1
  122. package/es/geo/transform.js.map +0 -1
  123. package/es/handler/IHandler.js.map +0 -1
  124. package/es/handler/blockable_map_event.js.map +0 -1
  125. package/es/handler/box_zoom.js.map +0 -1
  126. package/es/handler/click_zoom.js.map +0 -1
  127. package/es/handler/events/event.js.map +0 -1
  128. package/es/handler/events/index.js.map +0 -1
  129. package/es/handler/events/map_mouse_event.js.map +0 -1
  130. package/es/handler/events/map_touch_event.js.map +0 -1
  131. package/es/handler/events/map_wheel_event.js.map +0 -1
  132. package/es/handler/events/render_event.js.map +0 -1
  133. package/es/handler/handler_inertia.js.map +0 -1
  134. package/es/handler/handler_manager.js.map +0 -1
  135. package/es/handler/handler_util.js.map +0 -1
  136. package/es/handler/keyboard.js.map +0 -1
  137. package/es/handler/map_event.js.map +0 -1
  138. package/es/handler/mouse/index.js.map +0 -1
  139. package/es/handler/mouse/mouse_handler.js.map +0 -1
  140. package/es/handler/mouse/mousepan_handler.js.map +0 -1
  141. package/es/handler/mouse/mousepitch_hander.js.map +0 -1
  142. package/es/handler/mouse/mouserotate_hander.js.map +0 -1
  143. package/es/handler/mouse/util.js.map +0 -1
  144. package/es/handler/scroll_zoom.js.map +0 -1
  145. package/es/handler/shim/dblclick_zoom.js.map +0 -1
  146. package/es/handler/shim/drag_pan.js.map +0 -1
  147. package/es/handler/shim/drag_rotate.js.map +0 -1
  148. package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
  149. package/es/handler/tap/single_tap_recognizer.js.map +0 -1
  150. package/es/handler/tap/tap_drag_zoom.js.map +0 -1
  151. package/es/handler/tap/tap_recognizer.js.map +0 -1
  152. package/es/handler/tap/tap_zoom.js.map +0 -1
  153. package/es/handler/touch/index.js.map +0 -1
  154. package/es/handler/touch/touch_pan.js.map +0 -1
  155. package/es/handler/touch/touch_pitch.js.map +0 -1
  156. package/es/handler/touch/touch_rotate.js.map +0 -1
  157. package/es/handler/touch/touch_zoom.js.map +0 -1
  158. package/es/handler/touch/two_touch.js.map +0 -1
  159. package/es/hash.js.map +0 -1
  160. package/es/index.js.map +0 -1
  161. package/es/interface.js.map +0 -1
  162. package/es/map.js.map +0 -1
  163. package/es/util.js.map +0 -1
  164. package/es/utils/Aabb.js.map +0 -1
  165. package/es/utils/dom.js.map +0 -1
  166. package/es/utils/performance.js.map +0 -1
  167. package/es/utils/primitives.js.map +0 -1
  168. package/es/utils/task_queue.js.map +0 -1
  169. package/lib/camera.js.map +0 -1
  170. package/lib/earthmap.js.map +0 -1
  171. package/lib/geo/edge_insets.js.map +0 -1
  172. package/lib/geo/lng_lat.js.map +0 -1
  173. package/lib/geo/lng_lat_bounds.js.map +0 -1
  174. package/lib/geo/mercator.js.map +0 -1
  175. package/lib/geo/point.js.map +0 -1
  176. package/lib/geo/simple.js.map +0 -1
  177. package/lib/geo/transform.js.map +0 -1
  178. package/lib/handler/IHandler.js.map +0 -1
  179. package/lib/handler/blockable_map_event.js.map +0 -1
  180. package/lib/handler/box_zoom.js.map +0 -1
  181. package/lib/handler/click_zoom.js.map +0 -1
  182. package/lib/handler/events/event.js.map +0 -1
  183. package/lib/handler/events/index.js.map +0 -1
  184. package/lib/handler/events/map_mouse_event.js.map +0 -1
  185. package/lib/handler/events/map_touch_event.js.map +0 -1
  186. package/lib/handler/events/map_wheel_event.js.map +0 -1
  187. package/lib/handler/events/render_event.js.map +0 -1
  188. package/lib/handler/handler_inertia.js.map +0 -1
  189. package/lib/handler/handler_manager.js.map +0 -1
  190. package/lib/handler/handler_util.js.map +0 -1
  191. package/lib/handler/keyboard.js.map +0 -1
  192. package/lib/handler/map_event.js.map +0 -1
  193. package/lib/handler/mouse/index.js.map +0 -1
  194. package/lib/handler/mouse/mouse_handler.js.map +0 -1
  195. package/lib/handler/mouse/mousepan_handler.js.map +0 -1
  196. package/lib/handler/mouse/mousepitch_hander.js.map +0 -1
  197. package/lib/handler/mouse/mouserotate_hander.js.map +0 -1
  198. package/lib/handler/mouse/util.js.map +0 -1
  199. package/lib/handler/scroll_zoom.js.map +0 -1
  200. package/lib/handler/shim/dblclick_zoom.js.map +0 -1
  201. package/lib/handler/shim/drag_pan.js.map +0 -1
  202. package/lib/handler/shim/drag_rotate.js.map +0 -1
  203. package/lib/handler/shim/touch_zoom_rotate.js.map +0 -1
  204. package/lib/handler/tap/single_tap_recognizer.js.map +0 -1
  205. package/lib/handler/tap/tap_drag_zoom.js.map +0 -1
  206. package/lib/handler/tap/tap_recognizer.js.map +0 -1
  207. package/lib/handler/tap/tap_zoom.js.map +0 -1
  208. package/lib/handler/touch/index.js.map +0 -1
  209. package/lib/handler/touch/touch_pan.js.map +0 -1
  210. package/lib/handler/touch/touch_pitch.js.map +0 -1
  211. package/lib/handler/touch/touch_rotate.js.map +0 -1
  212. package/lib/handler/touch/touch_zoom.js.map +0 -1
  213. package/lib/handler/touch/two_touch.js.map +0 -1
  214. package/lib/hash.js.map +0 -1
  215. package/lib/index.js.map +0 -1
  216. package/lib/interface.js.map +0 -1
  217. package/lib/map.js.map +0 -1
  218. package/lib/util.js.map +0 -1
  219. package/lib/utils/Aabb.js.map +0 -1
  220. package/lib/utils/dom.js.map +0 -1
  221. package/lib/utils/performance.js.map +0 -1
  222. package/lib/utils/primitives.js.map +0 -1
  223. package/lib/utils/task_queue.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
 
5
4
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
5
 
@@ -8,8 +7,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
7
 
9
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
9
 
11
- import Point from '../../geo/point';
12
- import { indexTouches } from '../handler_util';
10
+ // @ts-ignore
11
+ import Point from "../../geo/point";
12
+ import { indexTouches } from "../handler_util";
13
13
 
14
14
  function getCentroid(points) {
15
15
  var sum = new Point(0, 0);
@@ -22,7 +22,8 @@ function getCentroid(points) {
22
22
  var point = _step.value;
23
23
 
24
24
  sum._add(point);
25
- }
25
+ } // @ts-ignore
26
+
26
27
  } catch (err) {
27
28
  _iterator.e(err);
28
29
  } finally {
@@ -36,20 +37,10 @@ export var MAX_TAP_INTERVAL = 500;
36
37
  export var MAX_TOUCH_TIME = 500;
37
38
  export var MAX_DIST = 30;
38
39
 
39
- var SingleTapRecognizer = function () {
40
+ var SingleTapRecognizer = /*#__PURE__*/function () {
40
41
  function SingleTapRecognizer(options) {
41
42
  _classCallCheck(this, SingleTapRecognizer);
42
43
 
43
- _defineProperty(this, "numTouches", void 0);
44
-
45
- _defineProperty(this, "centroid", void 0);
46
-
47
- _defineProperty(this, "startTime", void 0);
48
-
49
- _defineProperty(this, "aborted", void 0);
50
-
51
- _defineProperty(this, "touches", void 0);
52
-
53
44
  this.reset();
54
45
  this.numTouches = options.numTouches;
55
46
  }
@@ -123,5 +114,4 @@ var SingleTapRecognizer = function () {
123
114
  return SingleTapRecognizer;
124
115
  }();
125
116
 
126
- export { SingleTapRecognizer as default };
127
- //# sourceMappingURL=single_tap_recognizer.js.map
117
+ export { SingleTapRecognizer as default };
@@ -1,25 +1,13 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import { MAX_TAP_INTERVAL } from './single_tap_recognizer';
5
- import TapRecognizer from './tap_recognizer';
3
+ // @ts-ignore
4
+ import { MAX_TAP_INTERVAL } from "./single_tap_recognizer";
5
+ import TapRecognizer from "./tap_recognizer";
6
6
 
7
- var TapDragZoomHandler = function () {
7
+ var TapDragZoomHandler = /*#__PURE__*/function () {
8
8
  function TapDragZoomHandler() {
9
9
  _classCallCheck(this, TapDragZoomHandler);
10
10
 
11
- _defineProperty(this, "enabled", void 0);
12
-
13
- _defineProperty(this, "active", void 0);
14
-
15
- _defineProperty(this, "swipePoint", void 0);
16
-
17
- _defineProperty(this, "swipeTouch", void 0);
18
-
19
- _defineProperty(this, "tapTime", void 0);
20
-
21
- _defineProperty(this, "tap", void 0);
22
-
23
11
  this.tap = new TapRecognizer({
24
12
  numTouches: 1,
25
13
  numTaps: 1
@@ -120,5 +108,4 @@ var TapDragZoomHandler = function () {
120
108
  return TapDragZoomHandler;
121
109
  }();
122
110
 
123
- export { TapDragZoomHandler as default };
124
- //# sourceMappingURL=tap_drag_zoom.js.map
111
+ export { TapDragZoomHandler as default };
@@ -1,22 +1,12 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import SingleTapRecognizer, { MAX_DIST, MAX_TAP_INTERVAL } from './single_tap_recognizer';
3
+ // @ts-ignore
4
+ import SingleTapRecognizer, { MAX_DIST, MAX_TAP_INTERVAL } from "./single_tap_recognizer";
5
5
 
6
- var TapRecognizer = function () {
6
+ var TapRecognizer = /*#__PURE__*/function () {
7
7
  function TapRecognizer(options) {
8
8
  _classCallCheck(this, TapRecognizer);
9
9
 
10
- _defineProperty(this, "singleTap", void 0);
11
-
12
- _defineProperty(this, "numTaps", void 0);
13
-
14
- _defineProperty(this, "lastTime", void 0);
15
-
16
- _defineProperty(this, "lastTap", void 0);
17
-
18
- _defineProperty(this, "count", void 0);
19
-
20
10
  this.singleTap = new SingleTapRecognizer(options);
21
11
  this.numTaps = options.numTaps;
22
12
  this.reset();
@@ -68,5 +58,4 @@ var TapRecognizer = function () {
68
58
  return TapRecognizer;
69
59
  }();
70
60
 
71
- export { TapRecognizer as default };
72
- //# sourceMappingURL=tap_recognizer.js.map
61
+ export { TapRecognizer as default };
@@ -1,20 +1,12 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import TapRecognizer from './tap_recognizer';
3
+ // @ts-ignore
4
+ import TapRecognizer from "./tap_recognizer";
5
5
 
6
- var TapZoomHandler = function () {
6
+ var TapZoomHandler = /*#__PURE__*/function () {
7
7
  function TapZoomHandler() {
8
8
  _classCallCheck(this, TapZoomHandler);
9
9
 
10
- _defineProperty(this, "enabled", void 0);
11
-
12
- _defineProperty(this, "active", void 0);
13
-
14
- _defineProperty(this, "zoomIn", void 0);
15
-
16
- _defineProperty(this, "zoomOut", void 0);
17
-
18
10
  this.zoomIn = new TapRecognizer({
19
11
  numTouches: 1,
20
12
  numTaps: 2
@@ -120,5 +112,4 @@ var TapZoomHandler = function () {
120
112
  return TapZoomHandler;
121
113
  }();
122
114
 
123
- export { TapZoomHandler as default };
124
- //# sourceMappingURL=tap_zoom.js.map
115
+ export { TapZoomHandler as default };
@@ -1,6 +1,5 @@
1
- import TouchPanHandler from './touch_pan';
2
- import TouchPitchHandler from './touch_pitch';
3
- import TouchRotateHandler from './touch_rotate';
4
- import TouchZoomHandler from './touch_zoom';
5
- export { TouchPanHandler, TouchPitchHandler, TouchRotateHandler, TouchZoomHandler };
6
- //# sourceMappingURL=index.js.map
1
+ import TouchPanHandler from "./touch_pan";
2
+ import TouchPitchHandler from "./touch_pitch";
3
+ import TouchRotateHandler from "./touch_rotate";
4
+ import TouchZoomHandler from "./touch_zoom";
5
+ export { TouchPanHandler, TouchPitchHandler, TouchRotateHandler, TouchZoomHandler };
@@ -1,25 +1,13 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import Point from '../../geo/point';
5
- import { indexTouches } from '../handler_util';
3
+ // @ts-ignore
4
+ import Point from "../../geo/point";
5
+ import { indexTouches } from "../handler_util";
6
6
 
7
- var TouchPanHandler = function () {
7
+ var TouchPanHandler = /*#__PURE__*/function () {
8
8
  function TouchPanHandler(options) {
9
9
  _classCallCheck(this, TouchPanHandler);
10
10
 
11
- _defineProperty(this, "enabled", void 0);
12
-
13
- _defineProperty(this, "active", void 0);
14
-
15
- _defineProperty(this, "touches", void 0);
16
-
17
- _defineProperty(this, "minTouches", void 0);
18
-
19
- _defineProperty(this, "clickTolerance", void 0);
20
-
21
- _defineProperty(this, "sum", void 0);
22
-
23
11
  this.minTouches = 1;
24
12
  this.clickTolerance = options.clickTolerance || 1;
25
13
  this.reset();
@@ -114,7 +102,8 @@ var TouchPanHandler = function () {
114
102
 
115
103
  if (touchDeltaCount < this.minTouches || !touchDeltaSum.mag()) {
116
104
  return;
117
- }
105
+ } // @ts-ignore
106
+
118
107
 
119
108
  var panDelta = touchDeltaSum.div(touchDeltaCount);
120
109
 
@@ -122,7 +111,8 @@ var TouchPanHandler = function () {
122
111
 
123
112
  if (this.sum.mag() < this.clickTolerance) {
124
113
  return;
125
- }
114
+ } // @ts-ignore
115
+
126
116
 
127
117
  var around = touchPointSum.div(touchDeltaCount);
128
118
  return {
@@ -135,5 +125,4 @@ var TouchPanHandler = function () {
135
125
  return TouchPanHandler;
136
126
  }();
137
127
 
138
- export { TouchPanHandler as default };
139
- //# sourceMappingURL=touch_pan.js.map
128
+ export { TouchPanHandler as default };
@@ -1,17 +1,16 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
3
  import _get from "@babel/runtime/helpers/get";
5
4
  import _inherits from "@babel/runtime/helpers/inherits";
6
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
7
 
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
 
12
10
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
11
 
14
- import TwoTouchHandler from './two_touch';
12
+ // @ts-ignore
13
+ import TwoTouchHandler from "./two_touch";
15
14
 
16
15
  function isVertical(vector) {
17
16
  return Math.abs(vector.y) > Math.abs(vector.x);
@@ -19,29 +18,15 @@ function isVertical(vector) {
19
18
 
20
19
  var ALLOWED_SINGLE_TOUCH_TIME = 100;
21
20
 
22
- var TouchPitchHandler = function (_TwoTouchHandler) {
21
+ var TouchPitchHandler = /*#__PURE__*/function (_TwoTouchHandler) {
23
22
  _inherits(TouchPitchHandler, _TwoTouchHandler);
24
23
 
25
24
  var _super = _createSuper(TouchPitchHandler);
26
25
 
27
26
  function TouchPitchHandler() {
28
- var _this;
29
-
30
27
  _classCallCheck(this, TouchPitchHandler);
31
28
 
32
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
- args[_key] = arguments[_key];
34
- }
35
-
36
- _this = _super.call.apply(_super, [this].concat(args));
37
-
38
- _defineProperty(_assertThisInitialized(_this), "valid", void 0);
39
-
40
- _defineProperty(_assertThisInitialized(_this), "firstMove", void 0);
41
-
42
- _defineProperty(_assertThisInitialized(_this), "lastPoints", void 0);
43
-
44
- return _this;
29
+ return _super.apply(this, arguments);
45
30
  }
46
31
 
47
32
  _createClass(TouchPitchHandler, [{
@@ -59,6 +44,7 @@ var TouchPitchHandler = function (_TwoTouchHandler) {
59
44
  this.lastPoints = points;
60
45
 
61
46
  if (isVertical(points[0].sub(points[1]))) {
47
+ // fingers are more horizontal than vertical
62
48
  this.valid = false;
63
49
  }
64
50
  }
@@ -90,11 +76,13 @@ var TouchPitchHandler = function (_TwoTouchHandler) {
90
76
 
91
77
  var threshold = 2;
92
78
  var movedA = vectorA.mag() >= threshold;
93
- var movedB = vectorB.mag() >= threshold;
79
+ var movedB = vectorB.mag() >= threshold; // neither finger has moved a meaningful amount, wait
94
80
 
95
81
  if (!movedA && !movedB) {
96
82
  return;
97
- }
83
+ } // One finger has moved and the other has not.
84
+ // If enough time has passed, decide it is not a pitch.
85
+
98
86
 
99
87
  if (!movedA || !movedB) {
100
88
  if (this.firstMove === undefined) {
@@ -102,6 +90,7 @@ var TouchPitchHandler = function (_TwoTouchHandler) {
102
90
  }
103
91
 
104
92
  if (timeStamp - this.firstMove < ALLOWED_SINGLE_TOUCH_TIME) {
93
+ // still waiting for a movement from the second finger
105
94
  return undefined;
106
95
  } else {
107
96
  return false;
@@ -116,5 +105,4 @@ var TouchPitchHandler = function (_TwoTouchHandler) {
116
105
  return TouchPitchHandler;
117
106
  }(TwoTouchHandler);
118
107
 
119
- export { TouchPitchHandler as default };
120
- //# sourceMappingURL=touch_pitch.js.map
108
+ export { TouchPitchHandler as default };
@@ -1,42 +1,31 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
3
  import _get from "@babel/runtime/helpers/get";
5
4
  import _inherits from "@babel/runtime/helpers/inherits";
6
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
7
 
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
 
12
10
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
11
 
14
- import TwoTouchHandler from './two_touch';
15
- var ROTATION_THRESHOLD = 25;
12
+ // @ts-ignore
13
+ import TwoTouchHandler from "./two_touch";
14
+ var ROTATION_THRESHOLD = 25; // pixels along circumference of touch circle
16
15
 
17
16
  function getBearingDelta(a, b) {
18
17
  return a.angleWith(b) * 180 / Math.PI;
19
18
  }
20
19
 
21
- var TouchRotateHandler = function (_TwoTouchHandler) {
20
+ var TouchRotateHandler = /*#__PURE__*/function (_TwoTouchHandler) {
22
21
  _inherits(TouchRotateHandler, _TwoTouchHandler);
23
22
 
24
23
  var _super = _createSuper(TouchRotateHandler);
25
24
 
26
25
  function TouchRotateHandler() {
27
- var _this;
28
-
29
26
  _classCallCheck(this, TouchRotateHandler);
30
27
 
31
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
- args[_key] = arguments[_key];
33
- }
34
-
35
- _this = _super.call.apply(_super, [this].concat(args));
36
-
37
- _defineProperty(_assertThisInitialized(_this), "minDiameter", void 0);
38
-
39
- return _this;
28
+ return _super.apply(this, arguments);
40
29
  }
41
30
 
42
31
  _createClass(TouchRotateHandler, [{
@@ -73,6 +62,15 @@ var TouchRotateHandler = function (_TwoTouchHandler) {
73
62
  }, {
74
63
  key: "isBelowThreshold",
75
64
  value: function isBelowThreshold(vector) {
65
+ /*
66
+ * The threshold before a rotation actually happens is configured in
67
+ * pixels alongth circumference of the circle formed by the two fingers.
68
+ * This makes the threshold in degrees larger when the fingers are close
69
+ * together and smaller when the fingers are far apart.
70
+ *
71
+ * Use the smallest diameter from the whole gesture to reduce sensitivity
72
+ * when pinching in and out.
73
+ */
76
74
  this.minDiameter = Math.min(this.minDiameter, vector.mag());
77
75
  var circumference = Math.PI * this.minDiameter;
78
76
  var threshold = ROTATION_THRESHOLD / circumference * 360;
@@ -84,5 +82,4 @@ var TouchRotateHandler = function (_TwoTouchHandler) {
84
82
  return TouchRotateHandler;
85
83
  }(TwoTouchHandler);
86
84
 
87
- export { TouchRotateHandler as default };
88
- //# sourceMappingURL=touch_rotate.js.map
85
+ export { TouchRotateHandler as default };
@@ -1,44 +1,31 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
3
  import _get from "@babel/runtime/helpers/get";
5
4
  import _inherits from "@babel/runtime/helpers/inherits";
6
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
7
 
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
 
12
10
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
11
 
14
- import TwoTouchHandler from './two_touch';
12
+ // @ts-ignore
13
+ import TwoTouchHandler from "./two_touch";
15
14
  var ZOOM_THRESHOLD = 0.1;
16
15
 
17
16
  function getZoomDelta(distance, lastDistance) {
18
17
  return Math.log(distance / lastDistance) / Math.LN2;
19
18
  }
20
19
 
21
- var TouchZoomHandler = function (_TwoTouchHandler) {
20
+ var TouchZoomHandler = /*#__PURE__*/function (_TwoTouchHandler) {
22
21
  _inherits(TouchZoomHandler, _TwoTouchHandler);
23
22
 
24
23
  var _super = _createSuper(TouchZoomHandler);
25
24
 
26
25
  function TouchZoomHandler() {
27
- var _this;
28
-
29
26
  _classCallCheck(this, TouchZoomHandler);
30
27
 
31
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
- args[_key] = arguments[_key];
33
- }
34
-
35
- _this = _super.call.apply(_super, [this].concat(args));
36
-
37
- _defineProperty(_assertThisInitialized(_this), "distance", void 0);
38
-
39
- _defineProperty(_assertThisInitialized(_this), "startDistance", void 0);
40
-
41
- return _this;
28
+ return _super.apply(this, arguments);
42
29
  }
43
30
 
44
31
  _createClass(TouchZoomHandler, [{
@@ -75,5 +62,4 @@ var TouchZoomHandler = function (_TwoTouchHandler) {
75
62
  return TouchZoomHandler;
76
63
  }(TwoTouchHandler);
77
64
 
78
- export { TouchZoomHandler as default };
79
- //# sourceMappingURL=touch_zoom.js.map
65
+ export { TouchZoomHandler as default };
@@ -1,25 +1,13 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- import DOM from '../../utils/dom';
4
+ // @ts-ignore
5
+ import DOM from "../../utils/dom";
6
6
 
7
- var TwoTouchHandler = function () {
7
+ var TwoTouchHandler = /*#__PURE__*/function () {
8
8
  function TwoTouchHandler() {
9
9
  _classCallCheck(this, TwoTouchHandler);
10
10
 
11
- _defineProperty(this, "enabled", void 0);
12
-
13
- _defineProperty(this, "active", void 0);
14
-
15
- _defineProperty(this, "firstTwoTouches", void 0);
16
-
17
- _defineProperty(this, "vector", void 0);
18
-
19
- _defineProperty(this, "startVector", void 0);
20
-
21
- _defineProperty(this, "aroundCenter", void 0);
22
-
23
11
  this.reset();
24
12
  }
25
13
 
@@ -33,20 +21,25 @@ var TwoTouchHandler = function () {
33
21
  key: "start",
34
22
  value: function start(points) {
35
23
  return;
36
- }
24
+ } // eslint-disable-line
25
+
37
26
  }, {
38
27
  key: "move",
39
28
  value: function move(points, pinchAround, e) {
40
29
  return;
41
- }
30
+ } // eslint-disable-line
31
+
42
32
  }, {
43
33
  key: "touchstart",
44
34
  value: function touchstart(e, points, mapTouches) {
35
+ // console.log(e.target, e.targetTouches.length ? e.targetTouches[0].target : null);
36
+ // log('touchstart', points, e.target.innerHTML, e.targetTouches.length ? e.targetTouches[0].target.innerHTML: undefined);
45
37
  if (this.firstTwoTouches || mapTouches.length < 2) {
46
38
  return;
47
39
  }
48
40
 
49
- this.firstTwoTouches = [mapTouches[0].identifier, mapTouches[1].identifier];
41
+ this.firstTwoTouches = [mapTouches[0].identifier, mapTouches[1].identifier]; // implemented by child classes
42
+
50
43
  this.start([points[0], points[1]]);
51
44
  }
52
45
  }, {
@@ -69,7 +62,8 @@ var TwoTouchHandler = function () {
69
62
  return;
70
63
  }
71
64
 
72
- var pinchAround = this.aroundCenter ? null : a.add(b).div(2);
65
+ var pinchAround = this.aroundCenter ? null : a.add(b).div(2); // implemented by child classes
66
+
73
67
  return this.move([a, b], pinchAround, e);
74
68
  }
75
69
  }, {
@@ -136,5 +130,4 @@ function getTouchById(mapTouches, points, identifier) {
136
130
  return points[i];
137
131
  }
138
132
  }
139
- }
140
- //# sourceMappingURL=two_touch.js.map
133
+ }
package/es/hash.js CHANGED
@@ -1,21 +1,23 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import _throttle from "lodash/throttle";
4
+ // @ts-ignore
5
+ // tslint:disable-next-line:no-submodule-imports
5
6
  import { $window } from '@antv/l7-utils';
6
-
7
- var Hash = function () {
7
+ import { throttle } from 'lodash';
8
+
9
+ /*
10
+ * Adds the map's position to its page's location hash.
11
+ * Passed as an option to the map object.
12
+ *
13
+ * @returns {Hash} `this`
14
+ */
15
+ var Hash = /*#__PURE__*/function () {
8
16
  function Hash(hashName) {
9
17
  var _this = this;
10
18
 
11
19
  _classCallCheck(this, Hash);
12
20
 
13
- _defineProperty(this, "map", void 0);
14
-
15
- _defineProperty(this, "updateHash", void 0);
16
-
17
- _defineProperty(this, "hashName", void 0);
18
-
19
21
  _defineProperty(this, "onHashChange", function () {
20
22
  var loc = _this.getCurrentHash();
21
23
 
@@ -38,9 +40,11 @@ var Hash = function () {
38
40
  });
39
41
 
40
42
  _defineProperty(this, "getCurrentHash", function () {
43
+ // Get the current hash from location, stripped from its number sign
41
44
  var hash = window.location.hash.replace('#', '');
42
45
 
43
46
  if (_this.hashName) {
47
+ // Split the parameter-styled hash into parts and find the value we need
44
48
  var keyval;
45
49
  hash.split('&').map(function (part) {
46
50
  return part.split('=');
@@ -60,11 +64,15 @@ var Hash = function () {
60
64
 
61
65
  try {
62
66
  window.history.replaceState(window.history.state, '', hash);
63
- } catch (SecurityError) {}
67
+ } catch (SecurityError) {// IE11 does not allow this if the page is within an iframe created
68
+ // with iframe.contentWindow.document.write(...).
69
+ // https://github.com/mapbox/mapbox-gl-js/issues/7410
70
+ }
64
71
  });
65
72
 
66
- this.hashName = hashName && encodeURIComponent(hashName);
67
- this.updateHash = _throttle(this.updateHashUnthrottled, 30 * 1000 / 100);
73
+ this.hashName = hashName && encodeURIComponent(hashName); // Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.
74
+
75
+ this.updateHash = throttle(this.updateHashUnthrottled, 30 * 1000 / 100);
68
76
  }
69
77
 
70
78
  _createClass(Hash, [{
@@ -79,7 +87,9 @@ var Hash = function () {
79
87
  key: "remove",
80
88
  value: function remove() {
81
89
  $window.removeEventListener('hashchange', this.onHashChange, false);
82
- this.map.off('moveend', this.updateHash);
90
+ this.map.off('moveend', this.updateHash); // clearTimeout(this.updateHash());
91
+ // @ts-ignore
92
+
83
93
  delete this.map;
84
94
  return this;
85
95
  }
@@ -87,7 +97,8 @@ var Hash = function () {
87
97
  key: "getHashString",
88
98
  value: function getHashString(mapFeedback) {
89
99
  var center = this.map.getCenter();
90
- var zoom = Math.round(this.map.getZoom() * 100) / 100;
100
+ var zoom = Math.round(this.map.getZoom() * 100) / 100; // derived from equation: 512px * 2^z / 360 / 10^d < 0.5px
101
+
91
102
  var precision = Math.ceil((zoom * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10);
92
103
  var m = Math.pow(10, precision);
93
104
  var lng = Math.round(center.lng * m) / m;
@@ -97,6 +108,8 @@ var Hash = function () {
97
108
  var hash = '';
98
109
 
99
110
  if (mapFeedback) {
111
+ // new map feedback site has some constraints that don't allow
112
+ // us to use the same hash format as we do for the Map hash option.
100
113
  hash += "/".concat(lng, "/").concat(lat, "/").concat(zoom);
101
114
  } else {
102
115
  hash += "".concat(zoom, "/").concat(lat, "/").concat(lng);
@@ -140,5 +153,4 @@ var Hash = function () {
140
153
  return Hash;
141
154
  }();
142
155
 
143
- export default Hash;
144
- //# sourceMappingURL=hash.js.map
156
+ export default Hash;
package/es/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export * from './map';
2
- export * from './earthmap';
3
- //# sourceMappingURL=index.js.map
1
+ export * from "./map";
2
+ export * from "./earthmap";
package/es/interface.js CHANGED
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=interface.js.map
1
+ export {};