@loaders.gl/tile-converter 4.3.0-alpha.1 → 4.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/converter.min.cjs +79 -79
- package/dist/deps-installer/deps-installer.js +1 -1
- package/dist/i3s-server/app.js +7 -1
- package/dist/i3s-server/bin/i3s-server.min.cjs +80 -80
- package/dist/i3s-server/controllers/index-controller.d.ts +2 -1
- package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -1
- package/dist/i3s-server/controllers/index-controller.js +11 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/pgm-loader.js +1 -1
- package/dist/slpk-extractor.min.cjs +1 -1
- package/package.json +16 -16
- package/src/i3s-server/app.ts +7 -1
- package/src/i3s-server/controllers/index-controller.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tile-converter",
|
|
3
|
-
"version": "4.3.0-alpha.
|
|
3
|
+
"version": "4.3.0-alpha.2",
|
|
4
4
|
"description": "Converter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"copy-certificates": "cp -R src/i3s-server/certs dist/i3s-server"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@loaders.gl/3d-tiles": "4.3.0-alpha.
|
|
57
|
-
"@loaders.gl/compression": "4.3.0-alpha.
|
|
58
|
-
"@loaders.gl/crypto": "4.3.0-alpha.
|
|
59
|
-
"@loaders.gl/draco": "4.3.0-alpha.
|
|
60
|
-
"@loaders.gl/gltf": "4.3.0-alpha.
|
|
61
|
-
"@loaders.gl/i3s": "4.3.0-alpha.
|
|
62
|
-
"@loaders.gl/images": "4.3.0-alpha.
|
|
63
|
-
"@loaders.gl/loader-utils": "4.3.0-alpha.
|
|
64
|
-
"@loaders.gl/math": "4.3.0-alpha.
|
|
65
|
-
"@loaders.gl/polyfills": "4.3.0-alpha.
|
|
66
|
-
"@loaders.gl/textures": "4.3.0-alpha.
|
|
67
|
-
"@loaders.gl/tiles": "4.3.0-alpha.
|
|
68
|
-
"@loaders.gl/worker-utils": "4.3.0-alpha.
|
|
69
|
-
"@loaders.gl/zip": "4.3.0-alpha.
|
|
56
|
+
"@loaders.gl/3d-tiles": "4.3.0-alpha.2",
|
|
57
|
+
"@loaders.gl/compression": "4.3.0-alpha.2",
|
|
58
|
+
"@loaders.gl/crypto": "4.3.0-alpha.2",
|
|
59
|
+
"@loaders.gl/draco": "4.3.0-alpha.2",
|
|
60
|
+
"@loaders.gl/gltf": "4.3.0-alpha.2",
|
|
61
|
+
"@loaders.gl/i3s": "4.3.0-alpha.2",
|
|
62
|
+
"@loaders.gl/images": "4.3.0-alpha.2",
|
|
63
|
+
"@loaders.gl/loader-utils": "4.3.0-alpha.2",
|
|
64
|
+
"@loaders.gl/math": "4.3.0-alpha.2",
|
|
65
|
+
"@loaders.gl/polyfills": "4.3.0-alpha.2",
|
|
66
|
+
"@loaders.gl/textures": "4.3.0-alpha.2",
|
|
67
|
+
"@loaders.gl/tiles": "4.3.0-alpha.2",
|
|
68
|
+
"@loaders.gl/worker-utils": "4.3.0-alpha.2",
|
|
69
|
+
"@loaders.gl/zip": "4.3.0-alpha.2",
|
|
70
70
|
"@math.gl/core": "^4.0.0",
|
|
71
71
|
"@math.gl/culling": "^4.0.0",
|
|
72
72
|
"@math.gl/geoid": "^4.0.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@loaders.gl/core": "^4.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "77a3cb538ab7a1fbf74245f25590210451689f5c"
|
|
98
98
|
}
|
package/src/i3s-server/app.ts
CHANGED
|
@@ -24,7 +24,13 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|
|
24
24
|
app.use(cors());
|
|
25
25
|
|
|
26
26
|
if (/\.slpk$/.test(I3S_LAYER_PATH)) {
|
|
27
|
-
|
|
27
|
+
let filePath = FULL_LAYER_PATH;
|
|
28
|
+
// Checks if the first character is not a point to indicate absolute path
|
|
29
|
+
const absolutePath = /^[^.]/.exec(I3S_LAYER_PATH);
|
|
30
|
+
if (absolutePath) {
|
|
31
|
+
filePath = I3S_LAYER_PATH;
|
|
32
|
+
}
|
|
33
|
+
loadArchive(filePath);
|
|
28
34
|
app.use('/SceneServer/layers/0', router);
|
|
29
35
|
app.use('/SceneServer', sceneServerRouter);
|
|
30
36
|
} else {
|
|
@@ -3,18 +3,24 @@ import fs from 'fs';
|
|
|
3
3
|
|
|
4
4
|
const {promises} = fs;
|
|
5
5
|
|
|
6
|
-
const I3S_LAYER_PATH = process.env.I3sLayerPath || '';
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Get local file name by input HTTP URL
|
|
10
8
|
* @param url - I3S HTTP service url
|
|
9
|
+
* @param i3sLayerPath - I3S layer path
|
|
11
10
|
* @returns - local file name
|
|
12
11
|
*/
|
|
13
|
-
export async function getFileNameByUrl(url: string): Promise<string | null> {
|
|
12
|
+
export async function getFileNameByUrl(url: string, i3sLayerPath = ''): Promise<string | null> {
|
|
13
|
+
i3sLayerPath = i3sLayerPath || process.env.I3sLayerPath || '';
|
|
14
14
|
const extensions = ['json', 'bin', 'jpg', 'jpeg', 'png', 'bin.dds', 'ktx2'];
|
|
15
|
-
|
|
15
|
+
let filePath = process.cwd();
|
|
16
|
+
// Checks if the first character is not a point to indicate absolute path
|
|
17
|
+
const absolutePath = /^[^.]/.exec(i3sLayerPath);
|
|
18
|
+
if (absolutePath) {
|
|
19
|
+
filePath = '';
|
|
20
|
+
}
|
|
21
|
+
const FULL_LAYER_PATH = path.join(filePath, i3sLayerPath, url);
|
|
16
22
|
for (const ext of extensions) {
|
|
17
|
-
const fileName = `${FULL_LAYER_PATH}
|
|
23
|
+
const fileName = `${FULL_LAYER_PATH}/index.${ext}`;
|
|
18
24
|
try {
|
|
19
25
|
await promises.access(fileName);
|
|
20
26
|
return fileName;
|