@antv/l7-map 2.9.21 → 2.9.22-alpha.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.
- package/es/camera.js +115 -85
- package/es/css/l7.css +98 -0
- package/es/earthmap.js +27 -43
- package/es/geo/edge_insets.js +44 -14
- package/es/geo/lng_lat.js +15 -11
- package/es/geo/lng_lat_bounds.js +6 -10
- package/es/geo/mercator.js +24 -12
- package/es/geo/point.js +2 -8
- package/es/geo/simple.js +24 -12
- package/es/geo/transform.js +421 -120
- package/es/handler/IHandler.js +1 -2
- package/es/handler/blockable_map_event.js +13 -14
- package/es/handler/box_zoom.js +43 -27
- package/es/handler/click_zoom.js +3 -8
- package/es/handler/events/event.js +3 -6
- package/es/handler/events/index.js +4 -5
- package/es/handler/events/map_mouse_event.js +30 -20
- package/es/handler/events/map_touch_event.js +55 -25
- package/es/handler/events/map_wheel_event.js +24 -15
- package/es/handler/events/render_event.js +3 -6
- package/es/handler/handler_inertia.js +10 -12
- package/es/handler/handler_manager.js +75 -72
- package/es/handler/handler_util.js +2 -2
- package/es/handler/keyboard.js +20 -15
- package/es/handler/map_event.js +23 -12
- package/es/handler/mouse/index.js +4 -5
- package/es/handler/mouse/mouse_handler.js +17 -21
- package/es/handler/mouse/mousepan_handler.js +5 -5
- package/es/handler/mouse/mousepitch_hander.js +7 -5
- package/es/handler/mouse/mouserotate_hander.js +7 -5
- package/es/handler/mouse/util.js +3 -3
- package/es/handler/scroll_zoom.js +103 -67
- package/es/handler/shim/dblclick_zoom.js +35 -8
- package/es/handler/shim/drag_pan.js +48 -12
- package/es/handler/shim/drag_rotate.js +39 -10
- package/es/handler/shim/touch_zoom_rotate.js +59 -16
- package/es/handler/tap/single_tap_recognizer.js +7 -17
- package/es/handler/tap/tap_drag_zoom.js +5 -18
- package/es/handler/tap/tap_recognizer.js +4 -15
- package/es/handler/tap/tap_zoom.js +4 -13
- package/es/handler/touch/index.js +5 -6
- package/es/handler/touch/touch_pan.js +9 -20
- package/es/handler/touch/touch_pitch.js +11 -23
- package/es/handler/touch/touch_rotate.js +15 -18
- package/es/handler/touch/touch_zoom.js +5 -19
- package/es/handler/touch/two_touch.js +14 -21
- package/es/hash.js +28 -16
- package/es/index.js +2 -3
- package/es/interface.js +1 -2
- package/es/map.js +26 -47
- package/es/util.js +15 -6
- package/es/utils/Aabb.js +11 -12
- package/es/utils/dom.js +30 -11
- package/es/utils/performance.js +10 -6
- package/es/utils/primitives.js +11 -10
- package/es/utils/task_queue.js +6 -13
- package/lib/camera.js +508 -721
- package/lib/css/l7.css +98 -0
- package/lib/earthmap.js +222 -392
- package/lib/geo/edge_insets.js +64 -83
- package/lib/geo/lng_lat.js +65 -81
- package/lib/geo/lng_lat_bounds.js +124 -165
- package/lib/geo/mercator.js +62 -78
- package/lib/geo/point.js +171 -239
- package/lib/geo/simple.js +61 -80
- package/lib/geo/transform.js +470 -653
- package/lib/handler/IHandler.js +17 -2
- package/lib/handler/blockable_map_event.js +63 -83
- package/lib/handler/box_zoom.js +123 -176
- package/lib/handler/click_zoom.js +56 -68
- package/lib/handler/events/event.js +35 -23
- package/lib/handler/events/index.js +35 -29
- package/lib/handler/events/map_mouse_event.js +42 -72
- package/lib/handler/events/map_touch_event.js +45 -80
- package/lib/handler/events/map_wheel_event.js +34 -58
- package/lib/handler/events/render_event.js +31 -52
- package/lib/handler/handler_inertia.js +113 -160
- package/lib/handler/handler_manager.js +379 -620
- package/lib/handler/handler_util.js +28 -10
- package/lib/handler/keyboard.js +114 -146
- package/lib/handler/map_event.js +84 -120
- package/lib/handler/mouse/index.js +35 -29
- package/lib/handler/mouse/mouse_handler.js +90 -123
- package/lib/handler/mouse/mousepan_handler.js +46 -65
- package/lib/handler/mouse/mousepitch_hander.js +44 -63
- package/lib/handler/mouse/mouserotate_hander.js +44 -63
- package/lib/handler/mouse/util.js +38 -20
- package/lib/handler/scroll_zoom.js +175 -258
- package/lib/handler/shim/dblclick_zoom.js +42 -48
- package/lib/handler/shim/drag_pan.js +48 -59
- package/lib/handler/shim/drag_rotate.js +43 -51
- package/lib/handler/shim/touch_zoom_rotate.js +58 -78
- package/lib/handler/tap/single_tap_recognizer.js +84 -117
- package/lib/handler/tap/tap_drag_zoom.js +92 -115
- package/lib/handler/tap/tap_recognizer.js +60 -78
- package/lib/handler/tap/tap_zoom.js +88 -119
- package/lib/handler/touch/index.js +38 -37
- package/lib/handler/touch/touch_pan.js +98 -132
- package/lib/handler/touch/touch_pitch.js +73 -117
- package/lib/handler/touch/touch_rotate.js +58 -94
- package/lib/handler/touch/touch_zoom.js +49 -84
- package/lib/handler/touch/two_touch.js +88 -128
- package/lib/hash.js +100 -133
- package/lib/index.js +19 -31
- package/lib/interface.js +17 -2
- package/lib/map.js +238 -420
- package/lib/util.js +67 -78
- package/lib/utils/Aabb.js +80 -132
- package/lib/utils/dom.js +84 -141
- package/lib/utils/performance.js +54 -42
- package/lib/utils/primitives.js +59 -51
- package/lib/utils/task_queue.js +61 -108
- package/package.json +11 -8
- package/es/camera.js.map +0 -1
- package/es/earthmap.js.map +0 -1
- package/es/geo/edge_insets.js.map +0 -1
- package/es/geo/lng_lat.js.map +0 -1
- package/es/geo/lng_lat_bounds.js.map +0 -1
- package/es/geo/mercator.js.map +0 -1
- package/es/geo/point.js.map +0 -1
- package/es/geo/simple.js.map +0 -1
- package/es/geo/transform.js.map +0 -1
- package/es/handler/IHandler.js.map +0 -1
- package/es/handler/blockable_map_event.js.map +0 -1
- package/es/handler/box_zoom.js.map +0 -1
- package/es/handler/click_zoom.js.map +0 -1
- package/es/handler/events/event.js.map +0 -1
- package/es/handler/events/index.js.map +0 -1
- package/es/handler/events/map_mouse_event.js.map +0 -1
- package/es/handler/events/map_touch_event.js.map +0 -1
- package/es/handler/events/map_wheel_event.js.map +0 -1
- package/es/handler/events/render_event.js.map +0 -1
- package/es/handler/handler_inertia.js.map +0 -1
- package/es/handler/handler_manager.js.map +0 -1
- package/es/handler/handler_util.js.map +0 -1
- package/es/handler/keyboard.js.map +0 -1
- package/es/handler/map_event.js.map +0 -1
- package/es/handler/mouse/index.js.map +0 -1
- package/es/handler/mouse/mouse_handler.js.map +0 -1
- package/es/handler/mouse/mousepan_handler.js.map +0 -1
- package/es/handler/mouse/mousepitch_hander.js.map +0 -1
- package/es/handler/mouse/mouserotate_hander.js.map +0 -1
- package/es/handler/mouse/util.js.map +0 -1
- package/es/handler/scroll_zoom.js.map +0 -1
- package/es/handler/shim/dblclick_zoom.js.map +0 -1
- package/es/handler/shim/drag_pan.js.map +0 -1
- package/es/handler/shim/drag_rotate.js.map +0 -1
- package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
- package/es/handler/tap/single_tap_recognizer.js.map +0 -1
- package/es/handler/tap/tap_drag_zoom.js.map +0 -1
- package/es/handler/tap/tap_recognizer.js.map +0 -1
- package/es/handler/tap/tap_zoom.js.map +0 -1
- package/es/handler/touch/index.js.map +0 -1
- package/es/handler/touch/touch_pan.js.map +0 -1
- package/es/handler/touch/touch_pitch.js.map +0 -1
- package/es/handler/touch/touch_rotate.js.map +0 -1
- package/es/handler/touch/touch_zoom.js.map +0 -1
- package/es/handler/touch/two_touch.js.map +0 -1
- package/es/hash.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/interface.js.map +0 -1
- package/es/map.js.map +0 -1
- package/es/util.js.map +0 -1
- package/es/utils/Aabb.js.map +0 -1
- package/es/utils/dom.js.map +0 -1
- package/es/utils/performance.js.map +0 -1
- package/es/utils/primitives.js.map +0 -1
- package/es/utils/task_queue.js.map +0 -1
- package/lib/camera.js.map +0 -1
- package/lib/earthmap.js.map +0 -1
- package/lib/geo/edge_insets.js.map +0 -1
- package/lib/geo/lng_lat.js.map +0 -1
- package/lib/geo/lng_lat_bounds.js.map +0 -1
- package/lib/geo/mercator.js.map +0 -1
- package/lib/geo/point.js.map +0 -1
- package/lib/geo/simple.js.map +0 -1
- package/lib/geo/transform.js.map +0 -1
- package/lib/handler/IHandler.js.map +0 -1
- package/lib/handler/blockable_map_event.js.map +0 -1
- package/lib/handler/box_zoom.js.map +0 -1
- package/lib/handler/click_zoom.js.map +0 -1
- package/lib/handler/events/event.js.map +0 -1
- package/lib/handler/events/index.js.map +0 -1
- package/lib/handler/events/map_mouse_event.js.map +0 -1
- package/lib/handler/events/map_touch_event.js.map +0 -1
- package/lib/handler/events/map_wheel_event.js.map +0 -1
- package/lib/handler/events/render_event.js.map +0 -1
- package/lib/handler/handler_inertia.js.map +0 -1
- package/lib/handler/handler_manager.js.map +0 -1
- package/lib/handler/handler_util.js.map +0 -1
- package/lib/handler/keyboard.js.map +0 -1
- package/lib/handler/map_event.js.map +0 -1
- package/lib/handler/mouse/index.js.map +0 -1
- package/lib/handler/mouse/mouse_handler.js.map +0 -1
- package/lib/handler/mouse/mousepan_handler.js.map +0 -1
- package/lib/handler/mouse/mousepitch_hander.js.map +0 -1
- package/lib/handler/mouse/mouserotate_hander.js.map +0 -1
- package/lib/handler/mouse/util.js.map +0 -1
- package/lib/handler/scroll_zoom.js.map +0 -1
- package/lib/handler/shim/dblclick_zoom.js.map +0 -1
- package/lib/handler/shim/drag_pan.js.map +0 -1
- package/lib/handler/shim/drag_rotate.js.map +0 -1
- package/lib/handler/shim/touch_zoom_rotate.js.map +0 -1
- package/lib/handler/tap/single_tap_recognizer.js.map +0 -1
- package/lib/handler/tap/tap_drag_zoom.js.map +0 -1
- package/lib/handler/tap/tap_recognizer.js.map +0 -1
- package/lib/handler/tap/tap_zoom.js.map +0 -1
- package/lib/handler/touch/index.js.map +0 -1
- package/lib/handler/touch/touch_pan.js.map +0 -1
- package/lib/handler/touch/touch_pitch.js.map +0 -1
- package/lib/handler/touch/touch_rotate.js.map +0 -1
- package/lib/handler/touch/touch_zoom.js.map +0 -1
- package/lib/handler/touch/two_touch.js.map +0 -1
- package/lib/hash.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interface.js.map +0 -1
- package/lib/map.js.map +0 -1
- package/lib/util.js.map +0 -1
- package/lib/utils/Aabb.js.map +0 -1
- package/lib/utils/dom.js.map +0 -1
- package/lib/utils/performance.js.map +0 -1
- package/lib/utils/primitives.js.map +0 -1
- package/lib/utils/task_queue.js.map +0 -1
package/lib/geo/transform.js
CHANGED
|
@@ -1,686 +1,503 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 });
|
|
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);
|
|
21
|
+
|
|
22
|
+
// src/geo/transform.ts
|
|
23
|
+
var transform_exports = {};
|
|
24
|
+
__export(transform_exports, {
|
|
25
|
+
EXTENT: () => EXTENT,
|
|
26
|
+
default: () => Transform
|
|
9
27
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var _glMatrix = require("gl-matrix");
|
|
21
|
-
|
|
22
|
-
var _point = _interopRequireDefault(require("../geo/point"));
|
|
23
|
-
|
|
24
|
-
var _util = require("../util");
|
|
25
|
-
|
|
26
|
-
var _edge_insets = _interopRequireDefault(require("./edge_insets"));
|
|
27
|
-
|
|
28
|
-
var _lng_lat = _interopRequireDefault(require("./lng_lat"));
|
|
29
|
-
|
|
30
|
-
var _lng_lat_bounds = _interopRequireDefault(require("./lng_lat_bounds"));
|
|
31
|
-
|
|
32
|
-
var _mercator = _interopRequireWildcard(require("./mercator"));
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
|
-
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; } } }; }
|
|
39
|
-
|
|
40
|
-
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); }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
28
|
+
module.exports = __toCommonJS(transform_exports);
|
|
29
|
+
var import_l7_utils = require("@antv/l7-utils");
|
|
30
|
+
var import_gl_matrix = require("gl-matrix");
|
|
31
|
+
var import_point = __toESM(require("../geo/point"));
|
|
32
|
+
var import_util = require("../util");
|
|
33
|
+
var import_edge_insets = __toESM(require("./edge_insets"));
|
|
34
|
+
var import_lng_lat = __toESM(require("./lng_lat"));
|
|
35
|
+
var import_lng_lat_bounds = __toESM(require("./lng_lat_bounds"));
|
|
36
|
+
var import_mercator = __toESM(require("./mercator"));
|
|
44
37
|
var EXTENT = 8192;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
38
|
+
var Transform = class {
|
|
39
|
+
get minZoom() {
|
|
40
|
+
return this._minZoom;
|
|
41
|
+
}
|
|
42
|
+
set minZoom(zoom) {
|
|
43
|
+
if (this._minZoom === zoom) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this._minZoom = zoom;
|
|
47
|
+
this.zoom = Math.max(this.zoom, zoom);
|
|
48
|
+
}
|
|
49
|
+
get maxZoom() {
|
|
50
|
+
return this._maxZoom;
|
|
51
|
+
}
|
|
52
|
+
set maxZoom(zoom) {
|
|
53
|
+
if (this._maxZoom === zoom) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this._maxZoom = zoom;
|
|
57
|
+
this.zoom = Math.min(this.zoom, zoom);
|
|
58
|
+
}
|
|
59
|
+
get minPitch() {
|
|
60
|
+
return this._minPitch;
|
|
61
|
+
}
|
|
62
|
+
set minPitch(pitch) {
|
|
63
|
+
if (this._minPitch === pitch) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this._minPitch = pitch;
|
|
67
|
+
this._pitch = Math.max(this._pitch, pitch);
|
|
68
|
+
}
|
|
69
|
+
get maxPitch() {
|
|
70
|
+
return this._maxPitch;
|
|
71
|
+
}
|
|
72
|
+
set maxPitch(pitch) {
|
|
73
|
+
if (this._maxPitch === pitch) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this._maxPitch = pitch;
|
|
77
|
+
this._pitch = Math.min(this._pitch, pitch);
|
|
78
|
+
}
|
|
79
|
+
get renderWorldCopies() {
|
|
80
|
+
return this._renderWorldCopies;
|
|
81
|
+
}
|
|
82
|
+
set renderWorldCopies(renderWorldCopies) {
|
|
83
|
+
if (renderWorldCopies === void 0) {
|
|
84
|
+
renderWorldCopies = true;
|
|
85
|
+
} else if (renderWorldCopies === null) {
|
|
86
|
+
renderWorldCopies = false;
|
|
87
|
+
}
|
|
88
|
+
this._renderWorldCopies = renderWorldCopies;
|
|
89
|
+
}
|
|
90
|
+
get worldSize() {
|
|
91
|
+
return this.tileSize * this.scale;
|
|
92
|
+
}
|
|
93
|
+
get centerOffset() {
|
|
94
|
+
return this.centerPoint._sub(this.size._div(2));
|
|
95
|
+
}
|
|
96
|
+
get size() {
|
|
97
|
+
return new import_point.default(this.width, this.height);
|
|
98
|
+
}
|
|
99
|
+
get bearing() {
|
|
100
|
+
return -this.angle / Math.PI * 180;
|
|
101
|
+
}
|
|
102
|
+
set bearing(bearing) {
|
|
103
|
+
const b = -(0, import_util.wrap)(bearing, -180, 180) * Math.PI / 180;
|
|
104
|
+
if (this.angle === b) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.unmodified = false;
|
|
108
|
+
this.angle = b;
|
|
109
|
+
this.calcMatrices();
|
|
110
|
+
this.rotationMatrix = import_gl_matrix.mat2.create();
|
|
111
|
+
import_gl_matrix.mat2.rotate(this.rotationMatrix, this.rotationMatrix, this.angle);
|
|
112
|
+
}
|
|
113
|
+
get pitch() {
|
|
114
|
+
return this._pitch / Math.PI * 180;
|
|
115
|
+
}
|
|
116
|
+
set pitch(pitch) {
|
|
117
|
+
const p = (0, import_util.clamp)(pitch, this._minPitch, this._maxPitch) / 180 * Math.PI;
|
|
118
|
+
if (this._pitch === p) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.unmodified = false;
|
|
122
|
+
this._pitch = p;
|
|
123
|
+
this.calcMatrices();
|
|
124
|
+
}
|
|
125
|
+
get fov() {
|
|
126
|
+
return this._fov / Math.PI * 180;
|
|
127
|
+
}
|
|
128
|
+
set fov(fov) {
|
|
129
|
+
fov = Math.max(0.01, Math.min(60, fov));
|
|
130
|
+
if (this._fov === fov) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.unmodified = false;
|
|
134
|
+
this._fov = fov / 180 * Math.PI;
|
|
135
|
+
this.calcMatrices();
|
|
136
|
+
}
|
|
137
|
+
get zoom() {
|
|
138
|
+
return this._zoom;
|
|
139
|
+
}
|
|
140
|
+
set zoom(zoom) {
|
|
141
|
+
const z = Math.min(Math.max(zoom, this._minZoom), this._maxZoom);
|
|
142
|
+
if (this._zoom === z) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.unmodified = false;
|
|
146
|
+
this._zoom = z;
|
|
147
|
+
this.scale = this.zoomScale(z);
|
|
148
|
+
this.tileZoom = Math.floor(z);
|
|
149
|
+
this.zoomFraction = z - this.tileZoom;
|
|
150
|
+
this.constrain();
|
|
151
|
+
this.calcMatrices();
|
|
152
|
+
}
|
|
153
|
+
get center() {
|
|
154
|
+
return this._center;
|
|
155
|
+
}
|
|
156
|
+
set center(center) {
|
|
157
|
+
if (center.lat === this._center.lat && center.lng === this._center.lng) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.unmodified = false;
|
|
161
|
+
this._center = center;
|
|
162
|
+
this.constrain();
|
|
163
|
+
this.calcMatrices();
|
|
164
|
+
}
|
|
165
|
+
get padding() {
|
|
166
|
+
return this.edgeInsets.toJSON();
|
|
167
|
+
}
|
|
168
|
+
set padding(padding) {
|
|
169
|
+
if (this.edgeInsets.equals(padding)) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.unmodified = false;
|
|
173
|
+
this.edgeInsets.interpolate(this.edgeInsets, padding, 1);
|
|
174
|
+
this.calcMatrices();
|
|
175
|
+
}
|
|
176
|
+
get centerPoint() {
|
|
177
|
+
return this.edgeInsets.getCenter(this.width, this.height);
|
|
178
|
+
}
|
|
179
|
+
get point() {
|
|
180
|
+
return this.project(this.center);
|
|
181
|
+
}
|
|
182
|
+
constructor(minZoom, maxZoom, minPitch, maxPitch, renderWorldCopies) {
|
|
85
183
|
this.tileSize = 512;
|
|
86
184
|
this.maxValidLatitude = 85.051129;
|
|
87
|
-
this._renderWorldCopies = renderWorldCopies ===
|
|
185
|
+
this._renderWorldCopies = renderWorldCopies === void 0 ? true : renderWorldCopies;
|
|
88
186
|
this._minZoom = minZoom || 0;
|
|
89
187
|
this._maxZoom = maxZoom || 22;
|
|
90
|
-
this._minPitch = minPitch ===
|
|
91
|
-
this._maxPitch = maxPitch ===
|
|
188
|
+
this._minPitch = minPitch === void 0 || minPitch === null ? 0 : minPitch;
|
|
189
|
+
this._maxPitch = maxPitch === void 0 || maxPitch === null ? 60 : maxPitch;
|
|
92
190
|
this.setMaxBounds();
|
|
93
191
|
this.width = 0;
|
|
94
192
|
this.height = 0;
|
|
95
|
-
this._center = new
|
|
193
|
+
this._center = new import_lng_lat.default(0, 0);
|
|
96
194
|
this.zoom = 0;
|
|
97
195
|
this.angle = 0;
|
|
98
196
|
this._fov = 0.6435011087932844;
|
|
99
197
|
this._pitch = 0;
|
|
100
198
|
this.unmodified = true;
|
|
101
|
-
this.edgeInsets = new
|
|
199
|
+
this.edgeInsets = new import_edge_insets.default();
|
|
102
200
|
this.posMatrixCache = {};
|
|
103
201
|
this.alignedPosMatrixCache = {};
|
|
104
202
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
set: function set(renderWorldCopies) {
|
|
164
|
-
if (renderWorldCopies === undefined) {
|
|
165
|
-
renderWorldCopies = true;
|
|
166
|
-
} else if (renderWorldCopies === null) {
|
|
167
|
-
renderWorldCopies = false;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
this._renderWorldCopies = renderWorldCopies;
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "worldSize",
|
|
174
|
-
get: function get() {
|
|
175
|
-
return this.tileSize * this.scale;
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
key: "centerOffset",
|
|
179
|
-
get: function get() {
|
|
180
|
-
return this.centerPoint._sub(this.size._div(2));
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "size",
|
|
184
|
-
get: function get() {
|
|
185
|
-
return new _point.default(this.width, this.height);
|
|
186
|
-
}
|
|
187
|
-
}, {
|
|
188
|
-
key: "bearing",
|
|
189
|
-
get: function get() {
|
|
190
|
-
return -this.angle / Math.PI * 180;
|
|
191
|
-
},
|
|
192
|
-
set: function set(bearing) {
|
|
193
|
-
var b = -(0, _util.wrap)(bearing, -180, 180) * Math.PI / 180;
|
|
194
|
-
|
|
195
|
-
if (this.angle === b) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
this.unmodified = false;
|
|
200
|
-
this.angle = b;
|
|
201
|
-
this.calcMatrices();
|
|
202
|
-
this.rotationMatrix = _glMatrix.mat2.create();
|
|
203
|
-
|
|
204
|
-
_glMatrix.mat2.rotate(this.rotationMatrix, this.rotationMatrix, this.angle);
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
key: "pitch",
|
|
208
|
-
get: function get() {
|
|
209
|
-
return this._pitch / Math.PI * 180;
|
|
210
|
-
},
|
|
211
|
-
set: function set(pitch) {
|
|
212
|
-
var p = (0, _util.clamp)(pitch, this._minPitch, this._maxPitch) / 180 * Math.PI;
|
|
213
|
-
|
|
214
|
-
if (this._pitch === p) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
this.unmodified = false;
|
|
219
|
-
this._pitch = p;
|
|
220
|
-
this.calcMatrices();
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
key: "fov",
|
|
224
|
-
get: function get() {
|
|
225
|
-
return this._fov / Math.PI * 180;
|
|
226
|
-
},
|
|
227
|
-
set: function set(fov) {
|
|
228
|
-
fov = Math.max(0.01, Math.min(60, fov));
|
|
229
|
-
|
|
230
|
-
if (this._fov === fov) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
this.unmodified = false;
|
|
235
|
-
this._fov = fov / 180 * Math.PI;
|
|
236
|
-
this.calcMatrices();
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "zoom",
|
|
240
|
-
get: function get() {
|
|
241
|
-
return this._zoom;
|
|
242
|
-
},
|
|
243
|
-
set: function set(zoom) {
|
|
244
|
-
var z = Math.min(Math.max(zoom, this._minZoom), this._maxZoom);
|
|
245
|
-
|
|
246
|
-
if (this._zoom === z) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
this.unmodified = false;
|
|
251
|
-
this._zoom = z;
|
|
252
|
-
this.scale = this.zoomScale(z);
|
|
253
|
-
this.tileZoom = Math.floor(z);
|
|
254
|
-
this.zoomFraction = z - this.tileZoom;
|
|
255
|
-
this.constrain();
|
|
256
|
-
this.calcMatrices();
|
|
257
|
-
}
|
|
258
|
-
}, {
|
|
259
|
-
key: "center",
|
|
260
|
-
get: function get() {
|
|
261
|
-
return this._center;
|
|
262
|
-
},
|
|
263
|
-
set: function set(center) {
|
|
264
|
-
if (center.lat === this._center.lat && center.lng === this._center.lng) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
this.unmodified = false;
|
|
269
|
-
this._center = center;
|
|
270
|
-
this.constrain();
|
|
271
|
-
this.calcMatrices();
|
|
272
|
-
}
|
|
273
|
-
}, {
|
|
274
|
-
key: "padding",
|
|
275
|
-
get: function get() {
|
|
276
|
-
return this.edgeInsets.toJSON();
|
|
277
|
-
},
|
|
278
|
-
set: function set(padding) {
|
|
279
|
-
if (this.edgeInsets.equals(padding)) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
this.unmodified = false;
|
|
284
|
-
this.edgeInsets.interpolate(this.edgeInsets, padding, 1);
|
|
285
|
-
this.calcMatrices();
|
|
286
|
-
}
|
|
287
|
-
}, {
|
|
288
|
-
key: "centerPoint",
|
|
289
|
-
get: function get() {
|
|
290
|
-
return this.edgeInsets.getCenter(this.width, this.height);
|
|
291
|
-
}
|
|
292
|
-
}, {
|
|
293
|
-
key: "point",
|
|
294
|
-
get: function get() {
|
|
295
|
-
return this.project(this.center);
|
|
296
|
-
}
|
|
297
|
-
}, {
|
|
298
|
-
key: "clone",
|
|
299
|
-
value: function clone() {
|
|
300
|
-
var clone = new Transform(this._minZoom, this._maxZoom, this._minPitch, this._maxPitch, this._renderWorldCopies);
|
|
301
|
-
clone.tileSize = this.tileSize;
|
|
302
|
-
clone.latRange = this.latRange;
|
|
303
|
-
clone.width = this.width;
|
|
304
|
-
clone.height = this.height;
|
|
305
|
-
clone.center = this._center;
|
|
306
|
-
clone.zoom = this.zoom;
|
|
307
|
-
clone.angle = this.angle;
|
|
308
|
-
clone.fov = this._fov;
|
|
309
|
-
clone.pitch = this._pitch;
|
|
310
|
-
clone.unmodified = this.unmodified;
|
|
311
|
-
clone.edgeInsets = this.edgeInsets.clone();
|
|
312
|
-
clone.calcMatrices();
|
|
313
|
-
return clone;
|
|
314
|
-
}
|
|
315
|
-
}, {
|
|
316
|
-
key: "isPaddingEqual",
|
|
317
|
-
value: function isPaddingEqual(padding) {
|
|
318
|
-
return this.edgeInsets.equals(padding);
|
|
319
|
-
}
|
|
320
|
-
}, {
|
|
321
|
-
key: "interpolatePadding",
|
|
322
|
-
value: function interpolatePadding(start, target, t) {
|
|
323
|
-
this.unmodified = false;
|
|
324
|
-
this.edgeInsets.interpolate(start, target, t);
|
|
325
|
-
this.constrain();
|
|
326
|
-
this.calcMatrices();
|
|
203
|
+
clone() {
|
|
204
|
+
const clone = new Transform(this._minZoom, this._maxZoom, this._minPitch, this._maxPitch, this._renderWorldCopies);
|
|
205
|
+
clone.tileSize = this.tileSize;
|
|
206
|
+
clone.latRange = this.latRange;
|
|
207
|
+
clone.width = this.width;
|
|
208
|
+
clone.height = this.height;
|
|
209
|
+
clone.center = this._center;
|
|
210
|
+
clone.zoom = this.zoom;
|
|
211
|
+
clone.angle = this.angle;
|
|
212
|
+
clone.fov = this._fov;
|
|
213
|
+
clone.pitch = this._pitch;
|
|
214
|
+
clone.unmodified = this.unmodified;
|
|
215
|
+
clone.edgeInsets = this.edgeInsets.clone();
|
|
216
|
+
clone.calcMatrices();
|
|
217
|
+
return clone;
|
|
218
|
+
}
|
|
219
|
+
isPaddingEqual(padding) {
|
|
220
|
+
return this.edgeInsets.equals(padding);
|
|
221
|
+
}
|
|
222
|
+
interpolatePadding(start, target, t) {
|
|
223
|
+
this.unmodified = false;
|
|
224
|
+
this.edgeInsets.interpolate(start, target, t);
|
|
225
|
+
this.constrain();
|
|
226
|
+
this.calcMatrices();
|
|
227
|
+
}
|
|
228
|
+
coveringZoomLevel(options) {
|
|
229
|
+
const z = (options.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / options.tileSize));
|
|
230
|
+
return Math.max(0, z);
|
|
231
|
+
}
|
|
232
|
+
resize(width, height) {
|
|
233
|
+
this.width = width;
|
|
234
|
+
this.height = height;
|
|
235
|
+
this.pixelsToGLUnits = [2 / width, -2 / height];
|
|
236
|
+
this.constrain();
|
|
237
|
+
this.calcMatrices();
|
|
238
|
+
}
|
|
239
|
+
zoomScale(zoom) {
|
|
240
|
+
return Math.pow(2, zoom);
|
|
241
|
+
}
|
|
242
|
+
scaleZoom(scale) {
|
|
243
|
+
return Math.log(scale) / Math.LN2;
|
|
244
|
+
}
|
|
245
|
+
project(lnglat) {
|
|
246
|
+
const lat = (0, import_util.clamp)(lnglat.lat, -this.maxValidLatitude, this.maxValidLatitude);
|
|
247
|
+
return new import_point.default((0, import_mercator.mercatorXfromLng)(lnglat.lng) * this.worldSize, (0, import_mercator.mercatorYfromLat)(lat) * this.worldSize);
|
|
248
|
+
}
|
|
249
|
+
unproject(point) {
|
|
250
|
+
return new import_mercator.default(point.x / this.worldSize, point.y / this.worldSize).toLngLat();
|
|
251
|
+
}
|
|
252
|
+
setLocationAtPoint(lnglat, point) {
|
|
253
|
+
const a = this.pointCoordinate(point);
|
|
254
|
+
const b = this.pointCoordinate(this.centerPoint);
|
|
255
|
+
const loc = this.locationCoordinate(lnglat);
|
|
256
|
+
const newCenter = new import_mercator.default(loc.x - (a.x - b.x), loc.y - (a.y - b.y));
|
|
257
|
+
this.center = this.coordinateLocation(newCenter);
|
|
258
|
+
if (this._renderWorldCopies) {
|
|
259
|
+
this.center = this.center.wrap();
|
|
327
260
|
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
261
|
+
}
|
|
262
|
+
pointCoordinate(p) {
|
|
263
|
+
const targetZ = 0;
|
|
264
|
+
const coord0 = new Float64Array([p.x, p.y, 0, 1]);
|
|
265
|
+
const coord1 = new Float64Array([p.x, p.y, 1, 1]);
|
|
266
|
+
import_gl_matrix.vec4.transformMat4(coord0, coord0, this.pixelMatrixInverse);
|
|
267
|
+
import_gl_matrix.vec4.transformMat4(coord1, coord1, this.pixelMatrixInverse);
|
|
268
|
+
const w0 = coord0[3];
|
|
269
|
+
const w1 = coord1[3];
|
|
270
|
+
const x0 = coord0[0] / w0;
|
|
271
|
+
const x1 = coord1[0] / w1;
|
|
272
|
+
const y0 = coord0[1] / w0;
|
|
273
|
+
const y1 = coord1[1] / w1;
|
|
274
|
+
const z0 = coord0[2] / w0;
|
|
275
|
+
const z1 = coord1[2] / w1;
|
|
276
|
+
const t = z0 === z1 ? 0 : (targetZ - z0) / (z1 - z0);
|
|
277
|
+
return new import_mercator.default((0, import_util.interpolate)(x0, x1, t) / this.worldSize, (0, import_util.interpolate)(y0, y1, t) / this.worldSize);
|
|
278
|
+
}
|
|
279
|
+
getBounds() {
|
|
280
|
+
return new import_lng_lat_bounds.default().extend(this.pointLocation(new import_point.default(0, 0))).extend(this.pointLocation(new import_point.default(this.width, 0))).extend(this.pointLocation(new import_point.default(this.width, this.height))).extend(this.pointLocation(new import_point.default(0, this.height)));
|
|
281
|
+
}
|
|
282
|
+
getMaxBounds() {
|
|
283
|
+
if (!this.latRange || this.latRange.length !== 2 || !this.lngRange || this.lngRange.length !== 2) {
|
|
284
|
+
return null;
|
|
333
285
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
286
|
+
return new import_lng_lat_bounds.default([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]);
|
|
287
|
+
}
|
|
288
|
+
setMaxBounds(bounds) {
|
|
289
|
+
if (bounds) {
|
|
290
|
+
this.lngRange = [bounds.getWest(), bounds.getEast()];
|
|
291
|
+
this.latRange = [bounds.getSouth(), bounds.getNorth()];
|
|
340
292
|
this.constrain();
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
key: "zoomScale",
|
|
345
|
-
value: function zoomScale(zoom) {
|
|
346
|
-
return Math.pow(2, zoom);
|
|
347
|
-
}
|
|
348
|
-
}, {
|
|
349
|
-
key: "scaleZoom",
|
|
350
|
-
value: function scaleZoom(scale) {
|
|
351
|
-
return Math.log(scale) / Math.LN2;
|
|
352
|
-
}
|
|
353
|
-
}, {
|
|
354
|
-
key: "project",
|
|
355
|
-
value: function project(lnglat) {
|
|
356
|
-
var lat = (0, _util.clamp)(lnglat.lat, -this.maxValidLatitude, this.maxValidLatitude);
|
|
357
|
-
return new _point.default((0, _mercator.mercatorXfromLng)(lnglat.lng) * this.worldSize, (0, _mercator.mercatorYfromLat)(lat) * this.worldSize);
|
|
358
|
-
}
|
|
359
|
-
}, {
|
|
360
|
-
key: "unproject",
|
|
361
|
-
value: function unproject(point) {
|
|
362
|
-
return new _mercator.default(point.x / this.worldSize, point.y / this.worldSize).toLngLat();
|
|
293
|
+
} else {
|
|
294
|
+
this.lngRange = void 0;
|
|
295
|
+
this.latRange = [-this.maxValidLatitude, this.maxValidLatitude];
|
|
363
296
|
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
value: function getBounds() {
|
|
402
|
-
return new _lng_lat_bounds.default().extend(this.pointLocation(new _point.default(0, 0))).extend(this.pointLocation(new _point.default(this.width, 0))).extend(this.pointLocation(new _point.default(this.width, this.height))).extend(this.pointLocation(new _point.default(0, this.height)));
|
|
403
|
-
}
|
|
404
|
-
}, {
|
|
405
|
-
key: "getMaxBounds",
|
|
406
|
-
value: function getMaxBounds() {
|
|
407
|
-
if (!this.latRange || this.latRange.length !== 2 || !this.lngRange || this.lngRange.length !== 2) {
|
|
408
|
-
return null;
|
|
297
|
+
}
|
|
298
|
+
customLayerMatrix() {
|
|
299
|
+
return this.mercatorMatrix.slice();
|
|
300
|
+
}
|
|
301
|
+
maxPitchScaleFactor() {
|
|
302
|
+
if (!this.pixelMatrixInverse) {
|
|
303
|
+
return 1;
|
|
304
|
+
}
|
|
305
|
+
const coord = this.pointCoordinate(new import_point.default(0, 0));
|
|
306
|
+
const p = new Float32Array([
|
|
307
|
+
coord.x * this.worldSize,
|
|
308
|
+
coord.y * this.worldSize,
|
|
309
|
+
0,
|
|
310
|
+
1
|
|
311
|
+
]);
|
|
312
|
+
const topPoint = import_gl_matrix.vec4.transformMat4(p, p, this.pixelMatrix);
|
|
313
|
+
return topPoint[3] / this.cameraToCenterDistance;
|
|
314
|
+
}
|
|
315
|
+
getCameraPoint() {
|
|
316
|
+
const pitch = this._pitch;
|
|
317
|
+
const yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);
|
|
318
|
+
return this.centerPoint.add(new import_point.default(0, yOffset));
|
|
319
|
+
}
|
|
320
|
+
getCameraQueryGeometry(queryGeometry) {
|
|
321
|
+
const c = this.getCameraPoint();
|
|
322
|
+
if (queryGeometry.length === 1) {
|
|
323
|
+
return [queryGeometry[0], c];
|
|
324
|
+
} else {
|
|
325
|
+
let minX = c.x;
|
|
326
|
+
let minY = c.y;
|
|
327
|
+
let maxX = c.x;
|
|
328
|
+
let maxY = c.y;
|
|
329
|
+
for (const p of queryGeometry) {
|
|
330
|
+
minX = Math.min(minX, p.x);
|
|
331
|
+
minY = Math.min(minY, p.y);
|
|
332
|
+
maxX = Math.max(maxX, p.x);
|
|
333
|
+
maxY = Math.max(maxY, p.y);
|
|
409
334
|
}
|
|
410
|
-
|
|
411
|
-
|
|
335
|
+
return [
|
|
336
|
+
new import_point.default(minX, minY),
|
|
337
|
+
new import_point.default(maxX, minY),
|
|
338
|
+
new import_point.default(maxX, maxY),
|
|
339
|
+
new import_point.default(minX, maxY),
|
|
340
|
+
new import_point.default(minX, minY)
|
|
341
|
+
];
|
|
412
342
|
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
343
|
+
}
|
|
344
|
+
coordinatePoint(coord) {
|
|
345
|
+
const p = import_gl_matrix.vec4.fromValues(coord.x * this.worldSize, coord.y * this.worldSize, 0, 1);
|
|
346
|
+
import_gl_matrix.vec4.transformMat4(p, p, this.pixelMatrix);
|
|
347
|
+
return new import_point.default(p[0] / p[3], p[1] / p[3]);
|
|
348
|
+
}
|
|
349
|
+
locationPoint(lnglat) {
|
|
350
|
+
return this.coordinatePoint(this.locationCoordinate(lnglat));
|
|
351
|
+
}
|
|
352
|
+
pointLocation(p) {
|
|
353
|
+
return this.coordinateLocation(this.pointCoordinate(p));
|
|
354
|
+
}
|
|
355
|
+
locationCoordinate(lnglat) {
|
|
356
|
+
return import_mercator.default.fromLngLat(lnglat);
|
|
357
|
+
}
|
|
358
|
+
coordinateLocation(coord) {
|
|
359
|
+
return coord.toLngLat();
|
|
360
|
+
}
|
|
361
|
+
getProjectionMatrix() {
|
|
362
|
+
return this.projMatrix;
|
|
363
|
+
}
|
|
364
|
+
constrain() {
|
|
365
|
+
if (!this.center || !this.width || !this.height || this.constraining) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
this.constraining = true;
|
|
369
|
+
let minY = -90;
|
|
370
|
+
let maxY = 90;
|
|
371
|
+
let minX = -180;
|
|
372
|
+
let maxX = 180;
|
|
373
|
+
let sy;
|
|
374
|
+
let sx;
|
|
375
|
+
let x2;
|
|
376
|
+
let y2;
|
|
377
|
+
const size = this.size;
|
|
378
|
+
const unmodified = this.unmodified;
|
|
379
|
+
if (this.latRange) {
|
|
380
|
+
const latRange = this.latRange;
|
|
381
|
+
minY = (0, import_mercator.mercatorYfromLat)(latRange[1]) * this.worldSize;
|
|
382
|
+
maxY = (0, import_mercator.mercatorYfromLat)(latRange[0]) * this.worldSize;
|
|
383
|
+
sy = maxY - minY < size.y ? size.y / (maxY - minY) : 0;
|
|
384
|
+
}
|
|
385
|
+
if (this.lngRange) {
|
|
386
|
+
const lngRange = this.lngRange;
|
|
387
|
+
minX = (0, import_mercator.mercatorXfromLng)(lngRange[0]) * this.worldSize;
|
|
388
|
+
maxX = (0, import_mercator.mercatorXfromLng)(lngRange[1]) * this.worldSize;
|
|
389
|
+
sx = maxX - minX < size.x ? size.x / (maxX - minX) : 0;
|
|
390
|
+
}
|
|
391
|
+
const point = this.point;
|
|
392
|
+
const s = Math.max(sx || 0, sy || 0);
|
|
393
|
+
if (s) {
|
|
394
|
+
this.center = this.unproject(new import_point.default(sx ? (maxX + minX) / 2 : point.x, sy ? (maxY + minY) / 2 : point.y));
|
|
395
|
+
if (import_l7_utils.isMini) {
|
|
396
|
+
this.zoom = Math.max(this.zoom, Math.max(-1, this.minZoom));
|
|
420
397
|
} else {
|
|
421
|
-
this.
|
|
422
|
-
this.latRange = [-this.maxValidLatitude, this.maxValidLatitude];
|
|
398
|
+
this.zoom += this.scaleZoom(s);
|
|
423
399
|
}
|
|
400
|
+
this.unmodified = unmodified;
|
|
401
|
+
this.constraining = false;
|
|
402
|
+
return;
|
|
424
403
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}, {
|
|
431
|
-
key: "maxPitchScaleFactor",
|
|
432
|
-
value: function maxPitchScaleFactor() {
|
|
433
|
-
if (!this.pixelMatrixInverse) {
|
|
434
|
-
return 1;
|
|
404
|
+
if (this.latRange) {
|
|
405
|
+
const y = point.y;
|
|
406
|
+
const h2 = size.y / 2;
|
|
407
|
+
if (y - h2 < minY) {
|
|
408
|
+
y2 = minY + h2;
|
|
435
409
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
var p = new Float32Array([coord.x * this.worldSize, coord.y * this.worldSize, 0, 1]);
|
|
439
|
-
|
|
440
|
-
var topPoint = _glMatrix.vec4.transformMat4(p, p, this.pixelMatrix);
|
|
441
|
-
|
|
442
|
-
return topPoint[3] / this.cameraToCenterDistance;
|
|
443
|
-
}
|
|
444
|
-
}, {
|
|
445
|
-
key: "getCameraPoint",
|
|
446
|
-
value: function getCameraPoint() {
|
|
447
|
-
var pitch = this._pitch;
|
|
448
|
-
var yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);
|
|
449
|
-
return this.centerPoint.add(new _point.default(0, yOffset));
|
|
450
|
-
}
|
|
451
|
-
}, {
|
|
452
|
-
key: "getCameraQueryGeometry",
|
|
453
|
-
value: function getCameraQueryGeometry(queryGeometry) {
|
|
454
|
-
var c = this.getCameraPoint();
|
|
455
|
-
|
|
456
|
-
if (queryGeometry.length === 1) {
|
|
457
|
-
return [queryGeometry[0], c];
|
|
458
|
-
} else {
|
|
459
|
-
var minX = c.x;
|
|
460
|
-
var minY = c.y;
|
|
461
|
-
var maxX = c.x;
|
|
462
|
-
var maxY = c.y;
|
|
463
|
-
|
|
464
|
-
var _iterator = _createForOfIteratorHelper(queryGeometry),
|
|
465
|
-
_step;
|
|
466
|
-
|
|
467
|
-
try {
|
|
468
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
469
|
-
var p = _step.value;
|
|
470
|
-
minX = Math.min(minX, p.x);
|
|
471
|
-
minY = Math.min(minY, p.y);
|
|
472
|
-
maxX = Math.max(maxX, p.x);
|
|
473
|
-
maxY = Math.max(maxY, p.y);
|
|
474
|
-
}
|
|
475
|
-
} catch (err) {
|
|
476
|
-
_iterator.e(err);
|
|
477
|
-
} finally {
|
|
478
|
-
_iterator.f();
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
return [new _point.default(minX, minY), new _point.default(maxX, minY), new _point.default(maxX, maxY), new _point.default(minX, maxY), new _point.default(minX, minY)];
|
|
410
|
+
if (y + h2 > maxY) {
|
|
411
|
+
y2 = maxY - h2;
|
|
482
412
|
}
|
|
483
413
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
_glMatrix.vec4.transformMat4(p, p, this.pixelMatrix);
|
|
490
|
-
|
|
491
|
-
return new _point.default(p[0] / p[3], p[1] / p[3]);
|
|
492
|
-
}
|
|
493
|
-
}, {
|
|
494
|
-
key: "locationPoint",
|
|
495
|
-
value: function locationPoint(lnglat) {
|
|
496
|
-
return this.coordinatePoint(this.locationCoordinate(lnglat));
|
|
497
|
-
}
|
|
498
|
-
}, {
|
|
499
|
-
key: "pointLocation",
|
|
500
|
-
value: function pointLocation(p) {
|
|
501
|
-
return this.coordinateLocation(this.pointCoordinate(p));
|
|
502
|
-
}
|
|
503
|
-
}, {
|
|
504
|
-
key: "locationCoordinate",
|
|
505
|
-
value: function locationCoordinate(lnglat) {
|
|
506
|
-
return _mercator.default.fromLngLat(lnglat);
|
|
507
|
-
}
|
|
508
|
-
}, {
|
|
509
|
-
key: "coordinateLocation",
|
|
510
|
-
value: function coordinateLocation(coord) {
|
|
511
|
-
return coord.toLngLat();
|
|
512
|
-
}
|
|
513
|
-
}, {
|
|
514
|
-
key: "getProjectionMatrix",
|
|
515
|
-
value: function getProjectionMatrix() {
|
|
516
|
-
return this.projMatrix;
|
|
517
|
-
}
|
|
518
|
-
}, {
|
|
519
|
-
key: "constrain",
|
|
520
|
-
value: function constrain() {
|
|
521
|
-
if (!this.center || !this.width || !this.height || this.constraining) {
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
this.constraining = true;
|
|
526
|
-
var minY = -90;
|
|
527
|
-
var maxY = 90;
|
|
528
|
-
var minX = -180;
|
|
529
|
-
var maxX = 180;
|
|
530
|
-
var sy;
|
|
531
|
-
var sx;
|
|
532
|
-
var x2;
|
|
533
|
-
var y2;
|
|
534
|
-
var size = this.size;
|
|
535
|
-
var unmodified = this.unmodified;
|
|
536
|
-
|
|
537
|
-
if (this.latRange) {
|
|
538
|
-
var latRange = this.latRange;
|
|
539
|
-
minY = (0, _mercator.mercatorYfromLat)(latRange[1]) * this.worldSize;
|
|
540
|
-
maxY = (0, _mercator.mercatorYfromLat)(latRange[0]) * this.worldSize;
|
|
541
|
-
sy = maxY - minY < size.y ? size.y / (maxY - minY) : 0;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
if (this.lngRange) {
|
|
545
|
-
var lngRange = this.lngRange;
|
|
546
|
-
minX = (0, _mercator.mercatorXfromLng)(lngRange[0]) * this.worldSize;
|
|
547
|
-
maxX = (0, _mercator.mercatorXfromLng)(lngRange[1]) * this.worldSize;
|
|
548
|
-
sx = maxX - minX < size.x ? size.x / (maxX - minX) : 0;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
var point = this.point;
|
|
552
|
-
var s = Math.max(sx || 0, sy || 0);
|
|
553
|
-
|
|
554
|
-
if (s) {
|
|
555
|
-
this.center = this.unproject(new _point.default(sx ? (maxX + minX) / 2 : point.x, sy ? (maxY + minY) / 2 : point.y));
|
|
556
|
-
|
|
557
|
-
if (_l7Utils.isMini) {
|
|
558
|
-
this.zoom = Math.max(this.zoom, Math.max(-1, this.minZoom));
|
|
559
|
-
} else {
|
|
560
|
-
this.zoom += this.scaleZoom(s);
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
this.unmodified = unmodified;
|
|
564
|
-
this.constraining = false;
|
|
565
|
-
return;
|
|
414
|
+
if (this.lngRange) {
|
|
415
|
+
const x = point.x;
|
|
416
|
+
const w2 = size.x / 2;
|
|
417
|
+
if (x - w2 < minX) {
|
|
418
|
+
x2 = minX + w2;
|
|
566
419
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var y = point.y;
|
|
570
|
-
var h2 = size.y / 2;
|
|
571
|
-
|
|
572
|
-
if (y - h2 < minY) {
|
|
573
|
-
y2 = minY + h2;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
if (y + h2 > maxY) {
|
|
577
|
-
y2 = maxY - h2;
|
|
578
|
-
}
|
|
420
|
+
if (x + w2 > maxX) {
|
|
421
|
+
x2 = maxX - w2;
|
|
579
422
|
}
|
|
580
|
-
|
|
581
|
-
if (this.lngRange) {
|
|
582
|
-
var x = point.x;
|
|
583
|
-
var w2 = size.x / 2;
|
|
584
|
-
|
|
585
|
-
if (x - w2 < minX) {
|
|
586
|
-
x2 = minX + w2;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
if (x + w2 > maxX) {
|
|
590
|
-
x2 = maxX - w2;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
if (x2 !== undefined || y2 !== undefined) {
|
|
595
|
-
this.center = this.unproject(new _point.default(x2 !== undefined ? x2 : point.x, y2 !== undefined ? y2 : point.y));
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
this.unmodified = unmodified;
|
|
599
|
-
this.constraining = false;
|
|
600
423
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
value: function calcMatrices() {
|
|
604
|
-
if (!this.height) {
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
var halfFov = this._fov / 2;
|
|
609
|
-
var offset = this.centerOffset;
|
|
610
|
-
this.cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this.height;
|
|
611
|
-
var groundAngle = Math.PI / 2 + this._pitch;
|
|
612
|
-
var fovAboveCenter = this._fov * (0.5 + offset.y / this.height);
|
|
613
|
-
var topHalfSurfaceDistance = Math.sin(fovAboveCenter) * this.cameraToCenterDistance / Math.sin((0, _util.clamp)(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));
|
|
614
|
-
var point = this.point;
|
|
615
|
-
var x = point.x;
|
|
616
|
-
var y = point.y;
|
|
617
|
-
var furthestDistance = Math.cos(Math.PI / 2 - this._pitch) * topHalfSurfaceDistance + this.cameraToCenterDistance;
|
|
618
|
-
var farZ = furthestDistance * 1.01;
|
|
619
|
-
var nearZ = this.height / 50;
|
|
620
|
-
var m = new Float64Array(16);
|
|
621
|
-
|
|
622
|
-
_glMatrix.mat4.perspective(m, this._fov, this.width / this.height, nearZ, farZ);
|
|
623
|
-
|
|
624
|
-
m[8] = -offset.x * 2 / this.width;
|
|
625
|
-
m[9] = offset.y * 2 / this.height;
|
|
626
|
-
|
|
627
|
-
_glMatrix.mat4.scale(m, m, [1, -1, 1]);
|
|
628
|
-
|
|
629
|
-
_glMatrix.mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]);
|
|
630
|
-
|
|
631
|
-
_glMatrix.mat4.rotateX(m, m, this._pitch);
|
|
632
|
-
|
|
633
|
-
_glMatrix.mat4.rotateZ(m, m, this.angle);
|
|
634
|
-
|
|
635
|
-
_glMatrix.mat4.translate(m, m, [-x, -y, 0]);
|
|
636
|
-
|
|
637
|
-
this.mercatorMatrix = _glMatrix.mat4.scale([], m, [this.worldSize, this.worldSize, this.worldSize]);
|
|
638
|
-
|
|
639
|
-
_glMatrix.mat4.scale(m, m, [1, 1, (0, _mercator.mercatorZfromAltitude)(1, this.center.lat) * this.worldSize, 1]);
|
|
640
|
-
|
|
641
|
-
this.projMatrix = m;
|
|
642
|
-
this.invProjMatrix = _glMatrix.mat4.invert([], this.projMatrix);
|
|
643
|
-
var xShift = this.width % 2 / 2;
|
|
644
|
-
var yShift = this.height % 2 / 2;
|
|
645
|
-
var angleCos = Math.cos(this.angle);
|
|
646
|
-
var angleSin = Math.sin(this.angle);
|
|
647
|
-
var dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift;
|
|
648
|
-
var dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift;
|
|
649
|
-
var alignedM = new Float64Array(m);
|
|
650
|
-
|
|
651
|
-
_glMatrix.mat4.translate(alignedM, alignedM, [dx > 0.5 ? dx - 1 : dx, dy > 0.5 ? dy - 1 : dy, 0]);
|
|
652
|
-
|
|
653
|
-
this.alignedProjMatrix = alignedM;
|
|
654
|
-
m = _glMatrix.mat4.create();
|
|
655
|
-
|
|
656
|
-
_glMatrix.mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]);
|
|
657
|
-
|
|
658
|
-
_glMatrix.mat4.translate(m, m, [1, -1, 0]);
|
|
659
|
-
|
|
660
|
-
this.labelPlaneMatrix = m;
|
|
661
|
-
m = _glMatrix.mat4.create();
|
|
662
|
-
|
|
663
|
-
_glMatrix.mat4.scale(m, m, [1, -1, 1]);
|
|
664
|
-
|
|
665
|
-
_glMatrix.mat4.translate(m, m, [-1, -1, 0]);
|
|
666
|
-
|
|
667
|
-
_glMatrix.mat4.scale(m, m, [2 / this.width, 2 / this.height, 1]);
|
|
668
|
-
|
|
669
|
-
this.glCoordMatrix = m;
|
|
670
|
-
this.pixelMatrix = _glMatrix.mat4.multiply(new Float64Array(16), this.labelPlaneMatrix, this.projMatrix);
|
|
671
|
-
m = _glMatrix.mat4.invert(new Float64Array(16), this.pixelMatrix);
|
|
672
|
-
|
|
673
|
-
if (!m) {
|
|
674
|
-
throw new Error('failed to invert matrix');
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
this.pixelMatrixInverse = m;
|
|
678
|
-
this.posMatrixCache = {};
|
|
679
|
-
this.alignedPosMatrixCache = {};
|
|
424
|
+
if (x2 !== void 0 || y2 !== void 0) {
|
|
425
|
+
this.center = this.unproject(new import_point.default(x2 !== void 0 ? x2 : point.x, y2 !== void 0 ? y2 : point.y));
|
|
680
426
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
427
|
+
this.unmodified = unmodified;
|
|
428
|
+
this.constraining = false;
|
|
429
|
+
}
|
|
430
|
+
calcMatrices() {
|
|
431
|
+
if (!this.height) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const halfFov = this._fov / 2;
|
|
435
|
+
const offset = this.centerOffset;
|
|
436
|
+
this.cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this.height;
|
|
437
|
+
const groundAngle = Math.PI / 2 + this._pitch;
|
|
438
|
+
const fovAboveCenter = this._fov * (0.5 + offset.y / this.height);
|
|
439
|
+
const topHalfSurfaceDistance = Math.sin(fovAboveCenter) * this.cameraToCenterDistance / Math.sin((0, import_util.clamp)(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));
|
|
440
|
+
const point = this.point;
|
|
441
|
+
const x = point.x;
|
|
442
|
+
const y = point.y;
|
|
443
|
+
const furthestDistance = Math.cos(Math.PI / 2 - this._pitch) * topHalfSurfaceDistance + this.cameraToCenterDistance;
|
|
444
|
+
const farZ = furthestDistance * 1.01;
|
|
445
|
+
const nearZ = this.height / 50;
|
|
446
|
+
let m = new Float64Array(16);
|
|
447
|
+
import_gl_matrix.mat4.perspective(m, this._fov, this.width / this.height, nearZ, farZ);
|
|
448
|
+
m[8] = -offset.x * 2 / this.width;
|
|
449
|
+
m[9] = offset.y * 2 / this.height;
|
|
450
|
+
import_gl_matrix.mat4.scale(m, m, [1, -1, 1]);
|
|
451
|
+
import_gl_matrix.mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]);
|
|
452
|
+
import_gl_matrix.mat4.rotateX(m, m, this._pitch);
|
|
453
|
+
import_gl_matrix.mat4.rotateZ(m, m, this.angle);
|
|
454
|
+
import_gl_matrix.mat4.translate(m, m, [-x, -y, 0]);
|
|
455
|
+
this.mercatorMatrix = import_gl_matrix.mat4.scale([], m, [
|
|
456
|
+
this.worldSize,
|
|
457
|
+
this.worldSize,
|
|
458
|
+
this.worldSize
|
|
459
|
+
]);
|
|
460
|
+
import_gl_matrix.mat4.scale(m, m, [
|
|
461
|
+
1,
|
|
462
|
+
1,
|
|
463
|
+
(0, import_mercator.mercatorZfromAltitude)(1, this.center.lat) * this.worldSize,
|
|
464
|
+
1
|
|
465
|
+
]);
|
|
466
|
+
this.projMatrix = m;
|
|
467
|
+
this.invProjMatrix = import_gl_matrix.mat4.invert([], this.projMatrix);
|
|
468
|
+
const xShift = this.width % 2 / 2;
|
|
469
|
+
const yShift = this.height % 2 / 2;
|
|
470
|
+
const angleCos = Math.cos(this.angle);
|
|
471
|
+
const angleSin = Math.sin(this.angle);
|
|
472
|
+
const dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift;
|
|
473
|
+
const dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift;
|
|
474
|
+
const alignedM = new Float64Array(m);
|
|
475
|
+
import_gl_matrix.mat4.translate(alignedM, alignedM, [
|
|
476
|
+
dx > 0.5 ? dx - 1 : dx,
|
|
477
|
+
dy > 0.5 ? dy - 1 : dy,
|
|
478
|
+
0
|
|
479
|
+
]);
|
|
480
|
+
this.alignedProjMatrix = alignedM;
|
|
481
|
+
m = import_gl_matrix.mat4.create();
|
|
482
|
+
import_gl_matrix.mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]);
|
|
483
|
+
import_gl_matrix.mat4.translate(m, m, [1, -1, 0]);
|
|
484
|
+
this.labelPlaneMatrix = m;
|
|
485
|
+
m = import_gl_matrix.mat4.create();
|
|
486
|
+
import_gl_matrix.mat4.scale(m, m, [1, -1, 1]);
|
|
487
|
+
import_gl_matrix.mat4.translate(m, m, [-1, -1, 0]);
|
|
488
|
+
import_gl_matrix.mat4.scale(m, m, [2 / this.width, 2 / this.height, 1]);
|
|
489
|
+
this.glCoordMatrix = m;
|
|
490
|
+
this.pixelMatrix = import_gl_matrix.mat4.multiply(new Float64Array(16), this.labelPlaneMatrix, this.projMatrix);
|
|
491
|
+
m = import_gl_matrix.mat4.invert(new Float64Array(16), this.pixelMatrix);
|
|
492
|
+
if (!m) {
|
|
493
|
+
throw new Error("failed to invert matrix");
|
|
494
|
+
}
|
|
495
|
+
this.pixelMatrixInverse = m;
|
|
496
|
+
this.posMatrixCache = {};
|
|
497
|
+
this.alignedPosMatrixCache = {};
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
501
|
+
0 && (module.exports = {
|
|
502
|
+
EXTENT
|
|
503
|
+
});
|