@panoramax/web-viewer 4.0.3-develop-e6a52885 → 4.0.3-develop-28e2e30a

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "4.0.3-develop-e6a52885",
3
+ "version": "4.0.3-develop-28e2e30a",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -93,15 +93,15 @@
93
93
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
94
94
  "@fortawesome/free-regular-svg-icons": "^6.7.2",
95
95
  "@fortawesome/free-solid-svg-icons": "^6.7.2",
96
- "@photo-sphere-viewer/core": "5.12.1",
97
- "@photo-sphere-viewer/equirectangular-tiles-adapter": "5.12.1",
98
- "@photo-sphere-viewer/gallery-plugin": "5.12.1",
99
- "@photo-sphere-viewer/markers-plugin": "5.12.1",
100
- "@photo-sphere-viewer/virtual-tour-plugin": "5.12.1",
96
+ "@photo-sphere-viewer/core": "5.13.3",
97
+ "@photo-sphere-viewer/equirectangular-tiles-adapter": "5.13.3",
98
+ "@photo-sphere-viewer/gallery-plugin": "5.13.3",
99
+ "@photo-sphere-viewer/markers-plugin": "5.13.3",
100
+ "@photo-sphere-viewer/virtual-tour-plugin": "5.13.3",
101
101
  "iconify-icon": "^3.0.0",
102
102
  "json5": "^2.2.3",
103
103
  "lit": "^3.2.1",
104
- "maplibre-gl": "^5.3.0",
104
+ "maplibre-gl": "^5.6.0",
105
105
  "pmtiles": "^4.3.0",
106
106
  "query-selector-shadow-dom": "^1.0.1"
107
107
  },
@@ -94,7 +94,7 @@ export default class Photo extends PSViewer {
94
94
  resolution: parent.isWidthSmall() ? 32 : 64,
95
95
  shouldGoFast: options.shouldGoFast,
96
96
  }],
97
- withCredentials: parent?.fetchOptions?.credentials == "include",
97
+ withCredentials: parent.api._getPSVWithCredentials(),
98
98
  requestHeaders: parent?.fetchOptions?.headers,
99
99
  panorama: BASE_PANORAMA,
100
100
  lang: parent._t.psv,
package/src/utils/API.js CHANGED
@@ -369,6 +369,22 @@ export default class API extends EventTarget {
369
369
  }
370
370
  }
371
371
 
372
+ /**
373
+ * Get the withCredentials function for PhotoSphereViewer to handle fetch credentials parameter.
374
+ * @memberOf Panoramax.utils.API#
375
+ * @private
376
+ * @returns {function} The withCredentials function
377
+ */
378
+ _getPSVWithCredentials() {
379
+ const fetchOpts = this._getFetchOptions();
380
+ if(fetchOpts.credentials === "include") {
381
+ return (url) => url.startsWith(this._endpoint);
382
+ }
383
+ else {
384
+ return undefined;
385
+ }
386
+ }
387
+
372
388
  /**
373
389
  * Get sequence GeoJSON representation
374
390
  * @memberOf Panoramax.utils.API#
@@ -10,6 +10,7 @@ const createParent = () => ({
10
10
  _t: { pnx: {} },
11
11
  api: {
12
12
  _getFetchOptions: jest.fn(),
13
+ _getPSVWithCredentials: () => false,
13
14
  getPictureMetadataUrl: (picId, seqId) => `https://geovisio.fr/api/collections/${seqId}/items/${picId}`
14
15
  },
15
16
  });