@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
package/lib/earthmap.js CHANGED
@@ -1,91 +1,41 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.EarthMap = 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 _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
- var _merge2 = _interopRequireDefault(require("lodash/merge"));
25
-
26
- var _l7Utils = require("@antv/l7-utils");
27
-
28
- var _camera = _interopRequireDefault(require("./camera"));
29
-
30
- var _lng_lat = _interopRequireDefault(require("./geo/lng_lat"));
31
-
32
- var _lng_lat_bounds = _interopRequireDefault(require("./geo/lng_lat_bounds"));
33
-
34
- var _point = _interopRequireDefault(require("./geo/point"));
35
-
36
- var _handler_manager = _interopRequireDefault(require("./handler/handler_manager"));
37
-
38
- var _util = require("./util");
39
-
40
- var _performance = require("./utils/performance");
41
-
42
- var _task_queue = _interopRequireDefault(require("./utils/task_queue"));
43
-
44
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
45
-
46
- 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; } }
47
-
48
- function loadStyles(css, doc) {
49
- var isMiniAli = typeof my !== 'undefined' && !!my && typeof my.showToast === 'function' && my.isFRM !== true;
50
- var isWeChatMiniProgram = typeof wx !== 'undefined' && wx !== null && (typeof wx.request !== 'undefined' || typeof wx.miniProgram !== 'undefined');
51
-
52
- if (isMiniAli || isWeChatMiniProgram) {
53
- return;
54
- }
55
-
56
- if (!doc) doc = document;
57
-
58
- if (!doc) {
59
- return;
60
- }
61
-
62
- var head = doc.head || doc.getElementsByTagName('head')[0];
63
-
64
- if (!head) {
65
- head = doc.createElement('head');
66
- var body = doc.body || doc.getElementsByTagName('body')[0];
67
-
68
- if (body) {
69
- body.parentNode.insertBefore(head, body);
70
- } else {
71
- doc.documentElement.appendChild(head);
72
- }
73
- }
74
-
75
- var style = doc.createElement('style');
76
- style.type = 'text/css';
77
-
78
- if (style.styleSheet) {
79
- style.styleSheet.cssText = css;
80
- } else {
81
- style.appendChild(doc.createTextNode(css));
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
82
16
  }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
83
21
 
84
- head.appendChild(style);
85
- return style;
86
- }
87
-
88
- loadStyles(".l7-map {\n font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.l7-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.l7-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n\n.l7-canary {\n background-color: salmon;\n}\n\n.l7-canvas-container.l7-interactive,\n.l7-ctrl-group button.l7-ctrl-compass {\n cursor: -webkit-grab;\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.l7-canvas-container.l7-interactive.l7-track-pointer {\n cursor: pointer;\n}\n\n.l7-canvas-container.l7-interactive:active,\n.l7-ctrl-group button.l7-ctrl-compass:active {\n cursor: -webkit-grabbing;\n cursor: grabbing;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate,\n.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {\n -ms-touch-action: pan-x pan-y;\n touch-action: pan-x pan-y;\n}\n\n.l7-canvas-container.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: pinch-zoom;\n touch-action: pinch-zoom;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.l7-ctrl-top-left,\n.l7-ctrl-top-right,\n.l7-ctrl-bottom-left,\n.l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n.l7-ctrl-top-left { top: 0; left: 0; }\n.l7-ctrl-top-right { top: 0; right: 0; }\n.l7-ctrl-bottom-left { bottom: 0; left: 0; }\n.l7-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.l7-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; }\n.l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; }\n.l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; }\n.l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; }\n\n\n.l7-crosshair,\n.l7-crosshair .l7-interactive,\n.l7-crosshair .l7-interactive:active {\n cursor: crosshair;\n}\n\n.l7-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n z-index: 10;\n}\n");
22
+ // src/earthmap.ts
23
+ var earthmap_exports = {};
24
+ __export(earthmap_exports, {
25
+ EarthMap: () => EarthMap
26
+ });
27
+ module.exports = __toCommonJS(earthmap_exports);
28
+ var import_l7_utils = require("@antv/l7-utils");
29
+ var import_lodash = require("lodash");
30
+ var import_camera = __toESM(require("./camera"));
31
+ var import_l7 = require("./css/l7.css");
32
+ var import_lng_lat = __toESM(require("./geo/lng_lat"));
33
+ var import_lng_lat_bounds = __toESM(require("./geo/lng_lat_bounds"));
34
+ var import_point = __toESM(require("./geo/point"));
35
+ var import_handler_manager = __toESM(require("./handler/handler_manager"));
36
+ var import_util = require("./util");
37
+ var import_performance = require("./utils/performance");
38
+ var import_task_queue = __toESM(require("./utils/task_queue"));
89
39
  var defaultMinZoom = -2;
90
40
  var defaultMaxZoom = 22;
91
41
  var defaultMinPitch = 0;
@@ -117,332 +67,212 @@ var DefaultOptions = {
117
67
  pitchEnabled: true,
118
68
  rotateEnabled: true
119
69
  };
120
-
121
- var EarthMap = function (_Camera) {
122
- (0, _inherits2.default)(EarthMap, _Camera);
123
-
124
- var _super = _createSuper(EarthMap);
125
-
126
- function EarthMap(options) {
127
- var _this;
128
-
129
- (0, _classCallCheck2.default)(this, EarthMap);
130
- _this = _super.call(this, (0, _merge2.default)({}, DefaultOptions, options));
131
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "doubleClickZoom", void 0);
132
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "dragRotate", void 0);
133
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "dragPan", void 0);
134
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "touchZoomRotate", void 0);
135
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scrollZoom", void 0);
136
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "keyboard", void 0);
137
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "touchPitch", void 0);
138
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "boxZoom", void 0);
139
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlers", void 0);
140
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "container", void 0);
141
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "canvas", void 0);
142
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "canvasContainer", void 0);
143
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderTaskQueue", new _task_queue.default());
144
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "frame", void 0);
145
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "trackResize", true);
146
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onWindowOnline", function () {
147
- _this.update();
148
- });
149
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onWindowResize", function (event) {
150
- if (_this.trackResize) {
151
- _this.resize({
152
- originalEvent: event
153
- }).update();
70
+ var EarthMap = class extends import_camera.default {
71
+ constructor(options) {
72
+ super((0, import_lodash.merge)({}, DefaultOptions, options));
73
+ this.renderTaskQueue = new import_task_queue.default();
74
+ this.trackResize = true;
75
+ this.onWindowOnline = () => {
76
+ this.update();
77
+ };
78
+ this.onWindowResize = (event) => {
79
+ if (this.trackResize) {
80
+ this.resize({ originalEvent: event }).update();
154
81
  }
155
- });
156
-
157
- _this.initContainer();
158
-
159
- _this.resize();
160
-
161
- _this.handlers = new _handler_manager.default((0, _assertThisInitialized2.default)(_this), _this.options);
162
-
163
- if (typeof window !== 'undefined') {
164
- window.addEventListener('online', _this.onWindowOnline, false);
165
- window.addEventListener('resize', _this.onWindowResize, false);
166
- window.addEventListener('orientationchange', _this.onWindowResize, false);
82
+ };
83
+ this.initContainer();
84
+ this.resize();
85
+ this.handlers = new import_handler_manager.default(this, this.options);
86
+ if (typeof window !== "undefined") {
87
+ window.addEventListener("online", this.onWindowOnline, false);
88
+ window.addEventListener("resize", this.onWindowResize, false);
89
+ window.addEventListener("orientationchange", this.onWindowResize, false);
167
90
  }
168
-
169
- return _this;
170
91
  }
171
-
172
- (0, _createClass2.default)(EarthMap, [{
173
- key: "resize",
174
- value: function resize(eventData) {
175
- var dimensions = this.containerDimensions();
176
- var width = dimensions[0];
177
- var height = dimensions[1];
178
- this.transform.resize(width, height);
179
- var fireMoving = !this.moving;
180
-
181
- if (fireMoving) {
182
- this.stop();
183
- this.emit('movestart', new Event('movestart', eventData));
184
- this.emit('move', new Event('move', eventData));
185
- }
186
-
187
- this.emit('resize', new Event('resize', eventData));
188
-
189
- if (fireMoving) {
190
- this.emit('moveend', new Event('moveend', eventData));
191
- }
192
-
193
- return this;
194
- }
195
- }, {
196
- key: "getContainer",
197
- value: function getContainer() {
198
- return this.container;
199
- }
200
- }, {
201
- key: "getCanvas",
202
- value: function getCanvas() {
203
- return this.canvas;
204
- }
205
- }, {
206
- key: "getCanvasContainer",
207
- value: function getCanvasContainer() {
208
- return this.canvasContainer;
209
- }
210
- }, {
211
- key: "project",
212
- value: function project(lngLat) {
213
- return this.transform.locationPoint(_lng_lat.default.convert(lngLat));
214
- }
215
- }, {
216
- key: "unproject",
217
- value: function unproject(point) {
218
- return this.transform.pointLocation(_point.default.convert(point));
219
- }
220
- }, {
221
- key: "getBounds",
222
- value: function getBounds() {
223
- return this.transform.getBounds();
224
- }
225
- }, {
226
- key: "getMaxBounds",
227
- value: function getMaxBounds() {
228
- return this.transform.getMaxBounds();
92
+ resize(eventData) {
93
+ const dimensions = this.containerDimensions();
94
+ const width = dimensions[0];
95
+ const height = dimensions[1];
96
+ this.transform.resize(width, height);
97
+ const fireMoving = !this.moving;
98
+ if (fireMoving) {
99
+ this.stop();
100
+ this.emit("movestart", new Event("movestart", eventData));
101
+ this.emit("move", new Event("move", eventData));
229
102
  }
230
- }, {
231
- key: "setMaxBounds",
232
- value: function setMaxBounds(bounds) {
233
- this.transform.setMaxBounds(_lng_lat_bounds.default.convert(bounds));
103
+ this.emit("resize", new Event("resize", eventData));
104
+ if (fireMoving) {
105
+ this.emit("moveend", new Event("moveend", eventData));
234
106
  }
235
- }, {
236
- key: "setStyle",
237
- value: function setStyle(style) {
238
- return;
239
- }
240
- }, {
241
- key: "setMinZoom",
242
- value: function setMinZoom(minZoom) {
243
- minZoom = minZoom === null || minZoom === undefined ? defaultMinZoom : minZoom;
244
-
245
- if (minZoom >= defaultMinZoom && minZoom <= this.transform.maxZoom) {
246
- this.transform.minZoom = minZoom;
247
-
248
- if (this.getZoom() < minZoom) {
249
- this.setZoom(minZoom);
250
- }
251
-
252
- return this;
253
- } else {
254
- throw new Error("minZoom must be between ".concat(defaultMinZoom, " and the current maxZoom, inclusive"));
107
+ return this;
108
+ }
109
+ getContainer() {
110
+ return this.container;
111
+ }
112
+ getCanvas() {
113
+ return this.canvas;
114
+ }
115
+ getCanvasContainer() {
116
+ return this.canvasContainer;
117
+ }
118
+ project(lngLat) {
119
+ return this.transform.locationPoint(import_lng_lat.default.convert(lngLat));
120
+ }
121
+ unproject(point) {
122
+ return this.transform.pointLocation(import_point.default.convert(point));
123
+ }
124
+ getBounds() {
125
+ return this.transform.getBounds();
126
+ }
127
+ getMaxBounds() {
128
+ return this.transform.getMaxBounds();
129
+ }
130
+ setMaxBounds(bounds) {
131
+ this.transform.setMaxBounds(import_lng_lat_bounds.default.convert(bounds));
132
+ }
133
+ setStyle(style) {
134
+ return;
135
+ }
136
+ setMinZoom(minZoom) {
137
+ minZoom = minZoom === null || minZoom === void 0 ? defaultMinZoom : minZoom;
138
+ if (minZoom >= defaultMinZoom && minZoom <= this.transform.maxZoom) {
139
+ this.transform.minZoom = minZoom;
140
+ if (this.getZoom() < minZoom) {
141
+ this.setZoom(minZoom);
255
142
  }
143
+ return this;
144
+ } else {
145
+ throw new Error(`minZoom must be between ${defaultMinZoom} and the current maxZoom, inclusive`);
256
146
  }
257
- }, {
258
- key: "getMinZoom",
259
- value: function getMinZoom() {
260
- return this.transform.minZoom;
261
- }
262
- }, {
263
- key: "setMaxZoom",
264
- value: function setMaxZoom(maxZoom) {
265
- maxZoom = maxZoom === null || maxZoom === undefined ? defaultMaxZoom : maxZoom;
266
-
267
- if (maxZoom >= this.transform.minZoom) {
268
- this.transform.maxZoom = maxZoom;
269
-
270
- if (this.getZoom() > maxZoom) {
271
- this.setZoom(maxZoom);
272
- }
273
-
274
- return this;
275
- } else {
276
- throw new Error('maxZoom must be greater than the current minZoom');
147
+ }
148
+ getMinZoom() {
149
+ return this.transform.minZoom;
150
+ }
151
+ setMaxZoom(maxZoom) {
152
+ maxZoom = maxZoom === null || maxZoom === void 0 ? defaultMaxZoom : maxZoom;
153
+ if (maxZoom >= this.transform.minZoom) {
154
+ this.transform.maxZoom = maxZoom;
155
+ if (this.getZoom() > maxZoom) {
156
+ this.setZoom(maxZoom);
277
157
  }
158
+ return this;
159
+ } else {
160
+ throw new Error("maxZoom must be greater than the current minZoom");
278
161
  }
279
- }, {
280
- key: "getMaxZoom",
281
- value: function getMaxZoom() {
282
- return this.transform.maxZoom;
162
+ }
163
+ getMaxZoom() {
164
+ return this.transform.maxZoom;
165
+ }
166
+ setMinPitch(minPitch) {
167
+ minPitch = minPitch === null || minPitch === void 0 ? defaultMinPitch : minPitch;
168
+ if (minPitch < defaultMinPitch) {
169
+ throw new Error(`minPitch must be greater than or equal to ${defaultMinPitch}`);
283
170
  }
284
- }, {
285
- key: "setMinPitch",
286
- value: function setMinPitch(minPitch) {
287
- minPitch = minPitch === null || minPitch === undefined ? defaultMinPitch : minPitch;
288
-
289
- if (minPitch < defaultMinPitch) {
290
- throw new Error("minPitch must be greater than or equal to ".concat(defaultMinPitch));
291
- }
292
-
293
- if (minPitch >= defaultMinPitch && minPitch <= this.transform.maxPitch) {
294
- this.transform.minPitch = minPitch;
295
-
296
- if (this.getPitch() < minPitch) {
297
- this.setPitch(minPitch);
298
- }
299
-
300
- return this;
301
- } else {
302
- throw new Error("minPitch must be between ".concat(defaultMinPitch, " and the current maxPitch, inclusive"));
171
+ if (minPitch >= defaultMinPitch && minPitch <= this.transform.maxPitch) {
172
+ this.transform.minPitch = minPitch;
173
+ if (this.getPitch() < minPitch) {
174
+ this.setPitch(minPitch);
303
175
  }
176
+ return this;
177
+ } else {
178
+ throw new Error(`minPitch must be between ${defaultMinPitch} and the current maxPitch, inclusive`);
304
179
  }
305
- }, {
306
- key: "getMinPitch",
307
- value: function getMinPitch() {
308
- return this.transform.minPitch;
180
+ }
181
+ getMinPitch() {
182
+ return this.transform.minPitch;
183
+ }
184
+ setMaxPitch(maxPitch) {
185
+ maxPitch = maxPitch === null || maxPitch === void 0 ? defaultMaxPitch : maxPitch;
186
+ if (maxPitch > defaultMaxPitch) {
187
+ throw new Error(`maxPitch must be less than or equal to ${defaultMaxPitch}`);
309
188
  }
310
- }, {
311
- key: "setMaxPitch",
312
- value: function setMaxPitch(maxPitch) {
313
- maxPitch = maxPitch === null || maxPitch === undefined ? defaultMaxPitch : maxPitch;
314
-
315
- if (maxPitch > defaultMaxPitch) {
316
- throw new Error("maxPitch must be less than or equal to ".concat(defaultMaxPitch));
189
+ if (maxPitch >= this.transform.minPitch) {
190
+ this.transform.maxPitch = maxPitch;
191
+ if (this.getPitch() > maxPitch) {
192
+ this.setPitch(maxPitch);
317
193
  }
318
-
319
- if (maxPitch >= this.transform.minPitch) {
320
- this.transform.maxPitch = maxPitch;
321
-
322
- if (this.getPitch() > maxPitch) {
323
- this.setPitch(maxPitch);
324
- }
325
-
326
- return this;
327
- } else {
328
- throw new Error('maxPitch must be greater than the current minPitch');
329
- }
330
- }
331
- }, {
332
- key: "getMaxPitch",
333
- value: function getMaxPitch() {
334
- return this.transform.maxPitch;
335
- }
336
- }, {
337
- key: "getRenderWorldCopies",
338
- value: function getRenderWorldCopies() {
339
- return this.transform.renderWorldCopies;
194
+ return this;
195
+ } else {
196
+ throw new Error("maxPitch must be greater than the current minPitch");
340
197
  }
341
- }, {
342
- key: "setRenderWorldCopies",
343
- value: function setRenderWorldCopies(renderWorldCopies) {
344
- this.transform.renderWorldCopies = !!renderWorldCopies;
198
+ }
199
+ getMaxPitch() {
200
+ return this.transform.maxPitch;
201
+ }
202
+ getRenderWorldCopies() {
203
+ return this.transform.renderWorldCopies;
204
+ }
205
+ setRenderWorldCopies(renderWorldCopies) {
206
+ this.transform.renderWorldCopies = !!renderWorldCopies;
207
+ }
208
+ remove() {
209
+ if (this.frame) {
210
+ this.frame.cancel();
211
+ this.frame = null;
345
212
  }
346
- }, {
347
- key: "remove",
348
- value: function remove() {
349
- if (this.frame) {
350
- this.frame.cancel();
213
+ this.renderTaskQueue.clear();
214
+ }
215
+ requestRenderFrame(cb) {
216
+ this.update();
217
+ return this.renderTaskQueue.add(cb);
218
+ }
219
+ cancelRenderFrame(id) {
220
+ return this.renderTaskQueue.remove(id);
221
+ }
222
+ triggerRepaint() {
223
+ if (!this.frame) {
224
+ this.frame = (0, import_util.renderframe)((paintStartTimeStamp) => {
225
+ import_performance.PerformanceUtils.frame(paintStartTimeStamp);
351
226
  this.frame = null;
352
- }
353
-
354
- this.renderTaskQueue.clear();
355
- }
356
- }, {
357
- key: "requestRenderFrame",
358
- value: function requestRenderFrame(cb) {
359
- this.update();
360
- return this.renderTaskQueue.add(cb);
361
- }
362
- }, {
363
- key: "cancelRenderFrame",
364
- value: function cancelRenderFrame(id) {
365
- return this.renderTaskQueue.remove(id);
227
+ this.update(paintStartTimeStamp);
228
+ });
366
229
  }
367
- }, {
368
- key: "triggerRepaint",
369
- value: function triggerRepaint() {
370
- var _this2 = this;
371
-
372
- if (!this.frame) {
373
- this.frame = (0, _util.renderframe)(function (paintStartTimeStamp) {
374
- _performance.PerformanceUtils.frame(paintStartTimeStamp);
375
-
376
- _this2.frame = null;
377
-
378
- _this2.update(paintStartTimeStamp);
379
- });
380
- }
381
- }
382
- }, {
383
- key: "update",
384
- value: function update(time) {
385
- var _this3 = this;
386
-
387
- if (!this.frame) {
388
- this.frame = (0, _util.renderframe)(function (paintStartTimeStamp) {
389
- _performance.PerformanceUtils.frame(paintStartTimeStamp);
390
-
391
- _this3.frame = null;
392
-
393
- _this3.renderTaskQueue.run(time);
394
- });
395
- }
230
+ }
231
+ update(time) {
232
+ if (!this.frame) {
233
+ this.frame = (0, import_util.renderframe)((paintStartTimeStamp) => {
234
+ import_performance.PerformanceUtils.frame(paintStartTimeStamp);
235
+ this.frame = null;
236
+ this.renderTaskQueue.run(time);
237
+ });
396
238
  }
397
- }, {
398
- key: "initContainer",
399
- value: function initContainer() {
400
- if (typeof this.options.container === 'string') {
401
- this.container = window.document.getElementById(this.options.container);
402
-
403
- if (!this.container) {
404
- throw new Error("Container '".concat(this.options.container, "' not found."));
405
- }
406
- } else if (this.options.container instanceof HTMLElement) {
407
- this.container = this.options.container;
408
- } else {
409
- throw new Error("Invalid type: 'container' must be a String or HTMLElement.");
410
- }
411
-
412
- var container = this.container;
413
- container.classList.add('l7-map');
414
-
415
- var canvasContainer = this.canvasContainer = _l7Utils.DOM.create('div', 'l7-canvas-container', container);
416
-
417
- if (this.options.interactive) {
418
- canvasContainer.classList.add('l7-interactive');
239
+ }
240
+ initContainer() {
241
+ if (typeof this.options.container === "string") {
242
+ this.container = window.document.getElementById(this.options.container);
243
+ if (!this.container) {
244
+ throw new Error(`Container '${this.options.container}' not found.`);
419
245
  }
246
+ } else if (this.options.container instanceof HTMLElement) {
247
+ this.container = this.options.container;
248
+ } else {
249
+ throw new Error("Invalid type: 'container' must be a String or HTMLElement.");
420
250
  }
421
- }, {
422
- key: "containerDimensions",
423
- value: function containerDimensions() {
424
- var width = 0;
425
- var height = 0;
426
-
427
- if (this.container) {
428
- width = this.container.clientWidth || 400;
429
- height = this.container.clientHeight || 300;
430
- }
431
-
432
- return [width, height];
251
+ const container = this.container;
252
+ container.classList.add("l7-map");
253
+ const canvasContainer = this.canvasContainer = import_l7_utils.DOM.create("div", "l7-canvas-container", container);
254
+ if (this.options.interactive) {
255
+ canvasContainer.classList.add("l7-interactive");
433
256
  }
434
- }, {
435
- key: "resizeCanvas",
436
- value: function resizeCanvas(width, height) {
437
- var pixelRatio = _l7Utils.DOM.DPR || 1;
438
- this.canvas.width = pixelRatio * width;
439
- this.canvas.height = pixelRatio * height;
440
- this.canvas.style.width = "".concat(width, "px");
441
- this.canvas.style.height = "".concat(height, "px");
257
+ }
258
+ containerDimensions() {
259
+ let width = 0;
260
+ let height = 0;
261
+ if (this.container) {
262
+ width = this.container.clientWidth || 400;
263
+ height = this.container.clientHeight || 300;
442
264
  }
443
- }]);
444
- return EarthMap;
445
- }(_camera.default);
446
-
447
- exports.EarthMap = EarthMap;
448
- //# sourceMappingURL=earthmap.js.map
265
+ return [width, height];
266
+ }
267
+ resizeCanvas(width, height) {
268
+ const pixelRatio = import_l7_utils.DOM.DPR || 1;
269
+ this.canvas.width = pixelRatio * width;
270
+ this.canvas.height = pixelRatio * height;
271
+ this.canvas.style.width = `${width}px`;
272
+ this.canvas.style.height = `${height}px`;
273
+ }
274
+ };
275
+ // Annotate the CommonJS export names for ESM import in node:
276
+ 0 && (module.exports = {
277
+ EarthMap
278
+ });