itowns 2.43.2-next.14 → 2.43.2-next.15
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/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/examples/potree2_25d_map.html +1 -1
- package/lib/Core/Potree2Node.js +6 -1
- package/package.json +1 -1
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
potreeLayer = new itowns.Potree2Layer('Lion', {
|
|
64
64
|
source: new itowns.Potree2Source({
|
|
65
65
|
file: 'metadata.json',
|
|
66
|
-
url: 'https://
|
|
66
|
+
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
|
|
67
67
|
crs: view.referenceCrs,
|
|
68
68
|
}),
|
|
69
69
|
});
|
package/lib/Core/Potree2Node.js
CHANGED
|
@@ -105,11 +105,16 @@ class Potree2Node extends PointCloudNode {
|
|
|
105
105
|
}
|
|
106
106
|
networkOptions(byteOffset, byteSize) {
|
|
107
107
|
const first = byteOffset;
|
|
108
|
+
// When we specify 'multipart/byteranges' on headers request it trigger a preflight request
|
|
109
|
+
// Actually github doesn't support it https://github.com/orgs/community/discussions/24659
|
|
110
|
+
// But if we omit header parameter, github seems to know it's a 'multipart/byteranges' request (thanks to 'Range' parameter)
|
|
108
111
|
const networkOptions = {
|
|
109
112
|
...this.layer.source.networkOptions,
|
|
110
113
|
headers: {
|
|
111
114
|
...this.layer.source.networkOptions.headers,
|
|
112
|
-
'
|
|
115
|
+
...(this.url.startsWith('https://raw.githubusercontent.com') ? {} : {
|
|
116
|
+
'content-type': 'multipart/byteranges'
|
|
117
|
+
}),
|
|
113
118
|
Range: `bytes=${first}-${first + byteSize - 1n}`
|
|
114
119
|
}
|
|
115
120
|
};
|