@panoramax/web-viewer 5.3.0-develop-e555dbf8 → 5.3.0-develop-7456af38
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/build/cjs/index.js +3 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_photoviewer.js +3 -3
- package/build/cjs/index_photoviewer.js.map +1 -1
- package/build/esm/components/core/Basic.js +1 -1
- package/build/esm/utils/InitParameters.js +24 -29
- package/build/esm/utils/PhotoAdapter.js +2 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import BasicStyles from "./Basic.css" with { type: "css" };
|
|
|
9
9
|
document.adoptedStyleSheets.push(AtkinsonStyles);
|
|
10
10
|
document.adoptedStyleSheets.push(BasicStyles);
|
|
11
11
|
|
|
12
|
-
const __COMMIT_HASH__ = "
|
|
12
|
+
const __COMMIT_HASH__ = "7456af3";
|
|
13
13
|
const __PACKAGE_VERSION__ = "5.3.0";
|
|
14
14
|
const __PACKAGE_ISSUES_URL__ = "https://gitlab.com/panoramax/clients/web-viewer/-/work_items";
|
|
15
15
|
|
|
@@ -398,35 +398,6 @@ export function paramsToMapFilters(vals) {
|
|
|
398
398
|
* @param {object} params The parameters to apply.
|
|
399
399
|
*/
|
|
400
400
|
export function alterPSVState(psv, params) {
|
|
401
|
-
// Change xyz position
|
|
402
|
-
if(params.xyz) {
|
|
403
|
-
psv.addEventListener("picture-loaded", () => {
|
|
404
|
-
const coords = xyzParamToPSVPosition(params.xyz);
|
|
405
|
-
psv.setXYZ(coords.x, coords.y, coords.z);
|
|
406
|
-
}, {once: true});
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// Change xywh position
|
|
410
|
-
if(params.xywh) {
|
|
411
|
-
psv.addEventListener("picture-loaded", () => {
|
|
412
|
-
const coords = xywhParamToPSVPosition(params.xywh, psv.getPictureMetadata());
|
|
413
|
-
psv.rotate(coords);
|
|
414
|
-
psv.zoom(coords.z);
|
|
415
|
-
}, {once: true});
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// Select focused annotation
|
|
419
|
-
if(params.annotation) {
|
|
420
|
-
if(psv.getPictureMetadata()) {
|
|
421
|
-
psv.focusOnAnnotation(params.annotation);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
psv.addEventListener("picture-loaded", () => {
|
|
425
|
-
psv.focusOnAnnotation(params.annotation);
|
|
426
|
-
}, {once: true});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
401
|
// Change transitionDuration
|
|
431
402
|
let td = params.transitionDuration || params.speed;
|
|
432
403
|
if(td !== undefined) {
|
|
@@ -438,6 +409,30 @@ export function alterPSVState(psv, params) {
|
|
|
438
409
|
if(["none", "pic", "any", "seq"].includes(nav)) {
|
|
439
410
|
psv.setPicturesNavigation(nav);
|
|
440
411
|
}
|
|
412
|
+
|
|
413
|
+
// Params depending on picture loading state
|
|
414
|
+
const oncePicReady = () => {
|
|
415
|
+
// Change xyz position
|
|
416
|
+
if(params.xyz) {
|
|
417
|
+
const coords = xyzParamToPSVPosition(params.xyz);
|
|
418
|
+
psv.setXYZ(coords.x, coords.y, coords.z);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Change xywh position
|
|
422
|
+
if(params.xywh) {
|
|
423
|
+
const coords = xywhParamToPSVPosition(params.xywh, psv.getPictureMetadata());
|
|
424
|
+
psv.rotate(coords);
|
|
425
|
+
psv.zoom(coords.z);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// Select focused annotation
|
|
429
|
+
if(params.annotation) {
|
|
430
|
+
psv.focusOnAnnotation(params.annotation);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
if(psv.getPictureMetadata()) { oncePicReady(); }
|
|
435
|
+
else { psv.addEventListener("picture-loaded", oncePicReady, {once: true}); }
|
|
441
436
|
}
|
|
442
437
|
|
|
443
438
|
/**
|
|
@@ -18,13 +18,14 @@ export default class PhotoAdapter extends EquirectangularTilesAdapter {
|
|
|
18
18
|
if(!panorama.origBaseUrl) { panorama.origBaseUrl = panorama.baseUrl; }
|
|
19
19
|
else { panorama.baseUrl = panorama.origBaseUrl; }
|
|
20
20
|
|
|
21
|
-
// Fast mode + thumbnail available + no HD image loaded yet + flat picture
|
|
21
|
+
// Fast mode + thumbnail available + no HD image loaded yet + flat picture + not cropped 360°
|
|
22
22
|
if(
|
|
23
23
|
this._shouldGoFast()
|
|
24
24
|
&& panorama.thumbUrl
|
|
25
25
|
&& !panorama.hdLoaded
|
|
26
26
|
// eslint-disable-next-line eqeqeq
|
|
27
27
|
&& panorama.rows == 1
|
|
28
|
+
&& panorama.cropData?.croppedWidth !== panorama.cropData?.fullWidth
|
|
28
29
|
) {
|
|
29
30
|
panorama.baseUrl = panorama.thumbUrl;
|
|
30
31
|
}
|
package/package.json
CHANGED