Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
OGC
i3s-server
Commits
5b582386
Commit
5b582386
authored
4 years ago
by
Athanasios
Browse files
Options
Download
Email Patches
Plain Diff
Support textures
parent
94b2f72d
master
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.js
+2
-1
config.js
src/handler.js
+2
-0
src/handler.js
src/textures.js
+18
-0
src/textures.js
with
22 additions
and
1 deletion
+22
-1
config.js
+
2
-
1
View file @
5b582386
...
...
@@ -8,6 +8,7 @@ module.exports = {
SHARED
:
"
sharedResource.json.gz
"
,
FEATURES
:
"
.json.gz
"
,
GEOMETRIES
:
"
.bin.gz
"
,
ATTRIBUTES
:
"
.bin.gz
"
ATTRIBUTES
:
"
.bin.gz
"
,
TEXTURES
:
"
.bin.dds.gz
"
}
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/handler.js
+
2
-
0
View file @
5b582386
...
...
@@ -5,6 +5,7 @@ const shared = require('./shared');
const
features
=
require
(
'
./features
'
);
const
geometries
=
require
(
'
./geometries
'
);
const
attributes
=
require
(
'
./attributes
'
);
const
textures
=
require
(
'
./textures
'
);
const
layer
=
require
(
'
./layer
'
);
const
layers
=
require
(
'
./layers
'
);
...
...
@@ -16,6 +17,7 @@ const handlers = {
features
:
features
,
geometries
:
geometries
,
attributes
:
attributes
,
textures
:
textures
,
layer
:
layer
,
layers
:
layers
}
...
...
This diff is collapsed.
Click to expand it.
src/textures.js
0 → 100644
+
18
-
0
View file @
5b582386
const
config
=
require
(
'
../config
'
);
const
fs
=
require
(
'
fs
'
);
const
handle
=
(
req
,
res
)
=>
{
let
baseUrl
=
req
.
baseUrl
.
replace
(
/^
\/?
|
\/?
$/g
,
""
);
let
resourse
=
`
${
config
.
BASE_DIR
}
/
${
baseUrl
}
/
${
req
.
params
.
nodeid
}
/
${
req
.
params
.
resource
}
/
${
req
.
params
.
resourceid
}${
config
.
FOLDER_INDEX
.
TEXTURES
}
`
;
if
(
!
fs
.
existsSync
(
resourse
))
throw
new
Error
(
"
not found
"
);
res
.
set
({
'
Content-Type
'
:
'
application/octet-stream
'
,
'
Content-Encoding
'
:
'
gzip
'
});
res
.
sendFile
(
resourse
);
};
module
.
exports
=
handle
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets