@antv/l7-map 2.17.12 → 2.18.0

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 (104) hide show
  1. package/es/camera.js +92 -149
  2. package/es/earthmap.js +15 -68
  3. package/es/geo/edge_insets.js +4 -14
  4. package/es/geo/lng_lat.js +5 -13
  5. package/es/geo/lng_lat_bounds.js +4 -17
  6. package/es/geo/mercator.js +2 -10
  7. package/es/geo/point.js +0 -7
  8. package/es/geo/simple.js +6 -11
  9. package/es/geo/transform.js +128 -138
  10. package/es/handler/blockable_map_event.js +7 -12
  11. package/es/handler/box_zoom.js +10 -30
  12. package/es/handler/click_zoom.js +0 -5
  13. package/es/handler/events/event.js +2 -3
  14. package/es/handler/events/map_mouse_event.js +2 -13
  15. package/es/handler/events/map_touch_event.js +2 -12
  16. package/es/handler/events/map_wheel_event.js +1 -12
  17. package/es/handler/events/render_event.js +0 -13
  18. package/es/handler/handler_inertia.js +8 -35
  19. package/es/handler/handler_manager.js +90 -197
  20. package/es/handler/handler_util.js +1 -2
  21. package/es/handler/keyboard.js +1 -20
  22. package/es/handler/map_event.js +3 -9
  23. package/es/handler/mouse/mouse_handler.js +11 -24
  24. package/es/handler/mouse/mousepan_handler.js +1 -11
  25. package/es/handler/mouse/mousepitch_hander.js +1 -11
  26. package/es/handler/mouse/mouserotate_hander.js +1 -11
  27. package/es/handler/mouse/util.js +2 -3
  28. package/es/handler/scroll_zoom.js +43 -71
  29. package/es/handler/shim/dblclick_zoom.js +4 -9
  30. package/es/handler/shim/drag_pan.js +6 -18
  31. package/es/handler/shim/drag_rotate.js +4 -10
  32. package/es/handler/shim/touch_zoom_rotate.js +8 -23
  33. package/es/handler/tap/single_tap_recognizer.js +8 -31
  34. package/es/handler/tap/tap_drag_zoom.js +7 -15
  35. package/es/handler/tap/tap_recognizer.js +3 -11
  36. package/es/handler/tap/tap_zoom.js +1 -7
  37. package/es/handler/touch/touch_pan.js +4 -22
  38. package/es/handler/touch/touch_pitch.js +10 -27
  39. package/es/handler/touch/touch_rotate.js +8 -19
  40. package/es/handler/touch/touch_zoom.js +5 -18
  41. package/es/handler/touch/two_touch.js +19 -32
  42. package/es/hash.js +13 -35
  43. package/es/map.js +30 -107
  44. package/es/util.d.ts +3 -3
  45. package/es/util.js +20 -33
  46. package/es/utils/Aabb.js +10 -31
  47. package/es/utils/dom.js +33 -111
  48. package/es/utils/performance.js +9 -9
  49. package/es/utils/primitives.js +13 -11
  50. package/es/utils/task_queue.js +6 -23
  51. package/lib/camera.js +102 -179
  52. package/lib/earthmap.js +14 -83
  53. package/lib/geo/edge_insets.js +3 -18
  54. package/lib/geo/lng_lat.js +5 -18
  55. package/lib/geo/lng_lat_bounds.js +4 -20
  56. package/lib/geo/mercator.js +1 -22
  57. package/lib/geo/point.js +0 -8
  58. package/lib/geo/simple.js +5 -24
  59. package/lib/geo/transform.js +128 -170
  60. package/lib/handler/blockable_map_event.js +6 -14
  61. package/lib/handler/box_zoom.js +8 -39
  62. package/lib/handler/click_zoom.js +0 -6
  63. package/lib/handler/events/event.js +4 -7
  64. package/lib/handler/events/index.js +0 -4
  65. package/lib/handler/events/map_mouse_event.js +5 -22
  66. package/lib/handler/events/map_touch_event.js +2 -21
  67. package/lib/handler/events/map_wheel_event.js +1 -16
  68. package/lib/handler/events/render_event.js +0 -19
  69. package/lib/handler/handler_inertia.js +13 -44
  70. package/lib/handler/handler_manager.js +92 -222
  71. package/lib/handler/handler_util.js +1 -3
  72. package/lib/handler/keyboard.js +1 -22
  73. package/lib/handler/map_event.js +2 -11
  74. package/lib/handler/mouse/index.js +0 -4
  75. package/lib/handler/mouse/mouse_handler.js +10 -27
  76. package/lib/handler/mouse/mousepan_handler.js +1 -18
  77. package/lib/handler/mouse/mousepitch_hander.js +1 -17
  78. package/lib/handler/mouse/mouserotate_hander.js +1 -17
  79. package/lib/handler/mouse/util.js +2 -6
  80. package/lib/handler/scroll_zoom.js +43 -77
  81. package/lib/handler/shim/dblclick_zoom.js +4 -10
  82. package/lib/handler/shim/drag_pan.js +6 -20
  83. package/lib/handler/shim/drag_rotate.js +4 -11
  84. package/lib/handler/shim/touch_zoom_rotate.js +8 -25
  85. package/lib/handler/tap/single_tap_recognizer.js +8 -33
  86. package/lib/handler/tap/tap_drag_zoom.js +6 -18
  87. package/lib/handler/tap/tap_recognizer.js +2 -17
  88. package/lib/handler/tap/tap_zoom.js +0 -9
  89. package/lib/handler/touch/index.js +0 -5
  90. package/lib/handler/touch/touch_pan.js +4 -25
  91. package/lib/handler/touch/touch_pitch.js +10 -32
  92. package/lib/handler/touch/touch_rotate.js +8 -25
  93. package/lib/handler/touch/touch_zoom.js +5 -24
  94. package/lib/handler/touch/two_touch.js +18 -35
  95. package/lib/hash.js +12 -38
  96. package/lib/index.js +0 -8
  97. package/lib/map.js +30 -125
  98. package/lib/util.js +19 -46
  99. package/lib/utils/Aabb.js +10 -34
  100. package/lib/utils/dom.js +32 -118
  101. package/lib/utils/performance.js +9 -11
  102. package/lib/utils/primitives.js +13 -16
  103. package/lib/utils/task_queue.js +6 -24
  104. package/package.json +4 -4
package/lib/utils/dom.js CHANGED
@@ -1,60 +1,41 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
- var _l7Utils = require("@antv/l7-utils");
11
-
12
8
  var _point = _interopRequireDefault(require("../geo/point"));
13
-
14
9
  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; } } }; }
15
-
16
10
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
-
18
- 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; }
19
-
11
+ 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; } // @ts-ignore
20
12
  var DOM = {};
21
13
  var _default = DOM;
22
14
  exports.default = _default;
23
-
24
15
  DOM.create = function (tagName, className, container) {
25
- var el = _l7Utils.$window.document.createElement(tagName);
26
-
16
+ var el = window.document.createElement(tagName);
27
17
  if (className !== undefined) {
28
18
  el.className = className;
29
19
  }
30
-
31
20
  if (container) {
32
21
  container.appendChild(el);
33
22
  }
34
-
35
23
  return el;
36
24
  };
37
-
38
25
  DOM.createNS = function (namespaceURI, tagName) {
39
- var el = _l7Utils.$window.document.createElementNS(namespaceURI, tagName);
40
-
26
+ var el = window.document.createElementNS(namespaceURI, tagName);
41
27
  return el;
42
28
  };
43
-
44
- var docStyle = _l7Utils.$window.document && _l7Utils.$window.document.documentElement.style;
45
-
29
+ var docStyle = window.document && window.document.documentElement.style;
46
30
  function testProp(props) {
47
31
  if (!docStyle) {
48
32
  return props[0];
49
33
  }
50
-
51
34
  var _iterator = _createForOfIteratorHelper(props),
52
- _step;
53
-
35
+ _step;
54
36
  try {
55
37
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
56
38
  var i = _step.value;
57
-
58
39
  if (i in docStyle) {
59
40
  return i;
60
41
  }
@@ -64,37 +45,30 @@ function testProp(props) {
64
45
  } finally {
65
46
  _iterator.f();
66
47
  }
67
-
68
48
  return props[0];
69
49
  }
70
-
71
50
  var selectProp = testProp(['userSelect', 'MozUserSelect', 'WebkitUserSelect', 'msUserSelect']);
72
51
  var userSelect;
73
-
74
52
  DOM.disableDrag = function () {
75
53
  if (docStyle && selectProp) {
76
54
  userSelect = docStyle[selectProp];
77
55
  docStyle[selectProp] = 'none';
78
56
  }
79
57
  };
80
-
81
58
  DOM.enableDrag = function () {
82
59
  if (docStyle && selectProp) {
83
60
  docStyle[selectProp] = userSelect;
84
61
  }
85
62
  };
86
-
87
63
  var transformProp = testProp(['transform', 'WebkitTransform']);
88
-
89
64
  DOM.setTransform = function (el, value) {
90
65
  // https://github.com/facebook/flow/issues/7754
91
66
  // $FlowFixMe
92
67
  el.style[transformProp] = value;
93
- }; // Feature detection for {passive: false} support in add/removeEventListener.
94
-
68
+ };
95
69
 
70
+ // Feature detection for {passive: false} support in add/removeEventListener.
96
71
  var passiveSupported = false;
97
-
98
72
  try {
99
73
  // https://github.com/facebook/flow/issues/285
100
74
  // $FlowFixMe
@@ -103,129 +77,69 @@ try {
103
77
  // eslint-disable-line
104
78
  passiveSupported = true;
105
79
  }
106
- }); // @ts-ignore
107
-
108
- _l7Utils.$window.addEventListener('test', options, options); // @ts-ignore
109
-
110
-
111
- _l7Utils.$window.removeEventListener('test', options, options);
80
+ });
81
+ // @ts-ignore
82
+ window.addEventListener('test', options, options);
83
+ // @ts-ignore
84
+ window.removeEventListener('test', options, options);
112
85
  } catch (err) {
113
86
  passiveSupported = false;
114
87
  }
115
-
116
88
  DOM.addEventListener = function (target, type, callback) {
117
89
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
118
-
119
90
  if ('passive' in options && passiveSupported) {
120
91
  target.addEventListener(type, callback, options);
121
92
  } else {
122
93
  target.addEventListener(type, callback, options.capture);
123
94
  }
124
95
  };
125
-
126
96
  DOM.removeEventListener = function (target, type, callback) {
127
97
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
128
-
129
98
  if ('passive' in options && passiveSupported) {
130
99
  target.removeEventListener(type, callback, options);
131
100
  } else {
132
101
  target.removeEventListener(type, callback, options.capture);
133
102
  }
134
- }; // Suppress the next click, but only if it's immediate.
135
-
103
+ };
136
104
 
105
+ // Suppress the next click, but only if it's immediate.
137
106
  var suppressClick = function suppressClick(e) {
138
107
  e.preventDefault();
139
108
  e.stopPropagation();
140
-
141
- _l7Utils.$window.removeEventListener('click', suppressClick, true);
109
+ window.removeEventListener('click', suppressClick, true);
142
110
  };
143
-
144
111
  DOM.suppressClick = function () {
145
- if (_l7Utils.isMini) {
146
- return;
147
- }
148
-
149
- _l7Utils.$window.addEventListener('click', suppressClick, true);
150
-
112
+ window.addEventListener('click', suppressClick, true);
151
113
  setTimeout(function () {
152
- _l7Utils.$window.removeEventListener('click', suppressClick, true);
114
+ window.removeEventListener('click', suppressClick, true);
153
115
  }, 0);
154
116
  };
155
-
156
117
  DOM.mousePos = function (el, e) {
157
118
  // 暂时从 el 上获取 top/left, 后面需要动态获取
158
- if (!_l7Utils.isMini) {
159
- var rect = el.getBoundingClientRect();
160
- return new _point.default(e.clientX - rect.left - el.clientLeft, e.clientY - rect.top - el.clientTop);
161
- } else {
162
- return new _point.default( // @ts-ignore
163
- e.clientX - el.left - 0, // @ts-ignore
164
- e.clientY - el.top - 0);
165
- }
119
+ var rect = el.getBoundingClientRect();
120
+ return new _point.default(e.clientX - rect.left - el.clientLeft, e.clientY - rect.top - el.clientTop);
166
121
  };
167
-
168
122
  DOM.touchPos = function (el, touches) {
169
123
  // 暂时从 el 上获取 top/left, 后面需要动态获取
170
- if (!_l7Utils.isMini) {
171
- var rect = el.getBoundingClientRect();
172
- var points = [];
173
-
174
- var _iterator2 = _createForOfIteratorHelper(touches),
175
- _step2;
176
-
177
- try {
178
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
179
- var touche = _step2.value;
180
- points.push(new _point.default(touche.clientX - rect.left - el.clientLeft, touche.clientY - rect.top - el.clientTop));
181
- }
182
- } catch (err) {
183
- _iterator2.e(err);
184
- } finally {
185
- _iterator2.f();
186
- }
187
-
188
- return points;
189
- } else {
190
- var _points = [];
191
-
192
- var _iterator3 = _createForOfIteratorHelper(touches),
193
- _step3;
194
-
195
- try {
196
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
197
- var _touche = _step3.value;
198
-
199
- _points.push(new _point.default( // @ts-ignore
200
- _touche.clientX - el.left, // @ts-ignore
201
- _touche.clientY - el.top));
202
- }
203
- } catch (err) {
204
- _iterator3.e(err);
205
- } finally {
206
- _iterator3.f();
124
+ var rect = el.getBoundingClientRect();
125
+ var points = [];
126
+ var _iterator2 = _createForOfIteratorHelper(touches),
127
+ _step2;
128
+ try {
129
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
130
+ var touche = _step2.value;
131
+ points.push(new _point.default(touche.clientX - rect.left - el.clientLeft, touche.clientY - rect.top - el.clientTop));
207
132
  }
208
-
209
- return _points;
133
+ } catch (err) {
134
+ _iterator2.e(err);
135
+ } finally {
136
+ _iterator2.f();
210
137
  }
138
+ return points;
211
139
  };
212
-
213
140
  DOM.mouseButton = function (e) {
214
- if (!_l7Utils.isMini) {
215
- return e.button;
216
- }
217
-
218
- if ( // @ts-ignore
219
- typeof _l7Utils.$window.InstallTrigger !== 'undefined' && e.button === 2 && e.ctrlKey && _l7Utils.$window.navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
220
- // Fix for https://github.com/mapbox/mapbox-gl-js/issues/3131:
221
- // Firefox (detected by InstallTrigger) on Mac determines e.button = 2 when
222
- // using Control + left click
223
- return 0;
224
- }
225
-
226
141
  return e.button;
227
142
  };
228
-
229
143
  DOM.remove = function (node) {
230
144
  if (node.parentNode) {
231
145
  node.parentNode.removeChild(node);
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PerformanceUtils = exports.PerformanceMarkers = void 0;
7
-
8
- var _l7Utils = require("@antv/l7-utils");
9
-
10
7
  var lastFrameTime = null;
11
8
  var frameTimes = [];
12
9
  var minFramerateTarget = 30;
13
10
  var frameTimeTarget = 1000 / minFramerateTarget;
14
- var performance = _l7Utils.$window.performance;
11
+ var performance = window.performance;
15
12
  var PerformanceMarkers = {
16
13
  create: 'create',
17
14
  load: 'load',
@@ -24,37 +21,38 @@ var PerformanceUtils = {
24
21
  },
25
22
  frame: function frame(timestamp) {
26
23
  var currTimestamp = timestamp;
27
-
28
24
  if (lastFrameTime != null) {
29
25
  var frameTime = currTimestamp - lastFrameTime;
30
26
  frameTimes.push(frameTime);
31
27
  }
32
-
33
28
  lastFrameTime = currTimestamp;
34
29
  },
35
30
  clearMetrics: function clearMetrics() {
36
31
  lastFrameTime = null;
37
32
  frameTimes = [];
38
33
  performance.clearMeasures('loadTime');
39
- performance.clearMeasures('fullLoadTime'); // @ts-ignore
34
+ performance.clearMeasures('fullLoadTime');
35
+ // @ts-ignore
40
36
  // tslint:disable-next-line:forin
41
-
42
37
  for (var marker in PerformanceMarkers) {
43
38
  // @ts-ignore
44
39
  performance.clearMarks(PerformanceMarkers[marker]);
45
40
  }
46
41
  },
47
42
  getPerformanceMetrics: function getPerformanceMetrics() {
48
- var loadTime = performance.measure('loadTime', PerformanceMarkers.create, PerformanceMarkers.load // @ts-ignore
43
+ var loadTime = performance.measure('loadTime', PerformanceMarkers.create, PerformanceMarkers.load
44
+ // @ts-ignore
49
45
  ).duration;
50
- var fullLoadTime = performance.measure('fullLoadTime', PerformanceMarkers.create, PerformanceMarkers.fullLoad // @ts-ignore
46
+ var fullLoadTime = performance.measure('fullLoadTime', PerformanceMarkers.create, PerformanceMarkers.fullLoad
47
+ // @ts-ignore
51
48
  ).duration;
52
49
  var totalFrames = frameTimes.length;
53
50
  var avgFrameTime = frameTimes.reduce(function (prev, curr) {
54
51
  return prev + curr;
55
52
  }, 0) / totalFrames / 1000;
56
- var fps = 1 / avgFrameTime; // count frames that missed our framerate target
53
+ var fps = 1 / avgFrameTime;
57
54
 
55
+ // count frames that missed our framerate target
58
56
  var droppedFrames = frameTimes.filter(function (frameTime) {
59
57
  return frameTime > frameTimeTarget;
60
58
  }).reduce(function (acc, curr) {
@@ -1,50 +1,48 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
10
  var _glMatrix = require("gl-matrix");
15
-
16
11
  var Frustum = /*#__PURE__*/function () {
17
12
  function Frustum(points, planes) {
18
13
  (0, _classCallCheck2.default)(this, Frustum);
19
14
  this.points = points;
20
15
  this.planes = planes;
21
16
  }
22
-
23
17
  (0, _createClass2.default)(Frustum, null, [{
24
18
  key: "fromInvProjectionMatrix",
25
19
  value: function fromInvProjectionMatrix(invProj, worldSize, zoom) {
26
20
  var clipSpaceCorners = [[-1, 1, -1, 1], [1, 1, -1, 1], [1, -1, -1, 1], [-1, -1, -1, 1], [-1, 1, 1, 1], [1, 1, 1, 1], [1, -1, 1, 1], [-1, -1, 1, 1]];
27
- var scale = Math.pow(2, zoom); // Transform frustum corner points from clip space to tile space
21
+ var scale = Math.pow(2, zoom);
28
22
 
23
+ // Transform frustum corner points from clip space to tile space
29
24
  var frustumCoords = clipSpaceCorners.map(function (v) {
30
25
  return _glMatrix.vec4.transformMat4(new Float32Array([]), v, invProj);
31
26
  }).map(function (v) {
32
27
  return _glMatrix.vec4.scale(new Float32Array([]), v, 1.0 / v[3] / worldSize * scale);
33
28
  });
34
- var frustumPlanePointIndices = [[0, 1, 2], // near
35
- [6, 5, 4], // far
36
- [0, 3, 7], // left
37
- [2, 1, 5], // right
38
- [3, 2, 6], // bottom
29
+ var frustumPlanePointIndices = [[0, 1, 2],
30
+ // near
31
+ [6, 5, 4],
32
+ // far
33
+ [0, 3, 7],
34
+ // left
35
+ [2, 1, 5],
36
+ // right
37
+ [3, 2, 6],
38
+ // bottom
39
39
  [0, 4, 5] // top
40
40
  ];
41
+
41
42
  var frustumPlanes = frustumPlanePointIndices.map(function (p) {
42
43
  var a = _glMatrix.vec3.sub(new Float32Array(3), new Float32Array(frustumCoords[p[0]]), new Float32Array(frustumCoords[p[1]]));
43
-
44
44
  var b = _glMatrix.vec3.sub(new Float32Array(3), new Float32Array(frustumCoords[p[2]]), new Float32Array(frustumCoords[p[1]]));
45
-
46
45
  var n = _glMatrix.vec3.normalize(new Float32Array(3), _glMatrix.vec3.cross(new Float32Array(3), a, b));
47
-
48
46
  var d = -_glMatrix.vec3.dot(n, new Float32Array(frustumCoords[p[1]]));
49
47
  return n.concat(d);
50
48
  });
@@ -53,5 +51,4 @@ var Frustum = /*#__PURE__*/function () {
53
51
  }]);
54
52
  return Frustum;
55
53
  }();
56
-
57
54
  exports.default = Frustum;
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
10
  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; } } }; }
15
-
16
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
-
18
- 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; }
19
-
12
+ 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; }
20
13
  // can't mark opaque due to https://github.com/flowtype/flow-remove-types/pull/61
21
14
  var TaskQueue = /*#__PURE__*/function () {
22
15
  function TaskQueue() {
@@ -26,7 +19,6 @@ var TaskQueue = /*#__PURE__*/function () {
26
19
  this.cleared = false;
27
20
  this.currentlyRunning = false;
28
21
  }
29
-
30
22
  (0, _createClass2.default)(TaskQueue, [{
31
23
  key: "add",
32
24
  value: function add(callback) {
@@ -44,14 +36,11 @@ var TaskQueue = /*#__PURE__*/function () {
44
36
  value: function remove(id) {
45
37
  var running = this.currentlyRunning;
46
38
  var queue = running ? this.queue.concat(running) : this.queue;
47
-
48
39
  var _iterator = _createForOfIteratorHelper(queue),
49
- _step;
50
-
40
+ _step;
51
41
  try {
52
42
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
53
43
  var task = _step.value;
54
-
55
44
  if (task.id === id) {
56
45
  task.cancelled = true;
57
46
  return;
@@ -67,24 +56,20 @@ var TaskQueue = /*#__PURE__*/function () {
67
56
  key: "run",
68
57
  value: function run() {
69
58
  var timeStamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
70
- var queue = this.currentlyRunning = this.queue; // Tasks queued by callbacks in the current queue should be executed
71
- // on the next run, not the current run.
59
+ var queue = this.currentlyRunning = this.queue;
72
60
 
61
+ // Tasks queued by callbacks in the current queue should be executed
62
+ // on the next run, not the current run.
73
63
  this.queue = [];
74
-
75
64
  var _iterator2 = _createForOfIteratorHelper(queue),
76
- _step2;
77
-
65
+ _step2;
78
66
  try {
79
67
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
80
68
  var task = _step2.value;
81
-
82
69
  if (task.cancelled) {
83
70
  continue;
84
71
  }
85
-
86
72
  task.callback(timeStamp);
87
-
88
73
  if (this.cleared) {
89
74
  break;
90
75
  }
@@ -94,7 +79,6 @@ var TaskQueue = /*#__PURE__*/function () {
94
79
  } finally {
95
80
  _iterator2.f();
96
81
  }
97
-
98
82
  this.cleared = false;
99
83
  this.currentlyRunning = false;
100
84
  }
@@ -104,12 +88,10 @@ var TaskQueue = /*#__PURE__*/function () {
104
88
  if (this.currentlyRunning) {
105
89
  this.cleared = true;
106
90
  }
107
-
108
91
  this.queue = [];
109
92
  }
110
93
  }]);
111
94
  return TaskQueue;
112
95
  }();
113
-
114
96
  var _default = TaskQueue;
115
97
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-map",
3
- "version": "2.17.12",
3
+ "version": "2.18.0",
4
4
  "description": "l7 map",
5
5
  "keywords": [],
6
6
  "author": "thinkinggis <lzx199065@gmail.com>",
@@ -40,13 +40,13 @@
40
40
  },
41
41
  "homepage": "https://github.com/antvis/L7#readme",
42
42
  "dependencies": {
43
- "@antv/l7-utils": "2.17.12",
43
+ "@antv/l7-utils": "2.18.0",
44
44
  "@babel/runtime": "^7.7.7",
45
45
  "@mapbox/point-geometry": "^0.1.0",
46
46
  "@mapbox/unitbezier": "^0.0.0",
47
47
  "eventemitter3": "^4.0.4",
48
48
  "gl-matrix": "^3.1.0",
49
- "lodash": "^4.17.15"
49
+ "lodash-es": "^4.17.21"
50
50
  },
51
- "gitHead": "e1d345d25c580a3a44b79a112654d12953293fe6"
51
+ "gitHead": "89fc0b84737ea58f9eda2fe28d70773a900939f6"
52
52
  }