@antv/l7-map 2.17.12 → 2.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/package.json +4 -4
  2. package/es/camera.d.ts +0 -85
  3. package/es/camera.js +0 -775
  4. package/es/css/l7.css +0 -98
  5. package/es/earthmap.d.ts +0 -66
  6. package/es/earthmap.js +0 -422
  7. package/es/geo/edge_insets.d.ts +0 -54
  8. package/es/geo/edge_insets.js +0 -118
  9. package/es/geo/lng_lat.d.ts +0 -18
  10. package/es/geo/lng_lat.js +0 -81
  11. package/es/geo/lng_lat_bounds.d.ts +0 -24
  12. package/es/geo/lng_lat_bounds.js +0 -167
  13. package/es/geo/mercator.d.ts +0 -29
  14. package/es/geo/mercator.js +0 -92
  15. package/es/geo/point.d.ts +0 -40
  16. package/es/geo/point.js +0 -231
  17. package/es/geo/simple.d.ts +0 -29
  18. package/es/geo/simple.js +0 -92
  19. package/es/geo/transform.d.ts +0 -198
  20. package/es/geo/transform.js +0 -971
  21. package/es/handler/IHandler.d.ts +0 -34
  22. package/es/handler/IHandler.js +0 -1
  23. package/es/handler/blockable_map_event.d.ts +0 -17
  24. package/es/handler/blockable_map_event.js +0 -83
  25. package/es/handler/box_zoom.d.ts +0 -59
  26. package/es/handler/box_zoom.js +0 -200
  27. package/es/handler/click_zoom.d.ts +0 -16
  28. package/es/handler/click_zoom.js +0 -59
  29. package/es/handler/events/event.d.ts +0 -4
  30. package/es/handler/events/event.js +0 -12
  31. package/es/handler/events/index.d.ts +0 -4
  32. package/es/handler/events/index.js +0 -4
  33. package/es/handler/events/map_mouse_event.d.ts +0 -34
  34. package/es/handler/events/map_mouse_event.js +0 -75
  35. package/es/handler/events/map_touch_event.d.ts +0 -57
  36. package/es/handler/events/map_touch_event.js +0 -105
  37. package/es/handler/events/map_wheel_event.d.ts +0 -33
  38. package/es/handler/events/map_wheel_event.js +0 -61
  39. package/es/handler/events/render_event.d.ts +0 -5
  40. package/es/handler/events/render_event.js +0 -39
  41. package/es/handler/handler_inertia.d.ts +0 -23
  42. package/es/handler/handler_inertia.js +0 -184
  43. package/es/handler/handler_manager.d.ts +0 -61
  44. package/es/handler/handler_manager.js +0 -684
  45. package/es/handler/handler_util.d.ts +0 -4
  46. package/es/handler/handler_util.js +0 -10
  47. package/es/handler/keyboard.d.ts +0 -36
  48. package/es/handler/keyboard.js +0 -162
  49. package/es/handler/map_event.d.ts +0 -29
  50. package/es/handler/map_event.js +0 -131
  51. package/es/handler/mouse/index.d.ts +0 -4
  52. package/es/handler/mouse/index.js +0 -4
  53. package/es/handler/mouse/mouse_handler.d.ts +0 -22
  54. package/es/handler/mouse/mouse_handler.js +0 -131
  55. package/es/handler/mouse/mousepan_handler.d.ts +0 -10
  56. package/es/handler/mouse/mousepan_handler.js +0 -54
  57. package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
  58. package/es/handler/mouse/mousepitch_hander.js +0 -56
  59. package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
  60. package/es/handler/mouse/mouserotate_hander.js +0 -56
  61. package/es/handler/mouse/util.d.ts +0 -6
  62. package/es/handler/mouse/util.js +0 -12
  63. package/es/handler/scroll_zoom.d.ts +0 -93
  64. package/es/handler/scroll_zoom.js +0 -353
  65. package/es/handler/shim/dblclick_zoom.d.ts +0 -40
  66. package/es/handler/shim/dblclick_zoom.js +0 -72
  67. package/es/handler/shim/drag_pan.d.ts +0 -61
  68. package/es/handler/shim/drag_pan.js +0 -96
  69. package/es/handler/shim/drag_rotate.d.ts +0 -46
  70. package/es/handler/shim/drag_rotate.js +0 -80
  71. package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
  72. package/es/handler/shim/touch_zoom_rotate.js +0 -130
  73. package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
  74. package/es/handler/tap/single_tap_recognizer.js +0 -120
  75. package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
  76. package/es/handler/tap/tap_drag_zoom.js +0 -114
  77. package/es/handler/tap/tap_recognizer.d.ts +0 -17
  78. package/es/handler/tap/tap_recognizer.js +0 -62
  79. package/es/handler/tap/tap_zoom.d.ts +0 -22
  80. package/es/handler/tap/tap_zoom.js +0 -115
  81. package/es/handler/touch/index.d.ts +0 -5
  82. package/es/handler/touch/index.js +0 -5
  83. package/es/handler/touch/touch_pan.d.ts +0 -30
  84. package/es/handler/touch/touch_pan.js +0 -128
  85. package/es/handler/touch/touch_pitch.d.ts +0 -13
  86. package/es/handler/touch/touch_pitch.js +0 -110
  87. package/es/handler/touch/touch_rotate.d.ts +0 -12
  88. package/es/handler/touch/touch_rotate.js +0 -88
  89. package/es/handler/touch/touch_zoom.d.ts +0 -12
  90. package/es/handler/touch/touch_zoom.js +0 -67
  91. package/es/handler/touch/two_touch.d.ts +0 -23
  92. package/es/handler/touch/two_touch.js +0 -138
  93. package/es/hash.d.ts +0 -14
  94. package/es/hash.js +0 -156
  95. package/es/index.d.ts +0 -4
  96. package/es/index.js +0 -4
  97. package/es/interface.d.ts +0 -34
  98. package/es/interface.js +0 -1
  99. package/es/map.d.ts +0 -70
  100. package/es/map.js +0 -464
  101. package/es/util.d.ts +0 -25
  102. package/es/util.js +0 -101
  103. package/es/utils/Aabb.d.ts +0 -12
  104. package/es/utils/Aabb.js +0 -133
  105. package/es/utils/dom.d.ts +0 -4
  106. package/es/utils/dom.js +0 -218
  107. package/es/utils/performance.d.ts +0 -17
  108. package/es/utils/performance.js +0 -62
  109. package/es/utils/primitives.d.ts +0 -6
  110. package/es/utils/primitives.js +0 -45
  111. package/es/utils/task_queue.d.ts +0 -13
  112. package/es/utils/task_queue.js +0 -106
  113. package/lib/camera.js +0 -801
  114. package/lib/css/l7.css +0 -98
  115. package/lib/earthmap.js +0 -445
  116. package/lib/geo/edge_insets.js +0 -129
  117. package/lib/geo/lng_lat.js +0 -94
  118. package/lib/geo/lng_lat_bounds.js +0 -177
  119. package/lib/geo/mercator.js +0 -121
  120. package/lib/geo/point.js +0 -239
  121. package/lib/geo/simple.js +0 -123
  122. package/lib/geo/transform.js +0 -1013
  123. package/lib/handler/IHandler.js +0 -5
  124. package/lib/handler/blockable_map_event.js +0 -92
  125. package/lib/handler/box_zoom.js +0 -217
  126. package/lib/handler/click_zoom.js +0 -67
  127. package/lib/handler/events/event.js +0 -23
  128. package/lib/handler/events/index.js +0 -31
  129. package/lib/handler/events/map_mouse_event.js +0 -87
  130. package/lib/handler/events/map_touch_event.js +0 -119
  131. package/lib/handler/events/map_wheel_event.js +0 -72
  132. package/lib/handler/events/render_event.js +0 -52
  133. package/lib/handler/handler_inertia.js +0 -193
  134. package/lib/handler/handler_manager.js +0 -714
  135. package/lib/handler/handler_util.js +0 -17
  136. package/lib/handler/keyboard.js +0 -172
  137. package/lib/handler/map_event.js +0 -140
  138. package/lib/handler/mouse/index.js +0 -31
  139. package/lib/handler/mouse/mouse_handler.js +0 -141
  140. package/lib/handler/mouse/mousepan_handler.js +0 -66
  141. package/lib/handler/mouse/mousepitch_hander.js +0 -67
  142. package/lib/handler/mouse/mouserotate_hander.js +0 -67
  143. package/lib/handler/mouse/util.js +0 -26
  144. package/lib/handler/scroll_zoom.js +0 -367
  145. package/lib/handler/shim/dblclick_zoom.js +0 -80
  146. package/lib/handler/shim/drag_pan.js +0 -105
  147. package/lib/handler/shim/drag_rotate.js +0 -88
  148. package/lib/handler/shim/touch_zoom_rotate.js +0 -139
  149. package/lib/handler/tap/single_tap_recognizer.js +0 -131
  150. package/lib/handler/tap/tap_drag_zoom.js +0 -124
  151. package/lib/handler/tap/tap_recognizer.js +0 -78
  152. package/lib/handler/tap/tap_zoom.js +0 -124
  153. package/lib/handler/touch/index.js +0 -39
  154. package/lib/handler/touch/touch_pan.js +0 -138
  155. package/lib/handler/touch/touch_pitch.js +0 -120
  156. package/lib/handler/touch/touch_rotate.js +0 -99
  157. package/lib/handler/touch/touch_zoom.js +0 -78
  158. package/lib/handler/touch/two_touch.js +0 -148
  159. package/lib/hash.js +0 -169
  160. package/lib/index.js +0 -57
  161. package/lib/interface.js +0 -5
  162. package/lib/map.js +0 -489
  163. package/lib/util.js +0 -135
  164. package/lib/utils/Aabb.js +0 -143
  165. package/lib/utils/dom.js +0 -233
  166. package/lib/utils/performance.js +0 -72
  167. package/lib/utils/primitives.js +0 -57
  168. package/lib/utils/task_queue.js +0 -115
@@ -1,971 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
-
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; } } }; }
5
-
6
- 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); }
7
-
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; }
9
-
10
- // @ts-ignore
11
- import { isMini } from '@antv/l7-utils';
12
- import { mat2, mat4, vec4 } from 'gl-matrix';
13
- import Point from "../geo/point";
14
- import { clamp, interpolate, wrap } from "../util";
15
- import EdgeInsets from "./edge_insets";
16
- import LngLat from "./lng_lat";
17
- import LngLatBounds from "./lng_lat_bounds";
18
- import MercatorCoordinate, { mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude } from "./mercator";
19
- export var EXTENT = 8192;
20
-
21
- var Transform = /*#__PURE__*/function () {
22
- function Transform(minZoom, maxZoom, minPitch, maxPitch, renderWorldCopies) {
23
- _classCallCheck(this, Transform);
24
-
25
- this.tileSize = 512; // constant
26
-
27
- this.maxValidLatitude = 85.051129; // constant
28
-
29
- this._renderWorldCopies = renderWorldCopies === undefined ? true : renderWorldCopies;
30
- this._minZoom = minZoom || 0;
31
- this._maxZoom = maxZoom || 22;
32
- this._minPitch = minPitch === undefined || minPitch === null ? 0 : minPitch;
33
- this._maxPitch = maxPitch === undefined || maxPitch === null ? 60 : maxPitch;
34
- this.setMaxBounds();
35
- this.width = 0;
36
- this.height = 0;
37
- this._center = new LngLat(0, 0);
38
- this.zoom = 0;
39
- this.angle = 0;
40
- this._fov = 0.6435011087932844;
41
- this._pitch = 0;
42
- this.unmodified = true;
43
- this.edgeInsets = new EdgeInsets();
44
- this.posMatrixCache = {};
45
- this.alignedPosMatrixCache = {};
46
- }
47
-
48
- _createClass(Transform, [{
49
- key: "minZoom",
50
- get: function get() {
51
- return this._minZoom;
52
- },
53
- set: function set(zoom) {
54
- if (this._minZoom === zoom) {
55
- return;
56
- }
57
-
58
- this._minZoom = zoom;
59
- this.zoom = Math.max(this.zoom, zoom);
60
- }
61
- }, {
62
- key: "maxZoom",
63
- get: function get() {
64
- return this._maxZoom;
65
- },
66
- set: function set(zoom) {
67
- if (this._maxZoom === zoom) {
68
- return;
69
- }
70
-
71
- this._maxZoom = zoom;
72
- this.zoom = Math.min(this.zoom, zoom);
73
- }
74
- }, {
75
- key: "minPitch",
76
- get: function get() {
77
- return this._minPitch;
78
- },
79
- set: function set(pitch) {
80
- if (this._minPitch === pitch) {
81
- return;
82
- }
83
-
84
- this._minPitch = pitch;
85
- this._pitch = Math.max(this._pitch, pitch);
86
- }
87
- }, {
88
- key: "maxPitch",
89
- get: function get() {
90
- return this._maxPitch;
91
- },
92
- set: function set(pitch) {
93
- if (this._maxPitch === pitch) {
94
- return;
95
- }
96
-
97
- this._maxPitch = pitch;
98
- this._pitch = Math.min(this._pitch, pitch);
99
- }
100
- }, {
101
- key: "renderWorldCopies",
102
- get: function get() {
103
- return this._renderWorldCopies;
104
- },
105
- set: function set(renderWorldCopies) {
106
- if (renderWorldCopies === undefined) {
107
- renderWorldCopies = true;
108
- } else if (renderWorldCopies === null) {
109
- renderWorldCopies = false;
110
- }
111
-
112
- this._renderWorldCopies = renderWorldCopies;
113
- }
114
- }, {
115
- key: "worldSize",
116
- get: function get() {
117
- return this.tileSize * this.scale;
118
- }
119
- }, {
120
- key: "centerOffset",
121
- get: function get() {
122
- return this.centerPoint._sub(this.size._div(2));
123
- }
124
- }, {
125
- key: "size",
126
- get: function get() {
127
- return new Point(this.width, this.height);
128
- }
129
- }, {
130
- key: "bearing",
131
- get: function get() {
132
- return -this.angle / Math.PI * 180;
133
- },
134
- set: function set(bearing) {
135
- var b = -wrap(bearing, -180, 180) * Math.PI / 180;
136
-
137
- if (this.angle === b) {
138
- return;
139
- }
140
-
141
- this.unmodified = false;
142
- this.angle = b;
143
- this.calcMatrices(); // 2x2 matrix for rotating points
144
-
145
- this.rotationMatrix = mat2.create();
146
- mat2.rotate(this.rotationMatrix, this.rotationMatrix, this.angle);
147
- }
148
- }, {
149
- key: "pitch",
150
- get: function get() {
151
- return this._pitch / Math.PI * 180;
152
- },
153
- set: function set(pitch) {
154
- var p = clamp(pitch, this._minPitch, this._maxPitch) / 180 * Math.PI;
155
-
156
- if (this._pitch === p) {
157
- return;
158
- }
159
-
160
- this.unmodified = false;
161
- this._pitch = p;
162
- this.calcMatrices();
163
- }
164
- }, {
165
- key: "fov",
166
- get: function get() {
167
- return this._fov / Math.PI * 180;
168
- },
169
- set: function set(fov) {
170
- fov = Math.max(0.01, Math.min(60, fov));
171
-
172
- if (this._fov === fov) {
173
- return;
174
- }
175
-
176
- this.unmodified = false;
177
- this._fov = fov / 180 * Math.PI;
178
- this.calcMatrices();
179
- }
180
- }, {
181
- key: "zoom",
182
- get: function get() {
183
- return this._zoom;
184
- },
185
- set: function set(zoom) {
186
- var z = Math.min(Math.max(zoom, this._minZoom), this._maxZoom);
187
-
188
- if (this._zoom === z) {
189
- return;
190
- }
191
-
192
- this.unmodified = false;
193
- this._zoom = z;
194
- this.scale = this.zoomScale(z);
195
- this.tileZoom = Math.floor(z);
196
- this.zoomFraction = z - this.tileZoom;
197
- this.constrain();
198
- this.calcMatrices();
199
- }
200
- }, {
201
- key: "center",
202
- get: function get() {
203
- return this._center;
204
- },
205
- set: function set(center) {
206
- if (center.lat === this._center.lat && center.lng === this._center.lng) {
207
- return;
208
- }
209
-
210
- this.unmodified = false;
211
- this._center = center;
212
- this.constrain();
213
- this.calcMatrices();
214
- }
215
- }, {
216
- key: "padding",
217
- get: function get() {
218
- return this.edgeInsets.toJSON();
219
- },
220
- set: function set(padding) {
221
- if (this.edgeInsets.equals(padding)) {
222
- return;
223
- }
224
-
225
- this.unmodified = false; // Update edge-insets inplace
226
-
227
- this.edgeInsets.interpolate(this.edgeInsets, padding, 1);
228
- this.calcMatrices();
229
- }
230
- /**
231
- * The center of the screen in pixels with the top-left corner being (0,0)
232
- * and +y axis pointing downwards. This accounts for padding.
233
- *
234
- * @readonly
235
- * @type {Point}
236
- * @memberof Transform
237
- */
238
-
239
- }, {
240
- key: "centerPoint",
241
- get: function get() {
242
- return this.edgeInsets.getCenter(this.width, this.height);
243
- }
244
- }, {
245
- key: "point",
246
- get: function get() {
247
- return this.project(this.center);
248
- }
249
- }, {
250
- key: "clone",
251
- value: function clone() {
252
- var clone = new Transform(this._minZoom, this._maxZoom, this._minPitch, this._maxPitch, this._renderWorldCopies);
253
- clone.tileSize = this.tileSize;
254
- clone.latRange = this.latRange;
255
- clone.width = this.width;
256
- clone.height = this.height;
257
- clone.center = this._center;
258
- clone.zoom = this.zoom;
259
- clone.angle = this.angle;
260
- clone.fov = this._fov;
261
- clone.pitch = this._pitch;
262
- clone.unmodified = this.unmodified;
263
- clone.edgeInsets = this.edgeInsets.clone();
264
- clone.calcMatrices();
265
- return clone;
266
- }
267
- /**
268
- * Returns if the padding params match
269
- *
270
- * @param {IPaddingOptions} padding
271
- * @returns {boolean}
272
- * @memberof Transform
273
- */
274
-
275
- }, {
276
- key: "isPaddingEqual",
277
- value: function isPaddingEqual(padding) {
278
- return this.edgeInsets.equals(padding);
279
- }
280
- /**
281
- * Helper method to upadte edge-insets inplace
282
- *
283
- * @param {IPaddingOptions} target
284
- * @param {number} t
285
- * @memberof Transform
286
- */
287
-
288
- }, {
289
- key: "interpolatePadding",
290
- value: function interpolatePadding(start, target, t) {
291
- this.unmodified = false;
292
- this.edgeInsets.interpolate(start, target, t);
293
- this.constrain();
294
- this.calcMatrices();
295
- }
296
- /**
297
- * Return a zoom level that will cover all tiles the transform
298
- * @param {Object} options options
299
- * @param {number} options.tileSize Tile size, expressed in screen pixels.
300
- * @param {boolean} options.roundZoom Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.
301
- * @returns {number} zoom level An integer zoom level at which all tiles will be visible.
302
- */
303
-
304
- }, {
305
- key: "coveringZoomLevel",
306
- value: function coveringZoomLevel(options) {
307
- var z = (options.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / options.tileSize)); // At negative zoom levels load tiles from z0 because negative tile zoom levels don't exist.
308
-
309
- return Math.max(0, z);
310
- }
311
- /**
312
- * Return any "wrapped" copies of a given tile coordinate that are visible
313
- * in the current view.
314
- *
315
- * @private
316
- */
317
- // public getVisibleUnwrappedCoordinates(tileID: CanonicalTileID) {
318
- // const result = [new UnwrappedTileID(0, tileID)];
319
- // if (this._renderWorldCopies) {
320
- // const utl = this.pointCoordinate(new Point(0, 0));
321
- // const utr = this.pointCoordinate(new Point(this.width, 0));
322
- // const ubl = this.pointCoordinate(new Point(this.width, this.height));
323
- // const ubr = this.pointCoordinate(new Point(0, this.height));
324
- // const w0 = Math.floor(Math.min(utl.x, utr.x, ubl.x, ubr.x));
325
- // const w1 = Math.floor(Math.max(utl.x, utr.x, ubl.x, ubr.x));
326
- // // Add an extra copy of the world on each side to properly render ImageSources and CanvasSources.
327
- // // Both sources draw outside the tile boundaries of the tile that "contains them" so we need
328
- // // to add extra copies on both sides in case offscreen tiles need to draw into on-screen ones.
329
- // const extraWorldCopy = 1;
330
- // for (let w = w0 - extraWorldCopy; w <= w1 + extraWorldCopy; w++) {
331
- // if (w === 0) {
332
- // continue;
333
- // }
334
- // result.push(new UnwrappedTileID(w, tileID));
335
- // }
336
- // }
337
- // return result;
338
- // }
339
-
340
- /**
341
- * Return all coordinates that could cover this transform for a covering
342
- * zoom level.
343
- * @param {Object} options
344
- * @param {number} options.tileSize
345
- * @param {number} options.minzoom
346
- * @param {number} options.maxzoom
347
- * @param {boolean} options.roundZoom
348
- * @param {boolean} options.reparseOverscaled
349
- * @param {boolean} options.renderWorldCopies
350
- * @returns {Array<OverscaledTileID>} OverscaledTileIDs
351
- * @private
352
- */
353
- // public coveringTiles(options: {
354
- // tileSize: number;
355
- // minzoom?: number;
356
- // maxzoom?: number;
357
- // roundZoom?: boolean;
358
- // reparseOverscaled?: boolean;
359
- // renderWorldCopies?: boolean;
360
- // }): OverscaledTileID[] {
361
- // let z = this.coveringZoomLevel(options);
362
- // const actualZ = z;
363
- // if (options.minzoom !== undefined && z < options.minzoom) {
364
- // return [];
365
- // }
366
- // if (options.maxzoom !== undefined && z > options.maxzoom) {
367
- // z = options.maxzoom;
368
- // }
369
- // const centerCoord = MercatorCoordinate.fromLngLat(this.center);
370
- // const numTiles = Math.pow(2, z);
371
- // const centerPoint = [numTiles * centerCoord.x, numTiles * centerCoord.y, 0];
372
- // const cameraFrustum = Frustum.fromInvProjectionMatrix(
373
- // this.invProjMatrix,
374
- // this.worldSize,
375
- // z,
376
- // );
377
- // // No change of LOD behavior for pitch lower than 60 and when there is no top padding: return only tile ids from the requested zoom level
378
- // let minZoom = options.minzoom || 0;
379
- // // Use 0.1 as an epsilon to avoid for explicit == 0.0 floating point checks
380
- // if (this._pitch <= 60.0 && this.edgeInsets.top < 0.1) {
381
- // minZoom = z;
382
- // }
383
- // // There should always be a certain number of maximum zoom level tiles surrounding the center location
384
- // const radiusOfMaxLvlLodInTiles = 3;
385
- // const newRootTile = (wrap: number): any => {
386
- // return {
387
- // // All tiles are on zero elevation plane => z difference is zero
388
- // aabb: new Aabb(
389
- // [wrap * numTiles, 0, 0],
390
- // [(wrap + 1) * numTiles, numTiles, 0],
391
- // ),
392
- // zoom: 0,
393
- // x: 0,
394
- // y: 0,
395
- // wrap,
396
- // fullyVisible: false,
397
- // };
398
- // };
399
- // // Do a depth-first traversal to find visible tiles and proper levels of detail
400
- // const stack = [];
401
- // const result = [];
402
- // const maxZoom = z;
403
- // const overscaledZ = options.reparseOverscaled ? actualZ : z;
404
- // if (this._renderWorldCopies) {
405
- // // Render copy of the globe thrice on both sides
406
- // for (let i = 1; i <= 3; i++) {
407
- // stack.push(newRootTile(-i));
408
- // stack.push(newRootTile(i));
409
- // }
410
- // }
411
- // stack.push(newRootTile(0));
412
- // while (stack.length > 0) {
413
- // const it = stack.pop();
414
- // const x = it.x;
415
- // const y = it.y;
416
- // let fullyVisible = it.fullyVisible;
417
- // // Visibility of a tile is not required if any of its ancestor if fully inside the frustum
418
- // if (!fullyVisible) {
419
- // const intersectResult = it.aabb.intersects(cameraFrustum);
420
- // if (intersectResult === 0) {
421
- // continue;
422
- // }
423
- // fullyVisible = intersectResult === 2;
424
- // }
425
- // const distanceX = it.aabb.distanceX(centerPoint);
426
- // const distanceY = it.aabb.distanceY(centerPoint);
427
- // const longestDim = Math.max(Math.abs(distanceX), Math.abs(distanceY));
428
- // // We're using distance based heuristics to determine if a tile should be split into quadrants or not.
429
- // // radiusOfMaxLvlLodInTiles defines that there's always a certain number of maxLevel tiles next to the map center.
430
- // // Using the fact that a parent node in quadtree is twice the size of its children (per dimension)
431
- // // we can define distance thresholds for each relative level:
432
- // // f(k) = offset + 2 + 4 + 8 + 16 + ... + 2^k. This is the same as "offset+2^(k+1)-2"
433
- // const distToSplit =
434
- // radiusOfMaxLvlLodInTiles + (1 << (maxZoom - it.zoom)) - 2;
435
- // // Have we reached the target depth or is the tile too far away to be any split further?
436
- // if (
437
- // it.zoom === maxZoom ||
438
- // (longestDim > distToSplit && it.zoom >= minZoom)
439
- // ) {
440
- // result.push({
441
- // tileID: new OverscaledTileID(
442
- // it.zoom === maxZoom ? overscaledZ : it.zoom,
443
- // it.wrap,
444
- // it.zoom,
445
- // x,
446
- // y,
447
- // ),
448
- // distanceSq: vec2.sqrLen([
449
- // centerPoint[0] - 0.5 - x,
450
- // centerPoint[1] - 0.5 - y,
451
- // ]),
452
- // });
453
- // continue;
454
- // }
455
- // for (let i = 0; i < 4; i++) {
456
- // const childX = (x << 1) + (i % 2);
457
- // const childY = (y << 1) + (i >> 1);
458
- // stack.push({
459
- // aabb: it.aabb.quadrant(i),
460
- // zoom: it.zoom + 1,
461
- // x: childX,
462
- // y: childY,
463
- // wrap: it.wrap,
464
- // fullyVisible,
465
- // });
466
- // }
467
- // }
468
- // return result
469
- // .sort((a, b) => a.distanceSq - b.distanceSq)
470
- // .map((a) => a.tileID);
471
- // }
472
-
473
- }, {
474
- key: "resize",
475
- value: function resize(width, height) {
476
- this.width = width;
477
- this.height = height;
478
- this.pixelsToGLUnits = [2 / width, -2 / height];
479
- this.constrain();
480
- this.calcMatrices();
481
- }
482
- }, {
483
- key: "zoomScale",
484
- value: function zoomScale(zoom) {
485
- return Math.pow(2, zoom);
486
- }
487
- }, {
488
- key: "scaleZoom",
489
- value: function scaleZoom(scale) {
490
- return Math.log(scale) / Math.LN2;
491
- }
492
- }, {
493
- key: "project",
494
- value: function project(lnglat) {
495
- var lat = clamp(lnglat.lat, -this.maxValidLatitude, this.maxValidLatitude);
496
- return new Point(mercatorXfromLng(lnglat.lng) * this.worldSize, mercatorYfromLat(lat) * this.worldSize);
497
- }
498
- }, {
499
- key: "unproject",
500
- value: function unproject(point) {
501
- return new MercatorCoordinate(point.x / this.worldSize, point.y / this.worldSize).toLngLat();
502
- }
503
- }, {
504
- key: "setLocationAtPoint",
505
- value: function setLocationAtPoint(lnglat, point) {
506
- var a = this.pointCoordinate(point);
507
- var b = this.pointCoordinate(this.centerPoint);
508
- var loc = this.locationCoordinate(lnglat);
509
- var newCenter = new MercatorCoordinate(loc.x - (a.x - b.x), loc.y - (a.y - b.y));
510
- this.center = this.coordinateLocation(newCenter);
511
-
512
- if (this._renderWorldCopies) {
513
- this.center = this.center.wrap();
514
- }
515
- }
516
- }, {
517
- key: "pointCoordinate",
518
- value: function pointCoordinate(p) {
519
- var targetZ = 0; // since we don't know the correct projected z value for the point,
520
- // unproject two points to get a line and then find the point on that
521
- // line with z=0
522
-
523
- var coord0 = new Float64Array([p.x, p.y, 0, 1]);
524
- var coord1 = new Float64Array([p.x, p.y, 1, 1]); // @ts-ignore
525
-
526
- vec4.transformMat4(coord0, coord0, this.pixelMatrixInverse); // @ts-ignore
527
-
528
- vec4.transformMat4(coord1, coord1, this.pixelMatrixInverse);
529
- var w0 = coord0[3];
530
- var w1 = coord1[3];
531
- var x0 = coord0[0] / w0;
532
- var x1 = coord1[0] / w1;
533
- var y0 = coord0[1] / w0;
534
- var y1 = coord1[1] / w1;
535
- var z0 = coord0[2] / w0;
536
- var z1 = coord1[2] / w1;
537
- var t = z0 === z1 ? 0 : (targetZ - z0) / (z1 - z0);
538
- return new MercatorCoordinate(interpolate(x0, x1, t) / this.worldSize, interpolate(y0, y1, t) / this.worldSize);
539
- }
540
- /**
541
- * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
542
- * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
543
- * @returns {LngLatBounds} Returns a {@link LngLatBounds} object describing the map's geographical bounds.
544
- */
545
-
546
- }, {
547
- key: "getBounds",
548
- value: function getBounds() {
549
- return new LngLatBounds().extend(this.pointLocation(new Point(0, 0))).extend(this.pointLocation(new Point(this.width, 0))).extend(this.pointLocation(new Point(this.width, this.height))).extend(this.pointLocation(new Point(0, this.height)));
550
- }
551
- /**
552
- * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
553
- * @returns {LngLatBounds} {@link LngLatBounds}
554
- */
555
-
556
- }, {
557
- key: "getMaxBounds",
558
- value: function getMaxBounds() {
559
- if (!this.latRange || this.latRange.length !== 2 || !this.lngRange || this.lngRange.length !== 2) {
560
- return null;
561
- }
562
-
563
- return new LngLatBounds([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]);
564
- }
565
- /**
566
- * Sets or clears the map's geographical constraints.
567
- * @param {LngLatBounds} bounds A {@link LngLatBounds} object describing the new geographic boundaries of the map.
568
- */
569
-
570
- }, {
571
- key: "setMaxBounds",
572
- value: function setMaxBounds(bounds) {
573
- if (bounds) {
574
- this.lngRange = [bounds.getWest(), bounds.getEast()];
575
- this.latRange = [bounds.getSouth(), bounds.getNorth()];
576
- this.constrain();
577
- } else {
578
- this.lngRange = undefined;
579
- this.latRange = [-this.maxValidLatitude, this.maxValidLatitude];
580
- }
581
- }
582
- }, {
583
- key: "customLayerMatrix",
584
- value: function customLayerMatrix() {
585
- return this.mercatorMatrix.slice();
586
- }
587
- }, {
588
- key: "maxPitchScaleFactor",
589
- value: function maxPitchScaleFactor() {
590
- // calcMatrices hasn't run yet
591
- if (!this.pixelMatrixInverse) {
592
- return 1;
593
- }
594
-
595
- var coord = this.pointCoordinate(new Point(0, 0));
596
- var p = new Float32Array([coord.x * this.worldSize, coord.y * this.worldSize, 0, 1]);
597
- var topPoint = vec4.transformMat4(p, p, this.pixelMatrix);
598
- return topPoint[3] / this.cameraToCenterDistance;
599
- }
600
- /*
601
- * The camera looks at the map from a 3D (lng, lat, altitude) location. Let's use `cameraLocation`
602
- * as the name for the location under the camera and on the surface of the earth (lng, lat, 0).
603
- * `cameraPoint` is the projected position of the `cameraLocation`.
604
- *
605
- * This point is useful to us because only fill-extrusions that are between `cameraPoint` and
606
- * the query point on the surface of the earth can extend and intersect the query.
607
- *
608
- * When the map is not pitched the `cameraPoint` is equivalent to the center of the map because
609
- * the camera is right above the center of the map.
610
- */
611
-
612
- }, {
613
- key: "getCameraPoint",
614
- value: function getCameraPoint() {
615
- var pitch = this._pitch;
616
- var yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);
617
- return this.centerPoint.add(new Point(0, yOffset));
618
- }
619
- /*
620
- * When the map is pitched, some of the 3D features that intersect a query will not intersect
621
- * the query at the surface of the earth. Instead the feature may be closer and only intersect
622
- * the query because it extrudes into the air.
623
- *
624
- * This returns a geometry that includes all of the original query as well as all possible ares of the
625
- * screen where the *base* of a visible extrusion could be.
626
- * - For point queries, the line from the query point to the "camera point"
627
- * - For other geometries, the envelope of the query geometry and the "camera point"
628
- */
629
-
630
- }, {
631
- key: "getCameraQueryGeometry",
632
- value: function getCameraQueryGeometry(queryGeometry) {
633
- var c = this.getCameraPoint();
634
-
635
- if (queryGeometry.length === 1) {
636
- return [queryGeometry[0], c];
637
- } else {
638
- var minX = c.x;
639
- var minY = c.y;
640
- var maxX = c.x;
641
- var maxY = c.y;
642
-
643
- var _iterator = _createForOfIteratorHelper(queryGeometry),
644
- _step;
645
-
646
- try {
647
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
648
- var p = _step.value;
649
- minX = Math.min(minX, p.x);
650
- minY = Math.min(minY, p.y);
651
- maxX = Math.max(maxX, p.x);
652
- maxY = Math.max(maxY, p.y);
653
- }
654
- } catch (err) {
655
- _iterator.e(err);
656
- } finally {
657
- _iterator.f();
658
- }
659
-
660
- return [new Point(minX, minY), new Point(maxX, minY), new Point(maxX, maxY), new Point(minX, maxY), new Point(minX, minY)];
661
- }
662
- }
663
- /**
664
- * Given a coordinate, return the screen point that corresponds to it
665
- * @param {Coordinate} coord
666
- * @returns {Point} screen point
667
- * @private
668
- */
669
-
670
- }, {
671
- key: "coordinatePoint",
672
- value: function coordinatePoint(coord) {
673
- var p = vec4.fromValues(coord.x * this.worldSize, coord.y * this.worldSize, 0, 1);
674
- vec4.transformMat4(p, p, this.pixelMatrix);
675
- return new Point(p[0] / p[3], p[1] / p[3]);
676
- }
677
- /**
678
- * Given a location, return the screen point that corresponds to it
679
- * @param {LngLat} lnglat location
680
- * @returns {Point} screen point
681
- * @private
682
- */
683
-
684
- }, {
685
- key: "locationPoint",
686
- value: function locationPoint(lnglat) {
687
- return this.coordinatePoint(this.locationCoordinate(lnglat));
688
- }
689
- /**
690
- * Given a point on screen, return its lnglat
691
- * @param {Point} p screen point
692
- * @returns {LngLat} lnglat location
693
- * @private
694
- */
695
-
696
- }, {
697
- key: "pointLocation",
698
- value: function pointLocation(p) {
699
- // if(p.x !== 0 && p.x !== 1001) {
700
- // console.log(p.x)
701
- // }
702
- return this.coordinateLocation(this.pointCoordinate(p));
703
- }
704
- /**
705
- * Given a geographical lnglat, return an unrounded
706
- * coordinate that represents it at this transform's zoom level.
707
- * @param {LngLat} lnglat
708
- * @returns {Coordinate}
709
- * @private
710
- */
711
-
712
- }, {
713
- key: "locationCoordinate",
714
- value: function locationCoordinate(lnglat) {
715
- return MercatorCoordinate.fromLngLat(lnglat);
716
- }
717
- /**
718
- * Given a Coordinate, return its geographical position.
719
- * @param {Coordinate} coord
720
- * @returns {LngLat} lnglat
721
- * @private
722
- */
723
-
724
- }, {
725
- key: "coordinateLocation",
726
- value: function coordinateLocation(coord) {
727
- return coord.toLngLat();
728
- }
729
- }, {
730
- key: "getProjectionMatrix",
731
- value: function getProjectionMatrix() {
732
- return this.projMatrix;
733
- }
734
- /**
735
- * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.
736
- * @param {UnwrappedTileID} unwrappedTileID;
737
- * @private
738
- */
739
- // private calculatePosMatrix(
740
- // unwrappedTileID: UnwrappedTileID,
741
- // aligned: boolean = false,
742
- // ): Float32Array {
743
- // const posMatrixKey = unwrappedTileID.key;
744
- // const cache = aligned ? this.alignedPosMatrixCache : this.posMatrixCache;
745
- // if (cache[posMatrixKey]) {
746
- // return cache[posMatrixKey];
747
- // }
748
- // const canonical = unwrappedTileID.canonical;
749
- // const scale = this.worldSize / this.zoomScale(canonical.z);
750
- // const unwrappedX =
751
- // canonical.x + Math.pow(2, canonical.z) * unwrappedTileID.wrap;
752
- // const posMatrix = mat4.identity(new Float64Array(16));
753
- // mat4.translate(posMatrix, posMatrix, [
754
- // unwrappedX * scale,
755
- // canonical.y * scale,
756
- // 0,
757
- // ]);
758
- // mat4.scale(posMatrix, posMatrix, [scale / EXTENT, scale / EXTENT, 1]);
759
- // mat4.multiply(
760
- // posMatrix,
761
- // aligned ? this.alignedProjMatrix : this.projMatrix,
762
- // posMatrix,
763
- // );
764
- // cache[posMatrixKey] = new Float32Array(posMatrix);
765
- // return cache[posMatrixKey];
766
- // }
767
-
768
- }, {
769
- key: "constrain",
770
- value: function constrain() {
771
- if (!this.center || !this.width || !this.height || this.constraining) {
772
- return;
773
- }
774
-
775
- this.constraining = true;
776
- var minY = -90;
777
- var maxY = 90;
778
- var minX = -180;
779
- var maxX = 180;
780
- var sy;
781
- var sx;
782
- var x2;
783
- var y2;
784
- var size = this.size;
785
- var unmodified = this.unmodified;
786
-
787
- if (this.latRange) {
788
- var latRange = this.latRange;
789
- minY = mercatorYfromLat(latRange[1]) * this.worldSize;
790
- maxY = mercatorYfromLat(latRange[0]) * this.worldSize;
791
- sy = maxY - minY < size.y ? size.y / (maxY - minY) : 0;
792
- }
793
-
794
- if (this.lngRange) {
795
- var lngRange = this.lngRange;
796
- minX = mercatorXfromLng(lngRange[0]) * this.worldSize;
797
- maxX = mercatorXfromLng(lngRange[1]) * this.worldSize;
798
- sx = maxX - minX < size.x ? size.x / (maxX - minX) : 0;
799
- }
800
-
801
- var point = this.point; // how much the map should scale to fit the screen into given latitude/longitude ranges
802
-
803
- var s = Math.max(sx || 0, sy || 0);
804
-
805
- if (s) {
806
- this.center = this.unproject(new Point(sx ? (maxX + minX) / 2 : point.x, sy ? (maxY + minY) / 2 : point.y));
807
-
808
- if (isMini) {
809
- this.zoom = Math.max(this.zoom, Math.max(-1, this.minZoom));
810
- } else {
811
- this.zoom += this.scaleZoom(s);
812
- }
813
-
814
- this.unmodified = unmodified;
815
- this.constraining = false;
816
- return;
817
- }
818
-
819
- if (this.latRange) {
820
- var y = point.y;
821
- var h2 = size.y / 2;
822
-
823
- if (y - h2 < minY) {
824
- y2 = minY + h2;
825
- }
826
-
827
- if (y + h2 > maxY) {
828
- y2 = maxY - h2;
829
- }
830
- }
831
-
832
- if (this.lngRange) {
833
- var x = point.x;
834
- var w2 = size.x / 2;
835
-
836
- if (x - w2 < minX) {
837
- x2 = minX + w2;
838
- }
839
-
840
- if (x + w2 > maxX) {
841
- x2 = maxX - w2;
842
- }
843
- } // pan the map if the screen goes off the range
844
-
845
-
846
- if (x2 !== undefined || y2 !== undefined) {
847
- this.center = this.unproject(new Point(x2 !== undefined ? x2 : point.x, y2 !== undefined ? y2 : point.y));
848
- }
849
-
850
- this.unmodified = unmodified;
851
- this.constraining = false;
852
- }
853
- }, {
854
- key: "calcMatrices",
855
- value: function calcMatrices() {
856
- if (!this.height) {
857
- return;
858
- }
859
-
860
- var halfFov = this._fov / 2;
861
- var offset = this.centerOffset;
862
- this.cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this.height; // Find the distance from the center point [width/2 + offset.x, height/2 + offset.y] to the
863
- // center top point [width/2 + offset.x, 0] in Z units, using the law of sines.
864
- // 1 Z unit is equivalent to 1 horizontal px at the center of the map
865
- // (the distance between[width/2, height/2] and [width/2 + 1, height/2])
866
-
867
- var groundAngle = Math.PI / 2 + this._pitch;
868
- var fovAboveCenter = this._fov * (0.5 + offset.y / this.height);
869
- var topHalfSurfaceDistance = Math.sin(fovAboveCenter) * this.cameraToCenterDistance / Math.sin(clamp(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));
870
- var point = this.point;
871
- var x = point.x;
872
- var y = point.y; // Calculate z distance of the farthest fragment that should be rendered.
873
-
874
- var furthestDistance = Math.cos(Math.PI / 2 - this._pitch) * topHalfSurfaceDistance + this.cameraToCenterDistance; // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`
875
-
876
- var farZ = furthestDistance * 1.01; // The larger the value of nearZ is
877
- // - the more depth precision is available for features (good)
878
- // - clipping starts appearing sooner when the camera is close to 3d features (bad)
879
- //
880
- // Smaller values worked well for mapbox-gl-js but deckgl was encountering precision issues
881
- // when rendering it's layers using custom layers. This value was experimentally chosen and
882
- // seems to solve z-fighting issues in deckgl while not clipping buildings too close to the camera.
883
-
884
- var nearZ = this.height / 50; // matrix for conversion from location to GL coordinates (-1 .. 1)
885
- // 使用 Float64Array 的原因是为了避免计算精度问题、 mat4.create() 默认使用 Float32Array
886
-
887
- var m = new Float64Array(16); // @ts-ignore
888
-
889
- mat4.perspective(m, this._fov, this.width / this.height, nearZ, farZ); // Apply center of perspective offset
890
-
891
- m[8] = -offset.x * 2 / this.width;
892
- m[9] = offset.y * 2 / this.height; // @ts-ignore
893
-
894
- mat4.scale(m, m, [1, -1, 1]); // @ts-ignore
895
-
896
- mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]); // @ts-ignore
897
-
898
- mat4.rotateX(m, m, this._pitch); // @ts-ignore
899
-
900
- mat4.rotateZ(m, m, this.angle); // @ts-ignore
901
-
902
- mat4.translate(m, m, [-x, -y, 0]); // The mercatorMatrix can be used to transform points from mercator coordinates
903
- // ([0, 0] nw, [1, 1] se) to GL coordinates.
904
- // @ts-ignore
905
-
906
- this.mercatorMatrix = mat4.scale([], m, [this.worldSize, this.worldSize, this.worldSize]); // scale vertically to meters per pixel (inverse of ground resolution):
907
- // @ts-ignore
908
-
909
- mat4.scale(m, m, [1, 1, mercatorZfromAltitude(1, this.center.lat) * this.worldSize, 1]); // @ts-ignore
910
-
911
- this.projMatrix = m; // @ts-ignore
912
-
913
- this.invProjMatrix = mat4.invert([], this.projMatrix); // Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles.
914
- // We're rounding the (floating point) x/y values to achieve to avoid rendering raster images to fractional
915
- // coordinates. Additionally, we adjust by half a pixel in either direction in case that viewport dimension
916
- // is an odd integer to preserve rendering to the pixel grid. We're rotating this shift based on the angle
917
- // of the transformation so that 0°, 90°, 180°, and 270° rasters are crisp, and adjust the shift so that
918
- // it is always <= 0.5 pixels.
919
-
920
- var xShift = this.width % 2 / 2;
921
- var yShift = this.height % 2 / 2;
922
- var angleCos = Math.cos(this.angle);
923
- var angleSin = Math.sin(this.angle);
924
- var dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift;
925
- var dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift; // const alignedM = mat4.clone(m);
926
-
927
- var alignedM = new Float64Array(m); // @ts-ignore
928
-
929
- mat4.translate(alignedM, alignedM, [dx > 0.5 ? dx - 1 : dx, dy > 0.5 ? dy - 1 : dy, 0]); // @ts-ignore
930
-
931
- this.alignedProjMatrix = alignedM; // @ts-ignore
932
-
933
- m = mat4.create(); // @ts-ignore
934
-
935
- mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]); // @ts-ignore
936
-
937
- mat4.translate(m, m, [1, -1, 0]); // @ts-ignore
938
-
939
- this.labelPlaneMatrix = m; // @ts-ignore
940
-
941
- m = mat4.create(); // @ts-ignore
942
-
943
- mat4.scale(m, m, [1, -1, 1]); // @ts-ignore
944
-
945
- mat4.translate(m, m, [-1, -1, 0]); // @ts-ignore
946
-
947
- mat4.scale(m, m, [2 / this.width, 2 / this.height, 1]); // @ts-ignore
948
-
949
- this.glCoordMatrix = m; // matrix for conversion from location to screen coordinates
950
-
951
- this.pixelMatrix = mat4.multiply( // @ts-ignore
952
- new Float64Array(16), this.labelPlaneMatrix, this.projMatrix); // inverse matrix for conversion from screen coordinaes to location
953
- // @ts-ignore
954
-
955
- m = mat4.invert(new Float64Array(16), this.pixelMatrix);
956
-
957
- if (!m) {
958
- throw new Error('failed to invert matrix');
959
- } // @ts-ignore
960
-
961
-
962
- this.pixelMatrixInverse = m;
963
- this.posMatrixCache = {};
964
- this.alignedPosMatrixCache = {};
965
- }
966
- }]);
967
-
968
- return Transform;
969
- }();
970
-
971
- export { Transform as default };