@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
package/dist/dist.min.js
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
for (var name in all)
|
|
18
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
19
|
};
|
|
20
|
-
var __reExport = (target,
|
|
21
|
-
if (
|
|
22
|
-
for (let key of __getOwnPropNames(
|
|
20
|
+
var __reExport = (target, module, desc) => {
|
|
21
|
+
if (module && typeof module === "object" || typeof module === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(module))
|
|
23
23
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
24
|
-
__defProp(target, key, { get: () =>
|
|
24
|
+
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
25
25
|
}
|
|
26
26
|
return target;
|
|
27
27
|
};
|
|
28
|
-
var __toModule = (
|
|
29
|
-
return __reExport(__markAsModule(__defProp(
|
|
28
|
+
var __toModule = (module) => {
|
|
29
|
+
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);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// ../loader-utils/src/lib/env-utils/assert.ts
|
|
@@ -145,11 +145,13 @@
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
-
// ../worker-utils/src/lib/node/worker_threads-browser.
|
|
148
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.ts
|
|
149
149
|
var Worker2;
|
|
150
150
|
var init_worker_threads_browser = __esm({
|
|
151
|
-
"../worker-utils/src/lib/node/worker_threads-browser.
|
|
151
|
+
"../worker-utils/src/lib/node/worker_threads-browser.ts"() {
|
|
152
152
|
Worker2 = class {
|
|
153
|
+
terminate() {
|
|
154
|
+
}
|
|
153
155
|
};
|
|
154
156
|
}
|
|
155
157
|
});
|
|
@@ -262,7 +264,7 @@
|
|
|
262
264
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
263
265
|
}
|
|
264
266
|
static isSupported() {
|
|
265
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
267
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
266
268
|
}
|
|
267
269
|
destroy() {
|
|
268
270
|
this.onMessage = NOOP;
|
|
@@ -832,6 +834,30 @@
|
|
|
832
834
|
}
|
|
833
835
|
});
|
|
834
836
|
|
|
837
|
+
// ../loader-utils/src/json-loader.ts
|
|
838
|
+
function parseTextSync(text) {
|
|
839
|
+
return JSON.parse(text);
|
|
840
|
+
}
|
|
841
|
+
var VERSION3, JSONLoader;
|
|
842
|
+
var init_json_loader = __esm({
|
|
843
|
+
"../loader-utils/src/json-loader.ts"() {
|
|
844
|
+
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
845
|
+
JSONLoader = {
|
|
846
|
+
name: "JSON",
|
|
847
|
+
id: "json",
|
|
848
|
+
module: "json",
|
|
849
|
+
version: VERSION3,
|
|
850
|
+
extensions: ["json", "geojson"],
|
|
851
|
+
mimeTypes: ["application/json"],
|
|
852
|
+
category: "json",
|
|
853
|
+
text: true,
|
|
854
|
+
parseTextSync,
|
|
855
|
+
parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)),
|
|
856
|
+
options: {}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
|
|
835
861
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
836
862
|
var path_exports = {};
|
|
837
863
|
__export(path_exports, {
|
|
@@ -874,6 +900,7 @@
|
|
|
874
900
|
init_array_buffer_utils();
|
|
875
901
|
init_async_iteration();
|
|
876
902
|
init_file_aliases();
|
|
903
|
+
init_json_loader();
|
|
877
904
|
init_path();
|
|
878
905
|
}
|
|
879
906
|
});
|
|
@@ -1076,7 +1103,7 @@
|
|
|
1076
1103
|
}
|
|
1077
1104
|
});
|
|
1078
1105
|
|
|
1079
|
-
// ../../node_modules
|
|
1106
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
1080
1107
|
function isElectron(mockUserAgent) {
|
|
1081
1108
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1082
1109
|
return true;
|
|
@@ -1092,25 +1119,25 @@
|
|
|
1092
1119
|
return false;
|
|
1093
1120
|
}
|
|
1094
1121
|
var init_is_electron = __esm({
|
|
1095
|
-
"../../node_modules
|
|
1122
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
1096
1123
|
}
|
|
1097
1124
|
});
|
|
1098
1125
|
|
|
1099
|
-
// ../../node_modules
|
|
1126
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
1100
1127
|
function isBrowser3() {
|
|
1101
1128
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1102
1129
|
return !isNode || isElectron();
|
|
1103
1130
|
}
|
|
1104
1131
|
var init_is_browser = __esm({
|
|
1105
|
-
"../../node_modules
|
|
1132
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
1106
1133
|
init_is_electron();
|
|
1107
1134
|
}
|
|
1108
1135
|
});
|
|
1109
1136
|
|
|
1110
|
-
// ../../node_modules
|
|
1111
|
-
var globals3, self_3, window_3,
|
|
1137
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
1138
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
1112
1139
|
var init_globals3 = __esm({
|
|
1113
|
-
"../../node_modules
|
|
1140
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
1114
1141
|
globals3 = {
|
|
1115
1142
|
self: typeof self !== "undefined" && self,
|
|
1116
1143
|
window: typeof window !== "undefined" && window,
|
|
@@ -1120,24 +1147,31 @@
|
|
|
1120
1147
|
};
|
|
1121
1148
|
self_3 = globals3.self || globals3.window || globals3.global;
|
|
1122
1149
|
window_3 = globals3.window || globals3.self || globals3.global;
|
|
1123
|
-
global_3 = globals3.global || globals3.self || globals3.window;
|
|
1124
1150
|
document_3 = globals3.document || {};
|
|
1125
1151
|
process_ = globals3.process || {};
|
|
1126
1152
|
}
|
|
1127
1153
|
});
|
|
1128
1154
|
|
|
1129
|
-
// ../../node_modules
|
|
1130
|
-
var
|
|
1155
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1156
|
+
var VERSION4, isBrowser4;
|
|
1131
1157
|
var init_globals4 = __esm({
|
|
1132
|
-
"../../node_modules
|
|
1158
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
1133
1159
|
init_is_browser();
|
|
1134
|
-
|
|
1135
|
-
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1160
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1136
1161
|
isBrowser4 = isBrowser3();
|
|
1137
1162
|
}
|
|
1138
1163
|
});
|
|
1139
1164
|
|
|
1140
|
-
// ../../node_modules
|
|
1165
|
+
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
1166
|
+
var init_esm = __esm({
|
|
1167
|
+
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
1168
|
+
init_globals4();
|
|
1169
|
+
init_globals3();
|
|
1170
|
+
init_is_browser();
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
1141
1175
|
function getStorage(type) {
|
|
1142
1176
|
try {
|
|
1143
1177
|
const storage = window[type];
|
|
@@ -1151,9 +1185,15 @@
|
|
|
1151
1185
|
}
|
|
1152
1186
|
var LocalStorage;
|
|
1153
1187
|
var init_local_storage = __esm({
|
|
1154
|
-
"../../node_modules
|
|
1188
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
1189
|
+
init_defineProperty();
|
|
1155
1190
|
LocalStorage = class {
|
|
1156
|
-
constructor(id
|
|
1191
|
+
constructor(id) {
|
|
1192
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1193
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1194
|
+
_defineProperty(this, "storage", void 0);
|
|
1195
|
+
_defineProperty(this, "id", void 0);
|
|
1196
|
+
_defineProperty(this, "config", {});
|
|
1157
1197
|
this.storage = getStorage(type);
|
|
1158
1198
|
this.id = id;
|
|
1159
1199
|
this.config = {};
|
|
@@ -1188,7 +1228,7 @@
|
|
|
1188
1228
|
}
|
|
1189
1229
|
});
|
|
1190
1230
|
|
|
1191
|
-
// ../../node_modules
|
|
1231
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
1192
1232
|
function formatTime(ms) {
|
|
1193
1233
|
let formatted;
|
|
1194
1234
|
if (ms < 10) {
|
|
@@ -1202,11 +1242,13 @@
|
|
|
1202
1242
|
}
|
|
1203
1243
|
return formatted;
|
|
1204
1244
|
}
|
|
1205
|
-
function leftPad(string
|
|
1245
|
+
function leftPad(string) {
|
|
1246
|
+
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1206
1247
|
const padLength = Math.max(length4 - string.length, 0);
|
|
1207
1248
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1208
1249
|
}
|
|
1209
|
-
function formatImage(image, message, scale5
|
|
1250
|
+
function formatImage(image, message, scale5) {
|
|
1251
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1210
1252
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1211
1253
|
if (image.width > maxWidth) {
|
|
1212
1254
|
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
@@ -1217,16 +1259,16 @@
|
|
|
1217
1259
|
return ["".concat(message, " %c+"), style];
|
|
1218
1260
|
}
|
|
1219
1261
|
var init_formatters = __esm({
|
|
1220
|
-
"../../node_modules
|
|
1262
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
1221
1263
|
}
|
|
1222
1264
|
});
|
|
1223
1265
|
|
|
1224
|
-
// ../../node_modules
|
|
1266
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
1225
1267
|
function getColor(color) {
|
|
1226
1268
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
1227
1269
|
}
|
|
1228
1270
|
function addColor(string, color, background) {
|
|
1229
|
-
if (!
|
|
1271
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
1230
1272
|
if (color) {
|
|
1231
1273
|
color = getColor(color);
|
|
1232
1274
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -1240,31 +1282,32 @@
|
|
|
1240
1282
|
}
|
|
1241
1283
|
var COLOR;
|
|
1242
1284
|
var init_color = __esm({
|
|
1243
|
-
"../../node_modules
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
BLACK
|
|
1247
|
-
RED
|
|
1248
|
-
GREEN
|
|
1249
|
-
YELLOW
|
|
1250
|
-
BLUE
|
|
1251
|
-
MAGENTA
|
|
1252
|
-
CYAN
|
|
1253
|
-
WHITE
|
|
1254
|
-
BRIGHT_BLACK
|
|
1255
|
-
BRIGHT_RED
|
|
1256
|
-
BRIGHT_GREEN
|
|
1257
|
-
BRIGHT_YELLOW
|
|
1258
|
-
BRIGHT_BLUE
|
|
1259
|
-
BRIGHT_MAGENTA
|
|
1260
|
-
BRIGHT_CYAN
|
|
1261
|
-
BRIGHT_WHITE
|
|
1262
|
-
};
|
|
1285
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
1286
|
+
init_esm();
|
|
1287
|
+
(function(COLOR2) {
|
|
1288
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
1289
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
1290
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
1291
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
1292
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
1293
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
1294
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
1295
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
1296
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
1297
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
1298
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
1299
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
1300
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
1301
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
1302
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1303
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1304
|
+
})(COLOR || (COLOR = {}));
|
|
1263
1305
|
}
|
|
1264
1306
|
});
|
|
1265
1307
|
|
|
1266
|
-
// ../../node_modules
|
|
1267
|
-
function autobind(obj
|
|
1308
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
1309
|
+
function autobind(obj) {
|
|
1310
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1268
1311
|
const proto = Object.getPrototypeOf(obj);
|
|
1269
1312
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
1270
1313
|
for (const key of propNames) {
|
|
@@ -1276,28 +1319,30 @@
|
|
|
1276
1319
|
}
|
|
1277
1320
|
}
|
|
1278
1321
|
var init_autobind = __esm({
|
|
1279
|
-
"../../node_modules
|
|
1322
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
1280
1323
|
}
|
|
1281
1324
|
});
|
|
1282
1325
|
|
|
1283
|
-
// ../../node_modules
|
|
1326
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
1284
1327
|
function assert3(condition, message) {
|
|
1285
1328
|
if (!condition) {
|
|
1286
1329
|
throw new Error(message || "Assertion failed");
|
|
1287
1330
|
}
|
|
1288
1331
|
}
|
|
1289
1332
|
var init_assert3 = __esm({
|
|
1290
|
-
"../../node_modules
|
|
1333
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
1291
1334
|
}
|
|
1292
1335
|
});
|
|
1293
1336
|
|
|
1294
|
-
// ../../node_modules
|
|
1337
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
1295
1338
|
function getHiResTimestamp() {
|
|
1296
1339
|
let timestamp;
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1340
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
1341
|
+
var _window$performance, _window$performance$n;
|
|
1342
|
+
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);
|
|
1343
|
+
} else if ("hrtime" in process_) {
|
|
1344
|
+
var _process$hrtime;
|
|
1345
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
1301
1346
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1302
1347
|
} else {
|
|
1303
1348
|
timestamp = Date.now();
|
|
@@ -1305,21 +1350,19 @@
|
|
|
1305
1350
|
return timestamp;
|
|
1306
1351
|
}
|
|
1307
1352
|
var init_hi_res_timestamp = __esm({
|
|
1308
|
-
"../../node_modules
|
|
1309
|
-
|
|
1353
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
1354
|
+
init_esm();
|
|
1310
1355
|
}
|
|
1311
1356
|
});
|
|
1312
1357
|
|
|
1313
|
-
//
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
function getTableHeader(table) {
|
|
1317
|
-
for (const key in table) {
|
|
1318
|
-
for (const title in table[key]) {
|
|
1319
|
-
return title || "untitled";
|
|
1320
|
-
}
|
|
1358
|
+
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
1359
|
+
var init_node_asciify_image = __esm({
|
|
1360
|
+
"(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
|
|
1321
1361
|
}
|
|
1322
|
-
|
|
1362
|
+
});
|
|
1363
|
+
|
|
1364
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
1365
|
+
function noop() {
|
|
1323
1366
|
}
|
|
1324
1367
|
function normalizeLogLevel(logLevel) {
|
|
1325
1368
|
if (!logLevel) {
|
|
@@ -1348,7 +1391,6 @@
|
|
|
1348
1391
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
1349
1392
|
while (args.length && args.shift() !== message) {
|
|
1350
1393
|
}
|
|
1351
|
-
opts.args = args;
|
|
1352
1394
|
switch (typeof logLevel) {
|
|
1353
1395
|
case "string":
|
|
1354
1396
|
case "function":
|
|
@@ -1367,7 +1409,9 @@
|
|
|
1367
1409
|
}
|
|
1368
1410
|
const messageType = typeof opts.message;
|
|
1369
1411
|
assert3(messageType === "string" || messageType === "object");
|
|
1370
|
-
return Object.assign(opts,
|
|
1412
|
+
return Object.assign(opts, {
|
|
1413
|
+
args
|
|
1414
|
+
}, opts.opts);
|
|
1371
1415
|
}
|
|
1372
1416
|
function decorateMessage(id, message, opts) {
|
|
1373
1417
|
if (typeof message === "string") {
|
|
@@ -1377,29 +1421,25 @@
|
|
|
1377
1421
|
}
|
|
1378
1422
|
return message;
|
|
1379
1423
|
}
|
|
1380
|
-
function logImageInNode({
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
return () => asciify(image, {
|
|
1392
|
-
fit: "box",
|
|
1393
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
1394
|
-
}).then((data) => console.log(data));
|
|
1395
|
-
}
|
|
1424
|
+
function logImageInNode(_ref2) {
|
|
1425
|
+
let {
|
|
1426
|
+
image,
|
|
1427
|
+
message = "",
|
|
1428
|
+
scale: scale5 = 1
|
|
1429
|
+
} = _ref2;
|
|
1430
|
+
asciify.nodeAsciifyImage({
|
|
1431
|
+
image,
|
|
1432
|
+
message,
|
|
1433
|
+
scale: scale5
|
|
1434
|
+
});
|
|
1396
1435
|
return noop;
|
|
1397
1436
|
}
|
|
1398
|
-
function logImageInBrowser({
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1437
|
+
function logImageInBrowser(_ref3) {
|
|
1438
|
+
let {
|
|
1439
|
+
image,
|
|
1440
|
+
message = "",
|
|
1441
|
+
scale: scale5 = 1
|
|
1442
|
+
} = _ref3;
|
|
1403
1443
|
if (typeof image === "string") {
|
|
1404
1444
|
const img = new Image();
|
|
1405
1445
|
img.onload = () => {
|
|
@@ -1422,18 +1462,28 @@
|
|
|
1422
1462
|
}
|
|
1423
1463
|
return noop;
|
|
1424
1464
|
}
|
|
1465
|
+
function getTableHeader(table) {
|
|
1466
|
+
for (const key in table) {
|
|
1467
|
+
for (const title in table[key]) {
|
|
1468
|
+
return title || "untitled";
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
return "empty";
|
|
1472
|
+
}
|
|
1425
1473
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
1426
1474
|
var init_log = __esm({
|
|
1427
|
-
"../../node_modules
|
|
1428
|
-
|
|
1475
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
1476
|
+
init_defineProperty();
|
|
1477
|
+
init_esm();
|
|
1429
1478
|
init_local_storage();
|
|
1430
1479
|
init_formatters();
|
|
1431
1480
|
init_color();
|
|
1432
1481
|
init_autobind();
|
|
1433
1482
|
init_assert3();
|
|
1434
1483
|
init_hi_res_timestamp();
|
|
1484
|
+
init_node_asciify_image();
|
|
1435
1485
|
originalConsole = {
|
|
1436
|
-
debug:
|
|
1486
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
1437
1487
|
log: console.log,
|
|
1438
1488
|
info: console.info,
|
|
1439
1489
|
warn: console.warn,
|
|
@@ -1448,16 +1498,20 @@
|
|
|
1448
1498
|
once: true
|
|
1449
1499
|
};
|
|
1450
1500
|
Log = class {
|
|
1451
|
-
constructor({
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1501
|
+
constructor() {
|
|
1502
|
+
let {
|
|
1503
|
+
id
|
|
1504
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
1505
|
+
id: ""
|
|
1506
|
+
};
|
|
1507
|
+
_defineProperty(this, "id", void 0);
|
|
1508
|
+
_defineProperty(this, "VERSION", VERSION4);
|
|
1509
|
+
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
1510
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
1511
|
+
_defineProperty(this, "_storage", void 0);
|
|
1512
|
+
_defineProperty(this, "userData", {});
|
|
1513
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1456
1514
|
this.id = id;
|
|
1457
|
-
this.VERSION = VERSION3;
|
|
1458
|
-
this._startTs = getHiResTimestamp();
|
|
1459
|
-
this._deltaTs = getHiResTimestamp();
|
|
1460
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1461
1515
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1462
1516
|
this.userData = {};
|
|
1463
1517
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -1491,7 +1545,8 @@
|
|
|
1491
1545
|
getPriority() {
|
|
1492
1546
|
return this.level;
|
|
1493
1547
|
}
|
|
1494
|
-
enable(
|
|
1548
|
+
enable() {
|
|
1549
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
1495
1550
|
this._storage.updateConfiguration({
|
|
1496
1551
|
enabled
|
|
1497
1552
|
});
|
|
@@ -1503,6 +1558,21 @@
|
|
|
1503
1558
|
});
|
|
1504
1559
|
return this;
|
|
1505
1560
|
}
|
|
1561
|
+
get(setting) {
|
|
1562
|
+
return this._storage.config[setting];
|
|
1563
|
+
}
|
|
1564
|
+
set(setting, value) {
|
|
1565
|
+
this._storage.updateConfiguration({
|
|
1566
|
+
[setting]: value
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
settings() {
|
|
1570
|
+
if (console.table) {
|
|
1571
|
+
console.table(this._storage.config);
|
|
1572
|
+
} else {
|
|
1573
|
+
console.log(this._storage.config);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1506
1576
|
assert(condition, message) {
|
|
1507
1577
|
assert3(condition, message);
|
|
1508
1578
|
}
|
|
@@ -1531,6 +1601,9 @@
|
|
|
1531
1601
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
1532
1602
|
}
|
|
1533
1603
|
once(logLevel, message) {
|
|
1604
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1605
|
+
args[_key - 2] = arguments[_key];
|
|
1606
|
+
}
|
|
1534
1607
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
1535
1608
|
}
|
|
1536
1609
|
table(logLevel, table, columns) {
|
|
@@ -1541,17 +1614,18 @@
|
|
|
1541
1614
|
}
|
|
1542
1615
|
return noop;
|
|
1543
1616
|
}
|
|
1544
|
-
image({
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1617
|
+
image(_ref) {
|
|
1618
|
+
let {
|
|
1619
|
+
logLevel,
|
|
1620
|
+
priority,
|
|
1621
|
+
image,
|
|
1622
|
+
message = "",
|
|
1623
|
+
scale: scale5 = 1
|
|
1624
|
+
} = _ref;
|
|
1551
1625
|
if (!this._shouldLog(logLevel || priority)) {
|
|
1552
1626
|
return noop;
|
|
1553
1627
|
}
|
|
1554
|
-
return
|
|
1628
|
+
return isBrowser3 ? logImageInBrowser({
|
|
1555
1629
|
image,
|
|
1556
1630
|
message,
|
|
1557
1631
|
scale: scale5
|
|
@@ -1561,21 +1635,6 @@
|
|
|
1561
1635
|
scale: scale5
|
|
1562
1636
|
});
|
|
1563
1637
|
}
|
|
1564
|
-
settings() {
|
|
1565
|
-
if (console.table) {
|
|
1566
|
-
console.table(this._storage.config);
|
|
1567
|
-
} else {
|
|
1568
|
-
console.log(this._storage.config);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
get(setting) {
|
|
1572
|
-
return this._storage.config[setting];
|
|
1573
|
-
}
|
|
1574
|
-
set(setting, value) {
|
|
1575
|
-
this._storage.updateConfiguration({
|
|
1576
|
-
[setting]: value
|
|
1577
|
-
});
|
|
1578
|
-
}
|
|
1579
1638
|
time(logLevel, message) {
|
|
1580
1639
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
1581
1640
|
}
|
|
@@ -1585,10 +1644,11 @@
|
|
|
1585
1644
|
timeStamp(logLevel, message) {
|
|
1586
1645
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
1587
1646
|
}
|
|
1588
|
-
group(logLevel, message
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1647
|
+
group(logLevel, message) {
|
|
1648
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
1649
|
+
collapsed: false
|
|
1650
|
+
};
|
|
1651
|
+
const options = normalizeArguments({
|
|
1592
1652
|
logLevel,
|
|
1593
1653
|
message,
|
|
1594
1654
|
opts
|
|
@@ -1596,10 +1656,11 @@
|
|
|
1596
1656
|
const {
|
|
1597
1657
|
collapsed
|
|
1598
1658
|
} = opts;
|
|
1599
|
-
|
|
1600
|
-
return this._getLogFunction(
|
|
1659
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
1660
|
+
return this._getLogFunction(options);
|
|
1601
1661
|
}
|
|
1602
|
-
groupCollapsed(logLevel, message
|
|
1662
|
+
groupCollapsed(logLevel, message) {
|
|
1663
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1603
1664
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
1604
1665
|
collapsed: true
|
|
1605
1666
|
}));
|
|
@@ -1623,7 +1684,7 @@
|
|
|
1623
1684
|
_shouldLog(logLevel) {
|
|
1624
1685
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
1625
1686
|
}
|
|
1626
|
-
_getLogFunction(logLevel, message, method, args
|
|
1687
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
1627
1688
|
if (this._shouldLog(logLevel)) {
|
|
1628
1689
|
opts = normalizeArguments({
|
|
1629
1690
|
logLevel,
|
|
@@ -1650,48 +1711,18 @@
|
|
|
1650
1711
|
return noop;
|
|
1651
1712
|
}
|
|
1652
1713
|
};
|
|
1653
|
-
Log
|
|
1654
|
-
}
|
|
1655
|
-
});
|
|
1656
|
-
|
|
1657
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
1658
|
-
var init_hi_res_timestamp2 = __esm({
|
|
1659
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
1660
|
-
}
|
|
1661
|
-
});
|
|
1662
|
-
|
|
1663
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
1664
|
-
var init_stat = __esm({
|
|
1665
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
1666
|
-
init_hi_res_timestamp2();
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
|
-
|
|
1670
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
1671
|
-
var init_stats = __esm({
|
|
1672
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
1673
|
-
init_stat();
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
|
|
1677
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
1678
|
-
var init_esm = __esm({
|
|
1679
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
1680
|
-
init_stats();
|
|
1681
|
-
init_stat();
|
|
1682
|
-
init_hi_res_timestamp2();
|
|
1714
|
+
_defineProperty(Log, "VERSION", VERSION4);
|
|
1683
1715
|
}
|
|
1684
1716
|
});
|
|
1685
1717
|
|
|
1686
|
-
// ../../node_modules
|
|
1718
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
1687
1719
|
var esm_default;
|
|
1688
1720
|
var init_esm2 = __esm({
|
|
1689
|
-
"../../node_modules
|
|
1721
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
1690
1722
|
init_log();
|
|
1691
1723
|
init_log();
|
|
1692
|
-
init_esm();
|
|
1693
1724
|
esm_default = new Log({
|
|
1694
|
-
id: "probe.gl"
|
|
1725
|
+
id: "@probe.gl/log"
|
|
1695
1726
|
});
|
|
1696
1727
|
}
|
|
1697
1728
|
});
|
|
@@ -1954,658 +1985,35 @@
|
|
|
1954
1985
|
}
|
|
1955
1986
|
});
|
|
1956
1987
|
|
|
1957
|
-
//
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
return true;
|
|
1964
|
-
}
|
|
1965
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
1966
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
1967
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
1968
|
-
return true;
|
|
1969
|
-
}
|
|
1970
|
-
return false;
|
|
1971
|
-
}
|
|
1972
|
-
var init_is_electron2 = __esm({
|
|
1973
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
1988
|
+
// ../core/src/lib/utils/log.ts
|
|
1989
|
+
var log;
|
|
1990
|
+
var init_log2 = __esm({
|
|
1991
|
+
"../core/src/lib/utils/log.ts"() {
|
|
1992
|
+
init_esm2();
|
|
1993
|
+
log = new Log({ id: "loaders.gl" });
|
|
1974
1994
|
}
|
|
1975
1995
|
});
|
|
1976
1996
|
|
|
1977
|
-
//
|
|
1978
|
-
function
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
}
|
|
1982
|
-
var init_is_browser2 = __esm({
|
|
1983
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
1984
|
-
init_is_electron2();
|
|
1997
|
+
// ../core/src/lib/api/select-loader.ts
|
|
1998
|
+
async function selectLoader(data, loaders = [], options, context) {
|
|
1999
|
+
if (!validHTTPResponse(data)) {
|
|
2000
|
+
return null;
|
|
1985
2001
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
var globals4, self_4, window_4, document_4, process_2;
|
|
1990
|
-
var init_globals5 = __esm({
|
|
1991
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
1992
|
-
globals4 = {
|
|
1993
|
-
self: typeof self !== "undefined" && self,
|
|
1994
|
-
window: typeof window !== "undefined" && window,
|
|
1995
|
-
global: typeof global !== "undefined" && global,
|
|
1996
|
-
document: typeof document !== "undefined" && document,
|
|
1997
|
-
process: typeof process === "object" && process
|
|
1998
|
-
};
|
|
1999
|
-
self_4 = globals4.self || globals4.window || globals4.global;
|
|
2000
|
-
window_4 = globals4.window || globals4.self || globals4.global;
|
|
2001
|
-
document_4 = globals4.document || {};
|
|
2002
|
-
process_2 = globals4.process || {};
|
|
2002
|
+
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
2003
|
+
if (loader) {
|
|
2004
|
+
return loader;
|
|
2003
2005
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
var VERSION4, isBrowser6;
|
|
2008
|
-
var init_globals6 = __esm({
|
|
2009
|
-
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
2010
|
-
init_is_browser2();
|
|
2011
|
-
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
2012
|
-
isBrowser6 = isBrowser5();
|
|
2006
|
+
if (isBlob(data)) {
|
|
2007
|
+
data = await data.slice(0, 10).arrayBuffer();
|
|
2008
|
+
loader = selectLoaderSync(data, loaders, options, context);
|
|
2013
2009
|
}
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
2017
|
-
var init_esm3 = __esm({
|
|
2018
|
-
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
2019
|
-
init_globals6();
|
|
2020
|
-
init_globals5();
|
|
2021
|
-
init_is_browser2();
|
|
2010
|
+
if (!loader && !options?.nothrow) {
|
|
2011
|
+
throw new Error(getNoValidLoaderMessage(data));
|
|
2022
2012
|
}
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
try {
|
|
2028
|
-
const storage = window[type];
|
|
2029
|
-
const x = "__storage_test__";
|
|
2030
|
-
storage.setItem(x, x);
|
|
2031
|
-
storage.removeItem(x);
|
|
2032
|
-
return storage;
|
|
2033
|
-
} catch (e2) {
|
|
2034
|
-
return null;
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
var LocalStorage2;
|
|
2038
|
-
var init_local_storage2 = __esm({
|
|
2039
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
2040
|
-
init_defineProperty();
|
|
2041
|
-
LocalStorage2 = class {
|
|
2042
|
-
constructor(id) {
|
|
2043
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2044
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
2045
|
-
_defineProperty(this, "storage", void 0);
|
|
2046
|
-
_defineProperty(this, "id", void 0);
|
|
2047
|
-
_defineProperty(this, "config", {});
|
|
2048
|
-
this.storage = getStorage2(type);
|
|
2049
|
-
this.id = id;
|
|
2050
|
-
this.config = {};
|
|
2051
|
-
Object.assign(this.config, defaultSettings);
|
|
2052
|
-
this._loadConfiguration();
|
|
2053
|
-
}
|
|
2054
|
-
getConfiguration() {
|
|
2055
|
-
return this.config;
|
|
2056
|
-
}
|
|
2057
|
-
setConfiguration(configuration) {
|
|
2058
|
-
this.config = {};
|
|
2059
|
-
return this.updateConfiguration(configuration);
|
|
2060
|
-
}
|
|
2061
|
-
updateConfiguration(configuration) {
|
|
2062
|
-
Object.assign(this.config, configuration);
|
|
2063
|
-
if (this.storage) {
|
|
2064
|
-
const serialized = JSON.stringify(this.config);
|
|
2065
|
-
this.storage.setItem(this.id, serialized);
|
|
2066
|
-
}
|
|
2067
|
-
return this;
|
|
2068
|
-
}
|
|
2069
|
-
_loadConfiguration() {
|
|
2070
|
-
let configuration = {};
|
|
2071
|
-
if (this.storage) {
|
|
2072
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
2073
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
2074
|
-
}
|
|
2075
|
-
Object.assign(this.config, configuration);
|
|
2076
|
-
return this;
|
|
2077
|
-
}
|
|
2078
|
-
};
|
|
2079
|
-
}
|
|
2080
|
-
});
|
|
2081
|
-
|
|
2082
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
2083
|
-
function formatTime2(ms) {
|
|
2084
|
-
let formatted;
|
|
2085
|
-
if (ms < 10) {
|
|
2086
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
2087
|
-
} else if (ms < 100) {
|
|
2088
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
2089
|
-
} else if (ms < 1e3) {
|
|
2090
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
2091
|
-
} else {
|
|
2092
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
2093
|
-
}
|
|
2094
|
-
return formatted;
|
|
2095
|
-
}
|
|
2096
|
-
function leftPad2(string) {
|
|
2097
|
-
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
2098
|
-
const padLength = Math.max(length4 - string.length, 0);
|
|
2099
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
2100
|
-
}
|
|
2101
|
-
function formatImage2(image, message, scale5) {
|
|
2102
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
2103
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
2104
|
-
if (image.width > maxWidth) {
|
|
2105
|
-
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
2106
|
-
}
|
|
2107
|
-
const width = image.width * scale5;
|
|
2108
|
-
const height = image.height * scale5;
|
|
2109
|
-
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("");
|
|
2110
|
-
return ["".concat(message, " %c+"), style];
|
|
2111
|
-
}
|
|
2112
|
-
var init_formatters2 = __esm({
|
|
2113
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
2114
|
-
}
|
|
2115
|
-
});
|
|
2116
|
-
|
|
2117
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
2118
|
-
function getColor2(color) {
|
|
2119
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
2120
|
-
}
|
|
2121
|
-
function addColor2(string, color, background) {
|
|
2122
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
2123
|
-
if (color) {
|
|
2124
|
-
color = getColor2(color);
|
|
2125
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
2126
|
-
}
|
|
2127
|
-
if (background) {
|
|
2128
|
-
color = getColor2(background);
|
|
2129
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
return string;
|
|
2133
|
-
}
|
|
2134
|
-
var COLOR2;
|
|
2135
|
-
var init_color2 = __esm({
|
|
2136
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
2137
|
-
init_esm3();
|
|
2138
|
-
(function(COLOR3) {
|
|
2139
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
2140
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
2141
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
2142
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
2143
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
2144
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
2145
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
2146
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
2147
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
2148
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
2149
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
2150
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
2151
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
2152
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
2153
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
2154
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
2155
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
2156
|
-
}
|
|
2157
|
-
});
|
|
2158
|
-
|
|
2159
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
2160
|
-
function autobind2(obj) {
|
|
2161
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
2162
|
-
const proto = Object.getPrototypeOf(obj);
|
|
2163
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
2164
|
-
for (const key of propNames) {
|
|
2165
|
-
if (typeof obj[key] === "function") {
|
|
2166
|
-
if (!predefined.find((name) => key === name)) {
|
|
2167
|
-
obj[key] = obj[key].bind(obj);
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
var init_autobind2 = __esm({
|
|
2173
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
2174
|
-
}
|
|
2175
|
-
});
|
|
2176
|
-
|
|
2177
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
2178
|
-
function assert4(condition, message) {
|
|
2179
|
-
if (!condition) {
|
|
2180
|
-
throw new Error(message || "Assertion failed");
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
var init_assert4 = __esm({
|
|
2184
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
2185
|
-
}
|
|
2186
|
-
});
|
|
2187
|
-
|
|
2188
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
2189
|
-
function getHiResTimestamp3() {
|
|
2190
|
-
let timestamp;
|
|
2191
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
2192
|
-
var _window$performance, _window$performance$n;
|
|
2193
|
-
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);
|
|
2194
|
-
} else if ("hrtime" in process_2) {
|
|
2195
|
-
var _process$hrtime;
|
|
2196
|
-
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);
|
|
2197
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
2198
|
-
} else {
|
|
2199
|
-
timestamp = Date.now();
|
|
2200
|
-
}
|
|
2201
|
-
return timestamp;
|
|
2202
|
-
}
|
|
2203
|
-
var init_hi_res_timestamp3 = __esm({
|
|
2204
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
2205
|
-
init_esm3();
|
|
2206
|
-
}
|
|
2207
|
-
});
|
|
2208
|
-
|
|
2209
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
2210
|
-
function noop2() {
|
|
2211
|
-
}
|
|
2212
|
-
function normalizeLogLevel2(logLevel) {
|
|
2213
|
-
if (!logLevel) {
|
|
2214
|
-
return 0;
|
|
2215
|
-
}
|
|
2216
|
-
let resolvedLevel;
|
|
2217
|
-
switch (typeof logLevel) {
|
|
2218
|
-
case "number":
|
|
2219
|
-
resolvedLevel = logLevel;
|
|
2220
|
-
break;
|
|
2221
|
-
case "object":
|
|
2222
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
2223
|
-
break;
|
|
2224
|
-
default:
|
|
2225
|
-
return 0;
|
|
2226
|
-
}
|
|
2227
|
-
assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
2228
|
-
return resolvedLevel;
|
|
2229
|
-
}
|
|
2230
|
-
function normalizeArguments2(opts) {
|
|
2231
|
-
const {
|
|
2232
|
-
logLevel,
|
|
2233
|
-
message
|
|
2234
|
-
} = opts;
|
|
2235
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
2236
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
2237
|
-
while (args.length && args.shift() !== message) {
|
|
2238
|
-
}
|
|
2239
|
-
switch (typeof logLevel) {
|
|
2240
|
-
case "string":
|
|
2241
|
-
case "function":
|
|
2242
|
-
if (message !== void 0) {
|
|
2243
|
-
args.unshift(message);
|
|
2244
|
-
}
|
|
2245
|
-
opts.message = logLevel;
|
|
2246
|
-
break;
|
|
2247
|
-
case "object":
|
|
2248
|
-
Object.assign(opts, logLevel);
|
|
2249
|
-
break;
|
|
2250
|
-
default:
|
|
2251
|
-
}
|
|
2252
|
-
if (typeof opts.message === "function") {
|
|
2253
|
-
opts.message = opts.message();
|
|
2254
|
-
}
|
|
2255
|
-
const messageType = typeof opts.message;
|
|
2256
|
-
assert4(messageType === "string" || messageType === "object");
|
|
2257
|
-
return Object.assign(opts, {
|
|
2258
|
-
args
|
|
2259
|
-
}, opts.opts);
|
|
2260
|
-
}
|
|
2261
|
-
function decorateMessage2(id, message, opts) {
|
|
2262
|
-
if (typeof message === "string") {
|
|
2263
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
2264
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
2265
|
-
message = addColor2(message, opts.color, opts.background);
|
|
2266
|
-
}
|
|
2267
|
-
return message;
|
|
2268
|
-
}
|
|
2269
|
-
function logImageInNode2(_ref2) {
|
|
2270
|
-
let {
|
|
2271
|
-
image,
|
|
2272
|
-
message = "",
|
|
2273
|
-
scale: scale5 = 1
|
|
2274
|
-
} = _ref2;
|
|
2275
|
-
let asciify = null;
|
|
2276
|
-
try {
|
|
2277
|
-
asciify = module.require("asciify-image");
|
|
2278
|
-
} catch (error) {
|
|
2279
|
-
}
|
|
2280
|
-
if (asciify) {
|
|
2281
|
-
return () => asciify(image, {
|
|
2282
|
-
fit: "box",
|
|
2283
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
2284
|
-
}).then((data) => console.log(data));
|
|
2285
|
-
}
|
|
2286
|
-
return noop2;
|
|
2287
|
-
}
|
|
2288
|
-
function logImageInBrowser2(_ref3) {
|
|
2289
|
-
let {
|
|
2290
|
-
image,
|
|
2291
|
-
message = "",
|
|
2292
|
-
scale: scale5 = 1
|
|
2293
|
-
} = _ref3;
|
|
2294
|
-
if (typeof image === "string") {
|
|
2295
|
-
const img = new Image();
|
|
2296
|
-
img.onload = () => {
|
|
2297
|
-
const args = formatImage2(img, message, scale5);
|
|
2298
|
-
console.log(...args);
|
|
2299
|
-
};
|
|
2300
|
-
img.src = image;
|
|
2301
|
-
return noop2;
|
|
2302
|
-
}
|
|
2303
|
-
const element = image.nodeName || "";
|
|
2304
|
-
if (element.toLowerCase() === "img") {
|
|
2305
|
-
console.log(...formatImage2(image, message, scale5));
|
|
2306
|
-
return noop2;
|
|
2307
|
-
}
|
|
2308
|
-
if (element.toLowerCase() === "canvas") {
|
|
2309
|
-
const img = new Image();
|
|
2310
|
-
img.onload = () => console.log(...formatImage2(img, message, scale5));
|
|
2311
|
-
img.src = image.toDataURL();
|
|
2312
|
-
return noop2;
|
|
2313
|
-
}
|
|
2314
|
-
return noop2;
|
|
2315
|
-
}
|
|
2316
|
-
function getTableHeader2(table) {
|
|
2317
|
-
for (const key in table) {
|
|
2318
|
-
for (const title in table[key]) {
|
|
2319
|
-
return title || "untitled";
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
return "empty";
|
|
2323
|
-
}
|
|
2324
|
-
var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
|
|
2325
|
-
var init_log2 = __esm({
|
|
2326
|
-
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
2327
|
-
init_defineProperty();
|
|
2328
|
-
init_esm3();
|
|
2329
|
-
init_local_storage2();
|
|
2330
|
-
init_formatters2();
|
|
2331
|
-
init_color2();
|
|
2332
|
-
init_autobind2();
|
|
2333
|
-
init_assert4();
|
|
2334
|
-
init_hi_res_timestamp3();
|
|
2335
|
-
originalConsole2 = {
|
|
2336
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
2337
|
-
log: console.log,
|
|
2338
|
-
info: console.info,
|
|
2339
|
-
warn: console.warn,
|
|
2340
|
-
error: console.error
|
|
2341
|
-
};
|
|
2342
|
-
DEFAULT_SETTINGS2 = {
|
|
2343
|
-
enabled: true,
|
|
2344
|
-
level: 0
|
|
2345
|
-
};
|
|
2346
|
-
cache2 = {};
|
|
2347
|
-
ONCE2 = {
|
|
2348
|
-
once: true
|
|
2349
|
-
};
|
|
2350
|
-
Log2 = class {
|
|
2351
|
-
constructor() {
|
|
2352
|
-
let {
|
|
2353
|
-
id
|
|
2354
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2355
|
-
id: ""
|
|
2356
|
-
};
|
|
2357
|
-
_defineProperty(this, "id", void 0);
|
|
2358
|
-
_defineProperty(this, "VERSION", VERSION4);
|
|
2359
|
-
_defineProperty(this, "_startTs", getHiResTimestamp3());
|
|
2360
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp3());
|
|
2361
|
-
_defineProperty(this, "_storage", void 0);
|
|
2362
|
-
_defineProperty(this, "userData", {});
|
|
2363
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
2364
|
-
this.id = id;
|
|
2365
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
2366
|
-
this.userData = {};
|
|
2367
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
2368
|
-
autobind2(this);
|
|
2369
|
-
Object.seal(this);
|
|
2370
|
-
}
|
|
2371
|
-
set level(newLevel) {
|
|
2372
|
-
this.setLevel(newLevel);
|
|
2373
|
-
}
|
|
2374
|
-
get level() {
|
|
2375
|
-
return this.getLevel();
|
|
2376
|
-
}
|
|
2377
|
-
isEnabled() {
|
|
2378
|
-
return this._storage.config.enabled;
|
|
2379
|
-
}
|
|
2380
|
-
getLevel() {
|
|
2381
|
-
return this._storage.config.level;
|
|
2382
|
-
}
|
|
2383
|
-
getTotal() {
|
|
2384
|
-
return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
|
|
2385
|
-
}
|
|
2386
|
-
getDelta() {
|
|
2387
|
-
return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
|
|
2388
|
-
}
|
|
2389
|
-
set priority(newPriority) {
|
|
2390
|
-
this.level = newPriority;
|
|
2391
|
-
}
|
|
2392
|
-
get priority() {
|
|
2393
|
-
return this.level;
|
|
2394
|
-
}
|
|
2395
|
-
getPriority() {
|
|
2396
|
-
return this.level;
|
|
2397
|
-
}
|
|
2398
|
-
enable() {
|
|
2399
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2400
|
-
this._storage.updateConfiguration({
|
|
2401
|
-
enabled
|
|
2402
|
-
});
|
|
2403
|
-
return this;
|
|
2404
|
-
}
|
|
2405
|
-
setLevel(level) {
|
|
2406
|
-
this._storage.updateConfiguration({
|
|
2407
|
-
level
|
|
2408
|
-
});
|
|
2409
|
-
return this;
|
|
2410
|
-
}
|
|
2411
|
-
get(setting) {
|
|
2412
|
-
return this._storage.config[setting];
|
|
2413
|
-
}
|
|
2414
|
-
set(setting, value) {
|
|
2415
|
-
this._storage.updateConfiguration({
|
|
2416
|
-
[setting]: value
|
|
2417
|
-
});
|
|
2418
|
-
}
|
|
2419
|
-
settings() {
|
|
2420
|
-
if (console.table) {
|
|
2421
|
-
console.table(this._storage.config);
|
|
2422
|
-
} else {
|
|
2423
|
-
console.log(this._storage.config);
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
assert(condition, message) {
|
|
2427
|
-
assert4(condition, message);
|
|
2428
|
-
}
|
|
2429
|
-
warn(message) {
|
|
2430
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
2431
|
-
}
|
|
2432
|
-
error(message) {
|
|
2433
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
2434
|
-
}
|
|
2435
|
-
deprecated(oldUsage, newUsage) {
|
|
2436
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
2437
|
-
}
|
|
2438
|
-
removed(oldUsage, newUsage) {
|
|
2439
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
2440
|
-
}
|
|
2441
|
-
probe(logLevel, message) {
|
|
2442
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
2443
|
-
time: true,
|
|
2444
|
-
once: true
|
|
2445
|
-
});
|
|
2446
|
-
}
|
|
2447
|
-
log(logLevel, message) {
|
|
2448
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
2449
|
-
}
|
|
2450
|
-
info(logLevel, message) {
|
|
2451
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2452
|
-
}
|
|
2453
|
-
once(logLevel, message) {
|
|
2454
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2455
|
-
args[_key - 2] = arguments[_key];
|
|
2456
|
-
}
|
|
2457
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
2458
|
-
}
|
|
2459
|
-
table(logLevel, table, columns) {
|
|
2460
|
-
if (table) {
|
|
2461
|
-
return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
|
|
2462
|
-
tag: getTableHeader2(table)
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
return noop2;
|
|
2466
|
-
}
|
|
2467
|
-
image(_ref) {
|
|
2468
|
-
let {
|
|
2469
|
-
logLevel,
|
|
2470
|
-
priority,
|
|
2471
|
-
image,
|
|
2472
|
-
message = "",
|
|
2473
|
-
scale: scale5 = 1
|
|
2474
|
-
} = _ref;
|
|
2475
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
2476
|
-
return noop2;
|
|
2477
|
-
}
|
|
2478
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
2479
|
-
image,
|
|
2480
|
-
message,
|
|
2481
|
-
scale: scale5
|
|
2482
|
-
}) : logImageInNode2({
|
|
2483
|
-
image,
|
|
2484
|
-
message,
|
|
2485
|
-
scale: scale5
|
|
2486
|
-
});
|
|
2487
|
-
}
|
|
2488
|
-
time(logLevel, message) {
|
|
2489
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
2490
|
-
}
|
|
2491
|
-
timeEnd(logLevel, message) {
|
|
2492
|
-
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
2493
|
-
}
|
|
2494
|
-
timeStamp(logLevel, message) {
|
|
2495
|
-
return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
|
|
2496
|
-
}
|
|
2497
|
-
group(logLevel, message) {
|
|
2498
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2499
|
-
collapsed: false
|
|
2500
|
-
};
|
|
2501
|
-
const options = normalizeArguments2({
|
|
2502
|
-
logLevel,
|
|
2503
|
-
message,
|
|
2504
|
-
opts
|
|
2505
|
-
});
|
|
2506
|
-
const {
|
|
2507
|
-
collapsed
|
|
2508
|
-
} = opts;
|
|
2509
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
2510
|
-
return this._getLogFunction(options);
|
|
2511
|
-
}
|
|
2512
|
-
groupCollapsed(logLevel, message) {
|
|
2513
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2514
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
2515
|
-
collapsed: true
|
|
2516
|
-
}));
|
|
2517
|
-
}
|
|
2518
|
-
groupEnd(logLevel) {
|
|
2519
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
|
|
2520
|
-
}
|
|
2521
|
-
withGroup(logLevel, message, func) {
|
|
2522
|
-
this.group(logLevel, message)();
|
|
2523
|
-
try {
|
|
2524
|
-
func();
|
|
2525
|
-
} finally {
|
|
2526
|
-
this.groupEnd(logLevel)();
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
trace() {
|
|
2530
|
-
if (console.trace) {
|
|
2531
|
-
console.trace();
|
|
2532
|
-
}
|
|
2533
|
-
}
|
|
2534
|
-
_shouldLog(logLevel) {
|
|
2535
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
2536
|
-
}
|
|
2537
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
2538
|
-
if (this._shouldLog(logLevel)) {
|
|
2539
|
-
opts = normalizeArguments2({
|
|
2540
|
-
logLevel,
|
|
2541
|
-
message,
|
|
2542
|
-
args,
|
|
2543
|
-
opts
|
|
2544
|
-
});
|
|
2545
|
-
method = method || opts.method;
|
|
2546
|
-
assert4(method);
|
|
2547
|
-
opts.total = this.getTotal();
|
|
2548
|
-
opts.delta = this.getDelta();
|
|
2549
|
-
this._deltaTs = getHiResTimestamp3();
|
|
2550
|
-
const tag = opts.tag || opts.message;
|
|
2551
|
-
if (opts.once) {
|
|
2552
|
-
if (!cache2[tag]) {
|
|
2553
|
-
cache2[tag] = getHiResTimestamp3();
|
|
2554
|
-
} else {
|
|
2555
|
-
return noop2;
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
2559
|
-
return method.bind(console, message, ...opts.args);
|
|
2560
|
-
}
|
|
2561
|
-
return noop2;
|
|
2562
|
-
}
|
|
2563
|
-
};
|
|
2564
|
-
_defineProperty(Log2, "VERSION", VERSION4);
|
|
2565
|
-
}
|
|
2566
|
-
});
|
|
2567
|
-
|
|
2568
|
-
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
2569
|
-
var esm_default2;
|
|
2570
|
-
var init_esm4 = __esm({
|
|
2571
|
-
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
2572
|
-
init_log2();
|
|
2573
|
-
init_log2();
|
|
2574
|
-
esm_default2 = new Log2({
|
|
2575
|
-
id: "@probe.gl/log"
|
|
2576
|
-
});
|
|
2577
|
-
}
|
|
2578
|
-
});
|
|
2579
|
-
|
|
2580
|
-
// ../core/src/lib/utils/log.ts
|
|
2581
|
-
var log;
|
|
2582
|
-
var init_log3 = __esm({
|
|
2583
|
-
"../core/src/lib/utils/log.ts"() {
|
|
2584
|
-
init_esm4();
|
|
2585
|
-
log = new Log2({ id: "loaders.gl" });
|
|
2586
|
-
}
|
|
2587
|
-
});
|
|
2588
|
-
|
|
2589
|
-
// ../core/src/lib/api/select-loader.ts
|
|
2590
|
-
async function selectLoader(data, loaders = [], options, context) {
|
|
2591
|
-
if (!validHTTPResponse(data)) {
|
|
2592
|
-
return null;
|
|
2593
|
-
}
|
|
2594
|
-
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
2595
|
-
if (loader) {
|
|
2596
|
-
return loader;
|
|
2597
|
-
}
|
|
2598
|
-
if (isBlob(data)) {
|
|
2599
|
-
data = await data.slice(0, 10).arrayBuffer();
|
|
2600
|
-
loader = selectLoaderSync(data, loaders, options, context);
|
|
2601
|
-
}
|
|
2602
|
-
if (!loader && !options?.nothrow) {
|
|
2603
|
-
throw new Error(getNoValidLoaderMessage(data));
|
|
2604
|
-
}
|
|
2605
|
-
return loader;
|
|
2606
|
-
}
|
|
2607
|
-
function selectLoaderSync(data, loaders = [], options, context) {
|
|
2608
|
-
if (!validHTTPResponse(data)) {
|
|
2013
|
+
return loader;
|
|
2014
|
+
}
|
|
2015
|
+
function selectLoaderSync(data, loaders = [], options, context) {
|
|
2016
|
+
if (!validHTTPResponse(data)) {
|
|
2609
2017
|
return null;
|
|
2610
2018
|
}
|
|
2611
2019
|
if (loaders && !Array.isArray(loaders)) {
|
|
@@ -2771,7 +2179,7 @@
|
|
|
2771
2179
|
"../core/src/lib/api/select-loader.ts"() {
|
|
2772
2180
|
init_src2();
|
|
2773
2181
|
init_normalize_loader();
|
|
2774
|
-
|
|
2182
|
+
init_log2();
|
|
2775
2183
|
init_resource_utils();
|
|
2776
2184
|
init_register_loaders();
|
|
2777
2185
|
init_is_type();
|
|
@@ -3088,26 +2496,24 @@
|
|
|
3088
2496
|
"../core/src/index.ts"() {
|
|
3089
2497
|
init_parse();
|
|
3090
2498
|
init_load();
|
|
2499
|
+
init_src2();
|
|
3091
2500
|
}
|
|
3092
2501
|
});
|
|
3093
2502
|
|
|
3094
2503
|
// ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
|
|
3095
|
-
function
|
|
2504
|
+
function assert4(condition, message) {
|
|
3096
2505
|
if (!condition) {
|
|
3097
2506
|
throw new Error("math.gl assertion ".concat(message));
|
|
3098
2507
|
}
|
|
3099
2508
|
}
|
|
3100
|
-
var
|
|
2509
|
+
var init_assert4 = __esm({
|
|
3101
2510
|
"../../node_modules/@math.gl/core/dist/esm/lib/assert.js"() {
|
|
3102
2511
|
}
|
|
3103
2512
|
});
|
|
3104
2513
|
|
|
3105
2514
|
// ../../node_modules/@math.gl/core/dist/esm/lib/common.js
|
|
3106
|
-
function round(value) {
|
|
3107
|
-
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
3108
|
-
}
|
|
3109
2515
|
function formatValue(value, {
|
|
3110
|
-
precision = config.precision
|
|
2516
|
+
precision = config.precision
|
|
3111
2517
|
} = {}) {
|
|
3112
2518
|
value = round(value);
|
|
3113
2519
|
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
@@ -3115,19 +2521,6 @@
|
|
|
3115
2521
|
function isArray(value) {
|
|
3116
2522
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
3117
2523
|
}
|
|
3118
|
-
function duplicateArray(array) {
|
|
3119
|
-
return array.clone ? array.clone() : new Array(array.length);
|
|
3120
|
-
}
|
|
3121
|
-
function map(value, func, result) {
|
|
3122
|
-
if (isArray(value)) {
|
|
3123
|
-
result = result || duplicateArray(value);
|
|
3124
|
-
for (let i2 = 0; i2 < result.length && i2 < value.length; ++i2) {
|
|
3125
|
-
result[i2] = func(value[i2], i2, result);
|
|
3126
|
-
}
|
|
3127
|
-
return result;
|
|
3128
|
-
}
|
|
3129
|
-
return func(value);
|
|
3130
|
-
}
|
|
3131
2524
|
function toRadians(degrees2) {
|
|
3132
2525
|
return radians(degrees2);
|
|
3133
2526
|
}
|
|
@@ -3166,26 +2559,44 @@
|
|
|
3166
2559
|
if (b && b.equals) {
|
|
3167
2560
|
return b.equals(a2);
|
|
3168
2561
|
}
|
|
3169
|
-
if (
|
|
2562
|
+
if (typeof a2 === "number" && typeof b === "number") {
|
|
3170
2563
|
return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
|
|
3171
2564
|
}
|
|
3172
|
-
return false;
|
|
3173
|
-
} finally {
|
|
3174
|
-
config.EPSILON = oldEpsilon;
|
|
2565
|
+
return false;
|
|
2566
|
+
} finally {
|
|
2567
|
+
config.EPSILON = oldEpsilon;
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
function round(value) {
|
|
2571
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
2572
|
+
}
|
|
2573
|
+
function duplicateArray(array) {
|
|
2574
|
+
return array.clone ? array.clone() : new Array(array.length);
|
|
2575
|
+
}
|
|
2576
|
+
function map(value, func, result) {
|
|
2577
|
+
if (isArray(value)) {
|
|
2578
|
+
const array = value;
|
|
2579
|
+
result = result || duplicateArray(array);
|
|
2580
|
+
for (let i2 = 0; i2 < result.length && i2 < array.length; ++i2) {
|
|
2581
|
+
result[i2] = func(value[i2], i2, result);
|
|
2582
|
+
}
|
|
2583
|
+
return result;
|
|
3175
2584
|
}
|
|
2585
|
+
return func(value);
|
|
3176
2586
|
}
|
|
3177
2587
|
var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
|
|
3178
2588
|
var init_common = __esm({
|
|
3179
2589
|
"../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
|
|
3180
2590
|
RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
3181
2591
|
DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
3182
|
-
config = {
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
2592
|
+
config = {
|
|
2593
|
+
EPSILON: 1e-12,
|
|
2594
|
+
debug: false,
|
|
2595
|
+
precision: 4,
|
|
2596
|
+
printTypes: false,
|
|
2597
|
+
printDegrees: false,
|
|
2598
|
+
printRowMajor: true
|
|
2599
|
+
};
|
|
3189
2600
|
}
|
|
3190
2601
|
});
|
|
3191
2602
|
|
|
@@ -3215,24 +2626,25 @@
|
|
|
3215
2626
|
var init_math_array = __esm({
|
|
3216
2627
|
"../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
|
|
3217
2628
|
init_common();
|
|
3218
|
-
init_assert5();
|
|
3219
2629
|
MathArray = class extends _extendableBuiltin(Array) {
|
|
3220
|
-
get ELEMENTS() {
|
|
3221
|
-
assert5(false);
|
|
3222
|
-
return 0;
|
|
3223
|
-
}
|
|
3224
2630
|
clone() {
|
|
3225
2631
|
return new this.constructor().copy(this);
|
|
3226
2632
|
}
|
|
3227
|
-
from(arrayOrObject) {
|
|
3228
|
-
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
3229
|
-
}
|
|
3230
2633
|
fromArray(array, offset = 0) {
|
|
3231
2634
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3232
2635
|
this[i2] = array[i2 + offset];
|
|
3233
2636
|
}
|
|
3234
2637
|
return this.check();
|
|
3235
2638
|
}
|
|
2639
|
+
toArray(targetArray = [], offset = 0) {
|
|
2640
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2641
|
+
targetArray[offset + i2] = this[i2];
|
|
2642
|
+
}
|
|
2643
|
+
return targetArray;
|
|
2644
|
+
}
|
|
2645
|
+
from(arrayOrObject) {
|
|
2646
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
2647
|
+
}
|
|
3236
2648
|
to(arrayOrObject) {
|
|
3237
2649
|
if (arrayOrObject === this) {
|
|
3238
2650
|
return this;
|
|
@@ -3242,12 +2654,6 @@
|
|
|
3242
2654
|
toTarget(target) {
|
|
3243
2655
|
return target ? this.to(target) : this;
|
|
3244
2656
|
}
|
|
3245
|
-
toArray(array = [], offset = 0) {
|
|
3246
|
-
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3247
|
-
array[offset + i2] = this[i2];
|
|
3248
|
-
}
|
|
3249
|
-
return array;
|
|
3250
|
-
}
|
|
3251
2657
|
toFloat32Array() {
|
|
3252
2658
|
return new Float32Array(this);
|
|
3253
2659
|
}
|
|
@@ -3291,9 +2697,7 @@
|
|
|
3291
2697
|
}
|
|
3292
2698
|
lerp(a2, b, t2) {
|
|
3293
2699
|
if (t2 === void 0) {
|
|
3294
|
-
|
|
3295
|
-
b = a2;
|
|
3296
|
-
a2 = this;
|
|
2700
|
+
return this.lerp(this, a2, b);
|
|
3297
2701
|
}
|
|
3298
2702
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3299
2703
|
const ai = a2[i2];
|
|
@@ -3336,14 +2740,36 @@
|
|
|
3336
2740
|
return this.check();
|
|
3337
2741
|
}
|
|
3338
2742
|
scale(scale5) {
|
|
3339
|
-
if (
|
|
3340
|
-
|
|
2743
|
+
if (typeof scale5 === "number") {
|
|
2744
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2745
|
+
this[i2] *= scale5;
|
|
2746
|
+
}
|
|
2747
|
+
} else {
|
|
2748
|
+
for (let i2 = 0; i2 < this.ELEMENTS && i2 < scale5.length; ++i2) {
|
|
2749
|
+
this[i2] *= scale5[i2];
|
|
2750
|
+
}
|
|
3341
2751
|
}
|
|
2752
|
+
return this.check();
|
|
2753
|
+
}
|
|
2754
|
+
multiplyByScalar(scalar) {
|
|
3342
2755
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3343
|
-
this[i2] *=
|
|
2756
|
+
this[i2] *= scalar;
|
|
3344
2757
|
}
|
|
3345
2758
|
return this.check();
|
|
3346
2759
|
}
|
|
2760
|
+
check() {
|
|
2761
|
+
if (config.debug && !this.validate()) {
|
|
2762
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
2763
|
+
}
|
|
2764
|
+
return this;
|
|
2765
|
+
}
|
|
2766
|
+
validate() {
|
|
2767
|
+
let valid = this.length === this.ELEMENTS;
|
|
2768
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
2769
|
+
valid = valid && Number.isFinite(this[i2]);
|
|
2770
|
+
}
|
|
2771
|
+
return valid;
|
|
2772
|
+
}
|
|
3347
2773
|
sub(a2) {
|
|
3348
2774
|
return this.subtract(a2);
|
|
3349
2775
|
}
|
|
@@ -3369,7 +2795,7 @@
|
|
|
3369
2795
|
return this.check();
|
|
3370
2796
|
}
|
|
3371
2797
|
divideScalar(a2) {
|
|
3372
|
-
return this.
|
|
2798
|
+
return this.multiplyByScalar(1 / a2);
|
|
3373
2799
|
}
|
|
3374
2800
|
clampScalar(min, max) {
|
|
3375
2801
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
@@ -3377,25 +2803,9 @@
|
|
|
3377
2803
|
}
|
|
3378
2804
|
return this.check();
|
|
3379
2805
|
}
|
|
3380
|
-
multiplyByScalar(scalar) {
|
|
3381
|
-
return this.scale(scalar);
|
|
3382
|
-
}
|
|
3383
2806
|
get elements() {
|
|
3384
2807
|
return this;
|
|
3385
2808
|
}
|
|
3386
|
-
check() {
|
|
3387
|
-
if (config.debug && !this.validate()) {
|
|
3388
|
-
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
3389
|
-
}
|
|
3390
|
-
return this;
|
|
3391
|
-
}
|
|
3392
|
-
validate() {
|
|
3393
|
-
let valid = this.length === this.ELEMENTS;
|
|
3394
|
-
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
3395
|
-
valid = valid && Number.isFinite(this[i2]);
|
|
3396
|
-
}
|
|
3397
|
-
return valid;
|
|
3398
|
-
}
|
|
3399
2809
|
};
|
|
3400
2810
|
}
|
|
3401
2811
|
});
|
|
@@ -3424,17 +2834,9 @@
|
|
|
3424
2834
|
}
|
|
3425
2835
|
return v;
|
|
3426
2836
|
}
|
|
3427
|
-
function deprecated(method, version) {
|
|
3428
|
-
if (!map2[method]) {
|
|
3429
|
-
map2[method] = true;
|
|
3430
|
-
console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
|
|
3431
|
-
}
|
|
3432
|
-
}
|
|
3433
|
-
var map2;
|
|
3434
2837
|
var init_validators = __esm({
|
|
3435
2838
|
"../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
|
|
3436
2839
|
init_common();
|
|
3437
|
-
map2 = {};
|
|
3438
2840
|
}
|
|
3439
2841
|
});
|
|
3440
2842
|
|
|
@@ -3444,16 +2846,8 @@
|
|
|
3444
2846
|
"../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js"() {
|
|
3445
2847
|
init_math_array();
|
|
3446
2848
|
init_validators();
|
|
3447
|
-
|
|
2849
|
+
init_assert4();
|
|
3448
2850
|
Vector = class extends MathArray {
|
|
3449
|
-
get ELEMENTS() {
|
|
3450
|
-
assert5(false);
|
|
3451
|
-
return 0;
|
|
3452
|
-
}
|
|
3453
|
-
copy(vector) {
|
|
3454
|
-
assert5(false);
|
|
3455
|
-
return this;
|
|
3456
|
-
}
|
|
3457
2851
|
get x() {
|
|
3458
2852
|
return this[0];
|
|
3459
2853
|
}
|
|
@@ -3535,11 +2929,11 @@
|
|
|
3535
2929
|
return this.distanceSquared(vector);
|
|
3536
2930
|
}
|
|
3537
2931
|
getComponent(i2) {
|
|
3538
|
-
|
|
2932
|
+
assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3539
2933
|
return checkNumber(this[i2]);
|
|
3540
2934
|
}
|
|
3541
2935
|
setComponent(i2, value) {
|
|
3542
|
-
|
|
2936
|
+
assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
|
|
3543
2937
|
this[i2] = value;
|
|
3544
2938
|
return this.check();
|
|
3545
2939
|
}
|
|
@@ -3658,6 +3052,15 @@
|
|
|
3658
3052
|
out[2] = a2[2];
|
|
3659
3053
|
return out;
|
|
3660
3054
|
}
|
|
3055
|
+
function vec4_transformMat2(out, a2, m) {
|
|
3056
|
+
const x = a2[0];
|
|
3057
|
+
const y = a2[1];
|
|
3058
|
+
out[0] = m[0] * x + m[2] * y;
|
|
3059
|
+
out[1] = m[1] * x + m[3] * y;
|
|
3060
|
+
out[2] = a2[2];
|
|
3061
|
+
out[3] = a2[3];
|
|
3062
|
+
return out;
|
|
3063
|
+
}
|
|
3661
3064
|
function vec4_transformMat3(out, a2, m) {
|
|
3662
3065
|
const x = a2[0];
|
|
3663
3066
|
const y = a2[1];
|
|
@@ -3832,7 +3235,7 @@
|
|
|
3832
3235
|
});
|
|
3833
3236
|
|
|
3834
3237
|
// ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
|
|
3835
|
-
var ORIGIN,
|
|
3238
|
+
var ORIGIN, ZERO, Vector3;
|
|
3836
3239
|
var init_vector3 = __esm({
|
|
3837
3240
|
"../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
|
|
3838
3241
|
init_vector();
|
|
@@ -3841,10 +3244,13 @@
|
|
|
3841
3244
|
init_vec3();
|
|
3842
3245
|
init_gl_matrix_extras();
|
|
3843
3246
|
ORIGIN = [0, 0, 0];
|
|
3844
|
-
constants = {};
|
|
3845
3247
|
Vector3 = class extends Vector {
|
|
3846
3248
|
static get ZERO() {
|
|
3847
|
-
|
|
3249
|
+
if (!ZERO) {
|
|
3250
|
+
ZERO = new Vector3(0, 0, 0);
|
|
3251
|
+
Object.freeze(ZERO);
|
|
3252
|
+
}
|
|
3253
|
+
return ZERO;
|
|
3848
3254
|
}
|
|
3849
3255
|
constructor(x = 0, y = 0, z = 0) {
|
|
3850
3256
|
super(-0, -0, -0);
|
|
@@ -3954,6 +3360,113 @@
|
|
|
3954
3360
|
}
|
|
3955
3361
|
});
|
|
3956
3362
|
|
|
3363
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/vector4.js
|
|
3364
|
+
var ZERO2, Vector4;
|
|
3365
|
+
var init_vector4 = __esm({
|
|
3366
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/vector4.js"() {
|
|
3367
|
+
init_vector();
|
|
3368
|
+
init_common();
|
|
3369
|
+
init_validators();
|
|
3370
|
+
init_vec3();
|
|
3371
|
+
init_gl_matrix_extras();
|
|
3372
|
+
Vector4 = class extends Vector {
|
|
3373
|
+
static get ZERO() {
|
|
3374
|
+
if (!ZERO2) {
|
|
3375
|
+
ZERO2 = new Vector4(0, 0, 0, 0);
|
|
3376
|
+
Object.freeze(ZERO2);
|
|
3377
|
+
}
|
|
3378
|
+
return ZERO2;
|
|
3379
|
+
}
|
|
3380
|
+
constructor(x = 0, y = 0, z = 0, w = 0) {
|
|
3381
|
+
super(-0, -0, -0, -0);
|
|
3382
|
+
if (isArray(x) && arguments.length === 1) {
|
|
3383
|
+
this.copy(x);
|
|
3384
|
+
} else {
|
|
3385
|
+
if (config.debug) {
|
|
3386
|
+
checkNumber(x);
|
|
3387
|
+
checkNumber(y);
|
|
3388
|
+
checkNumber(z);
|
|
3389
|
+
checkNumber(w);
|
|
3390
|
+
}
|
|
3391
|
+
this[0] = x;
|
|
3392
|
+
this[1] = y;
|
|
3393
|
+
this[2] = z;
|
|
3394
|
+
this[3] = w;
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
set(x, y, z, w) {
|
|
3398
|
+
this[0] = x;
|
|
3399
|
+
this[1] = y;
|
|
3400
|
+
this[2] = z;
|
|
3401
|
+
this[3] = w;
|
|
3402
|
+
return this.check();
|
|
3403
|
+
}
|
|
3404
|
+
copy(array) {
|
|
3405
|
+
this[0] = array[0];
|
|
3406
|
+
this[1] = array[1];
|
|
3407
|
+
this[2] = array[2];
|
|
3408
|
+
this[3] = array[3];
|
|
3409
|
+
return this.check();
|
|
3410
|
+
}
|
|
3411
|
+
fromObject(object) {
|
|
3412
|
+
if (config.debug) {
|
|
3413
|
+
checkNumber(object.x);
|
|
3414
|
+
checkNumber(object.y);
|
|
3415
|
+
checkNumber(object.z);
|
|
3416
|
+
checkNumber(object.w);
|
|
3417
|
+
}
|
|
3418
|
+
this[0] = object.x;
|
|
3419
|
+
this[1] = object.y;
|
|
3420
|
+
this[2] = object.z;
|
|
3421
|
+
this[3] = object.w;
|
|
3422
|
+
return this;
|
|
3423
|
+
}
|
|
3424
|
+
toObject(object) {
|
|
3425
|
+
object.x = this[0];
|
|
3426
|
+
object.y = this[1];
|
|
3427
|
+
object.z = this[2];
|
|
3428
|
+
object.w = this[3];
|
|
3429
|
+
return object;
|
|
3430
|
+
}
|
|
3431
|
+
get ELEMENTS() {
|
|
3432
|
+
return 4;
|
|
3433
|
+
}
|
|
3434
|
+
get z() {
|
|
3435
|
+
return this[2];
|
|
3436
|
+
}
|
|
3437
|
+
set z(value) {
|
|
3438
|
+
this[2] = checkNumber(value);
|
|
3439
|
+
}
|
|
3440
|
+
get w() {
|
|
3441
|
+
return this[3];
|
|
3442
|
+
}
|
|
3443
|
+
set w(value) {
|
|
3444
|
+
this[3] = checkNumber(value);
|
|
3445
|
+
}
|
|
3446
|
+
transform(matrix4) {
|
|
3447
|
+
transformMat42(this, this, matrix4);
|
|
3448
|
+
return this.check();
|
|
3449
|
+
}
|
|
3450
|
+
transformByMatrix3(matrix3) {
|
|
3451
|
+
vec4_transformMat3(this, this, matrix3);
|
|
3452
|
+
return this.check();
|
|
3453
|
+
}
|
|
3454
|
+
transformByMatrix2(matrix2) {
|
|
3455
|
+
vec4_transformMat2(this, this, matrix2);
|
|
3456
|
+
return this.check();
|
|
3457
|
+
}
|
|
3458
|
+
transformByQuaternion(quaternion) {
|
|
3459
|
+
transformQuat(this, this, quaternion);
|
|
3460
|
+
return this.check();
|
|
3461
|
+
}
|
|
3462
|
+
applyMatrix4(m) {
|
|
3463
|
+
m.transform(this, this);
|
|
3464
|
+
return this;
|
|
3465
|
+
}
|
|
3466
|
+
};
|
|
3467
|
+
}
|
|
3468
|
+
});
|
|
3469
|
+
|
|
3957
3470
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
|
|
3958
3471
|
var Matrix;
|
|
3959
3472
|
var init_matrix = __esm({
|
|
@@ -3961,16 +3474,7 @@
|
|
|
3961
3474
|
init_math_array();
|
|
3962
3475
|
init_validators();
|
|
3963
3476
|
init_common();
|
|
3964
|
-
init_assert5();
|
|
3965
3477
|
Matrix = class extends MathArray {
|
|
3966
|
-
get ELEMENTS() {
|
|
3967
|
-
assert5(false);
|
|
3968
|
-
return 0;
|
|
3969
|
-
}
|
|
3970
|
-
get RANK() {
|
|
3971
|
-
assert5(false);
|
|
3972
|
-
return 0;
|
|
3973
|
-
}
|
|
3974
3478
|
toString() {
|
|
3975
3479
|
let string = "[";
|
|
3976
3480
|
if (config.printRowMajor) {
|
|
@@ -4173,7 +3677,21 @@
|
|
|
4173
3677
|
});
|
|
4174
3678
|
|
|
4175
3679
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
|
|
4176
|
-
|
|
3680
|
+
function getZeroMatrix() {
|
|
3681
|
+
if (!ZERO_MATRIX3) {
|
|
3682
|
+
ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
3683
|
+
Object.freeze(ZERO_MATRIX3);
|
|
3684
|
+
}
|
|
3685
|
+
return ZERO_MATRIX3;
|
|
3686
|
+
}
|
|
3687
|
+
function getIdentityMatrix() {
|
|
3688
|
+
if (!IDENTITY_MATRIX3) {
|
|
3689
|
+
IDENTITY_MATRIX3 = new Matrix3();
|
|
3690
|
+
Object.freeze(IDENTITY_MATRIX3);
|
|
3691
|
+
}
|
|
3692
|
+
return IDENTITY_MATRIX3;
|
|
3693
|
+
}
|
|
3694
|
+
var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
|
|
4177
3695
|
var init_matrix3 = __esm({
|
|
4178
3696
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
|
|
4179
3697
|
init_matrix();
|
|
@@ -4182,28 +3700,24 @@
|
|
|
4182
3700
|
init_mat3();
|
|
4183
3701
|
init_vec2();
|
|
4184
3702
|
init_vec3();
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
});
|
|
4198
|
-
constants2 = {};
|
|
3703
|
+
(function(INDICES3) {
|
|
3704
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
3705
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
3706
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
3707
|
+
INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
|
|
3708
|
+
INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
|
|
3709
|
+
INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
|
|
3710
|
+
INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
|
|
3711
|
+
INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
|
|
3712
|
+
INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
|
|
3713
|
+
})(INDICES || (INDICES = {}));
|
|
3714
|
+
IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
4199
3715
|
Matrix3 = class extends Matrix {
|
|
4200
3716
|
static get IDENTITY() {
|
|
4201
|
-
|
|
4202
|
-
return constants2.IDENTITY;
|
|
3717
|
+
return getIdentityMatrix();
|
|
4203
3718
|
}
|
|
4204
3719
|
static get ZERO() {
|
|
4205
|
-
|
|
4206
|
-
return constants2.ZERO;
|
|
3720
|
+
return getZeroMatrix();
|
|
4207
3721
|
}
|
|
4208
3722
|
get ELEMENTS() {
|
|
4209
3723
|
return 9;
|
|
@@ -4214,10 +3728,12 @@
|
|
|
4214
3728
|
get INDICES() {
|
|
4215
3729
|
return INDICES;
|
|
4216
3730
|
}
|
|
4217
|
-
constructor(array) {
|
|
3731
|
+
constructor(array, ...args) {
|
|
4218
3732
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
4219
3733
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
4220
3734
|
this.copy(array);
|
|
3735
|
+
} else if (args.length > 0) {
|
|
3736
|
+
this.copy([array, ...args]);
|
|
4221
3737
|
} else {
|
|
4222
3738
|
this.identity();
|
|
4223
3739
|
}
|
|
@@ -4234,6 +3750,16 @@
|
|
|
4234
3750
|
this[8] = array[8];
|
|
4235
3751
|
return this.check();
|
|
4236
3752
|
}
|
|
3753
|
+
identity() {
|
|
3754
|
+
return this.copy(IDENTITY_MATRIX);
|
|
3755
|
+
}
|
|
3756
|
+
fromObject(object) {
|
|
3757
|
+
return this.check();
|
|
3758
|
+
}
|
|
3759
|
+
fromQuaternion(q) {
|
|
3760
|
+
fromQuat(this, q);
|
|
3761
|
+
return this.check();
|
|
3762
|
+
}
|
|
4237
3763
|
set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
|
|
4238
3764
|
this[0] = m00;
|
|
4239
3765
|
this[1] = m10;
|
|
@@ -4261,13 +3787,6 @@
|
|
|
4261
3787
|
determinant() {
|
|
4262
3788
|
return determinant(this);
|
|
4263
3789
|
}
|
|
4264
|
-
identity() {
|
|
4265
|
-
return this.copy(IDENTITY);
|
|
4266
|
-
}
|
|
4267
|
-
fromQuaternion(q) {
|
|
4268
|
-
fromQuat(this, q);
|
|
4269
|
-
return this.check();
|
|
4270
|
-
}
|
|
4271
3790
|
transpose() {
|
|
4272
3791
|
transpose(this, this);
|
|
4273
3792
|
return this.check();
|
|
@@ -4292,7 +3811,7 @@
|
|
|
4292
3811
|
if (Array.isArray(factor)) {
|
|
4293
3812
|
scale(this, this, factor);
|
|
4294
3813
|
} else {
|
|
4295
|
-
scale(this, this, [factor, factor
|
|
3814
|
+
scale(this, this, [factor, factor]);
|
|
4296
3815
|
}
|
|
4297
3816
|
return this.check();
|
|
4298
3817
|
}
|
|
@@ -4301,32 +3820,30 @@
|
|
|
4301
3820
|
return this.check();
|
|
4302
3821
|
}
|
|
4303
3822
|
transform(vector, result) {
|
|
3823
|
+
let out;
|
|
4304
3824
|
switch (vector.length) {
|
|
4305
3825
|
case 2:
|
|
4306
|
-
|
|
3826
|
+
out = transformMat3(result || [-0, -0], vector, this);
|
|
4307
3827
|
break;
|
|
4308
3828
|
case 3:
|
|
4309
|
-
|
|
3829
|
+
out = transformMat32(result || [-0, -0, -0], vector, this);
|
|
4310
3830
|
break;
|
|
4311
3831
|
case 4:
|
|
4312
|
-
|
|
3832
|
+
out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
|
|
4313
3833
|
break;
|
|
4314
3834
|
default:
|
|
4315
3835
|
throw new Error("Illegal vector");
|
|
4316
3836
|
}
|
|
4317
|
-
checkVector(
|
|
4318
|
-
return
|
|
3837
|
+
checkVector(out, vector.length);
|
|
3838
|
+
return out;
|
|
4319
3839
|
}
|
|
4320
3840
|
transformVector(vector, result) {
|
|
4321
|
-
deprecated("Matrix3.transformVector");
|
|
4322
3841
|
return this.transform(vector, result);
|
|
4323
3842
|
}
|
|
4324
3843
|
transformVector2(vector, result) {
|
|
4325
|
-
deprecated("Matrix3.transformVector");
|
|
4326
3844
|
return this.transform(vector, result);
|
|
4327
3845
|
}
|
|
4328
3846
|
transformVector3(vector, result) {
|
|
4329
|
-
deprecated("Matrix3.transformVector");
|
|
4330
3847
|
return this.transform(vector, result);
|
|
4331
3848
|
}
|
|
4332
3849
|
};
|
|
@@ -4770,7 +4287,7 @@
|
|
|
4770
4287
|
out[15] = 0;
|
|
4771
4288
|
return out;
|
|
4772
4289
|
}
|
|
4773
|
-
function
|
|
4290
|
+
function perspectiveNO(out, fovy, aspect, near, far) {
|
|
4774
4291
|
var f2 = 1 / Math.tan(fovy / 2), nf;
|
|
4775
4292
|
out[0] = f2 / aspect;
|
|
4776
4293
|
out[1] = 0;
|
|
@@ -4796,7 +4313,7 @@
|
|
|
4796
4313
|
}
|
|
4797
4314
|
return out;
|
|
4798
4315
|
}
|
|
4799
|
-
function
|
|
4316
|
+
function orthoNO(out, left, right, bottom, top, near, far) {
|
|
4800
4317
|
var lr = 1 / (left - right);
|
|
4801
4318
|
var bt = 1 / (bottom - top);
|
|
4802
4319
|
var nf = 1 / (near - far);
|
|
@@ -4885,9 +4402,12 @@
|
|
|
4885
4402
|
out[15] = 1;
|
|
4886
4403
|
return out;
|
|
4887
4404
|
}
|
|
4405
|
+
var perspective, ortho;
|
|
4888
4406
|
var init_mat4 = __esm({
|
|
4889
4407
|
"../../node_modules/gl-matrix/esm/mat4.js"() {
|
|
4890
4408
|
init_common2();
|
|
4409
|
+
perspective = perspectiveNO;
|
|
4410
|
+
ortho = orthoNO;
|
|
4891
4411
|
}
|
|
4892
4412
|
});
|
|
4893
4413
|
|
|
@@ -5017,48 +4537,90 @@
|
|
|
5017
4537
|
});
|
|
5018
4538
|
|
|
5019
4539
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
|
|
5020
|
-
|
|
4540
|
+
function getZeroMatrix2() {
|
|
4541
|
+
if (!ZERO3) {
|
|
4542
|
+
ZERO3 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
4543
|
+
Object.freeze(ZERO3);
|
|
4544
|
+
}
|
|
4545
|
+
return ZERO3;
|
|
4546
|
+
}
|
|
4547
|
+
function getIdentityMatrix2() {
|
|
4548
|
+
if (!IDENTITY) {
|
|
4549
|
+
IDENTITY = new Matrix4();
|
|
4550
|
+
Object.freeze(IDENTITY);
|
|
4551
|
+
}
|
|
4552
|
+
return IDENTITY;
|
|
4553
|
+
}
|
|
4554
|
+
function checkRadians(possiblyDegrees) {
|
|
4555
|
+
if (possiblyDegrees > Math.PI * 2) {
|
|
4556
|
+
throw Error("expected radians");
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
|
|
4560
|
+
const column0Row0 = 2 * near / (right - left);
|
|
4561
|
+
const column1Row1 = 2 * near / (top - bottom);
|
|
4562
|
+
const column2Row0 = (right + left) / (right - left);
|
|
4563
|
+
const column2Row1 = (top + bottom) / (top - bottom);
|
|
4564
|
+
const column2Row2 = -1;
|
|
4565
|
+
const column2Row3 = -1;
|
|
4566
|
+
const column3Row2 = -2 * near;
|
|
4567
|
+
result[0] = column0Row0;
|
|
4568
|
+
result[1] = 0;
|
|
4569
|
+
result[2] = 0;
|
|
4570
|
+
result[3] = 0;
|
|
4571
|
+
result[4] = 0;
|
|
4572
|
+
result[5] = column1Row1;
|
|
4573
|
+
result[6] = 0;
|
|
4574
|
+
result[7] = 0;
|
|
4575
|
+
result[8] = column2Row0;
|
|
4576
|
+
result[9] = column2Row1;
|
|
4577
|
+
result[10] = column2Row2;
|
|
4578
|
+
result[11] = column2Row3;
|
|
4579
|
+
result[12] = 0;
|
|
4580
|
+
result[13] = 0;
|
|
4581
|
+
result[14] = column3Row2;
|
|
4582
|
+
result[15] = 0;
|
|
4583
|
+
return result;
|
|
4584
|
+
}
|
|
4585
|
+
var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO3, IDENTITY;
|
|
5021
4586
|
var init_matrix4 = __esm({
|
|
5022
4587
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js"() {
|
|
5023
|
-
init_validators();
|
|
5024
4588
|
init_matrix();
|
|
4589
|
+
init_validators();
|
|
5025
4590
|
init_gl_matrix_extras();
|
|
5026
4591
|
init_mat4();
|
|
5027
4592
|
init_vec2();
|
|
5028
4593
|
init_vec3();
|
|
5029
4594
|
init_vec4();
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
4595
|
+
(function(INDICES3) {
|
|
4596
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
4597
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
4598
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
4599
|
+
INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
|
|
4600
|
+
INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
|
|
4601
|
+
INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
|
|
4602
|
+
INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
|
|
4603
|
+
INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
|
|
4604
|
+
INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
|
|
4605
|
+
INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
|
|
4606
|
+
INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
|
|
4607
|
+
INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
|
|
4608
|
+
INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
|
|
4609
|
+
INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
|
|
4610
|
+
INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
|
|
4611
|
+
INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
|
|
4612
|
+
})(INDICES2 || (INDICES2 = {}));
|
|
4613
|
+
DEFAULT_FOVY = 45 * Math.PI / 180;
|
|
4614
|
+
DEFAULT_ASPECT = 1;
|
|
4615
|
+
DEFAULT_NEAR = 0.1;
|
|
4616
|
+
DEFAULT_FAR = 500;
|
|
4617
|
+
IDENTITY_MATRIX2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
5051
4618
|
Matrix4 = class extends Matrix {
|
|
5052
4619
|
static get IDENTITY() {
|
|
5053
|
-
|
|
5054
|
-
return constants3.IDENTITY;
|
|
4620
|
+
return getIdentityMatrix2();
|
|
5055
4621
|
}
|
|
5056
4622
|
static get ZERO() {
|
|
5057
|
-
|
|
5058
|
-
return constants3.ZERO;
|
|
5059
|
-
}
|
|
5060
|
-
get INDICES() {
|
|
5061
|
-
return INDICES2;
|
|
4623
|
+
return getZeroMatrix2();
|
|
5062
4624
|
}
|
|
5063
4625
|
get ELEMENTS() {
|
|
5064
4626
|
return 16;
|
|
@@ -5066,6 +4628,9 @@
|
|
|
5066
4628
|
get RANK() {
|
|
5067
4629
|
return 4;
|
|
5068
4630
|
}
|
|
4631
|
+
get INDICES() {
|
|
4632
|
+
return INDICES2;
|
|
4633
|
+
}
|
|
5069
4634
|
constructor(array) {
|
|
5070
4635
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
5071
4636
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
@@ -5151,91 +4716,65 @@
|
|
|
5151
4716
|
return result;
|
|
5152
4717
|
}
|
|
5153
4718
|
identity() {
|
|
5154
|
-
return this.copy(
|
|
4719
|
+
return this.copy(IDENTITY_MATRIX2);
|
|
5155
4720
|
}
|
|
5156
|
-
|
|
5157
|
-
fromQuat2(this, q);
|
|
4721
|
+
fromObject(object) {
|
|
5158
4722
|
return this.check();
|
|
5159
4723
|
}
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
4724
|
+
fromQuaternion(quaternion) {
|
|
4725
|
+
fromQuat2(this, quaternion);
|
|
4726
|
+
return this.check();
|
|
4727
|
+
}
|
|
4728
|
+
frustum(view) {
|
|
4729
|
+
const {
|
|
4730
|
+
left,
|
|
4731
|
+
right,
|
|
4732
|
+
bottom,
|
|
4733
|
+
top,
|
|
4734
|
+
near = DEFAULT_NEAR,
|
|
4735
|
+
far = DEFAULT_FAR
|
|
4736
|
+
} = view;
|
|
5168
4737
|
if (far === Infinity) {
|
|
5169
|
-
|
|
4738
|
+
computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
|
|
5170
4739
|
} else {
|
|
5171
4740
|
frustum(this, left, right, bottom, top, near, far);
|
|
5172
4741
|
}
|
|
5173
4742
|
return this.check();
|
|
5174
4743
|
}
|
|
5175
|
-
|
|
5176
|
-
const
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
const column2Row3 = -1;
|
|
5182
|
-
const column3Row2 = -2 * near;
|
|
5183
|
-
result[0] = column0Row0;
|
|
5184
|
-
result[1] = 0;
|
|
5185
|
-
result[2] = 0;
|
|
5186
|
-
result[3] = 0;
|
|
5187
|
-
result[4] = 0;
|
|
5188
|
-
result[5] = column1Row1;
|
|
5189
|
-
result[6] = 0;
|
|
5190
|
-
result[7] = 0;
|
|
5191
|
-
result[8] = column2Row0;
|
|
5192
|
-
result[9] = column2Row1;
|
|
5193
|
-
result[10] = column2Row2;
|
|
5194
|
-
result[11] = column2Row3;
|
|
5195
|
-
result[12] = 0;
|
|
5196
|
-
result[13] = 0;
|
|
5197
|
-
result[14] = column3Row2;
|
|
5198
|
-
result[15] = 0;
|
|
5199
|
-
return result;
|
|
5200
|
-
}
|
|
5201
|
-
lookAt(eye, center, up) {
|
|
5202
|
-
if (arguments.length === 1) {
|
|
5203
|
-
({
|
|
5204
|
-
eye,
|
|
5205
|
-
center,
|
|
5206
|
-
up
|
|
5207
|
-
} = eye);
|
|
5208
|
-
}
|
|
5209
|
-
center = center || [0, 0, 0];
|
|
5210
|
-
up = up || [0, 1, 0];
|
|
4744
|
+
lookAt(view) {
|
|
4745
|
+
const {
|
|
4746
|
+
eye,
|
|
4747
|
+
center = [0, 0, 0],
|
|
4748
|
+
up = [0, 1, 0]
|
|
4749
|
+
} = view;
|
|
5211
4750
|
lookAt(this, eye, center, up);
|
|
5212
4751
|
return this.check();
|
|
5213
4752
|
}
|
|
5214
|
-
ortho({
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
4753
|
+
ortho(view) {
|
|
4754
|
+
const {
|
|
4755
|
+
left,
|
|
4756
|
+
right,
|
|
4757
|
+
bottom,
|
|
4758
|
+
top,
|
|
4759
|
+
near = DEFAULT_NEAR,
|
|
4760
|
+
far = DEFAULT_FAR
|
|
4761
|
+
} = view;
|
|
5222
4762
|
ortho(this, left, right, bottom, top, near, far);
|
|
5223
4763
|
return this.check();
|
|
5224
4764
|
}
|
|
5225
|
-
orthographic({
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
}
|
|
4765
|
+
orthographic(view) {
|
|
4766
|
+
const {
|
|
4767
|
+
fovy = DEFAULT_FOVY,
|
|
4768
|
+
aspect = DEFAULT_ASPECT,
|
|
4769
|
+
focalDistance = 1,
|
|
4770
|
+
near = DEFAULT_NEAR,
|
|
4771
|
+
far = DEFAULT_FAR
|
|
4772
|
+
} = view;
|
|
4773
|
+
checkRadians(fovy);
|
|
5235
4774
|
const halfY = fovy / 2;
|
|
5236
4775
|
const top = focalDistance * Math.tan(halfY);
|
|
5237
4776
|
const right = top * aspect;
|
|
5238
|
-
return
|
|
4777
|
+
return this.ortho({
|
|
5239
4778
|
left: -right,
|
|
5240
4779
|
right,
|
|
5241
4780
|
bottom: -top,
|
|
@@ -5244,17 +4783,14 @@
|
|
|
5244
4783
|
far
|
|
5245
4784
|
});
|
|
5246
4785
|
}
|
|
5247
|
-
perspective({
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
fovy
|
|
5255
|
-
if (fovy > Math.PI * 2) {
|
|
5256
|
-
throw Error("radians");
|
|
5257
|
-
}
|
|
4786
|
+
perspective(view) {
|
|
4787
|
+
const {
|
|
4788
|
+
fovy = 45 * Math.PI / 180,
|
|
4789
|
+
aspect = 1,
|
|
4790
|
+
near = 0.1,
|
|
4791
|
+
far = 500
|
|
4792
|
+
} = view;
|
|
4793
|
+
checkRadians(fovy);
|
|
5258
4794
|
perspective(this, fovy, aspect, near, far);
|
|
5259
4795
|
return this.check();
|
|
5260
4796
|
}
|
|
@@ -5273,8 +4809,10 @@
|
|
|
5273
4809
|
result[2] = this[14];
|
|
5274
4810
|
return result;
|
|
5275
4811
|
}
|
|
5276
|
-
getRotation(result
|
|
5277
|
-
|
|
4812
|
+
getRotation(result, scaleResult) {
|
|
4813
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
4814
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
4815
|
+
const scale5 = this.getScale(scaleResult);
|
|
5278
4816
|
const inverseScale0 = 1 / scale5[0];
|
|
5279
4817
|
const inverseScale1 = 1 / scale5[1];
|
|
5280
4818
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -5296,8 +4834,10 @@
|
|
|
5296
4834
|
result[15] = 1;
|
|
5297
4835
|
return result;
|
|
5298
4836
|
}
|
|
5299
|
-
getRotationMatrix3(result
|
|
5300
|
-
|
|
4837
|
+
getRotationMatrix3(result, scaleResult) {
|
|
4838
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
4839
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
4840
|
+
const scale5 = this.getScale(scaleResult);
|
|
5301
4841
|
const inverseScale0 = 1 / scale5[0];
|
|
5302
4842
|
const inverseScale1 = 1 / scale5[1];
|
|
5303
4843
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -5340,23 +4880,19 @@
|
|
|
5340
4880
|
rotateZ2(this, this, radians2);
|
|
5341
4881
|
return this.check();
|
|
5342
4882
|
}
|
|
5343
|
-
rotateXYZ(
|
|
5344
|
-
return this.rotateX(
|
|
4883
|
+
rotateXYZ(angleXYZ) {
|
|
4884
|
+
return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
|
|
5345
4885
|
}
|
|
5346
4886
|
rotateAxis(radians2, axis) {
|
|
5347
4887
|
rotate2(this, this, radians2, axis);
|
|
5348
4888
|
return this.check();
|
|
5349
4889
|
}
|
|
5350
4890
|
scale(factor) {
|
|
5351
|
-
|
|
5352
|
-
scale2(this, this, factor);
|
|
5353
|
-
} else {
|
|
5354
|
-
scale2(this, this, [factor, factor, factor]);
|
|
5355
|
-
}
|
|
4891
|
+
scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
5356
4892
|
return this.check();
|
|
5357
4893
|
}
|
|
5358
|
-
translate(
|
|
5359
|
-
translate2(this, this,
|
|
4894
|
+
translate(vector) {
|
|
4895
|
+
translate2(this, this, vector);
|
|
5360
4896
|
return this.check();
|
|
5361
4897
|
}
|
|
5362
4898
|
transform(vector, result) {
|
|
@@ -5371,51 +4907,50 @@
|
|
|
5371
4907
|
const {
|
|
5372
4908
|
length: length4
|
|
5373
4909
|
} = vector;
|
|
4910
|
+
let out;
|
|
5374
4911
|
switch (length4) {
|
|
5375
4912
|
case 2:
|
|
5376
|
-
|
|
4913
|
+
out = transformMat4(result || [-0, -0], vector, this);
|
|
5377
4914
|
break;
|
|
5378
4915
|
case 3:
|
|
5379
|
-
|
|
4916
|
+
out = transformMat42(result || [-0, -0, -0], vector, this);
|
|
5380
4917
|
break;
|
|
5381
4918
|
default:
|
|
5382
4919
|
throw new Error("Illegal vector");
|
|
5383
4920
|
}
|
|
5384
|
-
checkVector(
|
|
5385
|
-
return
|
|
4921
|
+
checkVector(out, vector.length);
|
|
4922
|
+
return out;
|
|
5386
4923
|
}
|
|
5387
4924
|
transformAsVector(vector, result) {
|
|
4925
|
+
let out;
|
|
5388
4926
|
switch (vector.length) {
|
|
5389
4927
|
case 2:
|
|
5390
|
-
|
|
4928
|
+
out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
|
|
5391
4929
|
break;
|
|
5392
4930
|
case 3:
|
|
5393
|
-
|
|
4931
|
+
out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
|
|
5394
4932
|
break;
|
|
5395
4933
|
default:
|
|
5396
4934
|
throw new Error("Illegal vector");
|
|
5397
4935
|
}
|
|
5398
|
-
checkVector(
|
|
5399
|
-
return
|
|
5400
|
-
}
|
|
5401
|
-
makeRotationX(radians2) {
|
|
5402
|
-
return this.identity().rotateX(radians2);
|
|
5403
|
-
}
|
|
5404
|
-
makeTranslation(x, y, z) {
|
|
5405
|
-
return this.identity().translate([x, y, z]);
|
|
4936
|
+
checkVector(out, vector.length);
|
|
4937
|
+
return out;
|
|
5406
4938
|
}
|
|
5407
4939
|
transformPoint(vector, result) {
|
|
5408
|
-
deprecated("Matrix4.transformPoint", "3.0");
|
|
5409
4940
|
return this.transformAsPoint(vector, result);
|
|
5410
4941
|
}
|
|
5411
4942
|
transformVector(vector, result) {
|
|
5412
|
-
deprecated("Matrix4.transformVector", "3.0");
|
|
5413
4943
|
return this.transformAsPoint(vector, result);
|
|
5414
4944
|
}
|
|
5415
4945
|
transformDirection(vector, result) {
|
|
5416
|
-
deprecated("Matrix4.transformDirection", "3.0");
|
|
5417
4946
|
return this.transformAsVector(vector, result);
|
|
5418
4947
|
}
|
|
4948
|
+
makeRotationX(radians2) {
|
|
4949
|
+
return this.identity().rotateX(radians2);
|
|
4950
|
+
}
|
|
4951
|
+
makeTranslation(x, y, z) {
|
|
4952
|
+
return this.identity().translate([x, y, z]);
|
|
4953
|
+
}
|
|
5419
4954
|
};
|
|
5420
4955
|
}
|
|
5421
4956
|
});
|
|
@@ -5642,7 +5177,7 @@
|
|
|
5642
5177
|
"../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js"() {
|
|
5643
5178
|
init_math_array();
|
|
5644
5179
|
init_validators();
|
|
5645
|
-
|
|
5180
|
+
init_vector4();
|
|
5646
5181
|
init_quat();
|
|
5647
5182
|
init_vec4();
|
|
5648
5183
|
IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
@@ -5669,18 +5204,25 @@
|
|
|
5669
5204
|
this[3] = w;
|
|
5670
5205
|
return this.check();
|
|
5671
5206
|
}
|
|
5207
|
+
fromObject(object) {
|
|
5208
|
+
this[0] = object.x;
|
|
5209
|
+
this[1] = object.y;
|
|
5210
|
+
this[2] = object.z;
|
|
5211
|
+
this[3] = object.w;
|
|
5212
|
+
return this.check();
|
|
5213
|
+
}
|
|
5672
5214
|
fromMatrix3(m) {
|
|
5673
5215
|
fromMat3(this, m);
|
|
5674
5216
|
return this.check();
|
|
5675
5217
|
}
|
|
5676
|
-
identity() {
|
|
5677
|
-
identity2(this);
|
|
5678
|
-
return this.check();
|
|
5679
|
-
}
|
|
5680
5218
|
fromAxisRotation(axis, rad) {
|
|
5681
5219
|
setAxisAngle(this, axis, rad);
|
|
5682
5220
|
return this.check();
|
|
5683
5221
|
}
|
|
5222
|
+
identity() {
|
|
5223
|
+
identity2(this);
|
|
5224
|
+
return this.check();
|
|
5225
|
+
}
|
|
5684
5226
|
setAxisAngle(axis, rad) {
|
|
5685
5227
|
return this.fromAxisRotation(axis, rad);
|
|
5686
5228
|
}
|
|
@@ -5717,20 +5259,14 @@
|
|
|
5717
5259
|
lengthSquared() {
|
|
5718
5260
|
return squaredLength2(this);
|
|
5719
5261
|
}
|
|
5720
|
-
dot(a2
|
|
5721
|
-
if (b !== void 0) {
|
|
5722
|
-
throw new Error("Quaternion.dot only takes one argument");
|
|
5723
|
-
}
|
|
5262
|
+
dot(a2) {
|
|
5724
5263
|
return dot3(this, a2);
|
|
5725
5264
|
}
|
|
5726
5265
|
rotationTo(vectorA, vectorB) {
|
|
5727
5266
|
rotationTo(this, vectorA, vectorB);
|
|
5728
5267
|
return this.check();
|
|
5729
5268
|
}
|
|
5730
|
-
add(a2
|
|
5731
|
-
if (b !== void 0) {
|
|
5732
|
-
throw new Error("Quaternion.add only takes one argument");
|
|
5733
|
-
}
|
|
5269
|
+
add(a2) {
|
|
5734
5270
|
add2(this, this, a2);
|
|
5735
5271
|
return this.check();
|
|
5736
5272
|
}
|
|
@@ -5747,16 +5283,17 @@
|
|
|
5747
5283
|
return this.check();
|
|
5748
5284
|
}
|
|
5749
5285
|
lerp(a2, b, t2) {
|
|
5286
|
+
if (t2 === void 0) {
|
|
5287
|
+
return this.lerp(this, a2, b);
|
|
5288
|
+
}
|
|
5750
5289
|
lerp2(this, a2, b, t2);
|
|
5751
5290
|
return this.check();
|
|
5752
5291
|
}
|
|
5753
|
-
multiplyRight(a2
|
|
5754
|
-
assert5(!b);
|
|
5292
|
+
multiplyRight(a2) {
|
|
5755
5293
|
multiply3(this, this, a2);
|
|
5756
5294
|
return this.check();
|
|
5757
5295
|
}
|
|
5758
|
-
multiplyLeft(a2
|
|
5759
|
-
assert5(!b);
|
|
5296
|
+
multiplyLeft(a2) {
|
|
5760
5297
|
multiply3(this, a2, this);
|
|
5761
5298
|
return this.check();
|
|
5762
5299
|
}
|
|
@@ -5788,25 +5325,32 @@
|
|
|
5788
5325
|
scale4(this, this, b);
|
|
5789
5326
|
return this.check();
|
|
5790
5327
|
}
|
|
5791
|
-
slerp(
|
|
5328
|
+
slerp(arg0, arg1, arg2) {
|
|
5329
|
+
let start;
|
|
5330
|
+
let target;
|
|
5331
|
+
let ratio;
|
|
5792
5332
|
switch (arguments.length) {
|
|
5793
5333
|
case 1:
|
|
5794
5334
|
({
|
|
5795
5335
|
start = IDENTITY_QUATERNION,
|
|
5796
5336
|
target,
|
|
5797
5337
|
ratio
|
|
5798
|
-
} =
|
|
5338
|
+
} = arg0);
|
|
5799
5339
|
break;
|
|
5800
5340
|
case 2:
|
|
5801
|
-
[target, ratio] = arguments;
|
|
5802
5341
|
start = this;
|
|
5342
|
+
target = arg0;
|
|
5343
|
+
ratio = arg1;
|
|
5803
5344
|
break;
|
|
5804
5345
|
default:
|
|
5346
|
+
start = arg0;
|
|
5347
|
+
target = arg1;
|
|
5348
|
+
ratio = arg2;
|
|
5805
5349
|
}
|
|
5806
5350
|
slerp(this, start, target, ratio);
|
|
5807
5351
|
return this.check();
|
|
5808
5352
|
}
|
|
5809
|
-
transformVector4(vector, result =
|
|
5353
|
+
transformVector4(vector, result = new Vector4()) {
|
|
5810
5354
|
transformQuat2(result, vector, this);
|
|
5811
5355
|
return checkVector(result, 4);
|
|
5812
5356
|
}
|
|
@@ -5816,11 +5360,11 @@
|
|
|
5816
5360
|
setFromAxisAngle(axis, rad) {
|
|
5817
5361
|
return this.setAxisAngle(axis, rad);
|
|
5818
5362
|
}
|
|
5819
|
-
premultiply(a2
|
|
5820
|
-
return this.multiplyLeft(a2
|
|
5363
|
+
premultiply(a2) {
|
|
5364
|
+
return this.multiplyLeft(a2);
|
|
5821
5365
|
}
|
|
5822
|
-
multiply(a2
|
|
5823
|
-
return this.multiplyRight(a2
|
|
5366
|
+
multiply(a2) {
|
|
5367
|
+
return this.multiplyRight(a2);
|
|
5824
5368
|
}
|
|
5825
5369
|
};
|
|
5826
5370
|
}
|
|
@@ -5860,26 +5404,15 @@
|
|
|
5860
5404
|
});
|
|
5861
5405
|
|
|
5862
5406
|
// ../../node_modules/@math.gl/core/dist/esm/index.js
|
|
5863
|
-
var
|
|
5864
|
-
var init_esm5 = __esm({
|
|
5407
|
+
var init_esm3 = __esm({
|
|
5865
5408
|
"../../node_modules/@math.gl/core/dist/esm/index.js"() {
|
|
5866
|
-
init_common();
|
|
5867
5409
|
init_vector3();
|
|
5868
5410
|
init_matrix3();
|
|
5869
5411
|
init_matrix4();
|
|
5870
5412
|
init_quaternion();
|
|
5871
|
-
init_common();
|
|
5872
5413
|
init_math_utils();
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
self: typeof self !== "undefined" && self,
|
|
5876
|
-
window: typeof window !== "undefined" && window,
|
|
5877
|
-
global: typeof global !== "undefined" && global
|
|
5878
|
-
};
|
|
5879
|
-
global_5 = globals5.global || globals5.self || globals5.window;
|
|
5880
|
-
global_5.mathgl = {
|
|
5881
|
-
config
|
|
5882
|
-
};
|
|
5414
|
+
init_assert4();
|
|
5415
|
+
init_common();
|
|
5883
5416
|
}
|
|
5884
5417
|
});
|
|
5885
5418
|
|
|
@@ -5902,65 +5435,67 @@
|
|
|
5902
5435
|
});
|
|
5903
5436
|
|
|
5904
5437
|
// ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
|
|
5905
|
-
function
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
result[
|
|
5912
|
-
result[1] = map3(cartographic.latitude);
|
|
5438
|
+
function identity3(x) {
|
|
5439
|
+
return x;
|
|
5440
|
+
}
|
|
5441
|
+
function fromCartographic(cartographic, result = [], map2 = identity3) {
|
|
5442
|
+
if ("longitude" in cartographic) {
|
|
5443
|
+
result[0] = map2(cartographic.longitude);
|
|
5444
|
+
result[1] = map2(cartographic.latitude);
|
|
5913
5445
|
result[2] = cartographic.height;
|
|
5914
|
-
} else {
|
|
5915
|
-
result[0] =
|
|
5916
|
-
result[1] =
|
|
5446
|
+
} else if ("x" in cartographic) {
|
|
5447
|
+
result[0] = map2(cartographic.x);
|
|
5448
|
+
result[1] = map2(cartographic.y);
|
|
5917
5449
|
result[2] = cartographic.z;
|
|
5450
|
+
} else {
|
|
5451
|
+
result[0] = map2(cartographic[0]);
|
|
5452
|
+
result[1] = map2(cartographic[1]);
|
|
5453
|
+
result[2] = cartographic[2];
|
|
5918
5454
|
}
|
|
5919
5455
|
return result;
|
|
5920
5456
|
}
|
|
5921
|
-
function fromCartographicToRadians(cartographic, vector =
|
|
5922
|
-
return fromCartographic(cartographic, vector, config._cartographicRadians ?
|
|
5457
|
+
function fromCartographicToRadians(cartographic, vector = []) {
|
|
5458
|
+
return fromCartographic(cartographic, vector, config._cartographicRadians ? identity3 : toRadians);
|
|
5923
5459
|
}
|
|
5924
|
-
function toCartographic(vector, cartographic,
|
|
5925
|
-
if (
|
|
5926
|
-
cartographic
|
|
5927
|
-
cartographic
|
|
5928
|
-
cartographic[2] = vector[2];
|
|
5929
|
-
} else if ("longitude" in cartographic) {
|
|
5930
|
-
cartographic.longitude = map3(vector[0]);
|
|
5931
|
-
cartographic.latitude = map3(vector[1]);
|
|
5460
|
+
function toCartographic(vector, cartographic, map2 = identity3) {
|
|
5461
|
+
if ("longitude" in cartographic) {
|
|
5462
|
+
cartographic.longitude = map2(vector[0]);
|
|
5463
|
+
cartographic.latitude = map2(vector[1]);
|
|
5932
5464
|
cartographic.height = vector[2];
|
|
5933
|
-
} else {
|
|
5934
|
-
cartographic.x =
|
|
5935
|
-
cartographic.y =
|
|
5465
|
+
} else if ("x" in cartographic) {
|
|
5466
|
+
cartographic.x = map2(vector[0]);
|
|
5467
|
+
cartographic.y = map2(vector[1]);
|
|
5936
5468
|
cartographic.z = vector[2];
|
|
5469
|
+
} else {
|
|
5470
|
+
cartographic[0] = map2(vector[0]);
|
|
5471
|
+
cartographic[1] = map2(vector[1]);
|
|
5472
|
+
cartographic[2] = vector[2];
|
|
5937
5473
|
}
|
|
5938
5474
|
return cartographic;
|
|
5939
5475
|
}
|
|
5940
5476
|
function toCartographicFromRadians(vector, cartographic) {
|
|
5941
|
-
return toCartographic(vector, cartographic, config._cartographicRadians ?
|
|
5477
|
+
return toCartographic(vector, cartographic, config._cartographicRadians ? identity3 : toDegrees);
|
|
5942
5478
|
}
|
|
5943
|
-
var
|
|
5479
|
+
var scratchVector;
|
|
5944
5480
|
var init_type_utils = __esm({
|
|
5945
5481
|
"../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js"() {
|
|
5946
|
-
|
|
5482
|
+
init_esm3();
|
|
5947
5483
|
init_constants();
|
|
5948
|
-
noop3 = (x) => x;
|
|
5949
5484
|
scratchVector = new Vector3();
|
|
5950
5485
|
}
|
|
5951
5486
|
});
|
|
5952
5487
|
|
|
5953
5488
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
|
|
5954
|
-
function scaleToGeodeticSurface(cartesian, ellipsoid, result =
|
|
5489
|
+
function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
|
|
5955
5490
|
const {
|
|
5956
5491
|
oneOverRadii,
|
|
5957
5492
|
oneOverRadiiSquared,
|
|
5958
5493
|
centerToleranceSquared
|
|
5959
5494
|
} = ellipsoid;
|
|
5960
5495
|
scratchVector2.from(cartesian);
|
|
5961
|
-
const positionX =
|
|
5962
|
-
const positionY =
|
|
5963
|
-
const positionZ =
|
|
5496
|
+
const positionX = scratchVector2.x;
|
|
5497
|
+
const positionY = scratchVector2.y;
|
|
5498
|
+
const positionZ = scratchVector2.z;
|
|
5964
5499
|
const oneOverRadiiX = oneOverRadii.x;
|
|
5965
5500
|
const oneOverRadiiY = oneOverRadii.y;
|
|
5966
5501
|
const oneOverRadiiZ = oneOverRadii.z;
|
|
@@ -5982,7 +5517,7 @@
|
|
|
5982
5517
|
const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
|
|
5983
5518
|
const gradient = scaleToGeodeticSurfaceGradient;
|
|
5984
5519
|
gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
|
|
5985
|
-
let lambda = (1 - ratio) *
|
|
5520
|
+
let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
|
|
5986
5521
|
let correction = 0;
|
|
5987
5522
|
let xMultiplier;
|
|
5988
5523
|
let yMultiplier;
|
|
@@ -6009,7 +5544,7 @@
|
|
|
6009
5544
|
var scratchVector2, scaleToGeodeticSurfaceIntersection, scaleToGeodeticSurfaceGradient;
|
|
6010
5545
|
var init_scale_to_geodetic_surface = __esm({
|
|
6011
5546
|
"../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js"() {
|
|
6012
|
-
|
|
5547
|
+
init_esm3();
|
|
6013
5548
|
scratchVector2 = new Vector3();
|
|
6014
5549
|
scaleToGeodeticSurfaceIntersection = new Vector3();
|
|
6015
5550
|
scaleToGeodeticSurfaceGradient = new Vector3();
|
|
@@ -6019,7 +5554,7 @@
|
|
|
6019
5554
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js
|
|
6020
5555
|
function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
|
|
6021
5556
|
const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
|
|
6022
|
-
|
|
5557
|
+
assert4(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
|
|
6023
5558
|
let firstAxisVector;
|
|
6024
5559
|
let secondAxisVector;
|
|
6025
5560
|
let thirdAxisVector;
|
|
@@ -6081,7 +5616,7 @@
|
|
|
6081
5616
|
var EPSILON14, scratchOrigin, VECTOR_PRODUCT_LOCAL_FRAME, degeneratePositionLocalFrame, scratchAxisVectors, scratchVector1, scratchVector22, scratchVector3;
|
|
6082
5617
|
var init_ellipsoid_transform = __esm({
|
|
6083
5618
|
"../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/ellipsoid-transform.js"() {
|
|
6084
|
-
|
|
5619
|
+
init_esm3();
|
|
6085
5620
|
EPSILON14 = 1e-14;
|
|
6086
5621
|
scratchOrigin = new Vector3();
|
|
6087
5622
|
VECTOR_PRODUCT_LOCAL_FRAME = {
|
|
@@ -6145,10 +5680,11 @@
|
|
|
6145
5680
|
});
|
|
6146
5681
|
|
|
6147
5682
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js
|
|
6148
|
-
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian,
|
|
5683
|
+
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, Ellipsoid;
|
|
6149
5684
|
var init_ellipsoid = __esm({
|
|
6150
5685
|
"../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js"() {
|
|
6151
|
-
|
|
5686
|
+
init_defineProperty();
|
|
5687
|
+
init_esm3();
|
|
6152
5688
|
init_vec3();
|
|
6153
5689
|
init_constants();
|
|
6154
5690
|
init_type_utils();
|
|
@@ -6161,14 +5697,19 @@
|
|
|
6161
5697
|
scratchHeight = new Vector3();
|
|
6162
5698
|
scratchCartesian = new Vector3();
|
|
6163
5699
|
Ellipsoid = class {
|
|
6164
|
-
static get WGS84() {
|
|
6165
|
-
wgs84 = wgs84 || new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
|
|
6166
|
-
return wgs84;
|
|
6167
|
-
}
|
|
6168
5700
|
constructor(x = 0, y = 0, z = 0) {
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
5701
|
+
_defineProperty(this, "radii", void 0);
|
|
5702
|
+
_defineProperty(this, "radiiSquared", void 0);
|
|
5703
|
+
_defineProperty(this, "radiiToTheFourth", void 0);
|
|
5704
|
+
_defineProperty(this, "oneOverRadii", void 0);
|
|
5705
|
+
_defineProperty(this, "oneOverRadiiSquared", void 0);
|
|
5706
|
+
_defineProperty(this, "minimumRadius", void 0);
|
|
5707
|
+
_defineProperty(this, "maximumRadius", void 0);
|
|
5708
|
+
_defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
|
|
5709
|
+
_defineProperty(this, "squaredXOverSquaredZ", void 0);
|
|
5710
|
+
assert4(x >= 0);
|
|
5711
|
+
assert4(y >= 0);
|
|
5712
|
+
assert4(z >= 0);
|
|
6172
5713
|
this.radii = new Vector3(x, y, z);
|
|
6173
5714
|
this.radiiSquared = new Vector3(x * x, y * y, z * z);
|
|
6174
5715
|
this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
|
|
@@ -6176,7 +5717,6 @@
|
|
|
6176
5717
|
this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
|
|
6177
5718
|
this.minimumRadius = Math.min(x, y, z);
|
|
6178
5719
|
this.maximumRadius = Math.max(x, y, z);
|
|
6179
|
-
this.centerToleranceSquared = math_utils_default.EPSILON1;
|
|
6180
5720
|
if (this.radiiSquared.z !== 0) {
|
|
6181
5721
|
this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
|
|
6182
5722
|
}
|
|
@@ -6253,8 +5793,8 @@
|
|
|
6253
5793
|
return scratchPosition.from(position).scale(this.radii).to(result);
|
|
6254
5794
|
}
|
|
6255
5795
|
getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
|
|
6256
|
-
|
|
6257
|
-
|
|
5796
|
+
assert4(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
|
|
5797
|
+
assert4(this.radii.z > 0);
|
|
6258
5798
|
scratchPosition.from(position);
|
|
6259
5799
|
const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
|
|
6260
5800
|
if (Math.abs(z) >= this.radii.z - buffer) {
|
|
@@ -6263,11 +5803,12 @@
|
|
|
6263
5803
|
return scratchPosition.set(0, 0, z).to(result);
|
|
6264
5804
|
}
|
|
6265
5805
|
};
|
|
5806
|
+
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
6266
5807
|
}
|
|
6267
5808
|
});
|
|
6268
5809
|
|
|
6269
5810
|
// ../../node_modules/@math.gl/geospatial/dist/esm/index.js
|
|
6270
|
-
var
|
|
5811
|
+
var init_esm4 = __esm({
|
|
6271
5812
|
"../../node_modules/@math.gl/geospatial/dist/esm/index.js"() {
|
|
6272
5813
|
init_ellipsoid();
|
|
6273
5814
|
init_type_utils();
|
|
@@ -6702,6 +6243,7 @@
|
|
|
6702
6243
|
var DEFAULT_DRACO_OPTIONS, DracoLoader;
|
|
6703
6244
|
var init_draco_loader = __esm({
|
|
6704
6245
|
"../draco/src/draco-loader.ts"() {
|
|
6246
|
+
init_src();
|
|
6705
6247
|
init_version3();
|
|
6706
6248
|
DEFAULT_DRACO_OPTIONS = {
|
|
6707
6249
|
draco: {
|
|
@@ -6713,7 +6255,7 @@
|
|
|
6713
6255
|
};
|
|
6714
6256
|
DracoLoader = {
|
|
6715
6257
|
name: "Draco",
|
|
6716
|
-
id: "draco",
|
|
6258
|
+
id: isBrowser2 ? "draco" : "draco-nodejs",
|
|
6717
6259
|
module: "draco",
|
|
6718
6260
|
shapes: ["mesh"],
|
|
6719
6261
|
version: VERSION6,
|
|
@@ -6759,12 +6301,12 @@
|
|
|
6759
6301
|
});
|
|
6760
6302
|
|
|
6761
6303
|
// ../schema/src/lib/utils/assert.ts
|
|
6762
|
-
function
|
|
6304
|
+
function assert5(condition, message) {
|
|
6763
6305
|
if (!condition) {
|
|
6764
6306
|
throw new Error(message || "loader assertion failed.");
|
|
6765
6307
|
}
|
|
6766
6308
|
}
|
|
6767
|
-
var
|
|
6309
|
+
var init_assert5 = __esm({
|
|
6768
6310
|
"../schema/src/lib/utils/assert.ts"() {
|
|
6769
6311
|
}
|
|
6770
6312
|
});
|
|
@@ -6785,10 +6327,10 @@
|
|
|
6785
6327
|
var Schema;
|
|
6786
6328
|
var init_schema = __esm({
|
|
6787
6329
|
"../schema/src/lib/schema/impl/schema.ts"() {
|
|
6788
|
-
|
|
6330
|
+
init_assert5();
|
|
6789
6331
|
Schema = class {
|
|
6790
6332
|
constructor(fields, metadata) {
|
|
6791
|
-
|
|
6333
|
+
assert5(Array.isArray(fields));
|
|
6792
6334
|
checkNames(fields);
|
|
6793
6335
|
this.fields = fields;
|
|
6794
6336
|
this.metadata = metadata || new Map();
|
|
@@ -7734,15 +7276,17 @@
|
|
|
7734
7276
|
});
|
|
7735
7277
|
});
|
|
7736
7278
|
}
|
|
7737
|
-
var
|
|
7279
|
+
var DRACO_DECODER_VERSION, DRACO_ENCODER_VERSION, STATIC_DECODER_URL, DRACO_JS_DECODER_URL, DRACO_WASM_WRAPPER_URL, DRACO_WASM_DECODER_URL, DRACO_ENCODER_URL, loadDecoderPromise;
|
|
7738
7280
|
var init_draco_module_loader = __esm({
|
|
7739
7281
|
"../draco/src/lib/draco-module-loader.ts"() {
|
|
7740
7282
|
init_src();
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7283
|
+
DRACO_DECODER_VERSION = "1.5.5";
|
|
7284
|
+
DRACO_ENCODER_VERSION = "1.4.1";
|
|
7285
|
+
STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
7286
|
+
DRACO_JS_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.js`;
|
|
7287
|
+
DRACO_WASM_WRAPPER_URL = `${STATIC_DECODER_URL}/draco_wasm_wrapper.js`;
|
|
7288
|
+
DRACO_WASM_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.wasm`;
|
|
7289
|
+
DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/draco_encoder.js`;
|
|
7746
7290
|
}
|
|
7747
7291
|
});
|
|
7748
7292
|
|
|
@@ -7802,8 +7346,8 @@
|
|
|
7802
7346
|
options.wasmBinary = wasmBinary;
|
|
7803
7347
|
}
|
|
7804
7348
|
return new Promise((resolve) => {
|
|
7805
|
-
BasisModule(options).then((
|
|
7806
|
-
const { BasisFile, initializeBasis } =
|
|
7349
|
+
BasisModule(options).then((module) => {
|
|
7350
|
+
const { BasisFile, initializeBasis } = module;
|
|
7807
7351
|
initializeBasis();
|
|
7808
7352
|
resolve({ BasisFile });
|
|
7809
7353
|
});
|
|
@@ -7833,8 +7377,8 @@
|
|
|
7833
7377
|
options.wasmBinary = wasmBinary;
|
|
7834
7378
|
}
|
|
7835
7379
|
return new Promise((resolve) => {
|
|
7836
|
-
BasisEncoderModule(options).then((
|
|
7837
|
-
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } =
|
|
7380
|
+
BasisEncoderModule(options).then((module) => {
|
|
7381
|
+
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;
|
|
7838
7382
|
initializeBasis();
|
|
7839
7383
|
resolve({ BasisFile, KTX2File, BasisEncoder });
|
|
7840
7384
|
});
|
|
@@ -8406,11 +7950,12 @@
|
|
|
8406
7950
|
var BasisWorkerLoader, BasisLoader;
|
|
8407
7951
|
var init_basis_loader = __esm({
|
|
8408
7952
|
"../textures/src/basis-loader.ts"() {
|
|
7953
|
+
init_src();
|
|
8409
7954
|
init_version4();
|
|
8410
7955
|
init_parse_basis();
|
|
8411
7956
|
BasisWorkerLoader = {
|
|
8412
7957
|
name: "Basis",
|
|
8413
|
-
id: "basis",
|
|
7958
|
+
id: isBrowser2 ? "basis" : "basis-nodejs",
|
|
8414
7959
|
module: "textures",
|
|
8415
7960
|
version: VERSION7,
|
|
8416
7961
|
worker: true,
|
|
@@ -8854,10 +8399,10 @@
|
|
|
8854
8399
|
});
|
|
8855
8400
|
|
|
8856
8401
|
// ../../node_modules/@luma.gl/constants/dist/esm/index.js
|
|
8857
|
-
var
|
|
8858
|
-
var
|
|
8402
|
+
var esm_default2;
|
|
8403
|
+
var init_esm5 = __esm({
|
|
8859
8404
|
"../../node_modules/@luma.gl/constants/dist/esm/index.js"() {
|
|
8860
|
-
|
|
8405
|
+
esm_default2 = {
|
|
8861
8406
|
DEPTH_BUFFER_BIT: 256,
|
|
8862
8407
|
STENCIL_BUFFER_BIT: 1024,
|
|
8863
8408
|
COLOR_BUFFER_BIT: 16384,
|
|
@@ -9515,14 +9060,14 @@
|
|
|
9515
9060
|
var GL_TYPE_MAP, STRING_ATTRIBUTE_TYPE, OBJECT_ID_ATTRIBUTE_TYPE, FLOAT_64_TYPE, INT_16_ATTRIBUTE_TYPE, COORDINATE_SYSTEM;
|
|
9516
9061
|
var init_constants2 = __esm({
|
|
9517
9062
|
"src/lib/parsers/constants.ts"() {
|
|
9518
|
-
|
|
9063
|
+
init_esm5();
|
|
9519
9064
|
init_types();
|
|
9520
9065
|
GL_TYPE_MAP = {
|
|
9521
|
-
UInt8:
|
|
9522
|
-
UInt16:
|
|
9523
|
-
Float32:
|
|
9524
|
-
UInt32:
|
|
9525
|
-
UInt64:
|
|
9066
|
+
UInt8: esm_default2.UNSIGNED_BYTE,
|
|
9067
|
+
UInt16: esm_default2.UNSIGNED_SHORT,
|
|
9068
|
+
Float32: esm_default2.FLOAT,
|
|
9069
|
+
UInt32: esm_default2.UNSIGNED_INT,
|
|
9070
|
+
UInt64: esm_default2.DOUBLE
|
|
9526
9071
|
};
|
|
9527
9072
|
STRING_ATTRIBUTE_TYPE = "String";
|
|
9528
9073
|
OBJECT_ID_ATTRIBUTE_TYPE = "Oid32";
|
|
@@ -9538,6 +9083,249 @@
|
|
|
9538
9083
|
}
|
|
9539
9084
|
});
|
|
9540
9085
|
|
|
9086
|
+
// src/lib/parsers/parse-i3s-attribute.ts
|
|
9087
|
+
async function parseI3STileAttribute(arrayBuffer, options) {
|
|
9088
|
+
const { attributeName, attributeType } = options;
|
|
9089
|
+
if (!attributeName) {
|
|
9090
|
+
return {};
|
|
9091
|
+
}
|
|
9092
|
+
return {
|
|
9093
|
+
[attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null
|
|
9094
|
+
};
|
|
9095
|
+
}
|
|
9096
|
+
function parseAttribute(attributeType, arrayBuffer) {
|
|
9097
|
+
switch (attributeType) {
|
|
9098
|
+
case STRING_ATTRIBUTE_TYPE:
|
|
9099
|
+
return parseStringsAttribute(arrayBuffer);
|
|
9100
|
+
case OBJECT_ID_ATTRIBUTE_TYPE:
|
|
9101
|
+
return parseShortNumberAttribute(arrayBuffer);
|
|
9102
|
+
case FLOAT_64_TYPE:
|
|
9103
|
+
return parseFloatAttribute(arrayBuffer);
|
|
9104
|
+
case INT_16_ATTRIBUTE_TYPE:
|
|
9105
|
+
return parseInt16ShortNumberAttribute(arrayBuffer);
|
|
9106
|
+
default:
|
|
9107
|
+
return parseShortNumberAttribute(arrayBuffer);
|
|
9108
|
+
}
|
|
9109
|
+
}
|
|
9110
|
+
function parseShortNumberAttribute(arrayBuffer) {
|
|
9111
|
+
const countOffset = 4;
|
|
9112
|
+
return new Uint32Array(arrayBuffer, countOffset);
|
|
9113
|
+
}
|
|
9114
|
+
function parseInt16ShortNumberAttribute(arrayBuffer) {
|
|
9115
|
+
const countOffset = 4;
|
|
9116
|
+
return new Int16Array(arrayBuffer, countOffset);
|
|
9117
|
+
}
|
|
9118
|
+
function parseFloatAttribute(arrayBuffer) {
|
|
9119
|
+
const countOffset = 8;
|
|
9120
|
+
return new Float64Array(arrayBuffer, countOffset);
|
|
9121
|
+
}
|
|
9122
|
+
function parseStringsAttribute(arrayBuffer) {
|
|
9123
|
+
const stringsCountOffset = 0;
|
|
9124
|
+
const dataOffset = 8;
|
|
9125
|
+
const bytesPerStringSize = 4;
|
|
9126
|
+
const stringsArray = [];
|
|
9127
|
+
try {
|
|
9128
|
+
const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
|
|
9129
|
+
const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
|
|
9130
|
+
let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
|
|
9131
|
+
for (const stringByteSize of stringSizes) {
|
|
9132
|
+
const textDecoder = new TextDecoder("utf-8");
|
|
9133
|
+
const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);
|
|
9134
|
+
stringsArray.push(textDecoder.decode(stringAttribute));
|
|
9135
|
+
stringOffset += stringByteSize;
|
|
9136
|
+
}
|
|
9137
|
+
} catch (error) {
|
|
9138
|
+
console.error("Parse string attribute error: ", error.message);
|
|
9139
|
+
}
|
|
9140
|
+
return stringsArray;
|
|
9141
|
+
}
|
|
9142
|
+
var init_parse_i3s_attribute = __esm({
|
|
9143
|
+
"src/lib/parsers/parse-i3s-attribute.ts"() {
|
|
9144
|
+
init_constants2();
|
|
9145
|
+
}
|
|
9146
|
+
});
|
|
9147
|
+
|
|
9148
|
+
// src/i3s-attribute-loader.ts
|
|
9149
|
+
async function parse3(data, options) {
|
|
9150
|
+
data = parseI3STileAttribute(data, options);
|
|
9151
|
+
return data;
|
|
9152
|
+
}
|
|
9153
|
+
async function loadFeatureAttributes(tile, featureId, options = {}) {
|
|
9154
|
+
const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
|
|
9155
|
+
if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
|
|
9156
|
+
return null;
|
|
9157
|
+
}
|
|
9158
|
+
let attributes = [];
|
|
9159
|
+
const attributeLoadPromises = [];
|
|
9160
|
+
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
9161
|
+
const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);
|
|
9162
|
+
const attributeName = attributeStorageInfo[index].name;
|
|
9163
|
+
const attributeType = getAttributeValueType(attributeStorageInfo[index]);
|
|
9164
|
+
const loadOptions = { ...options, attributeName, attributeType };
|
|
9165
|
+
const promise = load(url, I3SAttributeLoader, loadOptions);
|
|
9166
|
+
attributeLoadPromises.push(promise);
|
|
9167
|
+
}
|
|
9168
|
+
try {
|
|
9169
|
+
attributes = await Promise.allSettled(attributeLoadPromises);
|
|
9170
|
+
} catch (error) {
|
|
9171
|
+
}
|
|
9172
|
+
if (!attributes.length) {
|
|
9173
|
+
return null;
|
|
9174
|
+
}
|
|
9175
|
+
return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
|
|
9176
|
+
}
|
|
9177
|
+
function getAttributesData(tile) {
|
|
9178
|
+
const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
|
|
9179
|
+
const attributeUrls = tile.header?.attributeUrls;
|
|
9180
|
+
const tilesetFields = tile.tileset?.tileset?.fields || [];
|
|
9181
|
+
return { attributeStorageInfo, attributeUrls, tilesetFields };
|
|
9182
|
+
}
|
|
9183
|
+
function getAttributeValueType(attribute) {
|
|
9184
|
+
if (attribute.hasOwnProperty("objectIds")) {
|
|
9185
|
+
return "Oid32";
|
|
9186
|
+
} else if (attribute.hasOwnProperty("attributeValues")) {
|
|
9187
|
+
return attribute.attributeValues.valueType;
|
|
9188
|
+
}
|
|
9189
|
+
return "";
|
|
9190
|
+
}
|
|
9191
|
+
function getFeatureIdsAttributeName(attributeStorageInfo) {
|
|
9192
|
+
const objectIdsAttribute = attributeStorageInfo.find((attribute) => attribute.name.includes("OBJECTID"));
|
|
9193
|
+
return objectIdsAttribute?.name;
|
|
9194
|
+
}
|
|
9195
|
+
function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
|
|
9196
|
+
const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
|
|
9197
|
+
const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
|
|
9198
|
+
if (!objectIds) {
|
|
9199
|
+
return null;
|
|
9200
|
+
}
|
|
9201
|
+
const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
|
|
9202
|
+
if (attributeIndex < 0) {
|
|
9203
|
+
return null;
|
|
9204
|
+
}
|
|
9205
|
+
return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
|
|
9206
|
+
}
|
|
9207
|
+
function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
|
|
9208
|
+
const attributesObject = {};
|
|
9209
|
+
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
9210
|
+
const attributeName = attributeStorageInfo[index].name;
|
|
9211
|
+
const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
|
|
9212
|
+
const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
|
|
9213
|
+
attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
|
|
9214
|
+
}
|
|
9215
|
+
return attributesObject;
|
|
9216
|
+
}
|
|
9217
|
+
function getAttributeCodedValues(attributeName, tilesetFields) {
|
|
9218
|
+
const attributeField = tilesetFields.find((field) => field.name === attributeName || field.alias === attributeName);
|
|
9219
|
+
return attributeField?.domain?.codedValues || [];
|
|
9220
|
+
}
|
|
9221
|
+
function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
|
|
9222
|
+
const attributeObject = attributes[index];
|
|
9223
|
+
if (attributeObject.status === REJECTED_STATUS) {
|
|
9224
|
+
return null;
|
|
9225
|
+
}
|
|
9226
|
+
return attributeObject.value[attributesName];
|
|
9227
|
+
}
|
|
9228
|
+
function formatAttributeValue(attribute, featureIdIndex, codedValues) {
|
|
9229
|
+
let value = EMPTY_VALUE;
|
|
9230
|
+
if (attribute && featureIdIndex in attribute) {
|
|
9231
|
+
value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, "").trim();
|
|
9232
|
+
}
|
|
9233
|
+
if (codedValues.length) {
|
|
9234
|
+
const codeValue = codedValues.find((codedValue) => codedValue.code === Number(value));
|
|
9235
|
+
value = codeValue?.name || EMPTY_VALUE;
|
|
9236
|
+
}
|
|
9237
|
+
return value;
|
|
9238
|
+
}
|
|
9239
|
+
var VERSION9, EMPTY_VALUE, REJECTED_STATUS, I3SAttributeLoader;
|
|
9240
|
+
var init_i3s_attribute_loader = __esm({
|
|
9241
|
+
"src/i3s-attribute-loader.ts"() {
|
|
9242
|
+
init_src3();
|
|
9243
|
+
init_parse_i3s_attribute();
|
|
9244
|
+
init_url_utils();
|
|
9245
|
+
VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9246
|
+
EMPTY_VALUE = "";
|
|
9247
|
+
REJECTED_STATUS = "rejected";
|
|
9248
|
+
I3SAttributeLoader = {
|
|
9249
|
+
name: "I3S Attribute",
|
|
9250
|
+
id: "i3s-attribute",
|
|
9251
|
+
module: "i3s",
|
|
9252
|
+
version: VERSION9,
|
|
9253
|
+
mimeTypes: ["application/binary"],
|
|
9254
|
+
parse: parse3,
|
|
9255
|
+
extensions: ["bin"],
|
|
9256
|
+
options: {},
|
|
9257
|
+
binary: true
|
|
9258
|
+
};
|
|
9259
|
+
}
|
|
9260
|
+
});
|
|
9261
|
+
|
|
9262
|
+
// src/lib/utils/customizeColors.ts
|
|
9263
|
+
async function customizeColors(colors, featureIds, tileOptions, tilesetOptions, options) {
|
|
9264
|
+
if (!options?.i3s?.colorsByAttribute) {
|
|
9265
|
+
return colors;
|
|
9266
|
+
}
|
|
9267
|
+
const colorizeAttributeField = tilesetOptions.fields.find(({ name }) => name === options?.i3s?.colorsByAttribute?.attributeName);
|
|
9268
|
+
if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
|
|
9269
|
+
return colors;
|
|
9270
|
+
}
|
|
9271
|
+
const colorizeAttributeData = await loadFeatureAttributeData(colorizeAttributeField.name, tileOptions, tilesetOptions, options);
|
|
9272
|
+
if (!colorizeAttributeData) {
|
|
9273
|
+
return colors;
|
|
9274
|
+
}
|
|
9275
|
+
const objectIdField = tilesetOptions.fields.find(({ type }) => type === "esriFieldTypeOID");
|
|
9276
|
+
if (!objectIdField) {
|
|
9277
|
+
return colors;
|
|
9278
|
+
}
|
|
9279
|
+
const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, tileOptions, tilesetOptions, options);
|
|
9280
|
+
if (!objectIdAttributeData) {
|
|
9281
|
+
return colors;
|
|
9282
|
+
}
|
|
9283
|
+
const attributeValuesMap = {};
|
|
9284
|
+
for (let i2 = 0; i2 < objectIdAttributeData[objectIdField.name].length; i2++) {
|
|
9285
|
+
attributeValuesMap[objectIdAttributeData[objectIdField.name][i2]] = calculateColorForAttribute(colorizeAttributeData[colorizeAttributeField.name][i2], options);
|
|
9286
|
+
}
|
|
9287
|
+
for (let i2 = 0; i2 < featureIds.value.length; i2++) {
|
|
9288
|
+
const color = attributeValuesMap[featureIds.value[i2]];
|
|
9289
|
+
if (!color) {
|
|
9290
|
+
continue;
|
|
9291
|
+
}
|
|
9292
|
+
colors.value.set(color, i2 * 4);
|
|
9293
|
+
}
|
|
9294
|
+
return colors;
|
|
9295
|
+
}
|
|
9296
|
+
function calculateColorForAttribute(attributeValue, options) {
|
|
9297
|
+
if (!options?.i3s?.colorsByAttribute) {
|
|
9298
|
+
return [255, 255, 255, 255];
|
|
9299
|
+
}
|
|
9300
|
+
const { minValue, maxValue, minColor, maxColor } = options.i3s.colorsByAttribute;
|
|
9301
|
+
const rate = (attributeValue - minValue) / (maxValue - minValue);
|
|
9302
|
+
const color = [255, 255, 255, 255];
|
|
9303
|
+
for (let i2 = 0; i2 < minColor.length; i2++) {
|
|
9304
|
+
color[i2] = Math.round((maxColor[i2] - minColor[i2]) * rate + minColor[i2]);
|
|
9305
|
+
}
|
|
9306
|
+
return color;
|
|
9307
|
+
}
|
|
9308
|
+
async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attributeStorageInfo }, options) {
|
|
9309
|
+
const attributeIndex = attributeStorageInfo.findIndex(({ name }) => attributeName === name);
|
|
9310
|
+
if (attributeIndex === -1) {
|
|
9311
|
+
return null;
|
|
9312
|
+
}
|
|
9313
|
+
const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], options?.i3s?.token);
|
|
9314
|
+
const attributeType = getAttributeValueType(attributeStorageInfo[attributeIndex]);
|
|
9315
|
+
const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {
|
|
9316
|
+
attributeName,
|
|
9317
|
+
attributeType
|
|
9318
|
+
});
|
|
9319
|
+
return objectIdAttributeData;
|
|
9320
|
+
}
|
|
9321
|
+
var init_customizeColors = __esm({
|
|
9322
|
+
"src/lib/utils/customizeColors.ts"() {
|
|
9323
|
+
init_src3();
|
|
9324
|
+
init_i3s_attribute_loader();
|
|
9325
|
+
init_url_utils();
|
|
9326
|
+
}
|
|
9327
|
+
});
|
|
9328
|
+
|
|
9541
9329
|
// src/lib/parsers/parse-i3s-tile-content.ts
|
|
9542
9330
|
function getLoaderForTextureFormat(textureFormat) {
|
|
9543
9331
|
switch (textureFormat) {
|
|
@@ -9552,29 +9340,36 @@
|
|
|
9552
9340
|
return ImageLoader;
|
|
9553
9341
|
}
|
|
9554
9342
|
}
|
|
9555
|
-
async function parseI3STileContent(arrayBuffer,
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9343
|
+
async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, options, context) {
|
|
9344
|
+
const content = {
|
|
9345
|
+
attributes: {},
|
|
9346
|
+
indices: null,
|
|
9347
|
+
featureIds: [],
|
|
9348
|
+
vertexCount: 0,
|
|
9349
|
+
modelMatrix: new Matrix4(),
|
|
9350
|
+
coordinateSystem: 0,
|
|
9351
|
+
byteLength: 0,
|
|
9352
|
+
texture: null
|
|
9353
|
+
};
|
|
9354
|
+
if (tileOptions.textureUrl) {
|
|
9355
|
+
const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
|
|
9356
|
+
const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
|
|
9562
9357
|
const response = await fetch(url, options?.fetch);
|
|
9563
9358
|
const arrayBuffer2 = await response.arrayBuffer();
|
|
9564
9359
|
if (options?.i3s.decodeTextures) {
|
|
9565
9360
|
if (loader === ImageLoader) {
|
|
9566
|
-
const options2 = { ...
|
|
9361
|
+
const options2 = { ...tileOptions.textureLoaderOptions, image: { type: "data" } };
|
|
9567
9362
|
try {
|
|
9568
|
-
|
|
9363
|
+
content.texture = await context.parse(arrayBuffer2, options2);
|
|
9569
9364
|
} catch (e2) {
|
|
9570
|
-
|
|
9365
|
+
content.texture = await parse(arrayBuffer2, loader, options2);
|
|
9571
9366
|
}
|
|
9572
9367
|
} else if (loader === CompressedTextureLoader || loader === BasisLoader) {
|
|
9573
|
-
let texture = await load(arrayBuffer2, loader,
|
|
9368
|
+
let texture = await load(arrayBuffer2, loader, tileOptions.textureLoaderOptions);
|
|
9574
9369
|
if (loader === BasisLoader) {
|
|
9575
9370
|
texture = texture[0];
|
|
9576
9371
|
}
|
|
9577
|
-
|
|
9372
|
+
content.texture = {
|
|
9578
9373
|
compressed: true,
|
|
9579
9374
|
mipmaps: false,
|
|
9580
9375
|
width: texture[0].width,
|
|
@@ -9583,27 +9378,23 @@
|
|
|
9583
9378
|
};
|
|
9584
9379
|
}
|
|
9585
9380
|
} else {
|
|
9586
|
-
|
|
9381
|
+
content.texture = arrayBuffer2;
|
|
9587
9382
|
}
|
|
9588
9383
|
}
|
|
9589
|
-
|
|
9590
|
-
if (
|
|
9591
|
-
|
|
9384
|
+
content.material = makePbrMaterial(tileOptions.materialDefinition, content.texture);
|
|
9385
|
+
if (content.material) {
|
|
9386
|
+
content.texture = null;
|
|
9592
9387
|
}
|
|
9593
|
-
return await parseI3SNodeGeometry(arrayBuffer,
|
|
9388
|
+
return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
|
|
9594
9389
|
}
|
|
9595
|
-
async function parseI3SNodeGeometry(arrayBuffer,
|
|
9596
|
-
if (!tile.content) {
|
|
9597
|
-
return tile;
|
|
9598
|
-
}
|
|
9599
|
-
const content = tile.content;
|
|
9390
|
+
async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
|
|
9600
9391
|
const contentByteLength = arrayBuffer.byteLength;
|
|
9601
9392
|
let attributes;
|
|
9602
9393
|
let vertexCount;
|
|
9603
9394
|
let byteOffset = 0;
|
|
9604
9395
|
let featureCount = 0;
|
|
9605
9396
|
let indices;
|
|
9606
|
-
if (
|
|
9397
|
+
if (tileOptions.isDracoGeometry) {
|
|
9607
9398
|
const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
|
|
9608
9399
|
draco: {
|
|
9609
9400
|
attributeNameEntry: I3S_ATTRIBUTE_TYPE
|
|
@@ -9638,8 +9429,8 @@
|
|
|
9638
9429
|
ordering: attributesOrder,
|
|
9639
9430
|
featureAttributes,
|
|
9640
9431
|
featureAttributeOrder
|
|
9641
|
-
} =
|
|
9642
|
-
const headers = parseHeaders(
|
|
9432
|
+
} = tilesetOptions.store.defaultGeometrySchema;
|
|
9433
|
+
const headers = parseHeaders(arrayBuffer, tilesetOptions);
|
|
9643
9434
|
byteOffset = headers.byteOffset;
|
|
9644
9435
|
vertexCount = headers.vertexCount;
|
|
9645
9436
|
featureCount = headers.featureCount;
|
|
@@ -9649,23 +9440,24 @@
|
|
|
9649
9440
|
attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
|
|
9650
9441
|
}
|
|
9651
9442
|
if (!options?.i3s?.coordinateSystem || options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
|
|
9652
|
-
const enuMatrix = parsePositions(attributes.position,
|
|
9443
|
+
const enuMatrix = parsePositions(attributes.position, tileOptions);
|
|
9653
9444
|
content.modelMatrix = enuMatrix.invert();
|
|
9654
9445
|
content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
|
|
9655
9446
|
} else {
|
|
9656
9447
|
content.modelMatrix = getModelMatrix(attributes.position);
|
|
9657
9448
|
content.coordinateSystem = COORDINATE_SYSTEM.LNGLAT_OFFSETS;
|
|
9658
9449
|
}
|
|
9450
|
+
attributes.color = await customizeColors(attributes.color, attributes.id, tileOptions, tilesetOptions, options);
|
|
9659
9451
|
content.attributes = {
|
|
9660
9452
|
positions: attributes.position,
|
|
9661
9453
|
normals: attributes.normal,
|
|
9662
9454
|
colors: normalizeAttribute(attributes.color),
|
|
9663
9455
|
texCoords: attributes.uv0,
|
|
9664
|
-
uvRegions: normalizeAttribute(attributes.uvRegion)
|
|
9456
|
+
uvRegions: normalizeAttribute(attributes.uvRegion || attributes.region)
|
|
9665
9457
|
};
|
|
9666
9458
|
content.indices = indices || null;
|
|
9667
9459
|
if (attributes.id && attributes.id.value) {
|
|
9668
|
-
|
|
9460
|
+
content.featureIds = attributes.id.value;
|
|
9669
9461
|
}
|
|
9670
9462
|
for (const attributeIndex in content.attributes) {
|
|
9671
9463
|
if (!content.attributes[attributeIndex]) {
|
|
@@ -9674,7 +9466,7 @@
|
|
|
9674
9466
|
}
|
|
9675
9467
|
content.vertexCount = vertexCount;
|
|
9676
9468
|
content.byteLength = contentByteLength;
|
|
9677
|
-
return
|
|
9469
|
+
return content;
|
|
9678
9470
|
}
|
|
9679
9471
|
function updateAttributesMetadata(attributes, decompressedGeometry) {
|
|
9680
9472
|
for (const key in decompressedGeometry.loaderData.attributes) {
|
|
@@ -9701,11 +9493,11 @@
|
|
|
9701
9493
|
attribute.normalized = true;
|
|
9702
9494
|
return attribute;
|
|
9703
9495
|
}
|
|
9704
|
-
function parseHeaders(
|
|
9496
|
+
function parseHeaders(arrayBuffer, options) {
|
|
9705
9497
|
let byteOffset = 0;
|
|
9706
9498
|
let vertexCount = 0;
|
|
9707
9499
|
let featureCount = 0;
|
|
9708
|
-
for (const { property, type } of
|
|
9500
|
+
for (const { property, type } of options.store.defaultGeometrySchema.header) {
|
|
9709
9501
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
9710
9502
|
switch (property) {
|
|
9711
9503
|
case HeaderAttributeProperty.vertexCount:
|
|
@@ -9775,8 +9567,8 @@
|
|
|
9775
9567
|
}
|
|
9776
9568
|
return new Uint32Array(values);
|
|
9777
9569
|
}
|
|
9778
|
-
function parsePositions(attribute,
|
|
9779
|
-
const mbs =
|
|
9570
|
+
function parsePositions(attribute, options) {
|
|
9571
|
+
const mbs = options.mbs;
|
|
9780
9572
|
const value = attribute.value;
|
|
9781
9573
|
const metadata = attribute.metadata;
|
|
9782
9574
|
const enuMatrix = new Matrix4();
|
|
@@ -9910,38 +9702,44 @@
|
|
|
9910
9702
|
var init_parse_i3s_tile_content = __esm({
|
|
9911
9703
|
"src/lib/parsers/parse-i3s-tile-content.ts"() {
|
|
9912
9704
|
init_src3();
|
|
9913
|
-
|
|
9914
|
-
|
|
9705
|
+
init_esm3();
|
|
9706
|
+
init_esm4();
|
|
9915
9707
|
init_src4();
|
|
9916
9708
|
init_src6();
|
|
9917
9709
|
init_src7();
|
|
9918
9710
|
init_types();
|
|
9919
9711
|
init_url_utils();
|
|
9920
9712
|
init_constants2();
|
|
9713
|
+
init_customizeColors();
|
|
9921
9714
|
scratchVector5 = new Vector3([0, 0, 0]);
|
|
9922
9715
|
I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
|
|
9923
9716
|
}
|
|
9924
9717
|
});
|
|
9925
9718
|
|
|
9926
9719
|
// src/i3s-content-loader.ts
|
|
9927
|
-
async function
|
|
9928
|
-
const { tile, tileset } = options?.i3s || {};
|
|
9929
|
-
|
|
9930
|
-
|
|
9720
|
+
async function parse4(data, options, context) {
|
|
9721
|
+
const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
|
|
9722
|
+
const tileOptions = _tileOptions || tile;
|
|
9723
|
+
const tilesetOptions = _tilesetOptions || tileset;
|
|
9724
|
+
if (!tileOptions || !tilesetOptions) {
|
|
9725
|
+
return null;
|
|
9726
|
+
}
|
|
9727
|
+
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
9931
9728
|
}
|
|
9932
|
-
var
|
|
9729
|
+
var VERSION10, I3SContentLoader;
|
|
9933
9730
|
var init_i3s_content_loader = __esm({
|
|
9934
9731
|
"src/i3s-content-loader.ts"() {
|
|
9732
|
+
init_src();
|
|
9935
9733
|
init_parse_i3s_tile_content();
|
|
9936
|
-
|
|
9734
|
+
VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
9937
9735
|
I3SContentLoader = {
|
|
9938
9736
|
name: "I3S Content (Indexed Scene Layers)",
|
|
9939
|
-
id: "i3s-content",
|
|
9737
|
+
id: isBrowser2 ? "i3s-content" : "i3s-content-nodejs",
|
|
9940
9738
|
module: "i3s",
|
|
9941
9739
|
worker: true,
|
|
9942
|
-
version:
|
|
9740
|
+
version: VERSION10,
|
|
9943
9741
|
mimeTypes: ["application/octet-stream"],
|
|
9944
|
-
parse:
|
|
9742
|
+
parse: parse4,
|
|
9945
9743
|
extensions: ["bin"],
|
|
9946
9744
|
options: {
|
|
9947
9745
|
"i3s-content": {}
|
|
@@ -9954,11 +9752,11 @@
|
|
|
9954
9752
|
var INTERSECTION;
|
|
9955
9753
|
var init_constants3 = __esm({
|
|
9956
9754
|
"../../node_modules/@math.gl/culling/dist/esm/constants.js"() {
|
|
9957
|
-
INTERSECTION =
|
|
9755
|
+
INTERSECTION = {
|
|
9958
9756
|
OUTSIDE: -1,
|
|
9959
9757
|
INTERSECTING: 0,
|
|
9960
9758
|
INSIDE: 1
|
|
9961
|
-
}
|
|
9759
|
+
};
|
|
9962
9760
|
}
|
|
9963
9761
|
});
|
|
9964
9762
|
|
|
@@ -9966,7 +9764,8 @@
|
|
|
9966
9764
|
var scratchVector6, scratchNormal2;
|
|
9967
9765
|
var init_axis_aligned_bounding_box = __esm({
|
|
9968
9766
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.js"() {
|
|
9969
|
-
|
|
9767
|
+
init_defineProperty();
|
|
9768
|
+
init_esm3();
|
|
9970
9769
|
init_constants3();
|
|
9971
9770
|
scratchVector6 = new Vector3();
|
|
9972
9771
|
scratchNormal2 = new Vector3();
|
|
@@ -9977,13 +9776,16 @@
|
|
|
9977
9776
|
var scratchVector7, scratchVector23, BoundingSphere;
|
|
9978
9777
|
var init_bounding_sphere = __esm({
|
|
9979
9778
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/bounding-sphere.js"() {
|
|
9980
|
-
|
|
9779
|
+
init_defineProperty();
|
|
9780
|
+
init_esm3();
|
|
9981
9781
|
init_mat4();
|
|
9982
9782
|
init_constants3();
|
|
9983
9783
|
scratchVector7 = new Vector3();
|
|
9984
9784
|
scratchVector23 = new Vector3();
|
|
9985
9785
|
BoundingSphere = class {
|
|
9986
9786
|
constructor(center = [0, 0, 0], radius = 0) {
|
|
9787
|
+
_defineProperty(this, "center", void 0);
|
|
9788
|
+
_defineProperty(this, "radius", void 0);
|
|
9987
9789
|
this.radius = -0;
|
|
9988
9790
|
this.center = new Vector3();
|
|
9989
9791
|
this.fromCenterRadius(center, radius);
|
|
@@ -10025,8 +9827,8 @@
|
|
|
10025
9827
|
return this;
|
|
10026
9828
|
}
|
|
10027
9829
|
expand(point) {
|
|
10028
|
-
|
|
10029
|
-
const radius =
|
|
9830
|
+
const scratchPoint = scratchVector7.from(point);
|
|
9831
|
+
const radius = scratchPoint.subtract(this.center).magnitude();
|
|
10030
9832
|
if (radius > this.radius) {
|
|
10031
9833
|
this.radius = radius;
|
|
10032
9834
|
}
|
|
@@ -10039,12 +9841,13 @@
|
|
|
10039
9841
|
return this;
|
|
10040
9842
|
}
|
|
10041
9843
|
distanceSquaredTo(point) {
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
return delta.lengthSquared() - this.radius * this.radius;
|
|
9844
|
+
const d = this.distanceTo(point);
|
|
9845
|
+
return d * d;
|
|
10045
9846
|
}
|
|
10046
9847
|
distanceTo(point) {
|
|
10047
|
-
|
|
9848
|
+
const scratchPoint = scratchVector7.from(point);
|
|
9849
|
+
const delta = scratchPoint.subtract(this.center);
|
|
9850
|
+
return Math.max(0, delta.len() - this.radius);
|
|
10048
9851
|
}
|
|
10049
9852
|
intersectPlane(plane) {
|
|
10050
9853
|
const center = this.center;
|
|
@@ -10067,7 +9870,8 @@
|
|
|
10067
9870
|
var scratchVector32, scratchOffset, scratchVectorU, scratchVectorV, scratchVectorW, scratchCorner, scratchToCenter, MATRIX3, OrientedBoundingBox;
|
|
10068
9871
|
var init_oriented_bounding_box = __esm({
|
|
10069
9872
|
"../../node_modules/@math.gl/culling/dist/esm/lib/bounding-volumes/oriented-bounding-box.js"() {
|
|
10070
|
-
|
|
9873
|
+
init_defineProperty();
|
|
9874
|
+
init_esm3();
|
|
10071
9875
|
init_bounding_sphere();
|
|
10072
9876
|
init_constants3();
|
|
10073
9877
|
scratchVector32 = new Vector3();
|
|
@@ -10090,6 +9894,8 @@
|
|
|
10090
9894
|
};
|
|
10091
9895
|
OrientedBoundingBox = class {
|
|
10092
9896
|
constructor(center = [0, 0, 0], halfAxes = [0, 0, 0, 0, 0, 0, 0, 0, 0]) {
|
|
9897
|
+
_defineProperty(this, "center", void 0);
|
|
9898
|
+
_defineProperty(this, "halfAxes", void 0);
|
|
10093
9899
|
this.center = new Vector3().from(center);
|
|
10094
9900
|
this.halfAxes = new Matrix3(halfAxes);
|
|
10095
9901
|
}
|
|
@@ -10261,17 +10067,20 @@
|
|
|
10261
10067
|
var scratchPosition2, scratchNormal3, Plane;
|
|
10262
10068
|
var init_plane = __esm({
|
|
10263
10069
|
"../../node_modules/@math.gl/culling/dist/esm/lib/plane.js"() {
|
|
10264
|
-
|
|
10070
|
+
init_defineProperty();
|
|
10071
|
+
init_esm3();
|
|
10265
10072
|
scratchPosition2 = new Vector3();
|
|
10266
10073
|
scratchNormal3 = new Vector3();
|
|
10267
10074
|
Plane = class {
|
|
10268
10075
|
constructor(normal = [0, 0, 1], distance = 0) {
|
|
10076
|
+
_defineProperty(this, "normal", void 0);
|
|
10077
|
+
_defineProperty(this, "distance", void 0);
|
|
10269
10078
|
this.normal = new Vector3();
|
|
10270
10079
|
this.distance = -0;
|
|
10271
10080
|
this.fromNormalDistance(normal, distance);
|
|
10272
10081
|
}
|
|
10273
10082
|
fromNormalDistance(normal, distance) {
|
|
10274
|
-
|
|
10083
|
+
assert4(Number.isFinite(distance));
|
|
10275
10084
|
this.normal.from(normal).normalize();
|
|
10276
10085
|
this.distance = distance;
|
|
10277
10086
|
return this;
|
|
@@ -10285,11 +10094,11 @@
|
|
|
10285
10094
|
}
|
|
10286
10095
|
fromCoefficients(a2, b, c2, d) {
|
|
10287
10096
|
this.normal.set(a2, b, c2);
|
|
10288
|
-
|
|
10097
|
+
assert4(equals(this.normal.len(), 1));
|
|
10289
10098
|
this.distance = d;
|
|
10290
10099
|
return this;
|
|
10291
10100
|
}
|
|
10292
|
-
clone(
|
|
10101
|
+
clone() {
|
|
10293
10102
|
return new Plane(this.normal, this.distance);
|
|
10294
10103
|
}
|
|
10295
10104
|
equals(right) {
|
|
@@ -10314,16 +10123,88 @@
|
|
|
10314
10123
|
});
|
|
10315
10124
|
|
|
10316
10125
|
// ../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js
|
|
10317
|
-
var faces, scratchPlaneCenter, scratchPlaneNormal, scratchPlane;
|
|
10126
|
+
var faces, scratchPlaneCenter, scratchPlaneNormal, scratchPlane, CullingVolume;
|
|
10318
10127
|
var init_culling_volume = __esm({
|
|
10319
10128
|
"../../node_modules/@math.gl/culling/dist/esm/lib/culling-volume.js"() {
|
|
10320
|
-
|
|
10129
|
+
init_defineProperty();
|
|
10130
|
+
init_esm3();
|
|
10321
10131
|
init_constants3();
|
|
10322
10132
|
init_plane();
|
|
10323
10133
|
faces = [new Vector3([1, 0, 0]), new Vector3([0, 1, 0]), new Vector3([0, 0, 1])];
|
|
10324
10134
|
scratchPlaneCenter = new Vector3();
|
|
10325
10135
|
scratchPlaneNormal = new Vector3();
|
|
10326
10136
|
scratchPlane = new Plane(new Vector3(1, 0, 0), 0);
|
|
10137
|
+
CullingVolume = class {
|
|
10138
|
+
constructor(planes = []) {
|
|
10139
|
+
_defineProperty(this, "planes", void 0);
|
|
10140
|
+
this.planes = planes;
|
|
10141
|
+
}
|
|
10142
|
+
fromBoundingSphere(boundingSphere) {
|
|
10143
|
+
this.planes.length = 2 * faces.length;
|
|
10144
|
+
const center = boundingSphere.center;
|
|
10145
|
+
const radius = boundingSphere.radius;
|
|
10146
|
+
let planeIndex = 0;
|
|
10147
|
+
for (const faceNormal of faces) {
|
|
10148
|
+
let plane0 = this.planes[planeIndex];
|
|
10149
|
+
let plane1 = this.planes[planeIndex + 1];
|
|
10150
|
+
if (!plane0) {
|
|
10151
|
+
plane0 = this.planes[planeIndex] = new Plane();
|
|
10152
|
+
}
|
|
10153
|
+
if (!plane1) {
|
|
10154
|
+
plane1 = this.planes[planeIndex + 1] = new Plane();
|
|
10155
|
+
}
|
|
10156
|
+
const plane0Center = scratchPlaneCenter.copy(faceNormal).scale(-radius).add(center);
|
|
10157
|
+
const plane0Distance = -faceNormal.dot(plane0Center);
|
|
10158
|
+
plane0.fromPointNormal(plane0Center, faceNormal);
|
|
10159
|
+
const plane1Center = scratchPlaneCenter.copy(faceNormal).scale(radius).add(center);
|
|
10160
|
+
const negatedFaceNormal = scratchPlaneNormal.copy(faceNormal).negate();
|
|
10161
|
+
const plane1Distance = -negatedFaceNormal.dot(plane1Center);
|
|
10162
|
+
plane1.fromPointNormal(plane1Center, negatedFaceNormal);
|
|
10163
|
+
planeIndex += 2;
|
|
10164
|
+
}
|
|
10165
|
+
return this;
|
|
10166
|
+
}
|
|
10167
|
+
computeVisibility(boundingVolume) {
|
|
10168
|
+
let intersect = INTERSECTION.INSIDE;
|
|
10169
|
+
for (const plane of this.planes) {
|
|
10170
|
+
const result = boundingVolume.intersectPlane(plane);
|
|
10171
|
+
switch (result) {
|
|
10172
|
+
case INTERSECTION.OUTSIDE:
|
|
10173
|
+
return INTERSECTION.OUTSIDE;
|
|
10174
|
+
case INTERSECTION.INTERSECTING:
|
|
10175
|
+
intersect = INTERSECTION.INTERSECTING;
|
|
10176
|
+
break;
|
|
10177
|
+
default:
|
|
10178
|
+
}
|
|
10179
|
+
}
|
|
10180
|
+
return intersect;
|
|
10181
|
+
}
|
|
10182
|
+
computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
|
|
10183
|
+
assert4(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
|
|
10184
|
+
if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
|
|
10185
|
+
return parentPlaneMask;
|
|
10186
|
+
}
|
|
10187
|
+
let mask = CullingVolume.MASK_INSIDE;
|
|
10188
|
+
const planes = this.planes;
|
|
10189
|
+
for (let k = 0; k < this.planes.length; ++k) {
|
|
10190
|
+
const flag = k < 31 ? 1 << k : 0;
|
|
10191
|
+
if (k < 31 && (parentPlaneMask & flag) === 0) {
|
|
10192
|
+
continue;
|
|
10193
|
+
}
|
|
10194
|
+
const plane = planes[k];
|
|
10195
|
+
const result = boundingVolume.intersectPlane(plane);
|
|
10196
|
+
if (result === INTERSECTION.OUTSIDE) {
|
|
10197
|
+
return CullingVolume.MASK_OUTSIDE;
|
|
10198
|
+
} else if (result === INTERSECTION.INTERSECTING) {
|
|
10199
|
+
mask |= flag;
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
return mask;
|
|
10203
|
+
}
|
|
10204
|
+
};
|
|
10205
|
+
_defineProperty(CullingVolume, "MASK_OUTSIDE", 4294967295);
|
|
10206
|
+
_defineProperty(CullingVolume, "MASK_INSIDE", 0);
|
|
10207
|
+
_defineProperty(CullingVolume, "MASK_INDETERMINATE", 2147483647);
|
|
10327
10208
|
}
|
|
10328
10209
|
});
|
|
10329
10210
|
|
|
@@ -10331,7 +10212,8 @@
|
|
|
10331
10212
|
var scratchPlaneUpVector, scratchPlaneRightVector, scratchPlaneNearCenter, scratchPlaneFarCenter, scratchPlaneNormal2;
|
|
10332
10213
|
var init_perspective_off_center_frustum = __esm({
|
|
10333
10214
|
"../../node_modules/@math.gl/culling/dist/esm/lib/perspective-off-center-frustum.js"() {
|
|
10334
|
-
|
|
10215
|
+
init_defineProperty();
|
|
10216
|
+
init_esm3();
|
|
10335
10217
|
init_culling_volume();
|
|
10336
10218
|
init_plane();
|
|
10337
10219
|
scratchPlaneUpVector = new Vector3();
|
|
@@ -10345,6 +10227,7 @@
|
|
|
10345
10227
|
// ../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js
|
|
10346
10228
|
var init_perspective_frustum = __esm({
|
|
10347
10229
|
"../../node_modules/@math.gl/culling/dist/esm/lib/perspective-frustum.js"() {
|
|
10230
|
+
init_defineProperty();
|
|
10348
10231
|
init_perspective_off_center_frustum();
|
|
10349
10232
|
}
|
|
10350
10233
|
});
|
|
@@ -10353,7 +10236,7 @@
|
|
|
10353
10236
|
var fromPointsXMin, fromPointsYMin, fromPointsZMin, fromPointsXMax, fromPointsYMax, fromPointsZMax, fromPointsCurrentPos, fromPointsScratch, fromPointsRitterCenter, fromPointsMinBoxPt, fromPointsMaxBoxPt, fromPointsNaiveCenterScratch, volumeConstant;
|
|
10354
10237
|
var init_bounding_sphere_from_points = __esm({
|
|
10355
10238
|
"../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/bounding-sphere-from-points.js"() {
|
|
10356
|
-
|
|
10239
|
+
init_esm3();
|
|
10357
10240
|
init_bounding_sphere();
|
|
10358
10241
|
fromPointsXMin = new Vector3();
|
|
10359
10242
|
fromPointsYMin = new Vector3();
|
|
@@ -10375,7 +10258,7 @@
|
|
|
10375
10258
|
var scratchMatrix, scratchUnitary, scratchDiagonal, jMatrix, jMatrixTranspose;
|
|
10376
10259
|
var init_compute_eigen_decomposition = __esm({
|
|
10377
10260
|
"../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/compute-eigen-decomposition.js"() {
|
|
10378
|
-
|
|
10261
|
+
init_esm3();
|
|
10379
10262
|
scratchMatrix = new Matrix3();
|
|
10380
10263
|
scratchUnitary = new Matrix3();
|
|
10381
10264
|
scratchDiagonal = new Matrix3();
|
|
@@ -10388,7 +10271,7 @@
|
|
|
10388
10271
|
var scratchVector24, scratchVector33, scratchVector42, scratchVector52, scratchVector62, scratchCovarianceResult, scratchEigenResult;
|
|
10389
10272
|
var init_bounding_box_from_points = __esm({
|
|
10390
10273
|
"../../node_modules/@math.gl/culling/dist/esm/lib/algorithms/bounding-box-from-points.js"() {
|
|
10391
|
-
|
|
10274
|
+
init_esm3();
|
|
10392
10275
|
init_compute_eigen_decomposition();
|
|
10393
10276
|
init_oriented_bounding_box();
|
|
10394
10277
|
init_axis_aligned_bounding_box();
|
|
@@ -10406,7 +10289,7 @@
|
|
|
10406
10289
|
});
|
|
10407
10290
|
|
|
10408
10291
|
// ../../node_modules/@math.gl/culling/dist/esm/index.js
|
|
10409
|
-
var
|
|
10292
|
+
var init_esm6 = __esm({
|
|
10410
10293
|
"../../node_modules/@math.gl/culling/dist/esm/index.js"() {
|
|
10411
10294
|
init_constants3();
|
|
10412
10295
|
init_axis_aligned_bounding_box();
|
|
@@ -10419,8 +10302,6 @@
|
|
|
10419
10302
|
init_bounding_sphere_from_points();
|
|
10420
10303
|
init_bounding_box_from_points();
|
|
10421
10304
|
init_compute_eigen_decomposition();
|
|
10422
|
-
init_constants3();
|
|
10423
|
-
init_constants3();
|
|
10424
10305
|
}
|
|
10425
10306
|
});
|
|
10426
10307
|
|
|
@@ -10456,21 +10337,21 @@
|
|
|
10456
10337
|
async function parseNodePage(data) {
|
|
10457
10338
|
return JSON.parse(new TextDecoder().decode(data));
|
|
10458
10339
|
}
|
|
10459
|
-
async function
|
|
10340
|
+
async function parse5(data) {
|
|
10460
10341
|
data = parseNodePage(data);
|
|
10461
10342
|
return data;
|
|
10462
10343
|
}
|
|
10463
|
-
var
|
|
10344
|
+
var VERSION11, I3SNodePageLoader;
|
|
10464
10345
|
var init_i3s_node_page_loader = __esm({
|
|
10465
10346
|
"src/i3s-node-page-loader.ts"() {
|
|
10466
|
-
|
|
10347
|
+
VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10467
10348
|
I3SNodePageLoader = {
|
|
10468
10349
|
name: "I3S Node Page",
|
|
10469
10350
|
id: "i3s-node-page",
|
|
10470
10351
|
module: "i3s",
|
|
10471
|
-
version:
|
|
10352
|
+
version: VERSION11,
|
|
10472
10353
|
mimeTypes: ["application/json"],
|
|
10473
|
-
parse:
|
|
10354
|
+
parse: parse5,
|
|
10474
10355
|
extensions: ["json"],
|
|
10475
10356
|
options: {}
|
|
10476
10357
|
};
|
|
@@ -10658,7 +10539,7 @@
|
|
|
10658
10539
|
});
|
|
10659
10540
|
|
|
10660
10541
|
// src/lib/parsers/parse-i3s.ts
|
|
10661
|
-
function normalizeTileData(tile,
|
|
10542
|
+
function normalizeTileData(tile, context) {
|
|
10662
10543
|
const url = context.url || "";
|
|
10663
10544
|
let contentUrl;
|
|
10664
10545
|
if (tile.geometryData) {
|
|
@@ -10732,8 +10613,8 @@
|
|
|
10732
10613
|
}
|
|
10733
10614
|
var init_parse_i3s = __esm({
|
|
10734
10615
|
"src/lib/parsers/parse-i3s.ts"() {
|
|
10735
|
-
init_esm8();
|
|
10736
10616
|
init_esm6();
|
|
10617
|
+
init_esm4();
|
|
10737
10618
|
init_src3();
|
|
10738
10619
|
init_src8();
|
|
10739
10620
|
init_i3s_nodepages_tiles();
|
|
@@ -10742,7 +10623,7 @@
|
|
|
10742
10623
|
});
|
|
10743
10624
|
|
|
10744
10625
|
// src/i3s-loader.ts
|
|
10745
|
-
async function parseI3S(data, options, context) {
|
|
10626
|
+
async function parseI3S(data, options = {}, context) {
|
|
10746
10627
|
const url = context.url;
|
|
10747
10628
|
options.i3s = options.i3s || {};
|
|
10748
10629
|
const magicNumber = getMagicNumber(data);
|
|
@@ -10764,11 +10645,7 @@
|
|
|
10764
10645
|
if (isTileset) {
|
|
10765
10646
|
data = await parseTileset(data, options, context);
|
|
10766
10647
|
} else if (isTileHeader) {
|
|
10767
|
-
data = await parseTile(data,
|
|
10768
|
-
if (options.i3s.loadContent) {
|
|
10769
|
-
options.i3s.tile = data;
|
|
10770
|
-
await load(data.contentUrl, I3SLoader, options);
|
|
10771
|
-
}
|
|
10648
|
+
data = await parseTile(data, context);
|
|
10772
10649
|
} else {
|
|
10773
10650
|
data = await parseTileContent(data, options);
|
|
10774
10651
|
}
|
|
@@ -10779,13 +10656,16 @@
|
|
|
10779
10656
|
}
|
|
10780
10657
|
async function parseTileset(data, options, context) {
|
|
10781
10658
|
const tilesetJson = JSON.parse(new TextDecoder().decode(data));
|
|
10659
|
+
if (tilesetJson?.layerType === POINT_CLOUD) {
|
|
10660
|
+
throw new Error("Point Cloud layers currently are not supported by I3SLoader");
|
|
10661
|
+
}
|
|
10782
10662
|
tilesetJson.loader = I3SLoader;
|
|
10783
10663
|
await normalizeTilesetData(tilesetJson, options, context);
|
|
10784
10664
|
return tilesetJson;
|
|
10785
10665
|
}
|
|
10786
|
-
async function parseTile(data,
|
|
10666
|
+
async function parseTile(data, context) {
|
|
10787
10667
|
data = JSON.parse(new TextDecoder().decode(data));
|
|
10788
|
-
return normalizeTileData(data,
|
|
10668
|
+
return normalizeTileData(data, context);
|
|
10789
10669
|
}
|
|
10790
10670
|
function getMagicNumber(data) {
|
|
10791
10671
|
if (data instanceof ArrayBuffer) {
|
|
@@ -10793,219 +10673,46 @@
|
|
|
10793
10673
|
}
|
|
10794
10674
|
return null;
|
|
10795
10675
|
}
|
|
10796
|
-
var
|
|
10676
|
+
var VERSION12, TILESET_REGEX, TILE_HEADER_REGEX, SLPK_HEX, POINT_CLOUD, I3SLoader;
|
|
10797
10677
|
var init_i3s_loader = __esm({
|
|
10798
10678
|
"src/i3s-loader.ts"() {
|
|
10799
10679
|
init_src3();
|
|
10800
10680
|
init_i3s_content_loader();
|
|
10801
10681
|
init_parse_i3s();
|
|
10802
10682
|
init_constants2();
|
|
10803
|
-
|
|
10683
|
+
VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10804
10684
|
TILESET_REGEX = /layers\/[0-9]+$/;
|
|
10805
10685
|
TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
10806
10686
|
SLPK_HEX = "504b0304";
|
|
10687
|
+
POINT_CLOUD = "PointCloud";
|
|
10807
10688
|
I3SLoader = {
|
|
10808
10689
|
name: "I3S (Indexed Scene Layers)",
|
|
10809
10690
|
id: "i3s",
|
|
10810
10691
|
module: "i3s",
|
|
10811
|
-
version:
|
|
10692
|
+
version: VERSION12,
|
|
10812
10693
|
mimeTypes: ["application/octet-stream"],
|
|
10813
10694
|
parse: parseI3S,
|
|
10814
10695
|
extensions: ["bin"],
|
|
10815
10696
|
options: {
|
|
10816
10697
|
i3s: {
|
|
10817
|
-
loadContent: true,
|
|
10818
10698
|
token: null,
|
|
10819
10699
|
isTileset: "auto",
|
|
10820
10700
|
isTileHeader: "auto",
|
|
10821
10701
|
tile: null,
|
|
10822
10702
|
tileset: null,
|
|
10703
|
+
_tileOptions: null,
|
|
10704
|
+
_tilesetOptions: null,
|
|
10823
10705
|
useDracoGeometry: true,
|
|
10824
10706
|
useCompressedTextures: true,
|
|
10825
10707
|
decodeTextures: true,
|
|
10826
|
-
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS
|
|
10708
|
+
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,
|
|
10709
|
+
colorsByAttribute: null
|
|
10827
10710
|
}
|
|
10828
10711
|
}
|
|
10829
10712
|
};
|
|
10830
10713
|
}
|
|
10831
10714
|
});
|
|
10832
10715
|
|
|
10833
|
-
// src/lib/parsers/parse-i3s-attribute.ts
|
|
10834
|
-
async function parseI3STileAttribute(arrayBuffer, options) {
|
|
10835
|
-
const { attributeName, attributeType } = options;
|
|
10836
|
-
if (!attributeName) {
|
|
10837
|
-
return {};
|
|
10838
|
-
}
|
|
10839
|
-
return {
|
|
10840
|
-
[attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null
|
|
10841
|
-
};
|
|
10842
|
-
}
|
|
10843
|
-
function parseAttribute(attributeType, arrayBuffer) {
|
|
10844
|
-
switch (attributeType) {
|
|
10845
|
-
case STRING_ATTRIBUTE_TYPE:
|
|
10846
|
-
return parseStringsAttribute(arrayBuffer);
|
|
10847
|
-
case OBJECT_ID_ATTRIBUTE_TYPE:
|
|
10848
|
-
return parseShortNumberAttribute(arrayBuffer);
|
|
10849
|
-
case FLOAT_64_TYPE:
|
|
10850
|
-
return parseFloatAttribute(arrayBuffer);
|
|
10851
|
-
case INT_16_ATTRIBUTE_TYPE:
|
|
10852
|
-
return parseInt16ShortNumberAttribute(arrayBuffer);
|
|
10853
|
-
default:
|
|
10854
|
-
return parseShortNumberAttribute(arrayBuffer);
|
|
10855
|
-
}
|
|
10856
|
-
}
|
|
10857
|
-
function parseShortNumberAttribute(arrayBuffer) {
|
|
10858
|
-
const countOffset = 4;
|
|
10859
|
-
return new Uint32Array(arrayBuffer, countOffset);
|
|
10860
|
-
}
|
|
10861
|
-
function parseInt16ShortNumberAttribute(arrayBuffer) {
|
|
10862
|
-
const countOffset = 4;
|
|
10863
|
-
return new Int16Array(arrayBuffer, countOffset);
|
|
10864
|
-
}
|
|
10865
|
-
function parseFloatAttribute(arrayBuffer) {
|
|
10866
|
-
const countOffset = 8;
|
|
10867
|
-
return new Float64Array(arrayBuffer, countOffset);
|
|
10868
|
-
}
|
|
10869
|
-
function parseStringsAttribute(arrayBuffer) {
|
|
10870
|
-
const stringsCountOffset = 0;
|
|
10871
|
-
const dataOffset = 8;
|
|
10872
|
-
const bytesPerStringSize = 4;
|
|
10873
|
-
const stringsArray = [];
|
|
10874
|
-
try {
|
|
10875
|
-
const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
|
|
10876
|
-
const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
|
|
10877
|
-
let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
|
|
10878
|
-
for (const stringByteSize of stringSizes) {
|
|
10879
|
-
const textDecoder = new TextDecoder("utf-8");
|
|
10880
|
-
const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);
|
|
10881
|
-
stringsArray.push(textDecoder.decode(stringAttribute));
|
|
10882
|
-
stringOffset += stringByteSize;
|
|
10883
|
-
}
|
|
10884
|
-
} catch (error) {
|
|
10885
|
-
console.error("Parse string attribute error: ", error.message);
|
|
10886
|
-
}
|
|
10887
|
-
return stringsArray;
|
|
10888
|
-
}
|
|
10889
|
-
var init_parse_i3s_attribute = __esm({
|
|
10890
|
-
"src/lib/parsers/parse-i3s-attribute.ts"() {
|
|
10891
|
-
init_constants2();
|
|
10892
|
-
}
|
|
10893
|
-
});
|
|
10894
|
-
|
|
10895
|
-
// src/i3s-attribute-loader.ts
|
|
10896
|
-
async function parse5(data, options) {
|
|
10897
|
-
data = parseI3STileAttribute(data, options);
|
|
10898
|
-
return data;
|
|
10899
|
-
}
|
|
10900
|
-
async function loadFeatureAttributes(tile, featureId, options = {}) {
|
|
10901
|
-
const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
|
|
10902
|
-
if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
|
|
10903
|
-
return null;
|
|
10904
|
-
}
|
|
10905
|
-
let attributes = [];
|
|
10906
|
-
const attributeLoadPromises = [];
|
|
10907
|
-
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
10908
|
-
const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);
|
|
10909
|
-
const attributeName = attributeStorageInfo[index].name;
|
|
10910
|
-
const attributeType = getAttributeValueType(attributeStorageInfo[index]);
|
|
10911
|
-
const loadOptions = { ...options, attributeName, attributeType };
|
|
10912
|
-
const promise = load(url, I3SAttributeLoader, loadOptions);
|
|
10913
|
-
attributeLoadPromises.push(promise);
|
|
10914
|
-
}
|
|
10915
|
-
try {
|
|
10916
|
-
attributes = await Promise.allSettled(attributeLoadPromises);
|
|
10917
|
-
} catch (error) {
|
|
10918
|
-
}
|
|
10919
|
-
if (!attributes.length) {
|
|
10920
|
-
return null;
|
|
10921
|
-
}
|
|
10922
|
-
return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
|
|
10923
|
-
}
|
|
10924
|
-
function getAttributesData(tile) {
|
|
10925
|
-
const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
|
|
10926
|
-
const attributeUrls = tile.header?.attributeUrls;
|
|
10927
|
-
const tilesetFields = tile.tileset?.tileset?.fields || [];
|
|
10928
|
-
return { attributeStorageInfo, attributeUrls, tilesetFields };
|
|
10929
|
-
}
|
|
10930
|
-
function getAttributeValueType(attribute) {
|
|
10931
|
-
if (attribute.hasOwnProperty("objectIds")) {
|
|
10932
|
-
return "Oid32";
|
|
10933
|
-
} else if (attribute.hasOwnProperty("attributeValues")) {
|
|
10934
|
-
return attribute.attributeValues.valueType;
|
|
10935
|
-
}
|
|
10936
|
-
return "";
|
|
10937
|
-
}
|
|
10938
|
-
function getFeatureIdsAttributeName(attributeStorageInfo) {
|
|
10939
|
-
const objectIdsAttribute = attributeStorageInfo.find((attribute) => attribute.name.includes("OBJECTID"));
|
|
10940
|
-
return objectIdsAttribute?.name;
|
|
10941
|
-
}
|
|
10942
|
-
function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
|
|
10943
|
-
const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
|
|
10944
|
-
const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
|
|
10945
|
-
if (!objectIds) {
|
|
10946
|
-
return null;
|
|
10947
|
-
}
|
|
10948
|
-
const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
|
|
10949
|
-
if (attributeIndex < 0) {
|
|
10950
|
-
return null;
|
|
10951
|
-
}
|
|
10952
|
-
return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
|
|
10953
|
-
}
|
|
10954
|
-
function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
|
|
10955
|
-
const attributesObject = {};
|
|
10956
|
-
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
10957
|
-
const attributeName = attributeStorageInfo[index].name;
|
|
10958
|
-
const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
|
|
10959
|
-
const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
|
|
10960
|
-
attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
|
|
10961
|
-
}
|
|
10962
|
-
return attributesObject;
|
|
10963
|
-
}
|
|
10964
|
-
function getAttributeCodedValues(attributeName, tilesetFields) {
|
|
10965
|
-
const attributeField = tilesetFields.find((field) => field.name === attributeName || field.alias === attributeName);
|
|
10966
|
-
return attributeField?.domain?.codedValues || [];
|
|
10967
|
-
}
|
|
10968
|
-
function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
|
|
10969
|
-
const attributeObject = attributes[index];
|
|
10970
|
-
if (attributeObject.status === REJECTED_STATUS) {
|
|
10971
|
-
return null;
|
|
10972
|
-
}
|
|
10973
|
-
return attributeObject.value[attributesName];
|
|
10974
|
-
}
|
|
10975
|
-
function formatAttributeValue(attribute, featureIdIndex, codedValues) {
|
|
10976
|
-
let value = EMPTY_VALUE;
|
|
10977
|
-
if (attribute && featureIdIndex in attribute) {
|
|
10978
|
-
value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, "").trim();
|
|
10979
|
-
}
|
|
10980
|
-
if (codedValues.length) {
|
|
10981
|
-
const codeValue = codedValues.find((codedValue) => codedValue.code === Number(value));
|
|
10982
|
-
value = codeValue?.name || EMPTY_VALUE;
|
|
10983
|
-
}
|
|
10984
|
-
return value;
|
|
10985
|
-
}
|
|
10986
|
-
var VERSION12, EMPTY_VALUE, REJECTED_STATUS, I3SAttributeLoader;
|
|
10987
|
-
var init_i3s_attribute_loader = __esm({
|
|
10988
|
-
"src/i3s-attribute-loader.ts"() {
|
|
10989
|
-
init_src3();
|
|
10990
|
-
init_parse_i3s_attribute();
|
|
10991
|
-
init_url_utils();
|
|
10992
|
-
VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10993
|
-
EMPTY_VALUE = "";
|
|
10994
|
-
REJECTED_STATUS = "rejected";
|
|
10995
|
-
I3SAttributeLoader = {
|
|
10996
|
-
name: "I3S Attribute",
|
|
10997
|
-
id: "i3s-attribute",
|
|
10998
|
-
module: "i3s",
|
|
10999
|
-
version: VERSION12,
|
|
11000
|
-
mimeTypes: ["application/binary"],
|
|
11001
|
-
parse: parse5,
|
|
11002
|
-
extensions: ["bin"],
|
|
11003
|
-
options: {},
|
|
11004
|
-
binary: true
|
|
11005
|
-
};
|
|
11006
|
-
}
|
|
11007
|
-
});
|
|
11008
|
-
|
|
11009
10716
|
// src/lib/parsers/parse-i3s-building-scene-layer.ts
|
|
11010
10717
|
async function parseBuildingSceneLayer(data, url) {
|
|
11011
10718
|
const layer0 = JSON.parse(new TextDecoder().decode(data));
|
|
@@ -11072,35 +10779,67 @@
|
|
|
11072
10779
|
async function parseWebscene(data) {
|
|
11073
10780
|
const layer0 = JSON.parse(new TextDecoder().decode(data));
|
|
11074
10781
|
const { operationalLayers } = layer0;
|
|
10782
|
+
const { layers, unsupportedLayers } = await parseOperationalLayers(operationalLayers, true);
|
|
10783
|
+
if (!layers.length) {
|
|
10784
|
+
throw new Error(NO_AVAILABLE_SUPPORTED_LAYERS_ERROR);
|
|
10785
|
+
}
|
|
11075
10786
|
return {
|
|
11076
10787
|
header: layer0,
|
|
11077
|
-
layers
|
|
10788
|
+
layers,
|
|
10789
|
+
unsupportedLayers
|
|
11078
10790
|
};
|
|
11079
10791
|
}
|
|
11080
|
-
function parseOperationalLayers(layersList) {
|
|
11081
|
-
|
|
10792
|
+
async function parseOperationalLayers(layersList, needToCheckCRS) {
|
|
10793
|
+
const layers = [];
|
|
10794
|
+
let unsupportedLayers = [];
|
|
11082
10795
|
for (let index = 0; index < layersList.length; index++) {
|
|
11083
10796
|
const layer = layersList[index];
|
|
11084
|
-
|
|
10797
|
+
const isLayerSupported = SUPPORTED_LAYERS_TYPES.includes(layer.layerType);
|
|
10798
|
+
if (isLayerSupported) {
|
|
10799
|
+
if (needToCheckCRS && layer.layerType !== GROUP_LAYER) {
|
|
10800
|
+
await checkSupportedIndexCRS(layer);
|
|
10801
|
+
needToCheckCRS = false;
|
|
10802
|
+
}
|
|
11085
10803
|
layers.push(layer);
|
|
10804
|
+
} else {
|
|
10805
|
+
unsupportedLayers.push(layer);
|
|
11086
10806
|
}
|
|
11087
10807
|
if (layer.layers?.length) {
|
|
11088
|
-
|
|
10808
|
+
const { layers: childLayers, unsupportedLayers: childUnsupportedLayers } = await parseOperationalLayers(layer.layers, needToCheckCRS);
|
|
10809
|
+
layer.layers = childLayers;
|
|
10810
|
+
unsupportedLayers = [...unsupportedLayers, ...childUnsupportedLayers];
|
|
11089
10811
|
}
|
|
11090
10812
|
}
|
|
11091
|
-
return layers;
|
|
10813
|
+
return { layers, unsupportedLayers };
|
|
10814
|
+
}
|
|
10815
|
+
async function checkSupportedIndexCRS(layer) {
|
|
10816
|
+
try {
|
|
10817
|
+
const layerJson = await load(layer.url, JSONLoader);
|
|
10818
|
+
const wkid = layerJson?.spatialReference?.wkid;
|
|
10819
|
+
if (wkid !== SUPPORTED_WKID) {
|
|
10820
|
+
throw new Error(NOT_SUPPORTED_CRS_ERROR);
|
|
10821
|
+
}
|
|
10822
|
+
} catch (error) {
|
|
10823
|
+
throw error;
|
|
10824
|
+
}
|
|
11092
10825
|
}
|
|
11093
|
-
var ARCGIS_SCENE_SERVER_LAYER_TYPE, BUILDING_SCENE_LAYER, INTEGRATED_MESH_LAYER, SUPPORTED_LAYERS_TYPES;
|
|
10826
|
+
var SUPPORTED_WKID, ARCGIS_SCENE_SERVER_LAYER_TYPE, BUILDING_SCENE_LAYER, INTEGRATED_MESH_LAYER, GROUP_LAYER, SUPPORTED_LAYERS_TYPES, NO_AVAILABLE_SUPPORTED_LAYERS_ERROR, NOT_SUPPORTED_CRS_ERROR;
|
|
11094
10827
|
var init_parse_arcgis_webscene = __esm({
|
|
11095
10828
|
"src/lib/parsers/parse-arcgis-webscene.ts"() {
|
|
10829
|
+
init_src3();
|
|
10830
|
+
SUPPORTED_WKID = 4326;
|
|
11096
10831
|
ARCGIS_SCENE_SERVER_LAYER_TYPE = "ArcGISSceneServiceLayer";
|
|
11097
10832
|
BUILDING_SCENE_LAYER = "BuildingSceneLayer";
|
|
11098
10833
|
INTEGRATED_MESH_LAYER = "IntegratedMeshLayer";
|
|
10834
|
+
GROUP_LAYER = "GroupLayer";
|
|
11099
10835
|
SUPPORTED_LAYERS_TYPES = [
|
|
11100
10836
|
ARCGIS_SCENE_SERVER_LAYER_TYPE,
|
|
11101
10837
|
INTEGRATED_MESH_LAYER,
|
|
11102
|
-
BUILDING_SCENE_LAYER
|
|
10838
|
+
BUILDING_SCENE_LAYER,
|
|
10839
|
+
GROUP_LAYER
|
|
11103
10840
|
];
|
|
10841
|
+
NO_AVAILABLE_SUPPORTED_LAYERS_ERROR = "NO_AVAILABLE_SUPPORTED_LAYERS_ERROR";
|
|
10842
|
+
NOT_SUPPORTED_CRS_ERROR = "NOT_SUPPORTED_CRS_ERROR";
|
|
11104
10843
|
}
|
|
11105
10844
|
});
|
|
11106
10845
|
|
|
@@ -11150,10 +10889,10 @@
|
|
|
11150
10889
|
|
|
11151
10890
|
// src/bundle.ts
|
|
11152
10891
|
var require_bundle = __commonJS({
|
|
11153
|
-
"src/bundle.ts"(exports,
|
|
10892
|
+
"src/bundle.ts"(exports, module) {
|
|
11154
10893
|
var moduleExports = (init_src9(), src_exports);
|
|
11155
10894
|
globalThis.loaders = globalThis.loaders || {};
|
|
11156
|
-
|
|
10895
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
11157
10896
|
}
|
|
11158
10897
|
});
|
|
11159
10898
|
require_bundle();
|