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.
@@ -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://blocinbloc-public-test.s3.fr-par.scw.cloud/lion-potree2',
66
+ url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
67
67
  crs: view.referenceCrs,
68
68
  }),
69
69
  });
@@ -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
- 'content-type': 'multipart/byteranges',
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itowns",
3
- "version": "2.43.2-next.14",
3
+ "version": "2.43.2-next.15",
4
4
  "description": "A JS/WebGL framework for 3D geospatial data visualization",
5
5
  "type": "module",
6
6
  "main": "lib/Main.js",