@loaders.gl/i3s 3.3.0-alpha.1 → 3.3.0-alpha.11
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/dist/dist.min.js +1219 -1480
- package/dist/es5/arcgis-webscene-loader.js +2 -8
- package/dist/es5/arcgis-webscene-loader.js.map +1 -1
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +19 -59
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -10
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +18 -18
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +48 -80
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +1 -12
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/index.js +12 -18
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +18 -78
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/constants.js +3 -19
- package/dist/es5/lib/parsers/constants.js.map +1 -1
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js +128 -30
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-attribute.js +1 -23
- package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +8 -25
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +90 -199
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js +6 -37
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +0 -7
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
- package/dist/es5/lib/utils/customizeColors.js +164 -0
- package/dist/es5/lib/utils/customizeColors.js.map +1 -0
- package/dist/es5/lib/utils/url-utils.js +3 -8
- package/dist/es5/lib/utils/url-utils.js.map +1 -1
- package/dist/es5/types.js +0 -3
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/workers/i3s-content-nodejs-worker.js +7 -0
- package/dist/es5/workers/i3s-content-nodejs-worker.js.map +1 -0
- package/dist/es5/workers/i3s-content-worker.js +0 -2
- package/dist/es5/workers/i3s-content-worker.js.map +1 -1
- package/dist/esm/arcgis-webscene-loader.js +3 -1
- package/dist/esm/arcgis-webscene-loader.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/i3s-attribute-loader.js +9 -26
- package/dist/esm/i3s-attribute-loader.js.map +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +2 -3
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/esm/i3s-content-loader.js +13 -6
- package/dist/esm/i3s-content-loader.js.map +1 -1
- package/dist/esm/i3s-loader.js +16 -24
- package/dist/esm/i3s-loader.js.map +1 -1
- package/dist/esm/i3s-node-page-loader.js +1 -2
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +2 -45
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/constants.js +2 -11
- package/dist/esm/lib/parsers/constants.js.map +1 -1
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js +50 -11
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-attribute.js +1 -8
- package/dist/esm/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js +1 -4
- package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +60 -104
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js +16 -18
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/esm/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
- package/dist/esm/lib/utils/customizeColors.js +96 -0
- package/dist/esm/lib/utils/customizeColors.js.map +1 -0
- package/dist/esm/lib/utils/url-utils.js +5 -5
- package/dist/esm/lib/utils/url-utils.js.map +1 -1
- package/dist/esm/types.js +0 -3
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/workers/i3s-content-nodejs-worker.js +5 -0
- package/dist/esm/workers/i3s-content-nodejs-worker.js.map +1 -0
- package/dist/esm/workers/i3s-content-worker.js.map +1 -1
- package/dist/i3s-attribute-loader.d.ts +6 -0
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +2 -1
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +9 -4
- package/dist/i3s-content-nodejs-worker.js +201 -0
- package/dist/i3s-content-nodejs-worker.js.map +7 -0
- package/dist/i3s-content-worker.js +675 -1046
- package/dist/i3s-loader.d.ts +5 -0
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +12 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/parsers/constants.js +1 -1
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -1
- package/dist/lib/parsers/parse-arcgis-webscene.js +49 -7
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +38 -33
- package/dist/lib/parsers/parse-i3s.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s.js +1 -1
- package/dist/lib/utils/customizeColors.d.ts +14 -0
- package/dist/lib/utils/customizeColors.d.ts.map +1 -0
- package/dist/lib/utils/customizeColors.js +89 -0
- package/dist/types.d.ts +265 -85
- package/dist/types.d.ts.map +1 -1
- package/dist/workers/i3s-content-nodejs-worker.d.ts +2 -0
- package/dist/workers/i3s-content-nodejs-worker.d.ts.map +1 -0
- package/dist/workers/i3s-content-nodejs-worker.js +6 -0
- package/package.json +12 -12
- package/src/i3s-attribute-loader.ts +1 -1
- package/src/i3s-content-loader.ts +19 -6
- package/src/i3s-loader.ts +22 -13
- package/src/index.ts +8 -1
- package/src/lib/parsers/constants.ts +1 -1
- package/src/lib/parsers/parse-arcgis-webscene.ts +57 -7
- package/src/lib/parsers/parse-i3s-tile-content.ts +56 -43
- package/src/lib/parsers/parse-i3s.ts +1 -1
- package/src/lib/utils/customizeColors.ts +129 -0
- package/src/types.ts +198 -3
- package/src/workers/i3s-content-nodejs-worker.ts +5 -0
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
for (var name in all)
|
|
15
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
16
|
};
|
|
17
|
-
var __reExport = (target,
|
|
18
|
-
if (
|
|
19
|
-
for (let key of __getOwnPropNames(
|
|
17
|
+
var __reExport = (target, module, desc) => {
|
|
18
|
+
if (module && typeof module === "object" || typeof module === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(module))
|
|
20
20
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
21
|
-
__defProp(target, key, { get: () =>
|
|
21
|
+
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
22
22
|
}
|
|
23
23
|
return target;
|
|
24
24
|
};
|
|
25
|
-
var __toModule = (
|
|
26
|
-
return __reExport(__markAsModule(__defProp(
|
|
25
|
+
var __toModule = (module) => {
|
|
26
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// (disabled):../worker-utils/src/lib/node/require-utils.node
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
56
56
|
|
|
57
57
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
58
|
-
var VERSION = true ? "3.3.0-alpha.
|
|
58
|
+
var VERSION = true ? "3.3.0-alpha.11" : DEFAULT_VERSION;
|
|
59
59
|
if (false) {
|
|
60
60
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
61
61
|
}
|
|
@@ -118,8 +118,10 @@
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
// ../worker-utils/src/lib/node/worker_threads-browser.
|
|
121
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.ts
|
|
122
122
|
var Worker2 = class {
|
|
123
|
+
terminate() {
|
|
124
|
+
}
|
|
123
125
|
};
|
|
124
126
|
|
|
125
127
|
// ../worker-utils/src/lib/worker-utils/get-loadable-worker-url.ts
|
|
@@ -212,7 +214,7 @@
|
|
|
212
214
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
213
215
|
}
|
|
214
216
|
static isSupported() {
|
|
215
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
217
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
216
218
|
}
|
|
217
219
|
destroy() {
|
|
218
220
|
this.onMessage = NOOP;
|
|
@@ -1045,7 +1047,7 @@
|
|
|
1045
1047
|
return await makeResponse(url);
|
|
1046
1048
|
}
|
|
1047
1049
|
|
|
1048
|
-
// ../../node_modules
|
|
1050
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
1049
1051
|
function isElectron(mockUserAgent) {
|
|
1050
1052
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1051
1053
|
return true;
|
|
@@ -1061,13 +1063,13 @@
|
|
|
1061
1063
|
return false;
|
|
1062
1064
|
}
|
|
1063
1065
|
|
|
1064
|
-
// ../../node_modules
|
|
1066
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
1065
1067
|
function isBrowser3() {
|
|
1066
1068
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1067
1069
|
return !isNode || isElectron();
|
|
1068
1070
|
}
|
|
1069
1071
|
|
|
1070
|
-
// ../../node_modules
|
|
1072
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
1071
1073
|
var globals3 = {
|
|
1072
1074
|
self: typeof self !== "undefined" && self,
|
|
1073
1075
|
window: typeof window !== "undefined" && window,
|
|
@@ -1077,15 +1079,14 @@
|
|
|
1077
1079
|
};
|
|
1078
1080
|
var self_3 = globals3.self || globals3.window || globals3.global;
|
|
1079
1081
|
var window_3 = globals3.window || globals3.self || globals3.global;
|
|
1080
|
-
var global_3 = globals3.global || globals3.self || globals3.window;
|
|
1081
1082
|
var document_3 = globals3.document || {};
|
|
1082
1083
|
var process_ = globals3.process || {};
|
|
1083
1084
|
|
|
1084
|
-
// ../../node_modules
|
|
1085
|
-
var VERSION3 = true ? "3.3.0-alpha.
|
|
1085
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1086
|
+
var VERSION3 = true ? "3.3.0-alpha.11" : "untranspiled source";
|
|
1086
1087
|
var isBrowser4 = isBrowser3();
|
|
1087
1088
|
|
|
1088
|
-
// ../../node_modules
|
|
1089
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
1089
1090
|
function getStorage(type) {
|
|
1090
1091
|
try {
|
|
1091
1092
|
const storage = window[type];
|
|
@@ -1098,7 +1099,12 @@
|
|
|
1098
1099
|
}
|
|
1099
1100
|
}
|
|
1100
1101
|
var LocalStorage = class {
|
|
1101
|
-
constructor(id
|
|
1102
|
+
constructor(id) {
|
|
1103
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1104
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1105
|
+
_defineProperty(this, "storage", void 0);
|
|
1106
|
+
_defineProperty(this, "id", void 0);
|
|
1107
|
+
_defineProperty(this, "config", {});
|
|
1102
1108
|
this.storage = getStorage(type);
|
|
1103
1109
|
this.id = id;
|
|
1104
1110
|
this.config = {};
|
|
@@ -1131,7 +1137,7 @@
|
|
|
1131
1137
|
}
|
|
1132
1138
|
};
|
|
1133
1139
|
|
|
1134
|
-
// ../../node_modules
|
|
1140
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
1135
1141
|
function formatTime(ms) {
|
|
1136
1142
|
let formatted;
|
|
1137
1143
|
if (ms < 10) {
|
|
@@ -1145,11 +1151,13 @@
|
|
|
1145
1151
|
}
|
|
1146
1152
|
return formatted;
|
|
1147
1153
|
}
|
|
1148
|
-
function leftPad(string
|
|
1154
|
+
function leftPad(string) {
|
|
1155
|
+
let length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1149
1156
|
const padLength = Math.max(length2 - string.length, 0);
|
|
1150
1157
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1151
1158
|
}
|
|
1152
|
-
function formatImage(image, message, scale2
|
|
1159
|
+
function formatImage(image, message, scale2) {
|
|
1160
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1153
1161
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1154
1162
|
if (image.width > maxWidth) {
|
|
1155
1163
|
scale2 = Math.min(scale2, maxWidth / image.width);
|
|
@@ -1160,30 +1168,31 @@
|
|
|
1160
1168
|
return ["".concat(message, " %c+"), style];
|
|
1161
1169
|
}
|
|
1162
1170
|
|
|
1163
|
-
// ../../node_modules
|
|
1164
|
-
var COLOR
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1171
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
1172
|
+
var COLOR;
|
|
1173
|
+
(function(COLOR2) {
|
|
1174
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
1175
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
1176
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
1177
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
1178
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
1179
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
1180
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
1181
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
1182
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
1183
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
1184
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
1185
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
1186
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
1187
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
1188
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1189
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1190
|
+
})(COLOR || (COLOR = {}));
|
|
1182
1191
|
function getColor(color) {
|
|
1183
1192
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
1184
1193
|
}
|
|
1185
1194
|
function addColor(string, color, background) {
|
|
1186
|
-
if (!
|
|
1195
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
1187
1196
|
if (color) {
|
|
1188
1197
|
color = getColor(color);
|
|
1189
1198
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -1196,8 +1205,9 @@
|
|
|
1196
1205
|
return string;
|
|
1197
1206
|
}
|
|
1198
1207
|
|
|
1199
|
-
// ../../node_modules
|
|
1200
|
-
function autobind(obj
|
|
1208
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
1209
|
+
function autobind(obj) {
|
|
1210
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1201
1211
|
const proto = Object.getPrototypeOf(obj);
|
|
1202
1212
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
1203
1213
|
for (const key of propNames) {
|
|
@@ -1209,20 +1219,22 @@
|
|
|
1209
1219
|
}
|
|
1210
1220
|
}
|
|
1211
1221
|
|
|
1212
|
-
// ../../node_modules
|
|
1222
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
1213
1223
|
function assert3(condition, message) {
|
|
1214
1224
|
if (!condition) {
|
|
1215
1225
|
throw new Error(message || "Assertion failed");
|
|
1216
1226
|
}
|
|
1217
1227
|
}
|
|
1218
1228
|
|
|
1219
|
-
// ../../node_modules
|
|
1229
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
1220
1230
|
function getHiResTimestamp() {
|
|
1221
1231
|
let timestamp;
|
|
1222
|
-
if (
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1232
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
1233
|
+
var _window$performance, _window$performance$n;
|
|
1234
|
+
timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
1235
|
+
} else if ("hrtime" in process_) {
|
|
1236
|
+
var _process$hrtime;
|
|
1237
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
1226
1238
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1227
1239
|
} else {
|
|
1228
1240
|
timestamp = Date.now();
|
|
@@ -1230,9 +1242,9 @@
|
|
|
1230
1242
|
return timestamp;
|
|
1231
1243
|
}
|
|
1232
1244
|
|
|
1233
|
-
// ../../node_modules
|
|
1245
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
1234
1246
|
var originalConsole = {
|
|
1235
|
-
debug:
|
|
1247
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
1236
1248
|
log: console.log,
|
|
1237
1249
|
info: console.info,
|
|
1238
1250
|
warn: console.warn,
|
|
@@ -1248,25 +1260,21 @@
|
|
|
1248
1260
|
var ONCE = {
|
|
1249
1261
|
once: true
|
|
1250
1262
|
};
|
|
1251
|
-
function getTableHeader(table) {
|
|
1252
|
-
for (const key in table) {
|
|
1253
|
-
for (const title in table[key]) {
|
|
1254
|
-
return title || "untitled";
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
return "empty";
|
|
1258
|
-
}
|
|
1259
1263
|
var Log = class {
|
|
1260
|
-
constructor({
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1264
|
+
constructor() {
|
|
1265
|
+
let {
|
|
1266
|
+
id
|
|
1267
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
1268
|
+
id: ""
|
|
1269
|
+
};
|
|
1270
|
+
_defineProperty(this, "id", void 0);
|
|
1271
|
+
_defineProperty(this, "VERSION", VERSION3);
|
|
1272
|
+
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
1273
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
1274
|
+
_defineProperty(this, "_storage", void 0);
|
|
1275
|
+
_defineProperty(this, "userData", {});
|
|
1276
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1265
1277
|
this.id = id;
|
|
1266
|
-
this.VERSION = VERSION3;
|
|
1267
|
-
this._startTs = getHiResTimestamp();
|
|
1268
|
-
this._deltaTs = getHiResTimestamp();
|
|
1269
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1270
1278
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1271
1279
|
this.userData = {};
|
|
1272
1280
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -1300,7 +1308,8 @@
|
|
|
1300
1308
|
getPriority() {
|
|
1301
1309
|
return this.level;
|
|
1302
1310
|
}
|
|
1303
|
-
enable(
|
|
1311
|
+
enable() {
|
|
1312
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
1304
1313
|
this._storage.updateConfiguration({
|
|
1305
1314
|
enabled
|
|
1306
1315
|
});
|
|
@@ -1312,6 +1321,21 @@
|
|
|
1312
1321
|
});
|
|
1313
1322
|
return this;
|
|
1314
1323
|
}
|
|
1324
|
+
get(setting) {
|
|
1325
|
+
return this._storage.config[setting];
|
|
1326
|
+
}
|
|
1327
|
+
set(setting, value) {
|
|
1328
|
+
this._storage.updateConfiguration({
|
|
1329
|
+
[setting]: value
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
settings() {
|
|
1333
|
+
if (console.table) {
|
|
1334
|
+
console.table(this._storage.config);
|
|
1335
|
+
} else {
|
|
1336
|
+
console.log(this._storage.config);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1315
1339
|
assert(condition, message) {
|
|
1316
1340
|
assert3(condition, message);
|
|
1317
1341
|
}
|
|
@@ -1340,6 +1364,9 @@
|
|
|
1340
1364
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
1341
1365
|
}
|
|
1342
1366
|
once(logLevel, message) {
|
|
1367
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1368
|
+
args[_key - 2] = arguments[_key];
|
|
1369
|
+
}
|
|
1343
1370
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
1344
1371
|
}
|
|
1345
1372
|
table(logLevel, table, columns) {
|
|
@@ -1350,17 +1377,18 @@
|
|
|
1350
1377
|
}
|
|
1351
1378
|
return noop;
|
|
1352
1379
|
}
|
|
1353
|
-
image({
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1380
|
+
image(_ref) {
|
|
1381
|
+
let {
|
|
1382
|
+
logLevel,
|
|
1383
|
+
priority,
|
|
1384
|
+
image,
|
|
1385
|
+
message = "",
|
|
1386
|
+
scale: scale2 = 1
|
|
1387
|
+
} = _ref;
|
|
1360
1388
|
if (!this._shouldLog(logLevel || priority)) {
|
|
1361
1389
|
return noop;
|
|
1362
1390
|
}
|
|
1363
|
-
return
|
|
1391
|
+
return isBrowser3 ? logImageInBrowser({
|
|
1364
1392
|
image,
|
|
1365
1393
|
message,
|
|
1366
1394
|
scale: scale2
|
|
@@ -1370,21 +1398,6 @@
|
|
|
1370
1398
|
scale: scale2
|
|
1371
1399
|
});
|
|
1372
1400
|
}
|
|
1373
|
-
settings() {
|
|
1374
|
-
if (console.table) {
|
|
1375
|
-
console.table(this._storage.config);
|
|
1376
|
-
} else {
|
|
1377
|
-
console.log(this._storage.config);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
get(setting) {
|
|
1381
|
-
return this._storage.config[setting];
|
|
1382
|
-
}
|
|
1383
|
-
set(setting, value) {
|
|
1384
|
-
this._storage.updateConfiguration({
|
|
1385
|
-
[setting]: value
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
1401
|
time(logLevel, message) {
|
|
1389
1402
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
1390
1403
|
}
|
|
@@ -1394,10 +1407,11 @@
|
|
|
1394
1407
|
timeStamp(logLevel, message) {
|
|
1395
1408
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
1396
1409
|
}
|
|
1397
|
-
group(logLevel, message
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1410
|
+
group(logLevel, message) {
|
|
1411
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
1412
|
+
collapsed: false
|
|
1413
|
+
};
|
|
1414
|
+
const options = normalizeArguments({
|
|
1401
1415
|
logLevel,
|
|
1402
1416
|
message,
|
|
1403
1417
|
opts
|
|
@@ -1405,10 +1419,11 @@
|
|
|
1405
1419
|
const {
|
|
1406
1420
|
collapsed
|
|
1407
1421
|
} = opts;
|
|
1408
|
-
|
|
1409
|
-
return this._getLogFunction(
|
|
1422
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
1423
|
+
return this._getLogFunction(options);
|
|
1410
1424
|
}
|
|
1411
|
-
groupCollapsed(logLevel, message
|
|
1425
|
+
groupCollapsed(logLevel, message) {
|
|
1426
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1412
1427
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
1413
1428
|
collapsed: true
|
|
1414
1429
|
}));
|
|
@@ -1432,7 +1447,7 @@
|
|
|
1432
1447
|
_shouldLog(logLevel) {
|
|
1433
1448
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
1434
1449
|
}
|
|
1435
|
-
_getLogFunction(logLevel, message, method, args
|
|
1450
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
1436
1451
|
if (this._shouldLog(logLevel)) {
|
|
1437
1452
|
opts = normalizeArguments({
|
|
1438
1453
|
logLevel,
|
|
@@ -1459,7 +1474,7 @@
|
|
|
1459
1474
|
return noop;
|
|
1460
1475
|
}
|
|
1461
1476
|
};
|
|
1462
|
-
Log
|
|
1477
|
+
_defineProperty(Log, "VERSION", VERSION3);
|
|
1463
1478
|
function normalizeLogLevel(logLevel) {
|
|
1464
1479
|
if (!logLevel) {
|
|
1465
1480
|
return 0;
|
|
@@ -1487,7 +1502,6 @@
|
|
|
1487
1502
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
1488
1503
|
while (args.length && args.shift() !== message) {
|
|
1489
1504
|
}
|
|
1490
|
-
opts.args = args;
|
|
1491
1505
|
switch (typeof logLevel) {
|
|
1492
1506
|
case "string":
|
|
1493
1507
|
case "function":
|
|
@@ -1506,7 +1520,9 @@
|
|
|
1506
1520
|
}
|
|
1507
1521
|
const messageType = typeof opts.message;
|
|
1508
1522
|
assert3(messageType === "string" || messageType === "object");
|
|
1509
|
-
return Object.assign(opts,
|
|
1523
|
+
return Object.assign(opts, {
|
|
1524
|
+
args
|
|
1525
|
+
}, opts.opts);
|
|
1510
1526
|
}
|
|
1511
1527
|
function decorateMessage(id, message, opts) {
|
|
1512
1528
|
if (typeof message === "string") {
|
|
@@ -1516,29 +1532,25 @@
|
|
|
1516
1532
|
}
|
|
1517
1533
|
return message;
|
|
1518
1534
|
}
|
|
1519
|
-
function logImageInNode({
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
return () => asciify(image, {
|
|
1531
|
-
fit: "box",
|
|
1532
|
-
width: "".concat(Math.round(80 * scale2), "%")
|
|
1533
|
-
}).then((data) => console.log(data));
|
|
1534
|
-
}
|
|
1535
|
+
function logImageInNode(_ref2) {
|
|
1536
|
+
let {
|
|
1537
|
+
image,
|
|
1538
|
+
message = "",
|
|
1539
|
+
scale: scale2 = 1
|
|
1540
|
+
} = _ref2;
|
|
1541
|
+
asciify.nodeAsciifyImage({
|
|
1542
|
+
image,
|
|
1543
|
+
message,
|
|
1544
|
+
scale: scale2
|
|
1545
|
+
});
|
|
1535
1546
|
return noop;
|
|
1536
1547
|
}
|
|
1537
|
-
function logImageInBrowser({
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1548
|
+
function logImageInBrowser(_ref3) {
|
|
1549
|
+
let {
|
|
1550
|
+
image,
|
|
1551
|
+
message = "",
|
|
1552
|
+
scale: scale2 = 1
|
|
1553
|
+
} = _ref3;
|
|
1542
1554
|
if (typeof image === "string") {
|
|
1543
1555
|
const img = new Image();
|
|
1544
1556
|
img.onload = () => {
|
|
@@ -1561,10 +1573,18 @@
|
|
|
1561
1573
|
}
|
|
1562
1574
|
return noop;
|
|
1563
1575
|
}
|
|
1576
|
+
function getTableHeader(table) {
|
|
1577
|
+
for (const key in table) {
|
|
1578
|
+
for (const title in table[key]) {
|
|
1579
|
+
return title || "untitled";
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
return "empty";
|
|
1583
|
+
}
|
|
1564
1584
|
|
|
1565
|
-
// ../../node_modules
|
|
1585
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
1566
1586
|
var esm_default = new Log({
|
|
1567
|
-
id: "probe.gl"
|
|
1587
|
+
id: "@probe.gl/log"
|
|
1568
1588
|
});
|
|
1569
1589
|
|
|
1570
1590
|
// ../core/src/lib/loader-utils/loggers.ts
|
|
@@ -1761,585 +1781,39 @@
|
|
|
1761
1781
|
const hasExtensions = Array.isArray(loader?.extensions);
|
|
1762
1782
|
return hasExtensions;
|
|
1763
1783
|
}
|
|
1764
|
-
function normalizeLoader(loader) {
|
|
1765
|
-
assert(loader, "null loader");
|
|
1766
|
-
assert(isLoaderObject(loader), "invalid loader");
|
|
1767
|
-
let options;
|
|
1768
|
-
if (Array.isArray(loader)) {
|
|
1769
|
-
options = loader[1];
|
|
1770
|
-
loader = loader[0];
|
|
1771
|
-
loader = {
|
|
1772
|
-
...loader,
|
|
1773
|
-
options: { ...loader.options, ...options }
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
if (loader?.parseTextSync || loader?.parseText) {
|
|
1777
|
-
loader.text = true;
|
|
1778
|
-
}
|
|
1779
|
-
if (!loader.text) {
|
|
1780
|
-
loader.binary = true;
|
|
1781
|
-
}
|
|
1782
|
-
return loader;
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
// ../core/src/lib/api/register-loaders.ts
|
|
1786
|
-
var getGlobalLoaderRegistry = () => {
|
|
1787
|
-
const state = getGlobalLoaderState();
|
|
1788
|
-
state.loaderRegistry = state.loaderRegistry || [];
|
|
1789
|
-
return state.loaderRegistry;
|
|
1790
|
-
};
|
|
1791
|
-
function getRegisteredLoaders() {
|
|
1792
|
-
return getGlobalLoaderRegistry();
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
1796
|
-
function isElectron2(mockUserAgent) {
|
|
1797
|
-
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1798
|
-
return true;
|
|
1799
|
-
}
|
|
1800
|
-
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
|
|
1801
|
-
return true;
|
|
1802
|
-
}
|
|
1803
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
1804
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
1805
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
1806
|
-
return true;
|
|
1807
|
-
}
|
|
1808
|
-
return false;
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
1812
|
-
function isBrowser5() {
|
|
1813
|
-
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1814
|
-
return !isNode || isElectron2();
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
1818
|
-
var globals4 = {
|
|
1819
|
-
self: typeof self !== "undefined" && self,
|
|
1820
|
-
window: typeof window !== "undefined" && window,
|
|
1821
|
-
global: typeof global !== "undefined" && global,
|
|
1822
|
-
document: typeof document !== "undefined" && document,
|
|
1823
|
-
process: typeof process === "object" && process
|
|
1824
|
-
};
|
|
1825
|
-
var self_4 = globals4.self || globals4.window || globals4.global;
|
|
1826
|
-
var window_4 = globals4.window || globals4.self || globals4.global;
|
|
1827
|
-
var document_4 = globals4.document || {};
|
|
1828
|
-
var process_2 = globals4.process || {};
|
|
1829
|
-
|
|
1830
|
-
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1831
|
-
var VERSION4 = true ? "3.3.0-alpha.1" : "untranspiled source";
|
|
1832
|
-
var isBrowser6 = isBrowser5();
|
|
1833
|
-
|
|
1834
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
1835
|
-
function getStorage2(type) {
|
|
1836
|
-
try {
|
|
1837
|
-
const storage = window[type];
|
|
1838
|
-
const x = "__storage_test__";
|
|
1839
|
-
storage.setItem(x, x);
|
|
1840
|
-
storage.removeItem(x);
|
|
1841
|
-
return storage;
|
|
1842
|
-
} catch (e2) {
|
|
1843
|
-
return null;
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
|
-
var LocalStorage2 = class {
|
|
1847
|
-
constructor(id) {
|
|
1848
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1849
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1850
|
-
_defineProperty(this, "storage", void 0);
|
|
1851
|
-
_defineProperty(this, "id", void 0);
|
|
1852
|
-
_defineProperty(this, "config", {});
|
|
1853
|
-
this.storage = getStorage2(type);
|
|
1854
|
-
this.id = id;
|
|
1855
|
-
this.config = {};
|
|
1856
|
-
Object.assign(this.config, defaultSettings);
|
|
1857
|
-
this._loadConfiguration();
|
|
1858
|
-
}
|
|
1859
|
-
getConfiguration() {
|
|
1860
|
-
return this.config;
|
|
1861
|
-
}
|
|
1862
|
-
setConfiguration(configuration) {
|
|
1863
|
-
this.config = {};
|
|
1864
|
-
return this.updateConfiguration(configuration);
|
|
1865
|
-
}
|
|
1866
|
-
updateConfiguration(configuration) {
|
|
1867
|
-
Object.assign(this.config, configuration);
|
|
1868
|
-
if (this.storage) {
|
|
1869
|
-
const serialized = JSON.stringify(this.config);
|
|
1870
|
-
this.storage.setItem(this.id, serialized);
|
|
1871
|
-
}
|
|
1872
|
-
return this;
|
|
1873
|
-
}
|
|
1874
|
-
_loadConfiguration() {
|
|
1875
|
-
let configuration = {};
|
|
1876
|
-
if (this.storage) {
|
|
1877
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
1878
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
1879
|
-
}
|
|
1880
|
-
Object.assign(this.config, configuration);
|
|
1881
|
-
return this;
|
|
1882
|
-
}
|
|
1883
|
-
};
|
|
1884
|
-
|
|
1885
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
1886
|
-
function formatTime2(ms) {
|
|
1887
|
-
let formatted;
|
|
1888
|
-
if (ms < 10) {
|
|
1889
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
1890
|
-
} else if (ms < 100) {
|
|
1891
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
1892
|
-
} else if (ms < 1e3) {
|
|
1893
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
1894
|
-
} else {
|
|
1895
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
1896
|
-
}
|
|
1897
|
-
return formatted;
|
|
1898
|
-
}
|
|
1899
|
-
function leftPad2(string) {
|
|
1900
|
-
let length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1901
|
-
const padLength = Math.max(length2 - string.length, 0);
|
|
1902
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1903
|
-
}
|
|
1904
|
-
function formatImage2(image, message, scale2) {
|
|
1905
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1906
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1907
|
-
if (image.width > maxWidth) {
|
|
1908
|
-
scale2 = Math.min(scale2, maxWidth / image.width);
|
|
1909
|
-
}
|
|
1910
|
-
const width = image.width * scale2;
|
|
1911
|
-
const height = image.height * scale2;
|
|
1912
|
-
const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
|
|
1913
|
-
return ["".concat(message, " %c+"), style];
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
1917
|
-
var COLOR2;
|
|
1918
|
-
(function(COLOR3) {
|
|
1919
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
1920
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
1921
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
1922
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
1923
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
1924
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
1925
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
1926
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
1927
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
1928
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
1929
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
1930
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
1931
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
1932
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
1933
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1934
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1935
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
1936
|
-
function getColor2(color) {
|
|
1937
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
1938
|
-
}
|
|
1939
|
-
function addColor2(string, color, background) {
|
|
1940
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
1941
|
-
if (color) {
|
|
1942
|
-
color = getColor2(color);
|
|
1943
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
1944
|
-
}
|
|
1945
|
-
if (background) {
|
|
1946
|
-
color = getColor2(background);
|
|
1947
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
return string;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
1954
|
-
function autobind2(obj) {
|
|
1955
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1956
|
-
const proto = Object.getPrototypeOf(obj);
|
|
1957
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
1958
|
-
for (const key of propNames) {
|
|
1959
|
-
if (typeof obj[key] === "function") {
|
|
1960
|
-
if (!predefined.find((name) => key === name)) {
|
|
1961
|
-
obj[key] = obj[key].bind(obj);
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
1968
|
-
function assert4(condition, message) {
|
|
1969
|
-
if (!condition) {
|
|
1970
|
-
throw new Error(message || "Assertion failed");
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
1975
|
-
function getHiResTimestamp3() {
|
|
1976
|
-
let timestamp;
|
|
1977
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
1978
|
-
var _window$performance, _window$performance$n;
|
|
1979
|
-
timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
1980
|
-
} else if ("hrtime" in process_2) {
|
|
1981
|
-
var _process$hrtime;
|
|
1982
|
-
const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
|
|
1983
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1984
|
-
} else {
|
|
1985
|
-
timestamp = Date.now();
|
|
1986
|
-
}
|
|
1987
|
-
return timestamp;
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
1991
|
-
var originalConsole2 = {
|
|
1992
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
1993
|
-
log: console.log,
|
|
1994
|
-
info: console.info,
|
|
1995
|
-
warn: console.warn,
|
|
1996
|
-
error: console.error
|
|
1997
|
-
};
|
|
1998
|
-
var DEFAULT_SETTINGS2 = {
|
|
1999
|
-
enabled: true,
|
|
2000
|
-
level: 0
|
|
2001
|
-
};
|
|
2002
|
-
function noop2() {
|
|
2003
|
-
}
|
|
2004
|
-
var cache2 = {};
|
|
2005
|
-
var ONCE2 = {
|
|
2006
|
-
once: true
|
|
2007
|
-
};
|
|
2008
|
-
var Log2 = class {
|
|
2009
|
-
constructor() {
|
|
2010
|
-
let {
|
|
2011
|
-
id
|
|
2012
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2013
|
-
id: ""
|
|
2014
|
-
};
|
|
2015
|
-
_defineProperty(this, "id", void 0);
|
|
2016
|
-
_defineProperty(this, "VERSION", VERSION4);
|
|
2017
|
-
_defineProperty(this, "_startTs", getHiResTimestamp3());
|
|
2018
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp3());
|
|
2019
|
-
_defineProperty(this, "_storage", void 0);
|
|
2020
|
-
_defineProperty(this, "userData", {});
|
|
2021
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
2022
|
-
this.id = id;
|
|
2023
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
2024
|
-
this.userData = {};
|
|
2025
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
2026
|
-
autobind2(this);
|
|
2027
|
-
Object.seal(this);
|
|
2028
|
-
}
|
|
2029
|
-
set level(newLevel) {
|
|
2030
|
-
this.setLevel(newLevel);
|
|
2031
|
-
}
|
|
2032
|
-
get level() {
|
|
2033
|
-
return this.getLevel();
|
|
2034
|
-
}
|
|
2035
|
-
isEnabled() {
|
|
2036
|
-
return this._storage.config.enabled;
|
|
2037
|
-
}
|
|
2038
|
-
getLevel() {
|
|
2039
|
-
return this._storage.config.level;
|
|
2040
|
-
}
|
|
2041
|
-
getTotal() {
|
|
2042
|
-
return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
|
|
2043
|
-
}
|
|
2044
|
-
getDelta() {
|
|
2045
|
-
return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
|
|
2046
|
-
}
|
|
2047
|
-
set priority(newPriority) {
|
|
2048
|
-
this.level = newPriority;
|
|
2049
|
-
}
|
|
2050
|
-
get priority() {
|
|
2051
|
-
return this.level;
|
|
2052
|
-
}
|
|
2053
|
-
getPriority() {
|
|
2054
|
-
return this.level;
|
|
2055
|
-
}
|
|
2056
|
-
enable() {
|
|
2057
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2058
|
-
this._storage.updateConfiguration({
|
|
2059
|
-
enabled
|
|
2060
|
-
});
|
|
2061
|
-
return this;
|
|
2062
|
-
}
|
|
2063
|
-
setLevel(level) {
|
|
2064
|
-
this._storage.updateConfiguration({
|
|
2065
|
-
level
|
|
2066
|
-
});
|
|
2067
|
-
return this;
|
|
2068
|
-
}
|
|
2069
|
-
get(setting) {
|
|
2070
|
-
return this._storage.config[setting];
|
|
2071
|
-
}
|
|
2072
|
-
set(setting, value) {
|
|
2073
|
-
this._storage.updateConfiguration({
|
|
2074
|
-
[setting]: value
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
settings() {
|
|
2078
|
-
if (console.table) {
|
|
2079
|
-
console.table(this._storage.config);
|
|
2080
|
-
} else {
|
|
2081
|
-
console.log(this._storage.config);
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
assert(condition, message) {
|
|
2085
|
-
assert4(condition, message);
|
|
2086
|
-
}
|
|
2087
|
-
warn(message) {
|
|
2088
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
2089
|
-
}
|
|
2090
|
-
error(message) {
|
|
2091
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
2092
|
-
}
|
|
2093
|
-
deprecated(oldUsage, newUsage) {
|
|
2094
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
2095
|
-
}
|
|
2096
|
-
removed(oldUsage, newUsage) {
|
|
2097
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
2098
|
-
}
|
|
2099
|
-
probe(logLevel, message) {
|
|
2100
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
2101
|
-
time: true,
|
|
2102
|
-
once: true
|
|
2103
|
-
});
|
|
2104
|
-
}
|
|
2105
|
-
log(logLevel, message) {
|
|
2106
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
2107
|
-
}
|
|
2108
|
-
info(logLevel, message) {
|
|
2109
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2110
|
-
}
|
|
2111
|
-
once(logLevel, message) {
|
|
2112
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2113
|
-
args[_key - 2] = arguments[_key];
|
|
2114
|
-
}
|
|
2115
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
2116
|
-
}
|
|
2117
|
-
table(logLevel, table, columns) {
|
|
2118
|
-
if (table) {
|
|
2119
|
-
return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
|
|
2120
|
-
tag: getTableHeader2(table)
|
|
2121
|
-
});
|
|
2122
|
-
}
|
|
2123
|
-
return noop2;
|
|
2124
|
-
}
|
|
2125
|
-
image(_ref) {
|
|
2126
|
-
let {
|
|
2127
|
-
logLevel,
|
|
2128
|
-
priority,
|
|
2129
|
-
image,
|
|
2130
|
-
message = "",
|
|
2131
|
-
scale: scale2 = 1
|
|
2132
|
-
} = _ref;
|
|
2133
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
2134
|
-
return noop2;
|
|
2135
|
-
}
|
|
2136
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
2137
|
-
image,
|
|
2138
|
-
message,
|
|
2139
|
-
scale: scale2
|
|
2140
|
-
}) : logImageInNode2({
|
|
2141
|
-
image,
|
|
2142
|
-
message,
|
|
2143
|
-
scale: scale2
|
|
2144
|
-
});
|
|
2145
|
-
}
|
|
2146
|
-
time(logLevel, message) {
|
|
2147
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
2148
|
-
}
|
|
2149
|
-
timeEnd(logLevel, message) {
|
|
2150
|
-
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
2151
|
-
}
|
|
2152
|
-
timeStamp(logLevel, message) {
|
|
2153
|
-
return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
|
|
2154
|
-
}
|
|
2155
|
-
group(logLevel, message) {
|
|
2156
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2157
|
-
collapsed: false
|
|
2158
|
-
};
|
|
2159
|
-
const options = normalizeArguments2({
|
|
2160
|
-
logLevel,
|
|
2161
|
-
message,
|
|
2162
|
-
opts
|
|
2163
|
-
});
|
|
2164
|
-
const {
|
|
2165
|
-
collapsed
|
|
2166
|
-
} = opts;
|
|
2167
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
2168
|
-
return this._getLogFunction(options);
|
|
2169
|
-
}
|
|
2170
|
-
groupCollapsed(logLevel, message) {
|
|
2171
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2172
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
2173
|
-
collapsed: true
|
|
2174
|
-
}));
|
|
2175
|
-
}
|
|
2176
|
-
groupEnd(logLevel) {
|
|
2177
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
|
|
2178
|
-
}
|
|
2179
|
-
withGroup(logLevel, message, func) {
|
|
2180
|
-
this.group(logLevel, message)();
|
|
2181
|
-
try {
|
|
2182
|
-
func();
|
|
2183
|
-
} finally {
|
|
2184
|
-
this.groupEnd(logLevel)();
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
trace() {
|
|
2188
|
-
if (console.trace) {
|
|
2189
|
-
console.trace();
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
_shouldLog(logLevel) {
|
|
2193
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
2194
|
-
}
|
|
2195
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
2196
|
-
if (this._shouldLog(logLevel)) {
|
|
2197
|
-
opts = normalizeArguments2({
|
|
2198
|
-
logLevel,
|
|
2199
|
-
message,
|
|
2200
|
-
args,
|
|
2201
|
-
opts
|
|
2202
|
-
});
|
|
2203
|
-
method = method || opts.method;
|
|
2204
|
-
assert4(method);
|
|
2205
|
-
opts.total = this.getTotal();
|
|
2206
|
-
opts.delta = this.getDelta();
|
|
2207
|
-
this._deltaTs = getHiResTimestamp3();
|
|
2208
|
-
const tag = opts.tag || opts.message;
|
|
2209
|
-
if (opts.once) {
|
|
2210
|
-
if (!cache2[tag]) {
|
|
2211
|
-
cache2[tag] = getHiResTimestamp3();
|
|
2212
|
-
} else {
|
|
2213
|
-
return noop2;
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
2217
|
-
return method.bind(console, message, ...opts.args);
|
|
2218
|
-
}
|
|
2219
|
-
return noop2;
|
|
2220
|
-
}
|
|
2221
|
-
};
|
|
2222
|
-
_defineProperty(Log2, "VERSION", VERSION4);
|
|
2223
|
-
function normalizeLogLevel2(logLevel) {
|
|
2224
|
-
if (!logLevel) {
|
|
2225
|
-
return 0;
|
|
2226
|
-
}
|
|
2227
|
-
let resolvedLevel;
|
|
2228
|
-
switch (typeof logLevel) {
|
|
2229
|
-
case "number":
|
|
2230
|
-
resolvedLevel = logLevel;
|
|
2231
|
-
break;
|
|
2232
|
-
case "object":
|
|
2233
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
2234
|
-
break;
|
|
2235
|
-
default:
|
|
2236
|
-
return 0;
|
|
2237
|
-
}
|
|
2238
|
-
assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
2239
|
-
return resolvedLevel;
|
|
2240
|
-
}
|
|
2241
|
-
function normalizeArguments2(opts) {
|
|
2242
|
-
const {
|
|
2243
|
-
logLevel,
|
|
2244
|
-
message
|
|
2245
|
-
} = opts;
|
|
2246
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
2247
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
2248
|
-
while (args.length && args.shift() !== message) {
|
|
2249
|
-
}
|
|
2250
|
-
switch (typeof logLevel) {
|
|
2251
|
-
case "string":
|
|
2252
|
-
case "function":
|
|
2253
|
-
if (message !== void 0) {
|
|
2254
|
-
args.unshift(message);
|
|
2255
|
-
}
|
|
2256
|
-
opts.message = logLevel;
|
|
2257
|
-
break;
|
|
2258
|
-
case "object":
|
|
2259
|
-
Object.assign(opts, logLevel);
|
|
2260
|
-
break;
|
|
2261
|
-
default:
|
|
2262
|
-
}
|
|
2263
|
-
if (typeof opts.message === "function") {
|
|
2264
|
-
opts.message = opts.message();
|
|
2265
|
-
}
|
|
2266
|
-
const messageType = typeof opts.message;
|
|
2267
|
-
assert4(messageType === "string" || messageType === "object");
|
|
2268
|
-
return Object.assign(opts, {
|
|
2269
|
-
args
|
|
2270
|
-
}, opts.opts);
|
|
2271
|
-
}
|
|
2272
|
-
function decorateMessage2(id, message, opts) {
|
|
2273
|
-
if (typeof message === "string") {
|
|
2274
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
2275
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
2276
|
-
message = addColor2(message, opts.color, opts.background);
|
|
2277
|
-
}
|
|
2278
|
-
return message;
|
|
2279
|
-
}
|
|
2280
|
-
function logImageInNode2(_ref2) {
|
|
2281
|
-
let {
|
|
2282
|
-
image,
|
|
2283
|
-
message = "",
|
|
2284
|
-
scale: scale2 = 1
|
|
2285
|
-
} = _ref2;
|
|
2286
|
-
let asciify = null;
|
|
2287
|
-
try {
|
|
2288
|
-
asciify = module.require("asciify-image");
|
|
2289
|
-
} catch (error) {
|
|
2290
|
-
}
|
|
2291
|
-
if (asciify) {
|
|
2292
|
-
return () => asciify(image, {
|
|
2293
|
-
fit: "box",
|
|
2294
|
-
width: "".concat(Math.round(80 * scale2), "%")
|
|
2295
|
-
}).then((data) => console.log(data));
|
|
2296
|
-
}
|
|
2297
|
-
return noop2;
|
|
2298
|
-
}
|
|
2299
|
-
function logImageInBrowser2(_ref3) {
|
|
2300
|
-
let {
|
|
2301
|
-
image,
|
|
2302
|
-
message = "",
|
|
2303
|
-
scale: scale2 = 1
|
|
2304
|
-
} = _ref3;
|
|
2305
|
-
if (typeof image === "string") {
|
|
2306
|
-
const img = new Image();
|
|
2307
|
-
img.onload = () => {
|
|
2308
|
-
const args = formatImage2(img, message, scale2);
|
|
2309
|
-
console.log(...args);
|
|
1784
|
+
function normalizeLoader(loader) {
|
|
1785
|
+
assert(loader, "null loader");
|
|
1786
|
+
assert(isLoaderObject(loader), "invalid loader");
|
|
1787
|
+
let options;
|
|
1788
|
+
if (Array.isArray(loader)) {
|
|
1789
|
+
options = loader[1];
|
|
1790
|
+
loader = loader[0];
|
|
1791
|
+
loader = {
|
|
1792
|
+
...loader,
|
|
1793
|
+
options: { ...loader.options, ...options }
|
|
2310
1794
|
};
|
|
2311
|
-
img.src = image;
|
|
2312
|
-
return noop2;
|
|
2313
|
-
}
|
|
2314
|
-
const element = image.nodeName || "";
|
|
2315
|
-
if (element.toLowerCase() === "img") {
|
|
2316
|
-
console.log(...formatImage2(image, message, scale2));
|
|
2317
|
-
return noop2;
|
|
2318
1795
|
}
|
|
2319
|
-
if (
|
|
2320
|
-
|
|
2321
|
-
img.onload = () => console.log(...formatImage2(img, message, scale2));
|
|
2322
|
-
img.src = image.toDataURL();
|
|
2323
|
-
return noop2;
|
|
1796
|
+
if (loader?.parseTextSync || loader?.parseText) {
|
|
1797
|
+
loader.text = true;
|
|
2324
1798
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
function getTableHeader2(table) {
|
|
2328
|
-
for (const key in table) {
|
|
2329
|
-
for (const title in table[key]) {
|
|
2330
|
-
return title || "untitled";
|
|
2331
|
-
}
|
|
1799
|
+
if (!loader.text) {
|
|
1800
|
+
loader.binary = true;
|
|
2332
1801
|
}
|
|
2333
|
-
return
|
|
1802
|
+
return loader;
|
|
2334
1803
|
}
|
|
2335
1804
|
|
|
2336
|
-
//
|
|
2337
|
-
var
|
|
2338
|
-
|
|
2339
|
-
|
|
1805
|
+
// ../core/src/lib/api/register-loaders.ts
|
|
1806
|
+
var getGlobalLoaderRegistry = () => {
|
|
1807
|
+
const state = getGlobalLoaderState();
|
|
1808
|
+
state.loaderRegistry = state.loaderRegistry || [];
|
|
1809
|
+
return state.loaderRegistry;
|
|
1810
|
+
};
|
|
1811
|
+
function getRegisteredLoaders() {
|
|
1812
|
+
return getGlobalLoaderRegistry();
|
|
1813
|
+
}
|
|
2340
1814
|
|
|
2341
1815
|
// ../core/src/lib/utils/log.ts
|
|
2342
|
-
var log = new
|
|
1816
|
+
var log = new Log({ id: "loaders.gl" });
|
|
2343
1817
|
|
|
2344
1818
|
// ../core/src/lib/api/select-loader.ts
|
|
2345
1819
|
var EXT_PATTERN = /\.([^.]+)$/;
|
|
@@ -2764,7 +2238,7 @@
|
|
|
2764
2238
|
}
|
|
2765
2239
|
|
|
2766
2240
|
// ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
|
|
2767
|
-
function
|
|
2241
|
+
function assert4(condition, message) {
|
|
2768
2242
|
if (!condition) {
|
|
2769
2243
|
throw new Error("math.gl assertion ".concat(message));
|
|
2770
2244
|
}
|
|
@@ -2773,18 +2247,16 @@
|
|
|
2773
2247
|
// ../../node_modules/@math.gl/core/dist/esm/lib/common.js
|
|
2774
2248
|
var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
2775
2249
|
var DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
2776
|
-
var config = {
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
2785
|
-
}
|
|
2250
|
+
var config = {
|
|
2251
|
+
EPSILON: 1e-12,
|
|
2252
|
+
debug: false,
|
|
2253
|
+
precision: 4,
|
|
2254
|
+
printTypes: false,
|
|
2255
|
+
printDegrees: false,
|
|
2256
|
+
printRowMajor: true
|
|
2257
|
+
};
|
|
2786
2258
|
function formatValue(value, {
|
|
2787
|
-
precision = config.precision
|
|
2259
|
+
precision = config.precision
|
|
2788
2260
|
} = {}) {
|
|
2789
2261
|
value = round(value);
|
|
2790
2262
|
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
@@ -2792,19 +2264,6 @@
|
|
|
2792
2264
|
function isArray(value) {
|
|
2793
2265
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
2794
2266
|
}
|
|
2795
|
-
function duplicateArray(array) {
|
|
2796
|
-
return array.clone ? array.clone() : new Array(array.length);
|
|
2797
|
-
}
|
|
2798
|
-
function map(value, func, result) {
|
|
2799
|
-
if (isArray(value)) {
|
|
2800
|
-
result = result || duplicateArray(value);
|
|
2801
|
-
for (let i2 = 0; i2 < result.length && i2 < value.length; ++i2) {
|
|
2802
|
-
result[i2] = func(value[i2], i2, result);
|
|
2803
|
-
}
|
|
2804
|
-
return result;
|
|
2805
|
-
}
|
|
2806
|
-
return func(value);
|
|
2807
|
-
}
|
|
2808
2267
|
function toRadians(degrees2) {
|
|
2809
2268
|
return radians(degrees2);
|
|
2810
2269
|
}
|
|
@@ -2843,7 +2302,7 @@
|
|
|
2843
2302
|
if (b && b.equals) {
|
|
2844
2303
|
return b.equals(a2);
|
|
2845
2304
|
}
|
|
2846
|
-
if (
|
|
2305
|
+
if (typeof a2 === "number" && typeof b === "number") {
|
|
2847
2306
|
return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
|
|
2848
2307
|
}
|
|
2849
2308
|
return false;
|
|
@@ -2851,6 +2310,23 @@
|
|
|
2851
2310
|
config.EPSILON = oldEpsilon;
|
|
2852
2311
|
}
|
|
2853
2312
|
}
|
|
2313
|
+
function round(value) {
|
|
2314
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
2315
|
+
}
|
|
2316
|
+
function duplicateArray(array) {
|
|
2317
|
+
return array.clone ? array.clone() : new Array(array.length);
|
|
2318
|
+
}
|
|
2319
|
+
function map(value, func, result) {
|
|
2320
|
+
if (isArray(value)) {
|
|
2321
|
+
const array = value;
|
|
2322
|
+
result = result || duplicateArray(array);
|
|
2323
|
+
for (let i2 = 0; i2 < result.length && i2 < array.length; ++i2) {
|
|
2324
|
+
result[i2] = func(value[i2], i2, result);
|
|
2325
|
+
}
|
|
2326
|
+
return result;
|
|
2327
|
+
}
|
|
2328
|
+
return func(value);
|
|
2329
|
+
}
|
|
2854
2330
|
|
|
2855
2331
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js
|
|
2856
2332
|
function _extendableBuiltin(cls) {
|
|
@@ -2875,22 +2351,24 @@
|
|
|
2875
2351
|
return ExtendableBuiltin;
|
|
2876
2352
|
}
|
|
2877
2353
|
var MathArray = class extends _extendableBuiltin(Array) {
|
|
2878
|
-
get ELEMENTS() {
|
|
2879
|
-
assert5(false);
|
|
2880
|
-
return 0;
|
|
2881
|
-
}
|
|
2882
2354
|
clone() {
|
|
2883
2355
|
return new this.constructor().copy(this);
|
|
2884
2356
|
}
|
|
2885
|
-
from(arrayOrObject) {
|
|
2886
|
-
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
2887
|
-
}
|
|
2888
2357
|
fromArray(array, offset = 0) {
|
|
2889
2358
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2890
2359
|
this[i2] = array[i2 + offset];
|
|
2891
2360
|
}
|
|
2892
2361
|
return this.check();
|
|
2893
2362
|
}
|
|
2363
|
+
toArray(targetArray = [], offset = 0) {
|
|
2364
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2365
|
+
targetArray[offset + i2] = this[i2];
|
|
2366
|
+
}
|
|
2367
|
+
return targetArray;
|
|
2368
|
+
}
|
|
2369
|
+
from(arrayOrObject) {
|
|
2370
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
2371
|
+
}
|
|
2894
2372
|
to(arrayOrObject) {
|
|
2895
2373
|
if (arrayOrObject === this) {
|
|
2896
2374
|
return this;
|
|
@@ -2900,12 +2378,6 @@
|
|
|
2900
2378
|
toTarget(target) {
|
|
2901
2379
|
return target ? this.to(target) : this;
|
|
2902
2380
|
}
|
|
2903
|
-
toArray(array = [], offset = 0) {
|
|
2904
|
-
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2905
|
-
array[offset + i2] = this[i2];
|
|
2906
|
-
}
|
|
2907
|
-
return array;
|
|
2908
|
-
}
|
|
2909
2381
|
toFloat32Array() {
|
|
2910
2382
|
return new Float32Array(this);
|
|
2911
2383
|
}
|
|
@@ -2949,9 +2421,7 @@
|
|
|
2949
2421
|
}
|
|
2950
2422
|
lerp(a2, b, t2) {
|
|
2951
2423
|
if (t2 === void 0) {
|
|
2952
|
-
|
|
2953
|
-
b = a2;
|
|
2954
|
-
a2 = this;
|
|
2424
|
+
return this.lerp(this, a2, b);
|
|
2955
2425
|
}
|
|
2956
2426
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2957
2427
|
const ai = a2[i2];
|
|
@@ -2994,14 +2464,36 @@
|
|
|
2994
2464
|
return this.check();
|
|
2995
2465
|
}
|
|
2996
2466
|
scale(scale2) {
|
|
2997
|
-
if (
|
|
2998
|
-
|
|
2467
|
+
if (typeof scale2 === "number") {
|
|
2468
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2469
|
+
this[i2] *= scale2;
|
|
2470
|
+
}
|
|
2471
|
+
} else {
|
|
2472
|
+
for (let i2 = 0; i2 < this.ELEMENTS && i2 < scale2.length; ++i2) {
|
|
2473
|
+
this[i2] *= scale2[i2];
|
|
2474
|
+
}
|
|
2999
2475
|
}
|
|
2476
|
+
return this.check();
|
|
2477
|
+
}
|
|
2478
|
+
multiplyByScalar(scalar) {
|
|
3000
2479
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3001
|
-
this[i2] *=
|
|
2480
|
+
this[i2] *= scalar;
|
|
3002
2481
|
}
|
|
3003
2482
|
return this.check();
|
|
3004
2483
|
}
|
|
2484
|
+
check() {
|
|
2485
|
+
if (config.debug && !this.validate()) {
|
|
2486
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
2487
|
+
}
|
|
2488
|
+
return this;
|
|
2489
|
+
}
|
|
2490
|
+
validate() {
|
|
2491
|
+
let valid = this.length === this.ELEMENTS;
|
|
2492
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2493
|
+
valid = valid && Number.isFinite(this[i2]);
|
|
2494
|
+
}
|
|
2495
|
+
return valid;
|
|
2496
|
+
}
|
|
3005
2497
|
sub(a2) {
|
|
3006
2498
|
return this.subtract(a2);
|
|
3007
2499
|
}
|
|
@@ -3027,7 +2519,7 @@
|
|
|
3027
2519
|
return this.check();
|
|
3028
2520
|
}
|
|
3029
2521
|
divideScalar(a2) {
|
|
3030
|
-
return this.
|
|
2522
|
+
return this.multiplyByScalar(1 / a2);
|
|
3031
2523
|
}
|
|
3032
2524
|
clampScalar(min, max) {
|
|
3033
2525
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
@@ -3035,25 +2527,9 @@
|
|
|
3035
2527
|
}
|
|
3036
2528
|
return this.check();
|
|
3037
2529
|
}
|
|
3038
|
-
multiplyByScalar(scalar) {
|
|
3039
|
-
return this.scale(scalar);
|
|
3040
|
-
}
|
|
3041
2530
|
get elements() {
|
|
3042
2531
|
return this;
|
|
3043
2532
|
}
|
|
3044
|
-
check() {
|
|
3045
|
-
if (config.debug && !this.validate()) {
|
|
3046
|
-
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
3047
|
-
}
|
|
3048
|
-
return this;
|
|
3049
|
-
}
|
|
3050
|
-
validate() {
|
|
3051
|
-
let valid = this.length === this.ELEMENTS;
|
|
3052
|
-
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3053
|
-
valid = valid && Number.isFinite(this[i2]);
|
|
3054
|
-
}
|
|
3055
|
-
return valid;
|
|
3056
|
-
}
|
|
3057
2533
|
};
|
|
3058
2534
|
|
|
3059
2535
|
// ../../node_modules/@math.gl/core/dist/esm/lib/validators.js
|
|
@@ -3080,24 +2556,9 @@
|
|
|
3080
2556
|
}
|
|
3081
2557
|
return v;
|
|
3082
2558
|
}
|
|
3083
|
-
var map2 = {};
|
|
3084
|
-
function deprecated(method, version) {
|
|
3085
|
-
if (!map2[method]) {
|
|
3086
|
-
map2[method] = true;
|
|
3087
|
-
console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
|
|
3088
|
-
}
|
|
3089
|
-
}
|
|
3090
2559
|
|
|
3091
2560
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js
|
|
3092
2561
|
var Vector = class extends MathArray {
|
|
3093
|
-
get ELEMENTS() {
|
|
3094
|
-
assert5(false);
|
|
3095
|
-
return 0;
|
|
3096
|
-
}
|
|
3097
|
-
copy(vector) {
|
|
3098
|
-
assert5(false);
|
|
3099
|
-
return this;
|
|
3100
|
-
}
|
|
3101
2562
|
get x() {
|
|
3102
2563
|
return this[0];
|
|
3103
2564
|
}
|
|
@@ -3179,11 +2640,11 @@
|
|
|
3179
2640
|
return this.distanceSquared(vector);
|
|
3180
2641
|
}
|
|
3181
2642
|
getComponent(i2) {
|
|
3182
|
-
|
|
2643
|
+
assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3183
2644
|
return checkNumber(this[i2]);
|
|
3184
2645
|
}
|
|
3185
2646
|
setComponent(i2, value) {
|
|
3186
|
-
|
|
2647
|
+
assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3187
2648
|
this[i2] = value;
|
|
3188
2649
|
return this.check();
|
|
3189
2650
|
}
|
|
@@ -3417,10 +2878,14 @@
|
|
|
3417
2878
|
|
|
3418
2879
|
// ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
|
|
3419
2880
|
var ORIGIN = [0, 0, 0];
|
|
3420
|
-
var
|
|
2881
|
+
var ZERO;
|
|
3421
2882
|
var Vector3 = class extends Vector {
|
|
3422
2883
|
static get ZERO() {
|
|
3423
|
-
|
|
2884
|
+
if (!ZERO) {
|
|
2885
|
+
ZERO = new Vector3(0, 0, 0);
|
|
2886
|
+
Object.freeze(ZERO);
|
|
2887
|
+
}
|
|
2888
|
+
return ZERO;
|
|
3424
2889
|
}
|
|
3425
2890
|
constructor(x = 0, y = 0, z = 0) {
|
|
3426
2891
|
super(-0, -0, -0);
|
|
@@ -3530,14 +2995,6 @@
|
|
|
3530
2995
|
|
|
3531
2996
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
|
|
3532
2997
|
var Matrix = class extends MathArray {
|
|
3533
|
-
get ELEMENTS() {
|
|
3534
|
-
assert5(false);
|
|
3535
|
-
return 0;
|
|
3536
|
-
}
|
|
3537
|
-
get RANK() {
|
|
3538
|
-
assert5(false);
|
|
3539
|
-
return 0;
|
|
3540
|
-
}
|
|
3541
2998
|
toString() {
|
|
3542
2999
|
let string = "[";
|
|
3543
3000
|
if (config.printRowMajor) {
|
|
@@ -4004,7 +3461,7 @@
|
|
|
4004
3461
|
out[15] = 0;
|
|
4005
3462
|
return out;
|
|
4006
3463
|
}
|
|
4007
|
-
function
|
|
3464
|
+
function perspectiveNO(out, fovy, aspect, near, far) {
|
|
4008
3465
|
var f2 = 1 / Math.tan(fovy / 2), nf;
|
|
4009
3466
|
out[0] = f2 / aspect;
|
|
4010
3467
|
out[1] = 0;
|
|
@@ -4030,7 +3487,8 @@
|
|
|
4030
3487
|
}
|
|
4031
3488
|
return out;
|
|
4032
3489
|
}
|
|
4033
|
-
|
|
3490
|
+
var perspective = perspectiveNO;
|
|
3491
|
+
function orthoNO(out, left, right, bottom, top, near, far) {
|
|
4034
3492
|
var lr = 1 / (left - right);
|
|
4035
3493
|
var bt = 1 / (bottom - top);
|
|
4036
3494
|
var nf = 1 / (near - far);
|
|
@@ -4052,6 +3510,7 @@
|
|
|
4052
3510
|
out[15] = 1;
|
|
4053
3511
|
return out;
|
|
4054
3512
|
}
|
|
3513
|
+
var ortho = orthoNO;
|
|
4055
3514
|
function lookAt(out, eye, center, up) {
|
|
4056
3515
|
var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
|
|
4057
3516
|
var eyex = eye[0];
|
|
@@ -4170,38 +3629,36 @@
|
|
|
4170
3629
|
}();
|
|
4171
3630
|
|
|
4172
3631
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
|
|
4173
|
-
var
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
var
|
|
3632
|
+
var INDICES;
|
|
3633
|
+
(function(INDICES2) {
|
|
3634
|
+
INDICES2[INDICES2["COL0ROW0"] = 0] = "COL0ROW0";
|
|
3635
|
+
INDICES2[INDICES2["COL0ROW1"] = 1] = "COL0ROW1";
|
|
3636
|
+
INDICES2[INDICES2["COL0ROW2"] = 2] = "COL0ROW2";
|
|
3637
|
+
INDICES2[INDICES2["COL0ROW3"] = 3] = "COL0ROW3";
|
|
3638
|
+
INDICES2[INDICES2["COL1ROW0"] = 4] = "COL1ROW0";
|
|
3639
|
+
INDICES2[INDICES2["COL1ROW1"] = 5] = "COL1ROW1";
|
|
3640
|
+
INDICES2[INDICES2["COL1ROW2"] = 6] = "COL1ROW2";
|
|
3641
|
+
INDICES2[INDICES2["COL1ROW3"] = 7] = "COL1ROW3";
|
|
3642
|
+
INDICES2[INDICES2["COL2ROW0"] = 8] = "COL2ROW0";
|
|
3643
|
+
INDICES2[INDICES2["COL2ROW1"] = 9] = "COL2ROW1";
|
|
3644
|
+
INDICES2[INDICES2["COL2ROW2"] = 10] = "COL2ROW2";
|
|
3645
|
+
INDICES2[INDICES2["COL2ROW3"] = 11] = "COL2ROW3";
|
|
3646
|
+
INDICES2[INDICES2["COL3ROW0"] = 12] = "COL3ROW0";
|
|
3647
|
+
INDICES2[INDICES2["COL3ROW1"] = 13] = "COL3ROW1";
|
|
3648
|
+
INDICES2[INDICES2["COL3ROW2"] = 14] = "COL3ROW2";
|
|
3649
|
+
INDICES2[INDICES2["COL3ROW3"] = 15] = "COL3ROW3";
|
|
3650
|
+
})(INDICES || (INDICES = {}));
|
|
3651
|
+
var DEFAULT_FOVY = 45 * Math.PI / 180;
|
|
3652
|
+
var DEFAULT_ASPECT = 1;
|
|
3653
|
+
var DEFAULT_NEAR = 0.1;
|
|
3654
|
+
var DEFAULT_FAR = 500;
|
|
3655
|
+
var IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
4194
3656
|
var Matrix4 = class extends Matrix {
|
|
4195
3657
|
static get IDENTITY() {
|
|
4196
|
-
|
|
4197
|
-
return constants2.IDENTITY;
|
|
3658
|
+
return getIdentityMatrix();
|
|
4198
3659
|
}
|
|
4199
3660
|
static get ZERO() {
|
|
4200
|
-
|
|
4201
|
-
return constants2.ZERO;
|
|
4202
|
-
}
|
|
4203
|
-
get INDICES() {
|
|
4204
|
-
return INDICES;
|
|
3661
|
+
return getZeroMatrix();
|
|
4205
3662
|
}
|
|
4206
3663
|
get ELEMENTS() {
|
|
4207
3664
|
return 16;
|
|
@@ -4209,6 +3666,9 @@
|
|
|
4209
3666
|
get RANK() {
|
|
4210
3667
|
return 4;
|
|
4211
3668
|
}
|
|
3669
|
+
get INDICES() {
|
|
3670
|
+
return INDICES;
|
|
3671
|
+
}
|
|
4212
3672
|
constructor(array) {
|
|
4213
3673
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
4214
3674
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
@@ -4294,91 +3754,65 @@
|
|
|
4294
3754
|
return result;
|
|
4295
3755
|
}
|
|
4296
3756
|
identity() {
|
|
4297
|
-
return this.copy(
|
|
3757
|
+
return this.copy(IDENTITY_MATRIX);
|
|
3758
|
+
}
|
|
3759
|
+
fromObject(object) {
|
|
3760
|
+
return this.check();
|
|
4298
3761
|
}
|
|
4299
|
-
fromQuaternion(
|
|
4300
|
-
fromQuat(this,
|
|
3762
|
+
fromQuaternion(quaternion) {
|
|
3763
|
+
fromQuat(this, quaternion);
|
|
4301
3764
|
return this.check();
|
|
4302
3765
|
}
|
|
4303
|
-
frustum({
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
3766
|
+
frustum(view) {
|
|
3767
|
+
const {
|
|
3768
|
+
left,
|
|
3769
|
+
right,
|
|
3770
|
+
bottom,
|
|
3771
|
+
top,
|
|
3772
|
+
near = DEFAULT_NEAR,
|
|
3773
|
+
far = DEFAULT_FAR
|
|
3774
|
+
} = view;
|
|
4311
3775
|
if (far === Infinity) {
|
|
4312
|
-
|
|
3776
|
+
computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
|
|
4313
3777
|
} else {
|
|
4314
3778
|
frustum(this, left, right, bottom, top, near, far);
|
|
4315
3779
|
}
|
|
4316
3780
|
return this.check();
|
|
4317
3781
|
}
|
|
4318
|
-
|
|
4319
|
-
const
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
const column2Row3 = -1;
|
|
4325
|
-
const column3Row2 = -2 * near;
|
|
4326
|
-
result[0] = column0Row0;
|
|
4327
|
-
result[1] = 0;
|
|
4328
|
-
result[2] = 0;
|
|
4329
|
-
result[3] = 0;
|
|
4330
|
-
result[4] = 0;
|
|
4331
|
-
result[5] = column1Row1;
|
|
4332
|
-
result[6] = 0;
|
|
4333
|
-
result[7] = 0;
|
|
4334
|
-
result[8] = column2Row0;
|
|
4335
|
-
result[9] = column2Row1;
|
|
4336
|
-
result[10] = column2Row2;
|
|
4337
|
-
result[11] = column2Row3;
|
|
4338
|
-
result[12] = 0;
|
|
4339
|
-
result[13] = 0;
|
|
4340
|
-
result[14] = column3Row2;
|
|
4341
|
-
result[15] = 0;
|
|
4342
|
-
return result;
|
|
4343
|
-
}
|
|
4344
|
-
lookAt(eye, center, up) {
|
|
4345
|
-
if (arguments.length === 1) {
|
|
4346
|
-
({
|
|
4347
|
-
eye,
|
|
4348
|
-
center,
|
|
4349
|
-
up
|
|
4350
|
-
} = eye);
|
|
4351
|
-
}
|
|
4352
|
-
center = center || [0, 0, 0];
|
|
4353
|
-
up = up || [0, 1, 0];
|
|
3782
|
+
lookAt(view) {
|
|
3783
|
+
const {
|
|
3784
|
+
eye,
|
|
3785
|
+
center = [0, 0, 0],
|
|
3786
|
+
up = [0, 1, 0]
|
|
3787
|
+
} = view;
|
|
4354
3788
|
lookAt(this, eye, center, up);
|
|
4355
3789
|
return this.check();
|
|
4356
3790
|
}
|
|
4357
|
-
ortho({
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
3791
|
+
ortho(view) {
|
|
3792
|
+
const {
|
|
3793
|
+
left,
|
|
3794
|
+
right,
|
|
3795
|
+
bottom,
|
|
3796
|
+
top,
|
|
3797
|
+
near = DEFAULT_NEAR,
|
|
3798
|
+
far = DEFAULT_FAR
|
|
3799
|
+
} = view;
|
|
4365
3800
|
ortho(this, left, right, bottom, top, near, far);
|
|
4366
3801
|
return this.check();
|
|
4367
3802
|
}
|
|
4368
|
-
orthographic({
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
}
|
|
3803
|
+
orthographic(view) {
|
|
3804
|
+
const {
|
|
3805
|
+
fovy = DEFAULT_FOVY,
|
|
3806
|
+
aspect = DEFAULT_ASPECT,
|
|
3807
|
+
focalDistance = 1,
|
|
3808
|
+
near = DEFAULT_NEAR,
|
|
3809
|
+
far = DEFAULT_FAR
|
|
3810
|
+
} = view;
|
|
3811
|
+
checkRadians(fovy);
|
|
4378
3812
|
const halfY = fovy / 2;
|
|
4379
3813
|
const top = focalDistance * Math.tan(halfY);
|
|
4380
3814
|
const right = top * aspect;
|
|
4381
|
-
return
|
|
3815
|
+
return this.ortho({
|
|
4382
3816
|
left: -right,
|
|
4383
3817
|
right,
|
|
4384
3818
|
bottom: -top,
|
|
@@ -4387,17 +3821,14 @@
|
|
|
4387
3821
|
far
|
|
4388
3822
|
});
|
|
4389
3823
|
}
|
|
4390
|
-
perspective({
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
fovy
|
|
4398
|
-
if (fovy > Math.PI * 2) {
|
|
4399
|
-
throw Error("radians");
|
|
4400
|
-
}
|
|
3824
|
+
perspective(view) {
|
|
3825
|
+
const {
|
|
3826
|
+
fovy = 45 * Math.PI / 180,
|
|
3827
|
+
aspect = 1,
|
|
3828
|
+
near = 0.1,
|
|
3829
|
+
far = 500
|
|
3830
|
+
} = view;
|
|
3831
|
+
checkRadians(fovy);
|
|
4401
3832
|
perspective(this, fovy, aspect, near, far);
|
|
4402
3833
|
return this.check();
|
|
4403
3834
|
}
|
|
@@ -4416,8 +3847,10 @@
|
|
|
4416
3847
|
result[2] = this[14];
|
|
4417
3848
|
return result;
|
|
4418
3849
|
}
|
|
4419
|
-
getRotation(result
|
|
4420
|
-
|
|
3850
|
+
getRotation(result, scaleResult) {
|
|
3851
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3852
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
3853
|
+
const scale2 = this.getScale(scaleResult);
|
|
4421
3854
|
const inverseScale0 = 1 / scale2[0];
|
|
4422
3855
|
const inverseScale1 = 1 / scale2[1];
|
|
4423
3856
|
const inverseScale2 = 1 / scale2[2];
|
|
@@ -4439,8 +3872,10 @@
|
|
|
4439
3872
|
result[15] = 1;
|
|
4440
3873
|
return result;
|
|
4441
3874
|
}
|
|
4442
|
-
getRotationMatrix3(result
|
|
4443
|
-
|
|
3875
|
+
getRotationMatrix3(result, scaleResult) {
|
|
3876
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3877
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
3878
|
+
const scale2 = this.getScale(scaleResult);
|
|
4444
3879
|
const inverseScale0 = 1 / scale2[0];
|
|
4445
3880
|
const inverseScale1 = 1 / scale2[1];
|
|
4446
3881
|
const inverseScale2 = 1 / scale2[2];
|
|
@@ -4483,23 +3918,19 @@
|
|
|
4483
3918
|
rotateZ2(this, this, radians2);
|
|
4484
3919
|
return this.check();
|
|
4485
3920
|
}
|
|
4486
|
-
rotateXYZ(
|
|
4487
|
-
return this.rotateX(
|
|
3921
|
+
rotateXYZ(angleXYZ) {
|
|
3922
|
+
return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
|
|
4488
3923
|
}
|
|
4489
3924
|
rotateAxis(radians2, axis) {
|
|
4490
3925
|
rotate(this, this, radians2, axis);
|
|
4491
3926
|
return this.check();
|
|
4492
3927
|
}
|
|
4493
3928
|
scale(factor) {
|
|
4494
|
-
|
|
4495
|
-
scale(this, this, factor);
|
|
4496
|
-
} else {
|
|
4497
|
-
scale(this, this, [factor, factor, factor]);
|
|
4498
|
-
}
|
|
3929
|
+
scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
4499
3930
|
return this.check();
|
|
4500
3931
|
}
|
|
4501
|
-
translate(
|
|
4502
|
-
translate(this, this,
|
|
3932
|
+
translate(vector) {
|
|
3933
|
+
translate(this, this, vector);
|
|
4503
3934
|
return this.check();
|
|
4504
3935
|
}
|
|
4505
3936
|
transform(vector, result) {
|
|
@@ -4514,52 +3945,98 @@
|
|
|
4514
3945
|
const {
|
|
4515
3946
|
length: length2
|
|
4516
3947
|
} = vector;
|
|
3948
|
+
let out;
|
|
4517
3949
|
switch (length2) {
|
|
4518
3950
|
case 2:
|
|
4519
|
-
|
|
3951
|
+
out = transformMat4(result || [-0, -0], vector, this);
|
|
4520
3952
|
break;
|
|
4521
3953
|
case 3:
|
|
4522
|
-
|
|
3954
|
+
out = transformMat42(result || [-0, -0, -0], vector, this);
|
|
4523
3955
|
break;
|
|
4524
3956
|
default:
|
|
4525
3957
|
throw new Error("Illegal vector");
|
|
4526
3958
|
}
|
|
4527
|
-
checkVector(
|
|
4528
|
-
return
|
|
3959
|
+
checkVector(out, vector.length);
|
|
3960
|
+
return out;
|
|
4529
3961
|
}
|
|
4530
3962
|
transformAsVector(vector, result) {
|
|
3963
|
+
let out;
|
|
4531
3964
|
switch (vector.length) {
|
|
4532
3965
|
case 2:
|
|
4533
|
-
|
|
3966
|
+
out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
|
|
4534
3967
|
break;
|
|
4535
3968
|
case 3:
|
|
4536
|
-
|
|
3969
|
+
out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
|
|
4537
3970
|
break;
|
|
4538
3971
|
default:
|
|
4539
3972
|
throw new Error("Illegal vector");
|
|
4540
3973
|
}
|
|
4541
|
-
checkVector(
|
|
4542
|
-
return
|
|
4543
|
-
}
|
|
4544
|
-
makeRotationX(radians2) {
|
|
4545
|
-
return this.identity().rotateX(radians2);
|
|
4546
|
-
}
|
|
4547
|
-
makeTranslation(x, y, z) {
|
|
4548
|
-
return this.identity().translate([x, y, z]);
|
|
3974
|
+
checkVector(out, vector.length);
|
|
3975
|
+
return out;
|
|
4549
3976
|
}
|
|
4550
3977
|
transformPoint(vector, result) {
|
|
4551
|
-
deprecated("Matrix4.transformPoint", "3.0");
|
|
4552
3978
|
return this.transformAsPoint(vector, result);
|
|
4553
3979
|
}
|
|
4554
3980
|
transformVector(vector, result) {
|
|
4555
|
-
deprecated("Matrix4.transformVector", "3.0");
|
|
4556
3981
|
return this.transformAsPoint(vector, result);
|
|
4557
3982
|
}
|
|
4558
3983
|
transformDirection(vector, result) {
|
|
4559
|
-
deprecated("Matrix4.transformDirection", "3.0");
|
|
4560
3984
|
return this.transformAsVector(vector, result);
|
|
4561
3985
|
}
|
|
3986
|
+
makeRotationX(radians2) {
|
|
3987
|
+
return this.identity().rotateX(radians2);
|
|
3988
|
+
}
|
|
3989
|
+
makeTranslation(x, y, z) {
|
|
3990
|
+
return this.identity().translate([x, y, z]);
|
|
3991
|
+
}
|
|
4562
3992
|
};
|
|
3993
|
+
var ZERO2;
|
|
3994
|
+
var IDENTITY;
|
|
3995
|
+
function getZeroMatrix() {
|
|
3996
|
+
if (!ZERO2) {
|
|
3997
|
+
ZERO2 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
3998
|
+
Object.freeze(ZERO2);
|
|
3999
|
+
}
|
|
4000
|
+
return ZERO2;
|
|
4001
|
+
}
|
|
4002
|
+
function getIdentityMatrix() {
|
|
4003
|
+
if (!IDENTITY) {
|
|
4004
|
+
IDENTITY = new Matrix4();
|
|
4005
|
+
Object.freeze(IDENTITY);
|
|
4006
|
+
}
|
|
4007
|
+
return IDENTITY;
|
|
4008
|
+
}
|
|
4009
|
+
function checkRadians(possiblyDegrees) {
|
|
4010
|
+
if (possiblyDegrees > Math.PI * 2) {
|
|
4011
|
+
throw Error("expected radians");
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
|
|
4015
|
+
const column0Row0 = 2 * near / (right - left);
|
|
4016
|
+
const column1Row1 = 2 * near / (top - bottom);
|
|
4017
|
+
const column2Row0 = (right + left) / (right - left);
|
|
4018
|
+
const column2Row1 = (top + bottom) / (top - bottom);
|
|
4019
|
+
const column2Row2 = -1;
|
|
4020
|
+
const column2Row3 = -1;
|
|
4021
|
+
const column3Row2 = -2 * near;
|
|
4022
|
+
result[0] = column0Row0;
|
|
4023
|
+
result[1] = 0;
|
|
4024
|
+
result[2] = 0;
|
|
4025
|
+
result[3] = 0;
|
|
4026
|
+
result[4] = 0;
|
|
4027
|
+
result[5] = column1Row1;
|
|
4028
|
+
result[6] = 0;
|
|
4029
|
+
result[7] = 0;
|
|
4030
|
+
result[8] = column2Row0;
|
|
4031
|
+
result[9] = column2Row1;
|
|
4032
|
+
result[10] = column2Row2;
|
|
4033
|
+
result[11] = column2Row3;
|
|
4034
|
+
result[12] = 0;
|
|
4035
|
+
result[13] = 0;
|
|
4036
|
+
result[14] = column3Row2;
|
|
4037
|
+
result[15] = 0;
|
|
4038
|
+
return result;
|
|
4039
|
+
}
|
|
4563
4040
|
|
|
4564
4041
|
// ../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js
|
|
4565
4042
|
var math_utils_default = {
|
|
@@ -4589,17 +4066,6 @@
|
|
|
4589
4066
|
TWO_PI: Math.PI * 2
|
|
4590
4067
|
};
|
|
4591
4068
|
|
|
4592
|
-
// ../../node_modules/@math.gl/core/dist/esm/index.js
|
|
4593
|
-
var globals5 = {
|
|
4594
|
-
self: typeof self !== "undefined" && self,
|
|
4595
|
-
window: typeof window !== "undefined" && window,
|
|
4596
|
-
global: typeof global !== "undefined" && global
|
|
4597
|
-
};
|
|
4598
|
-
var global_5 = globals5.global || globals5.self || globals5.window;
|
|
4599
|
-
global_5.mathgl = {
|
|
4600
|
-
config
|
|
4601
|
-
};
|
|
4602
|
-
|
|
4603
4069
|
// ../../node_modules/@math.gl/geospatial/dist/esm/constants.js
|
|
4604
4070
|
var WGS84_RADIUS_X = 6378137;
|
|
4605
4071
|
var WGS84_RADIUS_Y = 6378137;
|
|
@@ -4614,61 +4080,63 @@
|
|
|
4614
4080
|
};
|
|
4615
4081
|
|
|
4616
4082
|
// ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
|
|
4617
|
-
|
|
4083
|
+
function identity2(x) {
|
|
4084
|
+
return x;
|
|
4085
|
+
}
|
|
4618
4086
|
var scratchVector = new Vector3();
|
|
4619
|
-
function fromCartographic(cartographic, result,
|
|
4620
|
-
if (
|
|
4621
|
-
result[0] =
|
|
4622
|
-
result[1] =
|
|
4623
|
-
result[2] = cartographic[2];
|
|
4624
|
-
} else if ("longitude" in cartographic) {
|
|
4625
|
-
result[0] = map3(cartographic.longitude);
|
|
4626
|
-
result[1] = map3(cartographic.latitude);
|
|
4087
|
+
function fromCartographic(cartographic, result = [], map2 = identity2) {
|
|
4088
|
+
if ("longitude" in cartographic) {
|
|
4089
|
+
result[0] = map2(cartographic.longitude);
|
|
4090
|
+
result[1] = map2(cartographic.latitude);
|
|
4627
4091
|
result[2] = cartographic.height;
|
|
4628
|
-
} else {
|
|
4629
|
-
result[0] =
|
|
4630
|
-
result[1] =
|
|
4092
|
+
} else if ("x" in cartographic) {
|
|
4093
|
+
result[0] = map2(cartographic.x);
|
|
4094
|
+
result[1] = map2(cartographic.y);
|
|
4631
4095
|
result[2] = cartographic.z;
|
|
4096
|
+
} else {
|
|
4097
|
+
result[0] = map2(cartographic[0]);
|
|
4098
|
+
result[1] = map2(cartographic[1]);
|
|
4099
|
+
result[2] = cartographic[2];
|
|
4632
4100
|
}
|
|
4633
4101
|
return result;
|
|
4634
4102
|
}
|
|
4635
|
-
function fromCartographicToRadians(cartographic, vector =
|
|
4636
|
-
return fromCartographic(cartographic, vector, config._cartographicRadians ?
|
|
4103
|
+
function fromCartographicToRadians(cartographic, vector = []) {
|
|
4104
|
+
return fromCartographic(cartographic, vector, config._cartographicRadians ? identity2 : toRadians);
|
|
4637
4105
|
}
|
|
4638
|
-
function toCartographic(vector, cartographic,
|
|
4639
|
-
if (
|
|
4640
|
-
cartographic
|
|
4641
|
-
cartographic
|
|
4642
|
-
cartographic[2] = vector[2];
|
|
4643
|
-
} else if ("longitude" in cartographic) {
|
|
4644
|
-
cartographic.longitude = map3(vector[0]);
|
|
4645
|
-
cartographic.latitude = map3(vector[1]);
|
|
4106
|
+
function toCartographic(vector, cartographic, map2 = identity2) {
|
|
4107
|
+
if ("longitude" in cartographic) {
|
|
4108
|
+
cartographic.longitude = map2(vector[0]);
|
|
4109
|
+
cartographic.latitude = map2(vector[1]);
|
|
4646
4110
|
cartographic.height = vector[2];
|
|
4647
|
-
} else {
|
|
4648
|
-
cartographic.x =
|
|
4649
|
-
cartographic.y =
|
|
4111
|
+
} else if ("x" in cartographic) {
|
|
4112
|
+
cartographic.x = map2(vector[0]);
|
|
4113
|
+
cartographic.y = map2(vector[1]);
|
|
4650
4114
|
cartographic.z = vector[2];
|
|
4115
|
+
} else {
|
|
4116
|
+
cartographic[0] = map2(vector[0]);
|
|
4117
|
+
cartographic[1] = map2(vector[1]);
|
|
4118
|
+
cartographic[2] = vector[2];
|
|
4651
4119
|
}
|
|
4652
4120
|
return cartographic;
|
|
4653
4121
|
}
|
|
4654
4122
|
function toCartographicFromRadians(vector, cartographic) {
|
|
4655
|
-
return toCartographic(vector, cartographic, config._cartographicRadians ?
|
|
4123
|
+
return toCartographic(vector, cartographic, config._cartographicRadians ? identity2 : toDegrees);
|
|
4656
4124
|
}
|
|
4657
4125
|
|
|
4658
4126
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
|
|
4659
4127
|
var scratchVector2 = new Vector3();
|
|
4660
4128
|
var scaleToGeodeticSurfaceIntersection = new Vector3();
|
|
4661
4129
|
var scaleToGeodeticSurfaceGradient = new Vector3();
|
|
4662
|
-
function scaleToGeodeticSurface(cartesian, ellipsoid, result =
|
|
4130
|
+
function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
|
|
4663
4131
|
const {
|
|
4664
4132
|
oneOverRadii,
|
|
4665
4133
|
oneOverRadiiSquared,
|
|
4666
4134
|
centerToleranceSquared
|
|
4667
4135
|
} = ellipsoid;
|
|
4668
4136
|
scratchVector2.from(cartesian);
|
|
4669
|
-
const positionX =
|
|
4670
|
-
const positionY =
|
|
4671
|
-
const positionZ =
|
|
4137
|
+
const positionX = scratchVector2.x;
|
|
4138
|
+
const positionY = scratchVector2.y;
|
|
4139
|
+
const positionZ = scratchVector2.z;
|
|
4672
4140
|
const oneOverRadiiX = oneOverRadii.x;
|
|
4673
4141
|
const oneOverRadiiY = oneOverRadii.y;
|
|
4674
4142
|
const oneOverRadiiZ = oneOverRadii.z;
|
|
@@ -4690,7 +4158,7 @@
|
|
|
4690
4158
|
const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
|
|
4691
4159
|
const gradient = scaleToGeodeticSurfaceGradient;
|
|
4692
4160
|
gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
|
|
4693
|
-
let lambda = (1 - ratio) *
|
|
4161
|
+
let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
|
|
4694
4162
|
let correction = 0;
|
|
4695
4163
|
let xMultiplier;
|
|
4696
4164
|
let yMultiplier;
|
|
@@ -4777,7 +4245,7 @@
|
|
|
4777
4245
|
var scratchVector3 = new Vector3();
|
|
4778
4246
|
function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
|
|
4779
4247
|
const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
|
|
4780
|
-
|
|
4248
|
+
assert4(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
|
|
4781
4249
|
let firstAxisVector;
|
|
4782
4250
|
let secondAxisVector;
|
|
4783
4251
|
let thirdAxisVector;
|
|
@@ -4844,16 +4312,20 @@
|
|
|
4844
4312
|
var scratchPosition = new Vector3();
|
|
4845
4313
|
var scratchHeight = new Vector3();
|
|
4846
4314
|
var scratchCartesian = new Vector3();
|
|
4847
|
-
var wgs84;
|
|
4848
4315
|
var Ellipsoid = class {
|
|
4849
|
-
static get WGS84() {
|
|
4850
|
-
wgs84 = wgs84 || new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
|
|
4851
|
-
return wgs84;
|
|
4852
|
-
}
|
|
4853
4316
|
constructor(x = 0, y = 0, z = 0) {
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4317
|
+
_defineProperty(this, "radii", void 0);
|
|
4318
|
+
_defineProperty(this, "radiiSquared", void 0);
|
|
4319
|
+
_defineProperty(this, "radiiToTheFourth", void 0);
|
|
4320
|
+
_defineProperty(this, "oneOverRadii", void 0);
|
|
4321
|
+
_defineProperty(this, "oneOverRadiiSquared", void 0);
|
|
4322
|
+
_defineProperty(this, "minimumRadius", void 0);
|
|
4323
|
+
_defineProperty(this, "maximumRadius", void 0);
|
|
4324
|
+
_defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
|
|
4325
|
+
_defineProperty(this, "squaredXOverSquaredZ", void 0);
|
|
4326
|
+
assert4(x >= 0);
|
|
4327
|
+
assert4(y >= 0);
|
|
4328
|
+
assert4(z >= 0);
|
|
4857
4329
|
this.radii = new Vector3(x, y, z);
|
|
4858
4330
|
this.radiiSquared = new Vector3(x * x, y * y, z * z);
|
|
4859
4331
|
this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
|
|
@@ -4861,7 +4333,6 @@
|
|
|
4861
4333
|
this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
|
|
4862
4334
|
this.minimumRadius = Math.min(x, y, z);
|
|
4863
4335
|
this.maximumRadius = Math.max(x, y, z);
|
|
4864
|
-
this.centerToleranceSquared = math_utils_default.EPSILON1;
|
|
4865
4336
|
if (this.radiiSquared.z !== 0) {
|
|
4866
4337
|
this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
|
|
4867
4338
|
}
|
|
@@ -4938,8 +4409,8 @@
|
|
|
4938
4409
|
return scratchPosition.from(position).scale(this.radii).to(result);
|
|
4939
4410
|
}
|
|
4940
4411
|
getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
|
|
4941
|
-
|
|
4942
|
-
|
|
4412
|
+
assert4(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
|
|
4413
|
+
assert4(this.radii.z > 0);
|
|
4943
4414
|
scratchPosition.from(position);
|
|
4944
4415
|
const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
|
|
4945
4416
|
if (Math.abs(z) >= this.radii.z - buffer) {
|
|
@@ -4948,9 +4419,10 @@
|
|
|
4948
4419
|
return scratchPosition.set(0, 0, z).to(result);
|
|
4949
4420
|
}
|
|
4950
4421
|
};
|
|
4422
|
+
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
4951
4423
|
|
|
4952
4424
|
// ../images/src/lib/utils/version.ts
|
|
4953
|
-
var
|
|
4425
|
+
var VERSION4 = true ? "3.3.0-alpha.11" : "latest";
|
|
4954
4426
|
|
|
4955
4427
|
// ../images/src/lib/category-api/image-type.ts
|
|
4956
4428
|
var { _parseImageNode } = globalThis;
|
|
@@ -5289,7 +4761,7 @@
|
|
|
5289
4761
|
id: "image",
|
|
5290
4762
|
module: "images",
|
|
5291
4763
|
name: "Images",
|
|
5292
|
-
version:
|
|
4764
|
+
version: VERSION4,
|
|
5293
4765
|
mimeTypes: MIME_TYPES,
|
|
5294
4766
|
extensions: EXTENSIONS,
|
|
5295
4767
|
parse: parseImage,
|
|
@@ -5298,7 +4770,7 @@
|
|
|
5298
4770
|
};
|
|
5299
4771
|
|
|
5300
4772
|
// ../draco/src/lib/utils/version.ts
|
|
5301
|
-
var
|
|
4773
|
+
var VERSION5 = true ? "3.3.0-alpha.11" : "latest";
|
|
5302
4774
|
|
|
5303
4775
|
// ../draco/src/draco-loader.ts
|
|
5304
4776
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -5311,10 +4783,10 @@
|
|
|
5311
4783
|
};
|
|
5312
4784
|
var DracoLoader = {
|
|
5313
4785
|
name: "Draco",
|
|
5314
|
-
id: "draco",
|
|
4786
|
+
id: isBrowser2 ? "draco" : "draco-nodejs",
|
|
5315
4787
|
module: "draco",
|
|
5316
4788
|
shapes: ["mesh"],
|
|
5317
|
-
version:
|
|
4789
|
+
version: VERSION5,
|
|
5318
4790
|
worker: true,
|
|
5319
4791
|
extensions: ["drc"],
|
|
5320
4792
|
mimeTypes: ["application/octet-stream"],
|
|
@@ -5351,7 +4823,7 @@
|
|
|
5351
4823
|
}
|
|
5352
4824
|
|
|
5353
4825
|
// ../schema/src/lib/utils/assert.ts
|
|
5354
|
-
function
|
|
4826
|
+
function assert5(condition, message) {
|
|
5355
4827
|
if (!condition) {
|
|
5356
4828
|
throw new Error(message || "loader assertion failed.");
|
|
5357
4829
|
}
|
|
@@ -5360,7 +4832,7 @@
|
|
|
5360
4832
|
// ../schema/src/lib/schema/impl/schema.ts
|
|
5361
4833
|
var Schema = class {
|
|
5362
4834
|
constructor(fields, metadata) {
|
|
5363
|
-
|
|
4835
|
+
assert5(Array.isArray(fields));
|
|
5364
4836
|
checkNames(fields);
|
|
5365
4837
|
this.fields = fields;
|
|
5366
4838
|
this.metadata = metadata || new Map();
|
|
@@ -6219,11 +5691,13 @@
|
|
|
6219
5691
|
}
|
|
6220
5692
|
|
|
6221
5693
|
// ../draco/src/lib/draco-module-loader.ts
|
|
6222
|
-
var
|
|
6223
|
-
var
|
|
6224
|
-
var
|
|
6225
|
-
var
|
|
6226
|
-
var
|
|
5694
|
+
var DRACO_DECODER_VERSION = "1.5.5";
|
|
5695
|
+
var DRACO_ENCODER_VERSION = "1.4.1";
|
|
5696
|
+
var STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
5697
|
+
var DRACO_JS_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.js`;
|
|
5698
|
+
var DRACO_WASM_WRAPPER_URL = `${STATIC_DECODER_URL}/draco_wasm_wrapper.js`;
|
|
5699
|
+
var DRACO_WASM_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.wasm`;
|
|
5700
|
+
var DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/draco_encoder.js`;
|
|
6227
5701
|
var loadDecoderPromise;
|
|
6228
5702
|
async function loadDracoDecoderModule(options) {
|
|
6229
5703
|
const modules = options.modules || {};
|
|
@@ -6282,12 +5756,12 @@
|
|
|
6282
5756
|
}
|
|
6283
5757
|
|
|
6284
5758
|
// ../textures/src/lib/utils/version.ts
|
|
6285
|
-
var
|
|
5759
|
+
var VERSION6 = true ? "3.3.0-alpha.11" : "beta";
|
|
6286
5760
|
|
|
6287
5761
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6288
|
-
var
|
|
6289
|
-
var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${
|
|
6290
|
-
var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${
|
|
5762
|
+
var VERSION7 = true ? "3.3.0-alpha.11" : "beta";
|
|
5763
|
+
var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.wasm`;
|
|
5764
|
+
var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.js`;
|
|
6291
5765
|
var loadBasisTranscoderPromise;
|
|
6292
5766
|
async function loadBasisTrascoderModule(options) {
|
|
6293
5767
|
const modules = options.modules || {};
|
|
@@ -6313,8 +5787,8 @@
|
|
|
6313
5787
|
options.wasmBinary = wasmBinary;
|
|
6314
5788
|
}
|
|
6315
5789
|
return new Promise((resolve) => {
|
|
6316
|
-
BasisModule(options).then((
|
|
6317
|
-
const { BasisFile, initializeBasis } =
|
|
5790
|
+
BasisModule(options).then((module) => {
|
|
5791
|
+
const { BasisFile, initializeBasis } = module;
|
|
6318
5792
|
initializeBasis();
|
|
6319
5793
|
resolve({ BasisFile });
|
|
6320
5794
|
});
|
|
@@ -6345,8 +5819,8 @@
|
|
|
6345
5819
|
options.wasmBinary = wasmBinary;
|
|
6346
5820
|
}
|
|
6347
5821
|
return new Promise((resolve) => {
|
|
6348
|
-
BasisEncoderModule(options).then((
|
|
6349
|
-
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } =
|
|
5822
|
+
BasisEncoderModule(options).then((module) => {
|
|
5823
|
+
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;
|
|
6350
5824
|
initializeBasis();
|
|
6351
5825
|
resolve({ BasisFile, KTX2File, BasisEncoder });
|
|
6352
5826
|
});
|
|
@@ -6874,9 +6348,9 @@
|
|
|
6874
6348
|
// ../textures/src/basis-loader.ts
|
|
6875
6349
|
var BasisWorkerLoader = {
|
|
6876
6350
|
name: "Basis",
|
|
6877
|
-
id: "basis",
|
|
6351
|
+
id: isBrowser2 ? "basis" : "basis-nodejs",
|
|
6878
6352
|
module: "textures",
|
|
6879
|
-
version:
|
|
6353
|
+
version: VERSION6,
|
|
6880
6354
|
worker: true,
|
|
6881
6355
|
extensions: ["basis", "ktx2"],
|
|
6882
6356
|
mimeTypes: ["application/octet-stream", "image/ktx2"],
|
|
@@ -7189,7 +6663,7 @@
|
|
|
7189
6663
|
name: "Texture Containers",
|
|
7190
6664
|
id: "compressed-texture",
|
|
7191
6665
|
module: "textures",
|
|
7192
|
-
version:
|
|
6666
|
+
version: VERSION6,
|
|
7193
6667
|
worker: true,
|
|
7194
6668
|
extensions: [
|
|
7195
6669
|
"ktx",
|
|
@@ -7251,7 +6725,7 @@
|
|
|
7251
6725
|
}
|
|
7252
6726
|
|
|
7253
6727
|
// ../../node_modules/@luma.gl/constants/dist/esm/index.js
|
|
7254
|
-
var
|
|
6728
|
+
var esm_default2 = {
|
|
7255
6729
|
DEPTH_BUFFER_BIT: 256,
|
|
7256
6730
|
STENCIL_BUFFER_BIT: 1024,
|
|
7257
6731
|
COLOR_BUFFER_BIT: 16384,
|
|
@@ -7886,11 +7360,11 @@
|
|
|
7886
7360
|
}
|
|
7887
7361
|
}
|
|
7888
7362
|
var GL_TYPE_MAP = {
|
|
7889
|
-
UInt8:
|
|
7890
|
-
UInt16:
|
|
7891
|
-
Float32:
|
|
7892
|
-
UInt32:
|
|
7893
|
-
UInt64:
|
|
7363
|
+
UInt8: esm_default2.UNSIGNED_BYTE,
|
|
7364
|
+
UInt16: esm_default2.UNSIGNED_SHORT,
|
|
7365
|
+
Float32: esm_default2.FLOAT,
|
|
7366
|
+
UInt32: esm_default2.UNSIGNED_INT,
|
|
7367
|
+
UInt64: esm_default2.DOUBLE
|
|
7894
7368
|
};
|
|
7895
7369
|
function sizeOf(dataType) {
|
|
7896
7370
|
switch (dataType) {
|
|
@@ -7911,6 +7385,10 @@
|
|
|
7911
7385
|
throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);
|
|
7912
7386
|
}
|
|
7913
7387
|
}
|
|
7388
|
+
var STRING_ATTRIBUTE_TYPE = "String";
|
|
7389
|
+
var OBJECT_ID_ATTRIBUTE_TYPE = "Oid32";
|
|
7390
|
+
var FLOAT_64_TYPE = "Float64";
|
|
7391
|
+
var INT_16_ATTRIBUTE_TYPE = "Int16";
|
|
7914
7392
|
var COORDINATE_SYSTEM;
|
|
7915
7393
|
(function(COORDINATE_SYSTEM2) {
|
|
7916
7394
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["DEFAULT"] = -1] = "DEFAULT";
|
|
@@ -7920,6 +7398,149 @@
|
|
|
7920
7398
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["CARTESIAN"] = 0] = "CARTESIAN";
|
|
7921
7399
|
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
7922
7400
|
|
|
7401
|
+
// src/lib/parsers/parse-i3s-attribute.ts
|
|
7402
|
+
async function parseI3STileAttribute(arrayBuffer, options) {
|
|
7403
|
+
const { attributeName, attributeType } = options;
|
|
7404
|
+
if (!attributeName) {
|
|
7405
|
+
return {};
|
|
7406
|
+
}
|
|
7407
|
+
return {
|
|
7408
|
+
[attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null
|
|
7409
|
+
};
|
|
7410
|
+
}
|
|
7411
|
+
function parseAttribute(attributeType, arrayBuffer) {
|
|
7412
|
+
switch (attributeType) {
|
|
7413
|
+
case STRING_ATTRIBUTE_TYPE:
|
|
7414
|
+
return parseStringsAttribute(arrayBuffer);
|
|
7415
|
+
case OBJECT_ID_ATTRIBUTE_TYPE:
|
|
7416
|
+
return parseShortNumberAttribute(arrayBuffer);
|
|
7417
|
+
case FLOAT_64_TYPE:
|
|
7418
|
+
return parseFloatAttribute(arrayBuffer);
|
|
7419
|
+
case INT_16_ATTRIBUTE_TYPE:
|
|
7420
|
+
return parseInt16ShortNumberAttribute(arrayBuffer);
|
|
7421
|
+
default:
|
|
7422
|
+
return parseShortNumberAttribute(arrayBuffer);
|
|
7423
|
+
}
|
|
7424
|
+
}
|
|
7425
|
+
function parseShortNumberAttribute(arrayBuffer) {
|
|
7426
|
+
const countOffset = 4;
|
|
7427
|
+
return new Uint32Array(arrayBuffer, countOffset);
|
|
7428
|
+
}
|
|
7429
|
+
function parseInt16ShortNumberAttribute(arrayBuffer) {
|
|
7430
|
+
const countOffset = 4;
|
|
7431
|
+
return new Int16Array(arrayBuffer, countOffset);
|
|
7432
|
+
}
|
|
7433
|
+
function parseFloatAttribute(arrayBuffer) {
|
|
7434
|
+
const countOffset = 8;
|
|
7435
|
+
return new Float64Array(arrayBuffer, countOffset);
|
|
7436
|
+
}
|
|
7437
|
+
function parseStringsAttribute(arrayBuffer) {
|
|
7438
|
+
const stringsCountOffset = 0;
|
|
7439
|
+
const dataOffset = 8;
|
|
7440
|
+
const bytesPerStringSize = 4;
|
|
7441
|
+
const stringsArray = [];
|
|
7442
|
+
try {
|
|
7443
|
+
const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
|
|
7444
|
+
const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
|
|
7445
|
+
let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
|
|
7446
|
+
for (const stringByteSize of stringSizes) {
|
|
7447
|
+
const textDecoder = new TextDecoder("utf-8");
|
|
7448
|
+
const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);
|
|
7449
|
+
stringsArray.push(textDecoder.decode(stringAttribute));
|
|
7450
|
+
stringOffset += stringByteSize;
|
|
7451
|
+
}
|
|
7452
|
+
} catch (error) {
|
|
7453
|
+
console.error("Parse string attribute error: ", error.message);
|
|
7454
|
+
}
|
|
7455
|
+
return stringsArray;
|
|
7456
|
+
}
|
|
7457
|
+
|
|
7458
|
+
// src/i3s-attribute-loader.ts
|
|
7459
|
+
var VERSION8 = true ? "3.3.0-alpha.11" : "latest";
|
|
7460
|
+
var I3SAttributeLoader = {
|
|
7461
|
+
name: "I3S Attribute",
|
|
7462
|
+
id: "i3s-attribute",
|
|
7463
|
+
module: "i3s",
|
|
7464
|
+
version: VERSION8,
|
|
7465
|
+
mimeTypes: ["application/binary"],
|
|
7466
|
+
parse: parse3,
|
|
7467
|
+
extensions: ["bin"],
|
|
7468
|
+
options: {},
|
|
7469
|
+
binary: true
|
|
7470
|
+
};
|
|
7471
|
+
async function parse3(data, options) {
|
|
7472
|
+
data = parseI3STileAttribute(data, options);
|
|
7473
|
+
return data;
|
|
7474
|
+
}
|
|
7475
|
+
function getAttributeValueType(attribute) {
|
|
7476
|
+
if (attribute.hasOwnProperty("objectIds")) {
|
|
7477
|
+
return "Oid32";
|
|
7478
|
+
} else if (attribute.hasOwnProperty("attributeValues")) {
|
|
7479
|
+
return attribute.attributeValues.valueType;
|
|
7480
|
+
}
|
|
7481
|
+
return "";
|
|
7482
|
+
}
|
|
7483
|
+
|
|
7484
|
+
// src/lib/utils/customizeColors.ts
|
|
7485
|
+
async function customizeColors(colors, featureIds, tileOptions, tilesetOptions, options) {
|
|
7486
|
+
if (!options?.i3s?.colorsByAttribute) {
|
|
7487
|
+
return colors;
|
|
7488
|
+
}
|
|
7489
|
+
const colorizeAttributeField = tilesetOptions.fields.find(({ name }) => name === options?.i3s?.colorsByAttribute?.attributeName);
|
|
7490
|
+
if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
|
|
7491
|
+
return colors;
|
|
7492
|
+
}
|
|
7493
|
+
const colorizeAttributeData = await loadFeatureAttributeData(colorizeAttributeField.name, tileOptions, tilesetOptions, options);
|
|
7494
|
+
if (!colorizeAttributeData) {
|
|
7495
|
+
return colors;
|
|
7496
|
+
}
|
|
7497
|
+
const objectIdField = tilesetOptions.fields.find(({ type }) => type === "esriFieldTypeOID");
|
|
7498
|
+
if (!objectIdField) {
|
|
7499
|
+
return colors;
|
|
7500
|
+
}
|
|
7501
|
+
const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, tileOptions, tilesetOptions, options);
|
|
7502
|
+
if (!objectIdAttributeData) {
|
|
7503
|
+
return colors;
|
|
7504
|
+
}
|
|
7505
|
+
const attributeValuesMap = {};
|
|
7506
|
+
for (let i2 = 0; i2 < objectIdAttributeData[objectIdField.name].length; i2++) {
|
|
7507
|
+
attributeValuesMap[objectIdAttributeData[objectIdField.name][i2]] = calculateColorForAttribute(colorizeAttributeData[colorizeAttributeField.name][i2], options);
|
|
7508
|
+
}
|
|
7509
|
+
for (let i2 = 0; i2 < featureIds.value.length; i2++) {
|
|
7510
|
+
const color = attributeValuesMap[featureIds.value[i2]];
|
|
7511
|
+
if (!color) {
|
|
7512
|
+
continue;
|
|
7513
|
+
}
|
|
7514
|
+
colors.value.set(color, i2 * 4);
|
|
7515
|
+
}
|
|
7516
|
+
return colors;
|
|
7517
|
+
}
|
|
7518
|
+
function calculateColorForAttribute(attributeValue, options) {
|
|
7519
|
+
if (!options?.i3s?.colorsByAttribute) {
|
|
7520
|
+
return [255, 255, 255, 255];
|
|
7521
|
+
}
|
|
7522
|
+
const { minValue, maxValue, minColor, maxColor } = options.i3s.colorsByAttribute;
|
|
7523
|
+
const rate = (attributeValue - minValue) / (maxValue - minValue);
|
|
7524
|
+
const color = [255, 255, 255, 255];
|
|
7525
|
+
for (let i2 = 0; i2 < minColor.length; i2++) {
|
|
7526
|
+
color[i2] = Math.round((maxColor[i2] - minColor[i2]) * rate + minColor[i2]);
|
|
7527
|
+
}
|
|
7528
|
+
return color;
|
|
7529
|
+
}
|
|
7530
|
+
async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attributeStorageInfo }, options) {
|
|
7531
|
+
const attributeIndex = attributeStorageInfo.findIndex(({ name }) => attributeName === name);
|
|
7532
|
+
if (attributeIndex === -1) {
|
|
7533
|
+
return null;
|
|
7534
|
+
}
|
|
7535
|
+
const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], options?.i3s?.token);
|
|
7536
|
+
const attributeType = getAttributeValueType(attributeStorageInfo[attributeIndex]);
|
|
7537
|
+
const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {
|
|
7538
|
+
attributeName,
|
|
7539
|
+
attributeType
|
|
7540
|
+
});
|
|
7541
|
+
return objectIdAttributeData;
|
|
7542
|
+
}
|
|
7543
|
+
|
|
7923
7544
|
// src/lib/parsers/parse-i3s-tile-content.ts
|
|
7924
7545
|
var scratchVector5 = new Vector3([0, 0, 0]);
|
|
7925
7546
|
function getLoaderForTextureFormat(textureFormat) {
|
|
@@ -7936,29 +7557,36 @@
|
|
|
7936
7557
|
}
|
|
7937
7558
|
}
|
|
7938
7559
|
var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
|
|
7939
|
-
async function parseI3STileContent(arrayBuffer,
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7560
|
+
async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
|
|
7561
|
+
const content = {
|
|
7562
|
+
attributes: {},
|
|
7563
|
+
indices: null,
|
|
7564
|
+
featureIds: [],
|
|
7565
|
+
vertexCount: 0,
|
|
7566
|
+
modelMatrix: new Matrix4(),
|
|
7567
|
+
coordinateSystem: 0,
|
|
7568
|
+
byteLength: 0,
|
|
7569
|
+
texture: null
|
|
7570
|
+
};
|
|
7571
|
+
if (tileOptions.textureUrl) {
|
|
7572
|
+
const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
|
|
7573
|
+
const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
|
|
7946
7574
|
const response = await fetch(url, options?.fetch);
|
|
7947
7575
|
const arrayBuffer2 = await response.arrayBuffer();
|
|
7948
7576
|
if (options?.i3s.decodeTextures) {
|
|
7949
7577
|
if (loader === ImageLoader) {
|
|
7950
|
-
const options2 = { ...
|
|
7578
|
+
const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
|
|
7951
7579
|
try {
|
|
7952
|
-
|
|
7580
|
+
content.texture = await context.parse(arrayBuffer2, options2);
|
|
7953
7581
|
} catch (e2) {
|
|
7954
|
-
|
|
7582
|
+
content.texture = await parse(arrayBuffer2, loader, options2);
|
|
7955
7583
|
}
|
|
7956
7584
|
} else if (loader === CompressedTextureLoader || loader === BasisLoader) {
|
|
7957
|
-
let texture = await load(arrayBuffer2, loader,
|
|
7585
|
+
let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
|
|
7958
7586
|
if (loader === BasisLoader) {
|
|
7959
7587
|
texture = texture[0];
|
|
7960
7588
|
}
|
|
7961
|
-
|
|
7589
|
+
content.texture = {
|
|
7962
7590
|
compressed: true,
|
|
7963
7591
|
mipmaps: false,
|
|
7964
7592
|
width: texture[0].width,
|
|
@@ -7967,27 +7595,23 @@
|
|
|
7967
7595
|
};
|
|
7968
7596
|
}
|
|
7969
7597
|
} else {
|
|
7970
|
-
|
|
7598
|
+
content.texture = arrayBuffer2;
|
|
7971
7599
|
}
|
|
7972
7600
|
}
|
|
7973
|
-
|
|
7974
|
-
if (
|
|
7975
|
-
|
|
7601
|
+
content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
|
|
7602
|
+
if (content.material) {
|
|
7603
|
+
content.texture = null;
|
|
7976
7604
|
}
|
|
7977
|
-
return await parseI3SNodeGeometry(arrayBuffer,
|
|
7605
|
+
return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
|
|
7978
7606
|
}
|
|
7979
|
-
async function parseI3SNodeGeometry(arrayBuffer,
|
|
7980
|
-
if (!tile.content) {
|
|
7981
|
-
return tile;
|
|
7982
|
-
}
|
|
7983
|
-
const content = tile.content;
|
|
7607
|
+
async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
|
|
7984
7608
|
const contentByteLength = arrayBuffer.byteLength;
|
|
7985
7609
|
let attributes;
|
|
7986
7610
|
let vertexCount;
|
|
7987
7611
|
let byteOffset = 0;
|
|
7988
7612
|
let featureCount = 0;
|
|
7989
7613
|
let indices;
|
|
7990
|
-
if (
|
|
7614
|
+
if (tileOptions.isDracoGeometry) {
|
|
7991
7615
|
const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
|
|
7992
7616
|
draco: {
|
|
7993
7617
|
attributeNameEntry: I3S_ATTRIBUTE_TYPE
|
|
@@ -8022,8 +7646,8 @@
|
|
|
8022
7646
|
ordering: attributesOrder,
|
|
8023
7647
|
featureAttributes,
|
|
8024
7648
|
featureAttributeOrder
|
|
8025
|
-
} =
|
|
8026
|
-
const headers = parseHeaders(
|
|
7649
|
+
} = tilesetOptions.store.defaultGeometrySchema;
|
|
7650
|
+
const headers = parseHeaders(arrayBuffer, tilesetOptions);
|
|
8027
7651
|
byteOffset = headers.byteOffset;
|
|
8028
7652
|
vertexCount = headers.vertexCount;
|
|
8029
7653
|
featureCount = headers.featureCount;
|
|
@@ -8033,23 +7657,24 @@
|
|
|
8033
7657
|
attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
|
|
8034
7658
|
}
|
|
8035
7659
|
if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
|
|
8036
|
-
const enuMatrix = parsePositions(attributes.position,
|
|
7660
|
+
const enuMatrix = parsePositions(attributes.position, tileOptions);
|
|
8037
7661
|
content.modelMatrix = enuMatrix.invert();
|
|
8038
7662
|
content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
|
|
8039
7663
|
} else {
|
|
8040
7664
|
content.modelMatrix = getModelMatrix(attributes.position);
|
|
8041
7665
|
content.coordinateSystem = COORDINATE_SYSTEM.LNGLAT_OFFSETS;
|
|
8042
7666
|
}
|
|
7667
|
+
attributes.color = await customizeColors(attributes.color, attributes.id, tileOptions, tilesetOptions, options);
|
|
8043
7668
|
content.attributes = {
|
|
8044
7669
|
positions: attributes.position,
|
|
8045
7670
|
normals: attributes.normal,
|
|
8046
7671
|
colors: normalizeAttribute(attributes.color),
|
|
8047
7672
|
texCoords: attributes.uv0,
|
|
8048
|
-
uvRegions: normalizeAttribute(attributes.uvRegion)
|
|
7673
|
+
uvRegions: normalizeAttribute(attributes.uvRegion || attributes.region)
|
|
8049
7674
|
};
|
|
8050
7675
|
content.indices = indices || null;
|
|
8051
7676
|
if (attributes.id && attributes.id.value) {
|
|
8052
|
-
|
|
7677
|
+
content.featureIds = attributes.id.value;
|
|
8053
7678
|
}
|
|
8054
7679
|
for (const attributeIndex in content.attributes) {
|
|
8055
7680
|
if (!content.attributes[attributeIndex]) {
|
|
@@ -8058,7 +7683,7 @@
|
|
|
8058
7683
|
}
|
|
8059
7684
|
content.vertexCount = vertexCount;
|
|
8060
7685
|
content.byteLength = contentByteLength;
|
|
8061
|
-
return
|
|
7686
|
+
return content;
|
|
8062
7687
|
}
|
|
8063
7688
|
function updateAttributesMetadata(attributes, decompressedGeometry) {
|
|
8064
7689
|
for (const key in decompressedGeometry.loaderData.attributes) {
|
|
@@ -8085,11 +7710,11 @@
|
|
|
8085
7710
|
attribute.normalized = true;
|
|
8086
7711
|
return attribute;
|
|
8087
7712
|
}
|
|
8088
|
-
function parseHeaders(
|
|
7713
|
+
function parseHeaders(arrayBuffer, options) {
|
|
8089
7714
|
let byteOffset = 0;
|
|
8090
7715
|
let vertexCount = 0;
|
|
8091
7716
|
let featureCount = 0;
|
|
8092
|
-
for (const { property, type } of
|
|
7717
|
+
for (const { property, type } of options.store.defaultGeometrySchema.header) {
|
|
8093
7718
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
8094
7719
|
switch (property) {
|
|
8095
7720
|
case HeaderAttributeProperty.vertexCount:
|
|
@@ -8159,8 +7784,8 @@
|
|
|
8159
7784
|
}
|
|
8160
7785
|
return new Uint32Array(values);
|
|
8161
7786
|
}
|
|
8162
|
-
function parsePositions(attribute,
|
|
8163
|
-
const mbs =
|
|
7787
|
+
function parsePositions(attribute, options) {
|
|
7788
|
+
const mbs = options.mbs;
|
|
8164
7789
|
const value = attribute.value;
|
|
8165
7790
|
const metadata = attribute.metadata;
|
|
8166
7791
|
const enuMatrix = new Matrix4();
|
|
@@ -8292,24 +7917,28 @@
|
|
|
8292
7917
|
}
|
|
8293
7918
|
|
|
8294
7919
|
// src/i3s-content-loader.ts
|
|
8295
|
-
var VERSION9 = true ? "3.3.0-alpha.
|
|
7920
|
+
var VERSION9 = true ? "3.3.0-alpha.11" : "beta";
|
|
8296
7921
|
var I3SContentLoader = {
|
|
8297
7922
|
name: "I3S Content (Indexed Scene Layers)",
|
|
8298
|
-
id: "i3s-content",
|
|
7923
|
+
id: isBrowser2 ? "i3s-content" : "i3s-content-nodejs",
|
|
8299
7924
|
module: "i3s",
|
|
8300
7925
|
worker: true,
|
|
8301
7926
|
version: VERSION9,
|
|
8302
7927
|
mimeTypes: ["application/octet-stream"],
|
|
8303
|
-
parse:
|
|
7928
|
+
parse: parse4,
|
|
8304
7929
|
extensions: ["bin"],
|
|
8305
7930
|
options: {
|
|
8306
7931
|
"i3s-content": {}
|
|
8307
7932
|
}
|
|
8308
7933
|
};
|
|
8309
|
-
async function
|
|
8310
|
-
const { tile, tileset } = options?.i3s || {};
|
|
8311
|
-
|
|
8312
|
-
|
|
7934
|
+
async function parse4(data, options, context) {
|
|
7935
|
+
const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
|
|
7936
|
+
const tileOptions = _tileOptions || tile;
|
|
7937
|
+
const tilesetOptions = _tilesetOptions || tileset;
|
|
7938
|
+
if (!tileOptions || !tilesetOptions) {
|
|
7939
|
+
return null;
|
|
7940
|
+
}
|
|
7941
|
+
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
8313
7942
|
}
|
|
8314
7943
|
|
|
8315
7944
|
// src/workers/i3s-content-worker.ts
|