diff --git a/.eslintrc.json b/.eslintrc.json index d4a3a6bcf..579ae9f09 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,6 +23,7 @@ "prefer-destructuring": "off", "prefer-template": "off", "no-mixed-operators": "off", + "no-restricted-globals": "off", "arrow-parens": [ "error", "as-needed", diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..8d2ccd042 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,9 @@ +daysUntilStale: 7 +daysUntilClose: 7 +onlyLabels: + - invalid +staleLabel: wontfix +markComment: > + This issue has been automatically marked as wontfix because not enough + information was provided. It will be closed if no further activity occurs. +closeComment: false diff --git a/.jsdoc.json b/.jsdoc.json index 879af2912..52f320f26 100644 --- a/.jsdoc.json +++ b/.jsdoc.json @@ -1,6 +1,6 @@ { "source": { - "excludePattern": "PhotoSphereViewerCompat\\.js|data/constants\\.js" + "excludePattern": "PhotoSphereViewerCompat\\.js" }, "opts": { "recurse": true, diff --git a/dist/photo-sphere-viewer.css b/dist/photo-sphere-viewer.css index ca50e6c8c..d4f70687d 100644 --- a/dist/photo-sphere-viewer.css +++ b/dist/photo-sphere-viewer.css @@ -1,9 +1,91 @@ /*! - * Photo Sphere Viewer 4.0.7 + * Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel + * @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ +.psv-container { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + position: relative; + background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%); + overflow: hidden; +} + +.psv-container--fullscreen { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.psv-canvas-container { + position: absolute; + top: 0; + left: 0; + z-index: 0; + -webkit-transition: opacity linear 100ms; + transition: opacity linear 100ms; +} + +.psv-canvas { + display: block; +} + +.psv-loader-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 80; +} + +.psv-loader { + position: relative; + text-align: center; + color: rgba(61, 61, 61, 0.7); + width: 150px; + height: 150px; + border: 10px solid transparent; +} + +.psv-loader::before { + content: ""; + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.psv-loader, .psv-loader-image, .psv-loader-text { + display: inline-block; + vertical-align: middle; +} + +.psv-loader-canvas { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.psv-loader-text { + font: 14px sans-serif; +} + .psv-navbar { display: -webkit-box; display: -ms-flexbox; @@ -87,67 +169,17 @@ transition: transform 200ms ease, -webkit-transform 200ms ease; } -.psv-button .psv-button-svg * { - fill: currentColor; -} - .psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg { -webkit-transform: scale(1.2); transform: scale(1.2); } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ -.psv-container { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - position: relative; - background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%); - overflow: hidden; -} - -.psv-container--fullscreen { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; -} -.psv-canvas-container { - position: absolute; - top: 0; - left: 0; - z-index: 0; - -webkit-transition: opacity linear 100ms; - transition: opacity linear 100ms; -} - -.psv-canvas { - display: block; -} -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ .psv-autorotate-button.psv-button { width: 25px; height: 25px; padding: 7.5px; } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ + .psv-zoom-range.psv-button { width: 80px; height: 1px; @@ -189,68 +221,7 @@ -webkit-transform: scale(1.3); transform: scale(1.3); } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ -.psv-loader-container { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 80; -} - -.psv-loader { - position: relative; - text-align: center; - color: rgba(61, 61, 61, 0.7); - width: 150px; - height: 150px; - border: 10px solid transparent; -} - -.psv-loader::before { - content: ""; - display: inline-block; - height: 100%; - vertical-align: middle; -} -.psv-loader, .psv-loader-image, .psv-loader-text { - display: inline-block; - vertical-align: middle; -} - -.psv-loader-canvas { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.psv-loader-text { - font: 14px sans-serif; -} -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ .psv-notification { position: absolute; z-index: 100; @@ -287,12 +258,7 @@ opacity: 100; bottom: 80px; } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ + .psv-overlay { display: -webkit-box; display: -ms-flexbox; @@ -314,6 +280,7 @@ bottom: 0; right: 0; background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%); + color: black; opacity: 0.8; } @@ -341,12 +308,7 @@ opacity: 0.8; text-align: center; } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ + /* stylelint-disable scss/no-duplicate-dollar-variables */ /* stylelint-enable */ .psv-panel { @@ -485,12 +447,83 @@ .psv-panel--open .psv-panel-resizer { display: block; } -/*! - * Photo Sphere Viewer 4.0.7 - * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel - * @licence MIT (https://opensource.org/licenses/MIT) - */ + +.psv-panel-menu-title { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font: 24px sans-serif; + margin: 24px 12px; +} + +.psv-panel-menu-title svg { + width: 24px; + height: 24px; + margin-right: 12px; +} + +.psv-panel-menu-list { + list-style: none; + margin: 0; + padding: 0; + overflow: hidden; +} + +.psv-panel-menu-item { + min-height: 20px; + padding: 0.5em 1em; + cursor: pointer; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + -webkit-transition: background 0.1s ease-in-out; + transition: background 0.1s ease-in-out; +} + +.psv-panel-menu-item-icon { + -webkit-box-flex: 0; + -ms-flex: none; + flex: none; + height: 20px; + width: 20px; + margin-right: 0.5em; +} + +.psv-panel-menu-item-icon img { + max-width: 100%; + max-height: 100%; +} + +.psv-panel-menu-item-icon svg { + width: 100%; + height: 100%; +} + +.psv-panel-menu--stripped .psv-panel-menu-item:hover { + background: rgba(255, 255, 255, 0.2); +} + +.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd)::before { + background: rgba(255, 255, 255, 0.1); +} + +.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even)::before { + background: transparent; +} + +.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover { + background: rgba(255, 255, 255, 0.2); +} + .psv-tooltip { position: absolute; z-index: 50; diff --git a/dist/photo-sphere-viewer.css.map b/dist/photo-sphere-viewer.css.map index 64894eea4..14544cfc4 100644 --- a/dist/photo-sphere-viewer.css.map +++ b/dist/photo-sphere-viewer.css.map @@ -1 +1 @@ -{"version":3,"sources":["","navbar.scss%23sass","navbar.scss","viewer.scss%23sass","viewer.scss","autorotate.scss%23sass","autorotate.scss","zoom-range.scss%23sass","zoom-range.scss","loader.scss%23sass","loader.scss","notification.scss%23sass","notification.scss","overlay.scss%23sass","overlay.scss","panel.scss%23sass","panel.scss","tooltip.scss%23sass","tooltip.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,oBAAA;EAAA,oBAAA;EAAA,aAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,iCAAA;EACA,2CAAA;EAAA,mCAAA;ACCF;;ADAE;EACE,SAAA;ACGJ;;ADFE;;EAEE,+BAAA;UAAA,uBAAA;ACKJ;;ADHA;EACE,mBAAA;MAAA,kBAAA;UAAA,cAAA;EACA,+BAAA;EACA,gBAAA;EACA,kBAAA;ACMF;;ADLE;EACE,YAAA;EACA,WAAA;EACA,eAAA;ACQJ;;ADPI;EACE,8BAAA;ACUN;;ADTE;EACE,qBAAA;EACA,aAAA;EACA,qBAAA;EACA,mBAAA;ACYJ;;ADVA;EACE,mBAAA;MAAA,kBAAA;UAAA,cAAA;EACA,aAAA;EACA,kBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,uBAAA;EACA,+BAAA;ACaF;;ADZE;EACE,oCAAA;ACeJ;;ADdE;EACE,oBAAA;EACA,YA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AC+BJ;;AD9BI;EACE,uCAAA;ACiCN;;ADhCE;EACE,oDAAA;UAAA,4CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACmCJ;;ADlCI;EACE,uCAAA;ACqCN;;ADpCE;EACE,uCAAA;UAAA,+BAAA;EACA,UAAA;EACA,kCAAA;UAAA,0BAAA;ACuCJ","file":"photo-sphere-viewer.css","sourcesContent":[null,".psv-navbar {\n display: flex;\n position: absolute;\n z-index: 90;\n bottom: -40px;\n left: 0;\n width: 100%;\n height: 40px;\n background: rgba(61, 61, 61, 0.5);\n transition: bottom ease-in-out .1s; }\n .psv-navbar--open {\n bottom: 0; }\n .psv-navbar,\n .psv-navbar * {\n box-sizing: content-box; }\n\n.psv-caption {\n flex: 1 1 100%;\n color: rgba(255, 255, 255, 0.7);\n overflow: hidden;\n text-align: center; }\n .psv-caption-icon {\n height: 20px;\n width: 20px;\n cursor: pointer; }\n .psv-caption-icon * {\n fill: rgba(255, 255, 255, 0.7); }\n .psv-caption-content {\n display: inline-block;\n padding: 10px;\n font: 16px sans-serif;\n white-space: nowrap; }\n\n.psv-button {\n flex: 0 0 auto;\n padding: 10px;\n position: relative;\n cursor: pointer;\n height: 20px;\n width: 20px;\n background: transparent;\n color: rgba(255, 255, 255, 0.7); }\n .psv-button--active {\n background: rgba(255, 255, 255, 0.2); }\n .psv-button--disabled {\n pointer-events: none;\n opacity: 0.5; }\n .psv-button .psv-button-svg {\n width: 100%;\n transform: scale(1);\n transition: transform 200ms ease; }\n .psv-button .psv-button-svg * {\n fill: currentColor; }\n\n.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg {\n transform: scale(1.2); }\n",".psv-navbar {\n display: flex;\n position: absolute;\n z-index: 90;\n bottom: -40px;\n left: 0;\n width: 100%;\n height: 40px;\n background: rgba(61, 61, 61, 0.5);\n transition: bottom ease-in-out .1s; }\n .psv-navbar--open {\n bottom: 0; }\n .psv-navbar,\n .psv-navbar * {\n box-sizing: content-box; }\n\n.psv-caption {\n flex: 1 1 100%;\n color: rgba(255, 255, 255, 0.7);\n overflow: hidden;\n text-align: center; }\n .psv-caption-icon {\n height: 20px;\n width: 20px;\n cursor: pointer; }\n .psv-caption-icon * {\n fill: rgba(255, 255, 255, 0.7); }\n .psv-caption-content {\n display: inline-block;\n padding: 10px;\n font: 16px sans-serif;\n white-space: nowrap; }\n\n.psv-button {\n flex: 0 0 auto;\n padding: 10px;\n position: relative;\n cursor: pointer;\n height: 20px;\n width: 20px;\n background: transparent;\n color: rgba(255, 255, 255, 0.7); }\n .psv-button--active {\n background: rgba(255, 255, 255, 0.2); }\n .psv-button--disabled {\n pointer-events: none;\n opacity: 0.5; }\n .psv-button .psv-button-svg {\n width: 100%;\n transform: scale(1);\n transition: transform 200ms ease; }\n .psv-button .psv-button-svg * {\n fill: currentColor; }\n\n.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg {\n transform: scale(1.2); }\n",".psv-container {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n position: relative;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n overflow: hidden; }\n\n.psv-container--fullscreen {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0; }\n\n.psv-canvas-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n transition: opacity linear 100ms; }\n\n.psv-canvas {\n display: block; }\n",".psv-container {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n position: relative;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n overflow: hidden; }\n\n.psv-container--fullscreen {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0; }\n\n.psv-canvas-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n transition: opacity linear 100ms; }\n\n.psv-canvas {\n display: block; }\n",".psv-autorotate-button.psv-button {\n width: 25px;\n height: 25px;\n padding: 7.5px; }\n",".psv-autorotate-button.psv-button {\n width: 25px;\n height: 25px;\n padding: 7.5px; }\n",".psv-zoom-range.psv-button {\n width: 80px;\n height: 1px;\n margin: 10px 0;\n padding: 9.5px 0;\n max-width: 600px; }\n\n.psv-zoom-range-line {\n position: relative;\n width: 80px;\n height: 1px;\n background: rgba(255, 255, 255, 0.7);\n transition: all .3s ease; }\n\n.psv-zoom-range-handle {\n position: absolute;\n border-radius: 50%;\n top: -3px;\n width: 7px;\n height: 7px;\n background: rgba(255, 255, 255, 0.7);\n transform: scale(1);\n transition: transform .3s ease; }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line {\n box-shadow: 0 0 2px rgba(255, 255, 255, 0.7); }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle {\n transform: scale(1.3); }\n",".psv-zoom-range.psv-button {\n width: 80px;\n height: 1px;\n margin: 10px 0;\n padding: 9.5px 0;\n max-width: 600px; }\n\n.psv-zoom-range-line {\n position: relative;\n width: 80px;\n height: 1px;\n background: rgba(255, 255, 255, 0.7);\n transition: all .3s ease; }\n\n.psv-zoom-range-handle {\n position: absolute;\n border-radius: 50%;\n top: -3px;\n width: 7px;\n height: 7px;\n background: rgba(255, 255, 255, 0.7);\n transform: scale(1);\n transition: transform .3s ease; }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line {\n box-shadow: 0 0 2px rgba(255, 255, 255, 0.7); }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle {\n transform: scale(1.3); }\n",".psv-loader-container {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 80; }\n\n.psv-loader {\n position: relative;\n text-align: center;\n color: rgba(61, 61, 61, 0.7);\n width: 150px;\n height: 150px;\n border: 10px solid transparent; }\n .psv-loader::before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle; }\n .psv-loader, .psv-loader-image, .psv-loader-text {\n display: inline-block;\n vertical-align: middle; }\n .psv-loader-canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n .psv-loader-text {\n font: 14px sans-serif; }\n",".psv-loader-container {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 80; }\n\n.psv-loader {\n position: relative;\n text-align: center;\n color: rgba(61, 61, 61, 0.7);\n width: 150px;\n height: 150px;\n border: 10px solid transparent; }\n .psv-loader::before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle; }\n .psv-loader, .psv-loader-image, .psv-loader-text {\n display: inline-block;\n vertical-align: middle; }\n .psv-loader-canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n .psv-loader-text {\n font: 14px sans-serif; }\n",".psv-notification {\n position: absolute;\n z-index: 100;\n bottom: 0;\n display: flex;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n padding: 0 2em;\n opacity: 0;\n transition-property: opacity, bottom;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms; }\n .psv-notification-content {\n max-width: 50em;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n font: 14px sans-serif;\n color: white; }\n .psv-notification--visible {\n opacity: 100;\n bottom: 80px; }\n",".psv-notification {\n position: absolute;\n z-index: 100;\n bottom: 0;\n display: flex;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n padding: 0 2em;\n opacity: 0;\n transition-property: opacity, bottom;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms; }\n .psv-notification-content {\n max-width: 50em;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n font: 14px sans-serif;\n color: white; }\n .psv-notification--visible {\n opacity: 100;\n bottom: 80px; }\n",".psv-overlay {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 110;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n opacity: 0.8; }\n .psv-overlay-image {\n margin-bottom: 4vh; }\n .psv-overlay-image svg {\n width: 50vw; }\n @media (orientation: landscape) {\n .psv-overlay-image svg {\n /* stylelint-disable-line scss/media-feature-value-dollar-variable */\n width: 25vw; } }\n .psv-overlay-text {\n font: 30px sans-serif;\n text-align: center; }\n .psv-overlay-subtext {\n font: 20px sans-serif;\n opacity: .8;\n text-align: center; }\n",".psv-overlay {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 110;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n opacity: 0.8; }\n .psv-overlay-image {\n margin-bottom: 4vh; }\n .psv-overlay-image svg {\n width: 50vw; }\n @media (orientation: landscape) {\n .psv-overlay-image svg {\n /* stylelint-disable-line scss/media-feature-value-dollar-variable */\n width: 25vw; } }\n .psv-overlay-text {\n font: 30px sans-serif;\n text-align: center; }\n .psv-overlay-subtext {\n font: 20px sans-serif;\n opacity: .8;\n text-align: center; }\n","/* stylelint-disable scss/no-duplicate-dollar-variables */\n/* stylelint-enable */\n.psv-panel {\n position: absolute;\n z-index: 90;\n right: 0;\n height: 100%;\n width: 400px;\n max-width: calc(100% - 24px);\n background: rgba(10, 10, 10, 0.7);\n transform: translate3d(100%, 0, 0);\n opacity: 0;\n transition-property: opacity, transform;\n transition-timing-function: ease-in-out;\n transition-duration: .1s;\n cursor: default;\n margin-left: 9px; }\n .psv--has-navbar .psv-panel {\n height: calc(100% - 40px); }\n .psv-panel-close-button {\n display: none;\n position: absolute;\n top: 0;\n left: -24px;\n width: 24px;\n height: 24px;\n background: rgba(0, 0, 0, 0.9); }\n .psv-panel-close-button::before, .psv-panel-close-button::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 4px;\n width: 15px;\n height: 1px;\n background-color: #fff;\n transition: .2s ease-in-out;\n transition-property: width, left, transform; }\n .psv-panel-close-button::before {\n transform: rotate(45deg); }\n .psv-panel-close-button::after {\n transform: rotate(-45deg); }\n .psv-panel-close-button:hover::before, .psv-panel-close-button:hover::after {\n left: 0;\n width: 23px; }\n .psv-panel-close-button:hover::before {\n transform: rotate(135deg); }\n .psv-panel-close-button:hover::after {\n transform: rotate(45deg); }\n .psv-panel-resizer {\n display: none;\n position: absolute;\n top: 0;\n left: -9px;\n width: 9px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.9);\n cursor: col-resize; }\n .psv-panel-resizer::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 1px;\n margin-top: -14.5px;\n width: 1px;\n height: 1px;\n box-shadow: 1px 0 #fff, 3px 0px #fff, 5px 0px #fff, 1px 2px #fff, 3px 2px #fff, 5px 2px #fff, 1px 4px #fff, 3px 4px #fff, 5px 4px #fff, 1px 6px #fff, 3px 6px #fff, 5px 6px #fff, 1px 8px #fff, 3px 8px #fff, 5px 8px #fff, 1px 10px #fff, 3px 10px #fff, 5px 10px #fff, 1px 12px #fff, 3px 12px #fff, 5px 12px #fff, 1px 14px #fff, 3px 14px #fff, 5px 14px #fff, 1px 16px #fff, 3px 16px #fff, 5px 16px #fff, 1px 18px #fff, 3px 18px #fff, 5px 18px #fff, 1px 20px #fff, 3px 20px #fff, 5px 20px #fff, 1px 22px #fff, 3px 22px #fff, 5px 22px #fff, 1px 24px #fff, 3px 24px #fff, 5px 24px #fff, 1px 26px #fff, 3px 26px #fff, 5px 26px #fff, 1px 28px #fff, 3px 28px #fff, 5px 28px #fff;\n background: transparent; }\n .psv-panel-content {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n color: gainsboro;\n font: 16px sans-serif;\n overflow: auto; }\n .psv-panel-content:not(.psv-panel-content--no-margin) {\n padding: 1em; }\n .psv-panel-content--no-interaction {\n user-select: none;\n pointer-events: none; }\n .psv-panel--open {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: .2s; }\n .psv-panel--open .psv-panel-close-button,\n .psv-panel--open .psv-panel-resizer {\n display: block; }\n","/* stylelint-disable scss/no-duplicate-dollar-variables */\n/* stylelint-enable */\n.psv-panel {\n position: absolute;\n z-index: 90;\n right: 0;\n height: 100%;\n width: 400px;\n max-width: calc(100% - 24px);\n background: rgba(10, 10, 10, 0.7);\n transform: translate3d(100%, 0, 0);\n opacity: 0;\n transition-property: opacity, transform;\n transition-timing-function: ease-in-out;\n transition-duration: .1s;\n cursor: default;\n margin-left: 9px; }\n .psv--has-navbar .psv-panel {\n height: calc(100% - 40px); }\n .psv-panel-close-button {\n display: none;\n position: absolute;\n top: 0;\n left: -24px;\n width: 24px;\n height: 24px;\n background: rgba(0, 0, 0, 0.9); }\n .psv-panel-close-button::before, .psv-panel-close-button::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 4px;\n width: 15px;\n height: 1px;\n background-color: #fff;\n transition: .2s ease-in-out;\n transition-property: width, left, transform; }\n .psv-panel-close-button::before {\n transform: rotate(45deg); }\n .psv-panel-close-button::after {\n transform: rotate(-45deg); }\n .psv-panel-close-button:hover::before, .psv-panel-close-button:hover::after {\n left: 0;\n width: 23px; }\n .psv-panel-close-button:hover::before {\n transform: rotate(135deg); }\n .psv-panel-close-button:hover::after {\n transform: rotate(45deg); }\n .psv-panel-resizer {\n display: none;\n position: absolute;\n top: 0;\n left: -9px;\n width: 9px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.9);\n cursor: col-resize; }\n .psv-panel-resizer::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 1px;\n margin-top: -14.5px;\n width: 1px;\n height: 1px;\n box-shadow: 1px 0 #fff, 3px 0px #fff, 5px 0px #fff, 1px 2px #fff, 3px 2px #fff, 5px 2px #fff, 1px 4px #fff, 3px 4px #fff, 5px 4px #fff, 1px 6px #fff, 3px 6px #fff, 5px 6px #fff, 1px 8px #fff, 3px 8px #fff, 5px 8px #fff, 1px 10px #fff, 3px 10px #fff, 5px 10px #fff, 1px 12px #fff, 3px 12px #fff, 5px 12px #fff, 1px 14px #fff, 3px 14px #fff, 5px 14px #fff, 1px 16px #fff, 3px 16px #fff, 5px 16px #fff, 1px 18px #fff, 3px 18px #fff, 5px 18px #fff, 1px 20px #fff, 3px 20px #fff, 5px 20px #fff, 1px 22px #fff, 3px 22px #fff, 5px 22px #fff, 1px 24px #fff, 3px 24px #fff, 5px 24px #fff, 1px 26px #fff, 3px 26px #fff, 5px 26px #fff, 1px 28px #fff, 3px 28px #fff, 5px 28px #fff;\n background: transparent; }\n .psv-panel-content {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n color: gainsboro;\n font: 16px sans-serif;\n overflow: auto; }\n .psv-panel-content:not(.psv-panel-content--no-margin) {\n padding: 1em; }\n .psv-panel-content--no-interaction {\n user-select: none;\n pointer-events: none; }\n .psv-panel--open {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: .2s; }\n .psv-panel--open .psv-panel-close-button,\n .psv-panel--open .psv-panel-resizer {\n display: block; }\n",".psv-tooltip {\n position: absolute;\n z-index: 50;\n box-sizing: border-box;\n max-width: 200px;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n opacity: 0;\n transition-property: opacity;\n transition-timing-function: ease-in-out;\n transition-duration: 100ms;\n outline: 5px solid transparent; }\n .psv-tooltip-content {\n color: white;\n font: 14px sans-serif;\n text-shadow: 0 1px #000; }\n .psv-tooltip-arrow {\n position: absolute;\n height: 0;\n width: 0;\n border: 7px solid transparent; }\n .psv-tooltip--bottom-center {\n box-shadow: 0 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-center .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-left {\n box-shadow: -3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-left .psv-tooltip-arrow {\n border-left-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-center {\n box-shadow: 0 -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-center .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-right {\n box-shadow: 3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(-5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-right .psv-tooltip-arrow {\n border-right-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-left {\n box-shadow: -3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-left .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-right {\n box-shadow: 3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-right .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-left {\n box-shadow: -3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-left .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-right {\n box-shadow: 3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-right .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--visible {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: 100ms; }\n",".psv-tooltip {\n position: absolute;\n z-index: 50;\n box-sizing: border-box;\n max-width: 200px;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n opacity: 0;\n transition-property: opacity;\n transition-timing-function: ease-in-out;\n transition-duration: 100ms;\n outline: 5px solid transparent; }\n .psv-tooltip-content {\n color: white;\n font: 14px sans-serif;\n text-shadow: 0 1px #000; }\n .psv-tooltip-arrow {\n position: absolute;\n height: 0;\n width: 0;\n border: 7px solid transparent; }\n .psv-tooltip--bottom-center {\n box-shadow: 0 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-center .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-left {\n box-shadow: -3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-left .psv-tooltip-arrow {\n border-left-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-center {\n box-shadow: 0 -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-center .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-right {\n box-shadow: 3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(-5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-right .psv-tooltip-arrow {\n border-right-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-left {\n box-shadow: -3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-left .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-right {\n box-shadow: 3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-right .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-left {\n box-shadow: -3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-left .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-right {\n box-shadow: 3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-right .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--visible {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: 100ms; }\n"]} \ No newline at end of file +{"version":3,"sources":["","index.scss%23sass","index.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,WAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,kBAAA;EACA,mHAAA;EACA,gBAAA;ACCF;;ADCA;EACE,eAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;ACEF;;ADAA;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,UAAA;ECGF,wCAAA;EAAA,gCAAA;AACA;;ADDA;EACE,cAAA;ACIF;;ADFA;EACE,oBAAA;EAAA,oBAAA;EAAA,aAAA;EACA,yBAAA;MAAA,sBAAA;UAAA,mBAAA;EACA,wBAAA;MAAA,qBAAA;UAAA,uBAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;ECKF,WAAA;EDHE,YAAA;EACA,WAAA;ACKF;;ADHA;EACE,kBAAA;EACA,kBAAA;EACA,4BAAA;EACA,YAAA;EACA,aAAA;EACA,8BA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AA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACiHJ;;ADhHI;EACE,wCAAA;ACmHN;;ADlHE;EACE,kDAAA;UAAA,0CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACqHJ;;ADpHI;EACE,uCAAA;ACuHN;;ADtHE;EACE,iDAAA;UAAA,yCAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACyHJ;;ADxHI;EACE,yCAAA;AC2HN;;AD1HE;EACE,oDAAA;UAAA,4CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;AC6HJ;;AD5HI;EACE,0CAAA;AC+HN;;AD9HE;EACE,mDAAA;UAAA,2CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACiIJ;;ADhII;EACE,0CAAA;ACmIN;;ADlIE;EACE,qDAAA;UAAA,6CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACqIJ;;ADpII;EACE,uCAAA;ACuIN;;ADtIE;EACE,oDAAA;UAAA,4CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACyIJ;;ADxII;EACE,uCAAA;AC2IN;;AD1IE;EACE,uCAAA;UAAA,+BAAA;EACA,UAAA;EACA,kCAAA;UAAA,0BAAA;AC6IJ","file":"photo-sphere-viewer.css","sourcesContent":[null,".psv-container {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n position: relative;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n overflow: hidden; }\n\n.psv-container--fullscreen {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0; }\n\n.psv-canvas-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n transition: opacity linear 100ms; }\n\n.psv-canvas {\n display: block; }\n\n.psv-loader-container {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 80; }\n\n.psv-loader {\n position: relative;\n text-align: center;\n color: rgba(61, 61, 61, 0.7);\n width: 150px;\n height: 150px;\n border: 10px solid transparent; }\n .psv-loader::before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle; }\n .psv-loader, .psv-loader-image, .psv-loader-text {\n display: inline-block;\n vertical-align: middle; }\n .psv-loader-canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n .psv-loader-text {\n font: 14px sans-serif; }\n\n.psv-navbar {\n display: flex;\n position: absolute;\n z-index: 90;\n bottom: -40px;\n left: 0;\n width: 100%;\n height: 40px;\n background: rgba(61, 61, 61, 0.5);\n transition: bottom ease-in-out .1s; }\n .psv-navbar--open {\n bottom: 0; }\n .psv-navbar,\n .psv-navbar * {\n box-sizing: content-box; }\n\n.psv-caption {\n flex: 1 1 100%;\n color: rgba(255, 255, 255, 0.7);\n overflow: hidden;\n text-align: center; }\n .psv-caption-icon {\n height: 20px;\n width: 20px;\n cursor: pointer; }\n .psv-caption-icon * {\n fill: rgba(255, 255, 255, 0.7); }\n .psv-caption-content {\n display: inline-block;\n padding: 10px;\n font: 16px sans-serif;\n white-space: nowrap; }\n\n.psv-button {\n flex: 0 0 auto;\n padding: 10px;\n position: relative;\n cursor: pointer;\n height: 20px;\n width: 20px;\n background: transparent;\n color: rgba(255, 255, 255, 0.7); }\n .psv-button--active {\n background: rgba(255, 255, 255, 0.2); }\n .psv-button--disabled {\n pointer-events: none;\n opacity: 0.5; }\n .psv-button .psv-button-svg {\n width: 100%;\n transform: scale(1);\n transition: transform 200ms ease; }\n\n.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg {\n transform: scale(1.2); }\n\n.psv-autorotate-button.psv-button {\n width: 25px;\n height: 25px;\n padding: 7.5px; }\n\n.psv-zoom-range.psv-button {\n width: 80px;\n height: 1px;\n margin: 10px 0;\n padding: 9.5px 0;\n max-width: 600px; }\n\n.psv-zoom-range-line {\n position: relative;\n width: 80px;\n height: 1px;\n background: rgba(255, 255, 255, 0.7);\n transition: all .3s ease; }\n\n.psv-zoom-range-handle {\n position: absolute;\n border-radius: 50%;\n top: -3px;\n width: 7px;\n height: 7px;\n background: rgba(255, 255, 255, 0.7);\n transform: scale(1);\n transition: transform .3s ease; }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line {\n box-shadow: 0 0 2px rgba(255, 255, 255, 0.7); }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle {\n transform: scale(1.3); }\n\n.psv-notification {\n position: absolute;\n z-index: 100;\n bottom: 0;\n display: flex;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n padding: 0 2em;\n opacity: 0;\n transition-property: opacity, bottom;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms; }\n .psv-notification-content {\n max-width: 50em;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n font: 14px sans-serif;\n color: white; }\n .psv-notification--visible {\n opacity: 100;\n bottom: 80px; }\n\n.psv-overlay {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 110;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n color: black;\n opacity: 0.8; }\n .psv-overlay-image {\n margin-bottom: 4vh; }\n .psv-overlay-image svg {\n width: 50vw; }\n @media (orientation: landscape) {\n .psv-overlay-image svg {\n /* stylelint-disable-line scss/media-feature-value-dollar-variable */\n width: 25vw; } }\n .psv-overlay-text {\n font: 30px sans-serif;\n text-align: center; }\n .psv-overlay-subtext {\n font: 20px sans-serif;\n opacity: .8;\n text-align: center; }\n\n/* stylelint-disable scss/no-duplicate-dollar-variables */\n/* stylelint-enable */\n.psv-panel {\n position: absolute;\n z-index: 90;\n right: 0;\n height: 100%;\n width: 400px;\n max-width: calc(100% - 24px);\n background: rgba(10, 10, 10, 0.7);\n transform: translate3d(100%, 0, 0);\n opacity: 0;\n transition-property: opacity, transform;\n transition-timing-function: ease-in-out;\n transition-duration: .1s;\n cursor: default;\n margin-left: 9px; }\n .psv--has-navbar .psv-panel {\n height: calc(100% - 40px); }\n .psv-panel-close-button {\n display: none;\n position: absolute;\n top: 0;\n left: -24px;\n width: 24px;\n height: 24px;\n background: rgba(0, 0, 0, 0.9); }\n .psv-panel-close-button::before, .psv-panel-close-button::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 4px;\n width: 15px;\n height: 1px;\n background-color: #fff;\n transition: .2s ease-in-out;\n transition-property: width, left, transform; }\n .psv-panel-close-button::before {\n transform: rotate(45deg); }\n .psv-panel-close-button::after {\n transform: rotate(-45deg); }\n .psv-panel-close-button:hover::before, .psv-panel-close-button:hover::after {\n left: 0;\n width: 23px; }\n .psv-panel-close-button:hover::before {\n transform: rotate(135deg); }\n .psv-panel-close-button:hover::after {\n transform: rotate(45deg); }\n .psv-panel-resizer {\n display: none;\n position: absolute;\n top: 0;\n left: -9px;\n width: 9px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.9);\n cursor: col-resize; }\n .psv-panel-resizer::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 1px;\n margin-top: -14.5px;\n width: 1px;\n height: 1px;\n box-shadow: 1px 0 #fff, 3px 0px #fff, 5px 0px #fff, 1px 2px #fff, 3px 2px #fff, 5px 2px #fff, 1px 4px #fff, 3px 4px #fff, 5px 4px #fff, 1px 6px #fff, 3px 6px #fff, 5px 6px #fff, 1px 8px #fff, 3px 8px #fff, 5px 8px #fff, 1px 10px #fff, 3px 10px #fff, 5px 10px #fff, 1px 12px #fff, 3px 12px #fff, 5px 12px #fff, 1px 14px #fff, 3px 14px #fff, 5px 14px #fff, 1px 16px #fff, 3px 16px #fff, 5px 16px #fff, 1px 18px #fff, 3px 18px #fff, 5px 18px #fff, 1px 20px #fff, 3px 20px #fff, 5px 20px #fff, 1px 22px #fff, 3px 22px #fff, 5px 22px #fff, 1px 24px #fff, 3px 24px #fff, 5px 24px #fff, 1px 26px #fff, 3px 26px #fff, 5px 26px #fff, 1px 28px #fff, 3px 28px #fff, 5px 28px #fff;\n background: transparent; }\n .psv-panel-content {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n color: gainsboro;\n font: 16px sans-serif;\n overflow: auto; }\n .psv-panel-content:not(.psv-panel-content--no-margin) {\n padding: 1em; }\n .psv-panel-content--no-interaction {\n user-select: none;\n pointer-events: none; }\n .psv-panel--open {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: .2s; }\n .psv-panel--open .psv-panel-close-button,\n .psv-panel--open .psv-panel-resizer {\n display: block; }\n\n.psv-panel-menu-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 12px; }\n .psv-panel-menu-title svg {\n width: 24px;\n height: 24px;\n margin-right: 12px; }\n\n.psv-panel-menu-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n\n.psv-panel-menu-item {\n min-height: 20px;\n padding: 0.5em 1em;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n transition: background .1s ease-in-out; }\n .psv-panel-menu-item-icon {\n flex: none;\n height: 20px;\n width: 20px;\n margin-right: 0.5em; }\n .psv-panel-menu-item-icon img {\n max-width: 100%;\n max-height: 100%; }\n .psv-panel-menu-item-icon svg {\n width: 100%;\n height: 100%; }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:hover {\n background: rgba(255, 255, 255, 0.2); }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd)::before {\n background: rgba(255, 255, 255, 0.1); }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even)::before {\n background: transparent; }\n\n.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover {\n background: rgba(255, 255, 255, 0.2); }\n\n.psv-tooltip {\n position: absolute;\n z-index: 50;\n box-sizing: border-box;\n max-width: 200px;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n opacity: 0;\n transition-property: opacity;\n transition-timing-function: ease-in-out;\n transition-duration: 100ms;\n outline: 5px solid transparent; }\n .psv-tooltip-content {\n color: white;\n font: 14px sans-serif;\n text-shadow: 0 1px #000; }\n .psv-tooltip-arrow {\n position: absolute;\n height: 0;\n width: 0;\n border: 7px solid transparent; }\n .psv-tooltip--bottom-center {\n box-shadow: 0 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-center .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-left {\n box-shadow: -3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-left .psv-tooltip-arrow {\n border-left-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-center {\n box-shadow: 0 -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-center .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-right {\n box-shadow: 3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(-5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-right .psv-tooltip-arrow {\n border-right-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-left {\n box-shadow: -3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-left .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-right {\n box-shadow: 3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-right .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-left {\n box-shadow: -3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-left .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-right {\n box-shadow: 3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-right .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--visible {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: 100ms; }\n",".psv-container {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n position: relative;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n overflow: hidden; }\n\n.psv-container--fullscreen {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0; }\n\n.psv-canvas-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 0;\n transition: opacity linear 100ms; }\n\n.psv-canvas {\n display: block; }\n\n.psv-loader-container {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 80; }\n\n.psv-loader {\n position: relative;\n text-align: center;\n color: rgba(61, 61, 61, 0.7);\n width: 150px;\n height: 150px;\n border: 10px solid transparent; }\n .psv-loader::before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle; }\n .psv-loader, .psv-loader-image, .psv-loader-text {\n display: inline-block;\n vertical-align: middle; }\n .psv-loader-canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%; }\n .psv-loader-text {\n font: 14px sans-serif; }\n\n.psv-navbar {\n display: flex;\n position: absolute;\n z-index: 90;\n bottom: -40px;\n left: 0;\n width: 100%;\n height: 40px;\n background: rgba(61, 61, 61, 0.5);\n transition: bottom ease-in-out .1s; }\n .psv-navbar--open {\n bottom: 0; }\n .psv-navbar,\n .psv-navbar * {\n box-sizing: content-box; }\n\n.psv-caption {\n flex: 1 1 100%;\n color: rgba(255, 255, 255, 0.7);\n overflow: hidden;\n text-align: center; }\n .psv-caption-icon {\n height: 20px;\n width: 20px;\n cursor: pointer; }\n .psv-caption-icon * {\n fill: rgba(255, 255, 255, 0.7); }\n .psv-caption-content {\n display: inline-block;\n padding: 10px;\n font: 16px sans-serif;\n white-space: nowrap; }\n\n.psv-button {\n flex: 0 0 auto;\n padding: 10px;\n position: relative;\n cursor: pointer;\n height: 20px;\n width: 20px;\n background: transparent;\n color: rgba(255, 255, 255, 0.7); }\n .psv-button--active {\n background: rgba(255, 255, 255, 0.2); }\n .psv-button--disabled {\n pointer-events: none;\n opacity: 0.5; }\n .psv-button .psv-button-svg {\n width: 100%;\n transform: scale(1);\n transition: transform 200ms ease; }\n\n.psv-container:not(.psv--is-touch) .psv-button--hover-scale:not(.psv-button--disabled):hover .psv-button-svg {\n transform: scale(1.2); }\n\n.psv-autorotate-button.psv-button {\n width: 25px;\n height: 25px;\n padding: 7.5px; }\n\n.psv-zoom-range.psv-button {\n width: 80px;\n height: 1px;\n margin: 10px 0;\n padding: 9.5px 0;\n max-width: 600px; }\n\n.psv-zoom-range-line {\n position: relative;\n width: 80px;\n height: 1px;\n background: rgba(255, 255, 255, 0.7);\n transition: all .3s ease; }\n\n.psv-zoom-range-handle {\n position: absolute;\n border-radius: 50%;\n top: -3px;\n width: 7px;\n height: 7px;\n background: rgba(255, 255, 255, 0.7);\n transform: scale(1);\n transition: transform .3s ease; }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line {\n box-shadow: 0 0 2px rgba(255, 255, 255, 0.7); }\n\n.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle {\n transform: scale(1.3); }\n\n.psv-notification {\n position: absolute;\n z-index: 100;\n bottom: 0;\n display: flex;\n justify-content: center;\n box-sizing: border-box;\n width: 100%;\n padding: 0 2em;\n opacity: 0;\n transition-property: opacity, bottom;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms; }\n .psv-notification-content {\n max-width: 50em;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n font: 14px sans-serif;\n color: white; }\n .psv-notification--visible {\n opacity: 100;\n bottom: 80px; }\n\n.psv-overlay {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 110;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background: radial-gradient(#fff 0%, #fdfdfd 16%, #fbfbfb 33%, #f8f8f8 49%, #efefef 66%, #dfdfdf 82%, #bfbfbf 100%);\n color: black;\n opacity: 0.8; }\n .psv-overlay-image {\n margin-bottom: 4vh; }\n .psv-overlay-image svg {\n width: 50vw; }\n @media (orientation: landscape) {\n .psv-overlay-image svg {\n /* stylelint-disable-line scss/media-feature-value-dollar-variable */\n width: 25vw; } }\n .psv-overlay-text {\n font: 30px sans-serif;\n text-align: center; }\n .psv-overlay-subtext {\n font: 20px sans-serif;\n opacity: .8;\n text-align: center; }\n\n/* stylelint-disable scss/no-duplicate-dollar-variables */\n/* stylelint-enable */\n.psv-panel {\n position: absolute;\n z-index: 90;\n right: 0;\n height: 100%;\n width: 400px;\n max-width: calc(100% - 24px);\n background: rgba(10, 10, 10, 0.7);\n transform: translate3d(100%, 0, 0);\n opacity: 0;\n transition-property: opacity, transform;\n transition-timing-function: ease-in-out;\n transition-duration: .1s;\n cursor: default;\n margin-left: 9px; }\n .psv--has-navbar .psv-panel {\n height: calc(100% - 40px); }\n .psv-panel-close-button {\n display: none;\n position: absolute;\n top: 0;\n left: -24px;\n width: 24px;\n height: 24px;\n background: rgba(0, 0, 0, 0.9); }\n .psv-panel-close-button::before, .psv-panel-close-button::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 4px;\n width: 15px;\n height: 1px;\n background-color: #fff;\n transition: .2s ease-in-out;\n transition-property: width, left, transform; }\n .psv-panel-close-button::before {\n transform: rotate(45deg); }\n .psv-panel-close-button::after {\n transform: rotate(-45deg); }\n .psv-panel-close-button:hover::before, .psv-panel-close-button:hover::after {\n left: 0;\n width: 23px; }\n .psv-panel-close-button:hover::before {\n transform: rotate(135deg); }\n .psv-panel-close-button:hover::after {\n transform: rotate(45deg); }\n .psv-panel-resizer {\n display: none;\n position: absolute;\n top: 0;\n left: -9px;\n width: 9px;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.9);\n cursor: col-resize; }\n .psv-panel-resizer::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 1px;\n margin-top: -14.5px;\n width: 1px;\n height: 1px;\n box-shadow: 1px 0 #fff, 3px 0px #fff, 5px 0px #fff, 1px 2px #fff, 3px 2px #fff, 5px 2px #fff, 1px 4px #fff, 3px 4px #fff, 5px 4px #fff, 1px 6px #fff, 3px 6px #fff, 5px 6px #fff, 1px 8px #fff, 3px 8px #fff, 5px 8px #fff, 1px 10px #fff, 3px 10px #fff, 5px 10px #fff, 1px 12px #fff, 3px 12px #fff, 5px 12px #fff, 1px 14px #fff, 3px 14px #fff, 5px 14px #fff, 1px 16px #fff, 3px 16px #fff, 5px 16px #fff, 1px 18px #fff, 3px 18px #fff, 5px 18px #fff, 1px 20px #fff, 3px 20px #fff, 5px 20px #fff, 1px 22px #fff, 3px 22px #fff, 5px 22px #fff, 1px 24px #fff, 3px 24px #fff, 5px 24px #fff, 1px 26px #fff, 3px 26px #fff, 5px 26px #fff, 1px 28px #fff, 3px 28px #fff, 5px 28px #fff;\n background: transparent; }\n .psv-panel-content {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n color: gainsboro;\n font: 16px sans-serif;\n overflow: auto; }\n .psv-panel-content:not(.psv-panel-content--no-margin) {\n padding: 1em; }\n .psv-panel-content--no-interaction {\n user-select: none;\n pointer-events: none; }\n .psv-panel--open {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: .2s; }\n .psv-panel--open .psv-panel-close-button,\n .psv-panel--open .psv-panel-resizer {\n display: block; }\n\n.psv-panel-menu-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 12px; }\n .psv-panel-menu-title svg {\n width: 24px;\n height: 24px;\n margin-right: 12px; }\n\n.psv-panel-menu-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n\n.psv-panel-menu-item {\n min-height: 20px;\n padding: 0.5em 1em;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n transition: background .1s ease-in-out; }\n .psv-panel-menu-item-icon {\n flex: none;\n height: 20px;\n width: 20px;\n margin-right: 0.5em; }\n .psv-panel-menu-item-icon img {\n max-width: 100%;\n max-height: 100%; }\n .psv-panel-menu-item-icon svg {\n width: 100%;\n height: 100%; }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:hover {\n background: rgba(255, 255, 255, 0.2); }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(odd)::before {\n background: rgba(255, 255, 255, 0.1); }\n\n.psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even), .psv-panel-menu--stripped .psv-panel-menu-item:nth-child(even)::before {\n background: transparent; }\n\n.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover {\n background: rgba(255, 255, 255, 0.2); }\n\n.psv-tooltip {\n position: absolute;\n z-index: 50;\n box-sizing: border-box;\n max-width: 200px;\n background-color: rgba(61, 61, 61, 0.8);\n border-radius: 4px;\n padding: 0.5em 1em;\n opacity: 0;\n transition-property: opacity;\n transition-timing-function: ease-in-out;\n transition-duration: 100ms;\n outline: 5px solid transparent; }\n .psv-tooltip-content {\n color: white;\n font: 14px sans-serif;\n text-shadow: 0 1px #000; }\n .psv-tooltip-arrow {\n position: absolute;\n height: 0;\n width: 0;\n border: 7px solid transparent; }\n .psv-tooltip--bottom-center {\n box-shadow: 0 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-center .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-left {\n box-shadow: -3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-left .psv-tooltip-arrow {\n border-left-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-center {\n box-shadow: 0 -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-center .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--center-right {\n box-shadow: 3px 0 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(-5px, 0, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--center-right .psv-tooltip-arrow {\n border-right-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-left {\n box-shadow: -3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-left .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--bottom-right {\n box-shadow: 3px 3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, -5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--bottom-right .psv-tooltip-arrow {\n border-bottom-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-left {\n box-shadow: -3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-left .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--top-right {\n box-shadow: 3px -3px 0 rgba(90, 90, 90, 0.7);\n transform: translate3d(0, 5px, 0);\n transition-property: opacity, transform; }\n .psv-tooltip--top-right .psv-tooltip-arrow {\n border-top-color: rgba(61, 61, 61, 0.8); }\n .psv-tooltip--visible {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n transition-duration: 100ms; }\n"]} \ No newline at end of file diff --git a/dist/photo-sphere-viewer.js b/dist/photo-sphere-viewer.js index 6afd7d62c..10de3e3b7 100644 --- a/dist/photo-sphere-viewer.js +++ b/dist/photo-sphere-viewer.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('uevent')) : typeof define === 'function' && define.amd ? define(['exports', 'three', 'uevent'], factory) : - (global = global || self, factory(global.PhotoSphereViewer = {}, global.THREE, global.uEvent)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PhotoSphereViewer = {}, global.THREE, global.uEvent)); }(this, (function (exports, THREE, uevent) { 'use strict'; /** @@ -45,6 +45,14 @@ */ var TWOFINGERSOVERLAY_DELAY = 100; + /** + * @summary Duration in milliseconds of the "ctrl zoom" overlay + * @memberOf PSV.constants + * @type {number} + * @constant + */ + + var CTRLZOOM_TIMEOUT = 2000; /** * @summary Time size of the mouse position history used to compute inertia * @memberOf PSV.constants @@ -93,14 +101,6 @@ */ var CUBE_HASHMAP = ['left', 'right', 'top', 'bottom', 'back', 'front']; - /** - * @summary Property name added to buttons list - * @memberOf PSV.constants - * @type {string} - * @constant - */ - - var BUTTON_DATA = 'psvButton'; /** * @summary Property name added to viewer element * @memberOf PSV.constants @@ -340,6 +340,7 @@ var IDS = { MENU: 'menu', TWO_FINGERS: 'twoFingers', + CTRL_ZOOM: 'ctrlZoom', ERROR: 'error' }; /* eslint-disable */ @@ -430,13 +431,13 @@ DBLCLICK_DELAY: DBLCLICK_DELAY, LONGTOUCH_DELAY: LONGTOUCH_DELAY, TWOFINGERSOVERLAY_DELAY: TWOFINGERSOVERLAY_DELAY, + CTRLZOOM_TIMEOUT: CTRLZOOM_TIMEOUT, INERTIA_WINDOW: INERTIA_WINDOW, SPHERE_RADIUS: SPHERE_RADIUS, SPHERE_VERTICES: SPHERE_VERTICES, CUBE_VERTICES: CUBE_VERTICES, CUBE_MAP: CUBE_MAP, CUBE_HASHMAP: CUBE_HASHMAP, - BUTTON_DATA: BUTTON_DATA, VIEWER_DATA: VIEWER_DATA, ACTIONS: ACTIONS, EVENTS: EVENTS, @@ -559,6 +560,7 @@ var KEYMAP = { 13: 'Enter', + 17: 'Control', 27: 'Escape', 32: ' ', 33: 'PageUp', @@ -653,7 +655,7 @@ * @description From Facebook's Fixed Data Table * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js} * @copyright Facebook - * @param {MouseWheelEvent} event + * @param {WheelEvent} event * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}} */ @@ -1241,7 +1243,7 @@ } else { parsed = value; } - } else if (typeof angle === 'number' && !Number.isNaN(angle)) { + } else if (typeof angle === 'number' && !isNaN(angle)) { parsed = angle; } else { throw new PSVError('Unknown angle "' + angle + '"'); @@ -1942,9 +1944,9 @@ AbstractButton.icon = null; AbstractButton.iconActive = null; - var playActive = "\n"; + var playActive = "\n"; - var play = "\n"; + var play = "\n"; /** * @summary Navigation bar autorotate button class @@ -2096,7 +2098,7 @@ return CustomButton; }(AbstractButton); - var download = "\n"; + var download = "\n"; /** * @summary Navigation bar download button class @@ -2139,9 +2141,9 @@ DownloadButton.id = 'download'; DownloadButton.icon = download; - var fullscreenIn = "\n"; + var fullscreenIn = "\n"; - var fullscreenOut = "\n"; + var fullscreenOut = "\n"; /** * @summary Navigation bar fullscreen button class @@ -2211,21 +2213,7 @@ FullscreenButton.icon = fullscreenIn; FullscreenButton.iconActive = fullscreenOut; - var menuIcon = "\n"; - - var HTML_BUTTON_DATA = 'data-' + dasherize(BUTTON_DATA); - /** - * @summary Menu template - * @param {AbstractButton[]} buttons - * @param {PSV.Viewer} psv - * @returns {string} - */ - - var menuTemplate = (function (buttons, psv) { - return "\n
\n

" + psv.config.lang.menu + "

\n
    \n " + buttons.map(function (button) { - return "\n
  • \n " + button.container.innerHTML + "\n

    " + button.container.title + "

    \n
  • \n "; - }).join('') + "\n
\n
\n"; - }); + var menuIcon = "\n"; /** * @summary Navigation bar menu button class @@ -2236,6 +2224,20 @@ var MenuButton = /*#__PURE__*/function (_AbstractButton) { _inheritsLoose(MenuButton, _AbstractButton); + /** + * @summary Property name added to buttons list + * @type {string} + * @constant + */ + + /** + * @summary Menu template + * @param {AbstractButton[]} buttons + * @param {PSV.Viewer} psv + * @param {string} dataKey + * @returns {string} + */ + /** * @param {PSV.components.Navbar} navbar */ @@ -2329,11 +2331,11 @@ this.psv.panel.show({ id: IDS.MENU, - content: menuTemplate(this.parent.collapsed, this.psv), + content: MenuButton.MENU_TEMPLATE(this.parent.collapsed, this.psv, dasherize(MenuButton.BUTTON_DATA)), noMargin: true, clickHandler: function clickHandler(e) { var li = e.target ? getClosest(e.target, 'li') : undefined; - var buttonId = li ? li.dataset[BUTTON_DATA] : undefined; + var buttonId = li ? li.dataset[MenuButton.BUTTON_DATA] : undefined; if (buttonId) { _this2.parent.getButton(buttonId).onClick(); @@ -2354,6 +2356,13 @@ }(AbstractButton); MenuButton.id = 'menu'; MenuButton.icon = menuIcon; + MenuButton.BUTTON_DATA = 'psvButton'; + + MenuButton.MENU_TEMPLATE = function (buttons, psv, dataKey) { + return "\n
\n

" + menuIcon + " " + psv.config.lang.menu + "

\n
    \n " + buttons.map(function (button) { + return "\n
  • \n " + button.container.innerHTML + "\n " + button.container.title + "\n
  • \n "; + }).join('') + "\n
\n
\n"; + }; /** * @summary General information about the system @@ -2562,7 +2571,7 @@ function AbstractZoomButton(navbar, value) { var _this; - _this = _AbstractButton.call(this, navbar, 'psv-button--hover-scale psv-zoom-button', true) || this; + _this = _AbstractButton.call(this, navbar, 'psv-button--hover-scale psv-zoom-button') || this; /** * @override * @property {number} value @@ -2649,8 +2658,8 @@ */ ; - _proto.onClick = function onClick() {} // nothing - + _proto.onClick = function onClick() {// nothing + } /** * @summary Handles click events * @description Zooms in and register long press timer @@ -2726,7 +2735,7 @@ return AbstractZoomButton; }(AbstractButton); - var zoomIn = "\n"; + var zoomIn = "\n"; /** * @summary Navigation bar zoom-in button class @@ -2749,7 +2758,7 @@ ZoomInButton.id = 'zoomIn'; ZoomInButton.icon = zoomIn; - var zoomOut = "\n"; + var zoomOut = "\n"; /** * @summary Navigation bar zoom-out button class @@ -2953,8 +2962,8 @@ */ ; - _proto.onClick = function onClick() {} // nothing - + _proto.onClick = function onClick() {// nothing + } /** * @summary Moves the zoom cursor * @param {number} level @@ -3093,6 +3102,7 @@ mousewheelSpeed: 1, mousemove: true, captureCursor: false, + mousewheelCtrlKey: false, touchmoveTwoFingers: false, useXmpData: true, panoData: null, @@ -3106,7 +3116,8 @@ download: 'Download', fullscreen: 'Fullscreen', menu: 'Menu', - twoFingers: ['Use two fingers to navigate'], + twoFingers: 'Use two fingers to navigate', + ctrlZoom: 'Use ctrl + scroll to zoom the image', loadError: 'The panorama can\'t be loaded' }, keyboard: { @@ -3172,7 +3183,12 @@ return bound(_maxFov, 1, 179); }, lang: function lang(_lang) { - return _extends({}, DEFAULTS.lang, {}, _lang); + if (Array.isArray(_lang.twoFingers)) { + logWarn('lang.twoFingers must not be an array'); + _lang.twoFingers = _lang.twoFingers[0]; + } + + return _extends({}, DEFAULTS.lang, _lang); }, keyboard: function keyboard(_keyboard) { // keyboard=true becomes the default map @@ -3242,7 +3258,7 @@ return config; } - var info = ""; + var info = "\n"; /** * @summary Navigation bar caption button class @@ -4428,7 +4444,7 @@ return Panel; }(AbstractComponent); - var errorIcon = "\n"; + var errorIcon = "\n"; /** * @namespace PSV.services @@ -4694,7 +4710,9 @@ return DataHelper; }(AbstractService); - var gestureIcon = "\n"; + var gestureIcon = "\n"; + + var mousewheelIcon = "\n"; /** * @summary Events handler @@ -4723,8 +4741,11 @@ * @property {number} mouseY - current y position of the cursor * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y] * @property {number} pinchDist - distance between fingers when zooming + * @property {boolean} ctrlKeyDown - when the Ctrl key is pressed * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks * @property {number} dblclickTimeout - timeout id for double click + * @property {number} twofingersTimeout - timeout id for "two fingers" overlay + * @property {number} ctrlZoomTimeout - timeout id for "ctrol zoom" overlay * @protected */ @@ -4738,10 +4759,12 @@ mouseY: 0, mouseHistory: [], pinchDist: 0, + ctrlKeyDown: false, dblclickData: null, dblclickTimeout: null, longtouchTimeout: null, - twofingersTimeout: null + twofingersTimeout: null, + ctrlZoomTimeout: null }; /** * @summary Throttled wrapper of {@link PSV.Viewer#autoSize} @@ -4765,6 +4788,7 @@ _proto.init = function init() { window.addEventListener('resize', this); window.addEventListener('keydown', this); + window.addEventListener('keyup', this); this.psv.container.addEventListener('mouseenter', this); this.psv.container.addEventListener('mousedown', this); this.psv.container.addEventListener('mouseleave', this); @@ -4787,6 +4811,7 @@ _proto.destroy = function destroy() { window.removeEventListener('resize', this); window.removeEventListener('keydown', this); + window.removeEventListener('keyup', this); this.psv.container.removeEventListener('mouseenter', this); this.psv.container.removeEventListener('mousedown', this); this.psv.container.removeEventListener('mouseleave', this); @@ -4804,6 +4829,7 @@ clearTimeout(this.state.dblclickTimeout); clearTimeout(this.state.longtouchTimeout); clearTimeout(this.state.twofingersTimeout); + clearTimeout(this.state.ctrlZoomTimeout); delete this.state; _AbstractService.prototype.destroy.call(this); @@ -4829,6 +4855,11 @@ break; + case 'keyup': + this.__onKeyUp(); + + break; + case 'mouseup': this.__onMouseUp(evt); @@ -4918,6 +4949,17 @@ ; _proto.__onKeyDown = function __onKeyDown(evt) { + var key = getEventKey(evt); + + if (this.config.mousewheelCtrlKey) { + this.state.ctrlKeyDown = key === 'Control'; + + if (this.state.ctrlKeyDown) { + clearTimeout(this.state.ctrlZoomTimeout); + this.psv.overlay.hide(IDS.CTRL_ZOOM); + } + } + if (!this.state.keyboardEnabled) { return; } @@ -4925,11 +4967,9 @@ var dLong = 0; var dLat = 0; var dZoom = 0; - var key = getEventKey(evt); - var action = this.config.keyboard[key]; /* eslint-disable */ - switch (action) { + switch (this.config.keyboard[key]) { // @formatter:off case ACTIONS.ROTATE_LAT_UP: dLat = 0.01; @@ -4972,6 +5012,15 @@ }); } } + /** + * @summary Handles keyboard events + * @private + */ + ; + + _proto.__onKeyUp = function __onKeyUp() { + this.state.ctrlKeyDown = false; + } /** * @summary Handles mouse down events * @param {MouseEvent} evt @@ -5131,7 +5180,7 @@ _this3.psv.overlay.show({ id: IDS.TWO_FINGERS, image: gestureIcon, - text: _this3.config.lang.twoFingers[0] + text: _this3.config.lang.twoFingers }); }, TWOFINGERSOVERLAY_DELAY); } @@ -5176,16 +5225,31 @@ } /** * @summary Handles mouse wheel events - * @param {MouseWheelEvent} evt + * @param {WheelEvent} evt * @private */ ; _proto.__onMouseWheel = function __onMouseWheel(evt) { + var _this4 = this; + if (!this.config.mousewheel) { return; } + if (this.config.mousewheelCtrlKey && !this.state.ctrlKeyDown) { + this.psv.overlay.show({ + id: IDS.CTRL_ZOOM, + image: mousewheelIcon, + text: this.config.lang.ctrlZoom + }); + clearTimeout(this.state.ctrlZoomTimeout); + this.state.ctrlZoomTimeout = setTimeout(function () { + return _this4.psv.overlay.hide(IDS.CTRL_ZOOM); + }, CTRLZOOM_TIMEOUT); + return; + } + evt.preventDefault(); evt.stopPropagation(); var delta = normalizeWheel(evt).spinY * 5; @@ -5223,19 +5287,19 @@ ; _proto.__startMove = function __startMove(evt) { - var _this4 = this; + var _this5 = this; this.psv.stopAutorotate(); this.psv.stopAnimation().then(function () { - _this4.state.mouseX = evt.clientX; - _this4.state.mouseY = evt.clientY; - _this4.state.startMouseX = _this4.state.mouseX; - _this4.state.startMouseY = _this4.state.mouseY; - _this4.state.moving = true; - _this4.state.zooming = false; - _this4.state.mouseHistory.length = 0; - - _this4.__logMouseMove(evt); + _this5.state.mouseX = evt.clientX; + _this5.state.mouseY = evt.clientY; + _this5.state.startMouseX = _this5.state.mouseX; + _this5.state.startMouseY = _this5.state.mouseY; + _this5.state.moving = true; + _this5.state.zooming = false; + _this5.state.mouseHistory.length = 0; + + _this5.__logMouseMove(evt); }); } /** @@ -5314,7 +5378,7 @@ ; _proto.__stopMoveInertia = function __stopMoveInertia(evt) { - var _this5 = this; + var _this6 = this; var direction = { x: evt.clientX - this.state.mouseHistory[0][1], @@ -5335,10 +5399,10 @@ duration: norm * INERTIA_WINDOW / 100, easing: 'outCirc', onTick: function onTick(properties) { - _this5.__move(properties, false); + _this6.__move(properties, false); } }).finally(function () { - _this5.state.moving = false; + _this6.state.moving = false; }); } /** @@ -5352,7 +5416,7 @@ ; _proto.__click = function __click(evt, longtouch) { - var _this6 = this; + var _this7 = this; if (longtouch === void 0) { longtouch = false; @@ -5391,8 +5455,8 @@ this.psv.trigger(EVENTS.CLICK, data); this.state.dblclickData = clone(data); this.state.dblclickTimeout = setTimeout(function () { - _this6.state.dblclickTimeout = null; - _this6.state.dblclickData = null; + _this7.state.dblclickTimeout = null; + _this7.state.dblclickData = null; }, DBLCLICK_DELAY); } else { if (Math.abs(this.state.dblclickData.clientX - data.clientX) < MOVE_THRESHOLD && Math.abs(this.state.dblclickData.clientY - data.clientY) < MOVE_THRESHOLD) { @@ -5950,7 +6014,7 @@ } } - if (item.dispose) { + if (item.dispose && !(item instanceof THREE.Scene)) { item.dispose(); } @@ -6436,7 +6500,7 @@ * @property {*} data */ - _this.prop = _extends({}, _this.prop, {}, size, { + _this.prop = _extends({}, _this.prop, size, { state: STATE.NONE, width: 0, height: 0, diff --git a/dist/photo-sphere-viewer.js.map b/dist/photo-sphere-viewer.js.map index 775fcba9d..d33a67fb1 100644 --- a/dist/photo-sphere-viewer.js.map +++ b/dist/photo-sphere-viewer.js.map @@ -1 +1 @@ -{"version":3,"file":"photo-sphere-viewer.js","sources":["../src/data/constants.js","../src/utils/browser.js","../src/utils/math.js","../src/utils/misc.js","../src/PSVError.js","../src/utils/psv.js","../src/utils/index.js","../src/Animation.js","../src/components/AbstractComponent.js","../src/buttons/AbstractButton.js","../src/buttons/AutorotateButton.js","../src/buttons/CustomButton.js","../src/buttons/DownloadButton.js","../src/buttons/FullscreenButton.js","../src/templates/menu.js","../src/buttons/MenuButton.js","../src/data/system.js","../src/buttons/AbstractZoomButton.js","../src/buttons/ZoomInButton.js","../src/buttons/ZoomOutButton.js","../src/buttons/ZoomRangeButton.js","../src/data/config.js","../src/buttons/CaptionButton.js","../src/components/NavbarCaption.js","../src/components/Navbar.js","../src/plugins/AbstractPlugin.js","../src/components/Loader.js","../src/components/Notification.js","../src/components/Overlay.js","../src/components/Panel.js","../src/services/AbstractService.js","../src/services/DataHelper.js","../src/services/EventsHandler.js","../src/services/Renderer.js","../src/services/TextureLoader.js","../src/components/Tooltip.js","../src/services/TooltipRenderer.js","../src/Viewer.js"],"sourcesContent":["/**\n * @namespace PSV.constants\n */\n\n/**\n * @summary Number of pixels bellow which a mouse move will be considered as a click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const MOVE_THRESHOLD = 4;\n\n/**\n * @summary Delay in milliseconds between two clicks to consider a double click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DBLCLICK_DELAY = 300;\n\n/**\n * @summary Delay in milliseconds to emulate a long touch\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const LONGTOUCH_DELAY = 500;\n\n/**\n * @summary Delay in milliseconds to for the two fingers overlay to appear\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const TWOFINGERSOVERLAY_DELAY = 100;\n\n/**\n * @summary Time size of the mouse position history used to compute inertia\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const INERTIA_WINDOW = 300;\n\n/**\n * @summary Radius of the THREE.SphereGeometry, Half-length of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_RADIUS = 100;\n\n/**\n * @summary Number of vertice of the THREE.SphereGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_VERTICES = 64;\n\n/**\n * @summary Number of vertices of each side of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const CUBE_VERTICES = 8;\n\n/**\n * @summary Order of cube textures for arrays\n * @memberOf PSV.constants\n * @type {number[]}\n * @constant\n */\nexport const CUBE_MAP = [0, 2, 4, 5, 3, 1];\n\n/**\n * @summary Order of cube textures for maps\n * @memberOf PSV.constants\n * @type {string[]}\n * @constant\n */\nexport const CUBE_HASHMAP = ['left', 'right', 'top', 'bottom', 'back', 'front'];\n\n/**\n * @summary Property name added to buttons list\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const BUTTON_DATA = 'psvButton';\n\n/**\n * @summary Property name added to viewer element\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const VIEWER_DATA = 'photoSphereViewer';\n\n/**\n * @summary Available actions\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const ACTIONS = {\n ROTATE_LAT_UP : 'rotateLatitudeUp',\n ROTATE_LAT_DOWN : 'rotateLatitudeDown',\n ROTATE_LONG_RIGHT: 'rotateLongitudeRight',\n ROTATE_LONG_LEFT : 'rotateLongitudeLeft',\n ZOOM_IN : 'zoomIn',\n ZOOM_OUT : 'zoomOut',\n TOGGLE_AUTOROTATE: 'toggleAutorotate',\n};\n\n/**\n * @summary Available events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event autorotate\n * @memberof PSV\n * @summary Triggered when the automatic rotation is enabled/disabled\n * @param {boolean} enabled\n */\n AUTOROTATE : 'autorotate',\n /**\n * @event before-render\n * @memberof PSV\n * @summary Triggered before a render, used to modify the view\n * @param {number} timestamp - time provided by requestAnimationFrame\n */\n BEFORE_RENDER : 'before-render',\n /**\n * @event before-rotate\n * @memberOf PSV\n * @summary Triggered before a rotate operation, can be cancelled\n * @param {PSV.ExtendedPosition}\n */\n BEFORE_ROTATE : 'before-rotate',\n /**\n * @event click\n * @memberof PSV\n * @summary Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)\n * @param {PSV.ClickData} data\n */\n CLICK : 'click',\n /**\n * @event close-panel\n * @memberof PSV\n * @summary Trigered when the panel is closed\n * @param {string} [id]\n */\n CLOSE_PANEL : 'close-panel',\n /**\n * @event config-changed\n * @memberOf PSV\n * @summary Triggered after a call to setOption/setOptions\n * @param {string[]} name of changed options\n */\n CONFIG_CHANGED : 'config-changed',\n /**\n * @event dblclick\n * @memberof PSV\n * @summary Triggered when the user double clicks on the viewer. The simple `click` event is always fired before `dblclick`\n * @param {PSV.ClickData} data\n */\n DOUBLE_CLICK : 'dblclick',\n /**\n * @event fullscreen-updated\n * @memberof PSV\n * @summary Triggered when the fullscreen mode is enabled/disabled\n * @param {boolean} enabled\n */\n FULLSCREEN_UPDATED: 'fullscreen-updated',\n /**\n * @event hide-notification\n * @memberof PSV\n * @summary Trigered when the notification is hidden\n */\n HIDE_NOTIFICATION : 'hide-notification',\n /**\n * @event hide-overlay\n * @memberof PSV\n * @summary Trigered when the overlay is hidden\n * @param {string} [id]\n */\n HIDE_OVERLAY : 'hide-overlay',\n /**\n * @event hide-tooltip\n * @memberof PSV\n * @summary Trigered when the tooltip is hidden\n * @param {*} Data associated to this tooltip\n */\n HIDE_TOOLTIP : 'hide-tooltip',\n /**\n * @event open-panel\n * @memberof PSV\n * @summary Triggered when the panel is opened\n * @param {string} [id]\n */\n OPEN_PANEL : 'open-panel',\n /**\n * @event panorama-loaded\n * @memberof PSV\n * @summary Triggered when a panorama image has been loaded\n */\n PANORAMA_LOADED : 'panorama-loaded',\n /**\n * @event position-updated\n * @memberof PSV\n * @summary Triggered when the view longitude and/or latitude changes\n * @param {PSV.Position} position\n */\n POSITION_UPDATED : 'position-updated',\n /**\n * @event ready\n * @memberof PSV\n * @summary Triggered when the panorama image has been loaded and the viewer is ready to perform the first render\n */\n READY : 'ready',\n /**\n * @event render\n * @memberof PSV\n * @summary Triggered on each viewer render, **this event is triggered very often**\n */\n RENDER : 'render',\n /**\n * @event show-notification\n * @memberof PSV\n * @summary Trigered when the notification is shown\n */\n SHOW_NOTIFICATION : 'show-notification',\n /**\n * @event show-overlay\n * @memberof PSV\n * @summary Trigered when the overlay is shown\n * @param {string} [id]\n */\n SHOW_OVERLAY : 'show-overlay',\n /**\n * @event show-tooltip\n * @memberof PSV\n * @summary Trigered when the tooltip is shown\n * @param {*} Data associated to this tooltip\n * @param {PSV.components.Tooltip} Instance of the tooltip\n */\n SHOW_TOOLTIP : 'show-tooltip',\n /**\n * @event size-updated\n * @memberof PSV\n * @summary Triggered when the viewer size changes\n * @param {PSV.Size} size\n */\n SIZE_UPDATED : 'size-updated',\n /**\n * @event stop-all\n * @memberof PSV\n * @summary Triggered when all current animations are stopped\n */\n STOP_ALL : 'stop-all',\n /**\n * @event zoom-updated\n * @memberof PSV\n * @summary Triggered when the zoom level changes\n * @param {number} zoomLevel\n */\n ZOOM_UPDATED : 'zoom-updated',\n};\n\n/**\n * @summary Available change events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const CHANGE_EVENTS = {\n /**\n * @event get-animate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of an animation\n */\n GET_ANIMATE_POSITION: 'get-animate-position',\n /**\n * @event get-rotate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of a rotation\n */\n GET_ROTATE_POSITION : 'get-rotate-position',\n};\n\n/**\n * @summary Internal identifiers for various stuff\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const IDS = {\n MENU : 'menu',\n TWO_FINGERS: 'twoFingers',\n ERROR : 'error',\n};\n\n/* eslint-disable */\n// @formatter:off\n/**\n * @summary Collection of easing functions\n * @memberOf PSV.constants\n * @see {@link https://gist.github.com/frederickk/6165768}\n * @type {Object}\n * @constant\n */\nexport const EASINGS = {\n linear : (t) => t,\n\n inQuad : (t) => t*t,\n outQuad : (t) => t*(2-t),\n inOutQuad : (t) => t<.5 ? 2*t*t : -1+(4-2*t)*t,\n\n inCubic : (t) => t*t*t,\n outCubic : (t) => (--t)*t*t+1,\n inOutCubic: (t) => t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1,\n\n inQuart : (t) => t*t*t*t,\n outQuart : (t) => 1-(--t)*t*t*t,\n inOutQuart: (t) => t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t,\n\n inQuint : (t) => t*t*t*t*t,\n outQuint : (t) => 1+(--t)*t*t*t*t,\n inOutQuint: (t) => t<.5 ? 16*t*t*t*t*t : 1+16*(--t)*t*t*t*t,\n\n inSine : (t) => 1-Math.cos(t*(Math.PI/2)),\n outSine : (t) => Math.sin(t*(Math.PI/2)),\n inOutSine : (t) => .5-.5*Math.cos(Math.PI*t),\n\n inExpo : (t) => Math.pow(2, 10*(t-1)),\n outExpo : (t) => 1-Math.pow(2, -10*t),\n inOutExpo : (t) => (t=t*2-1)<0 ? .5*Math.pow(2, 10*t) : 1-.5*Math.pow(2, -10*t),\n\n inCirc : (t) => 1-Math.sqrt(1-t*t),\n outCirc : (t) => Math.sqrt(1-(t-1)*(t-1)),\n inOutCirc : (t) => (t*=2)<1 ? .5-.5*Math.sqrt(1-t*t) : .5+.5*Math.sqrt(1-(t-=2)*t)\n};\n// @formatter:on\n/* eslint-enable */\n","/**\n * @summary Toggles a CSS class\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} element\n * @param {string} className\n * @param {boolean} [active] - forced state\n */\nexport function toggleClass(element, className, active) {\n // manual implementation for IE11 and SVGElement\n if (!element.classList) {\n let currentClassName = element.getAttribute('class') || '';\n const currentActive = currentClassName.indexOf(className) !== -1;\n const regex = new RegExp('(?:^|\\\\s)' + className + '(?:\\\\s|$)');\n\n if ((active === undefined || active) && !currentActive) {\n currentClassName += currentClassName.length > 0 ? ' ' + className : className;\n }\n else if (!active) {\n currentClassName = currentClassName.replace(regex, ' ');\n }\n\n element.setAttribute('class', currentClassName);\n }\n else if (active === undefined) {\n element.classList.toggle(className);\n }\n else if (active && !element.classList.contains(className)) {\n element.classList.add(className);\n }\n else if (!active) {\n element.classList.remove(className);\n }\n}\n\n/**\n * @summary Adds one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function addClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, true);\n });\n }\n}\n\n/**\n * @summary Removes one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function removeClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, false);\n });\n }\n}\n\n/**\n * @summary Searches if an element has a particular parent at any level including itself\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @returns {boolean}\n */\nexport function hasParent(el, parent) {\n let test = el;\n\n do {\n if (test === parent) {\n return true;\n }\n test = test.parentNode;\n } while (test);\n\n return false;\n}\n\n/**\n * @summary Gets the closest parent (can by itself)\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} el\n * @param {string} selector\n * @returns {HTMLElement}\n */\nexport function getClosest(el, selector) {\n const matches = el.matches || el.msMatchesSelector;\n let test = el;\n // When el is document or window, the matches does not exist\n if (!matches) {\n return null;\n }\n\n do {\n if (matches.bind(test)(selector)) {\n return test;\n }\n test = test instanceof SVGElement ? test.parentNode : test.parentElement;\n } while (test);\n\n return null;\n}\n\n/**\n * @summary Map between keyboard events `keyCode|which` and `key`\n * @memberOf PSV.utils\n * @type {Object}\n * @readonly\n * @private\n */\nconst KEYMAP = {\n 13 : 'Enter',\n 27 : 'Escape',\n 32 : ' ',\n 33 : 'PageUp',\n 34 : 'PageDown',\n 37 : 'ArrowLeft',\n 38 : 'ArrowUp',\n 39 : 'ArrowRight',\n 40 : 'ArrowDown',\n 46 : 'Delete',\n 107: '+',\n 109: '-',\n};\n\n/**\n * @summary Map for non standard keyboard events `key` for IE and Edge\n * @see https://github.com/shvaikalesh/shim-keyboard-event-key\n * @type {Object}\n * @readonly\n * @private\n */\nconst MS_KEYMAP = {\n Add : '+',\n Del : 'Delete',\n Down : 'ArrowDown',\n Esc : 'Escape',\n Left : 'ArrowLeft',\n Right : 'ArrowRight',\n Spacebar: ' ',\n Subtract: '-',\n Up : 'ArrowUp',\n};\n\n/**\n * @summary Returns the key name of a KeyboardEvent\n * @memberOf PSV.utils\n * @param {KeyboardEvent} evt\n * @returns {string}\n */\nexport function getEventKey(evt) {\n let key = evt.key || KEYMAP[evt.keyCode || evt.which];\n\n if (key && MS_KEYMAP[key]) {\n key = MS_KEYMAP[key];\n }\n\n return key;\n}\n\n/**\n * @summary Detects if fullscreen is enabled\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @returns {boolean}\n */\nexport function isFullscreenEnabled(elt) {\n /* eslint-disable-next-line max-len */\n return (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) === elt;\n}\n\n/**\n * @summary Enters fullscreen mode\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n */\nexport function requestFullscreen(elt) {\n /* eslint-disable-next-line max-len */\n (elt.requestFullscreen || elt.mozRequestFullScreen || elt.webkitRequestFullscreen || elt.msRequestFullscreen).call(elt);\n}\n\n/**\n * @summary Exits fullscreen mode\n * @memberOf PSV.utils\n */\nexport function exitFullscreen() {\n /* eslint-disable-next-line max-len */\n (document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen).call(document);\n}\n\n/**\n * @summary Gets an element style\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @param {string} prop\n * @returns {*}\n */\nexport function getStyle(elt, prop) {\n return window.getComputedStyle(elt, null)[prop];\n}\n\n/**\n * @summary Normalize mousewheel values accross browsers\n * @memberOf PSV.utils\n * @description From Facebook's Fixed Data Table\n * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js}\n * @copyright Facebook\n * @param {MouseWheelEvent} event\n * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}}\n */\nexport function normalizeWheel(event) {\n const PIXEL_STEP = 10;\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n\n let spinX = 0;\n let spinY = 0;\n let pixelX = 0;\n let pixelY = 0;\n\n // Legacy\n if ('detail' in event) {\n spinY = event.detail;\n }\n if ('wheelDelta' in event) {\n spinY = -event.wheelDelta / 120;\n }\n if ('wheelDeltaY' in event) {\n spinY = -event.wheelDeltaY / 120;\n }\n if ('wheelDeltaX' in event) {\n spinX = -event.wheelDeltaX / 120;\n }\n\n // side scrolling on FF with DOMMouseScroll\n if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n spinX = spinY;\n spinY = 0;\n }\n\n pixelX = spinX * PIXEL_STEP;\n pixelY = spinY * PIXEL_STEP;\n\n if ('deltaY' in event) {\n pixelY = event.deltaY;\n }\n if ('deltaX' in event) {\n pixelX = event.deltaX;\n }\n\n if ((pixelX || pixelY) && event.deltaMode) {\n // delta in LINE units\n if (event.deltaMode === 1) {\n pixelX *= LINE_HEIGHT;\n pixelY *= LINE_HEIGHT;\n }\n // delta in PAGE units\n else {\n pixelX *= PAGE_HEIGHT;\n pixelY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pixelX && !spinX) {\n spinX = (pixelX < 1) ? -1 : 1;\n }\n if (pixelY && !spinY) {\n spinY = (pixelY < 1) ? -1 : 1;\n }\n\n return { spinX, spinY, pixelX, pixelY };\n}\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * Returns the distance between two points on a sphere of radius one\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Transforms a string to dash-case{@link https://github.com/shahata/dasherize}\n * @memberOf PSV.utils\n * @param {string} str\n * @returns {string}\n */\nexport function dasherize(str) {\n return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {\n return (i > 0 ? '-' : '') + s.toLowerCase();\n });\n}\n\n/**\n * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n * @memberOf PSV.utils\n * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401}\n * @param {Function} func\n * @param {number} wait\n * @returns {Function}\n */\nexport function throttle(func, wait) {\n /* eslint-disable */\n let self, args, result;\n let timeout;\n let previous = 0;\n const later = function() {\n previous = Date.now();\n timeout = undefined;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n };\n return function() {\n const now = Date.now();\n if (!previous) {\n previous = now;\n }\n const remaining = wait - (now - previous);\n self = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n previous = now;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n }\n else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n /* eslint-enable */\n}\n\n/**\n * @summary Test if an object is a plain object\n * @memberOf PSV.utils\n * @description Test if an object is a plain object, i.e. is constructed\n * by the built-in Object constructor and inherits directly from Object.prototype\n * or null. Some built-in objects pass the test, e.g. Math which is a plain object\n * and some host or exotic objects may pass also.\n * {@link http://stackoverflow.com/a/5878101/1207670}\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isPlainObject(obj) {\n // Basic check for Type object that's not null\n if (typeof obj === 'object' && obj !== null) {\n // If Object.getPrototypeOf supported, use it\n if (typeof Object.getPrototypeOf === 'function') {\n const proto = Object.getPrototypeOf(obj);\n return proto === Object.prototype || proto === null;\n }\n\n // Otherwise, use internal class\n // This should be reliable as if getPrototypeOf not supported, is pre-ES5\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n // Not an object\n return false;\n}\n\n/**\n * @summary Merges the enumerable attributes of two objects\n * @memberOf PSV.utils\n * @description Replaces arrays and alters the target object.\n * @copyright Nicholas Fisher \n * @param {Object} target\n * @param {Object} src\n * @returns {Object} target\n */\nexport function deepmerge(target, src) {\n /* eslint-disable */\n let first = src;\n\n return (function merge(target, src) {\n if (Array.isArray(src)) {\n if (!target || !Array.isArray(target)) {\n target = [];\n }\n else {\n target.length = 0;\n }\n src.forEach(function(e, i) {\n target[i] = merge(null, e);\n });\n }\n else if (typeof src === 'object') {\n if (!target || Array.isArray(target)) {\n target = {};\n }\n Object.keys(src).forEach(function(key) {\n if (typeof src[key] !== 'object' || !src[key] || !isPlainObject(src[key])) {\n target[key] = src[key];\n }\n else if (src[key] != first) {\n if (!target[key]) {\n target[key] = merge(null, src[key]);\n }\n else {\n merge(target[key], src[key]);\n }\n }\n });\n }\n else {\n target = src;\n }\n\n return target;\n }(target, src));\n /* eslint-enable */\n}\n\n/**\n * @summary Deeply clones an object\n * @memberOf PSV.utils\n * @param {Object} src\n * @returns {Object}\n */\nexport function clone(src) {\n return deepmerge(null, src);\n}\n\n/**\n * @summery Test of an object is empty\n * @memberOf PSV.utils\n * @param {object} obj\n * @returns {boolean}\n */\nexport function isEmpty(obj) {\n return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);\n}\n\n/**\n * @summary Loops over enumerable properties of an object\n * @memberOf PSV.utils\n * @param {Object} object\n * @param {Function} callback\n */\nexport function each(object, callback) {\n Object.keys(object).forEach((key) => {\n callback(object[key], key);\n });\n}\n\n/**\n * @summary Returns the intersection between two arrays\n * @memberOf PSV.utils\n * @template T\n * @param {T[]} array1\n * @param {T[]} array2\n * @returns {T[]}\n */\nexport function intersect(array1, array2) {\n return array1.filter(value => array2.indexOf(value) !== -1);\n}\n","/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound } from './math';\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (string)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n return result[1];\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n return result[1];\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|object} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.Math.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.Math.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !Number.isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = (zeroCenter ? parsed + Math.PI : parsed) % (Math.PI * 2);\n\n if (parsed < 0) {\n parsed += Math.PI * 2;\n }\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n","/**\n * @namespace PSV.utils\n */\n\nexport * from './browser.js';\nexport * from './math.js';\nexport * from './misc.js';\nexport * from './psv.js';\n","import { EASINGS } from './data/constants';\nimport { each } from './utils';\n\n/**\n * @callback OnTick\n * @summary Function called for each animation frame with computed properties\n * @memberOf PSV.Animation\n * @param {Object.} properties - current values\n * @param {float} progress - 0 to 1\n */\n\n/**\n * @summary Interpolation helper for animations\n * @memberOf PSV\n * @description\n * Implements the Promise API with an additional \"cancel\" and \"finally\" methods.\n * The promise is resolved when the animation is complete and rejected if the animation is cancelled.\n * @example\n * new Animation({\n * properties: {\n * width: {start: 100, end: 200}\n * },\n * duration: 5000,\n * onTick: (properties) => element.style.width = `${properties.width}px`;\n * })\n */\nexport class Animation {\n\n /**\n * @param {Object} options\n * @param {Object.} options.properties\n * @param {number} options.properties[].start\n * @param {number} options.properties[].end\n * @param {number} options.duration\n * @param {number} [options.delay=0]\n * @param {string} [options.easing='linear']\n * @param {PSV.Animation.OnTick} options.onTick - called on each frame\n */\n constructor(options) {\n this.__cancelled = false;\n this.__resolved = false;\n\n this.__promise = new Promise((resolve, reject) => {\n this.__resolve = resolve;\n this.__reject = reject;\n });\n\n if (options) {\n if (!options.easing || typeof options.easing === 'string') {\n options.easing = EASINGS[options.easing || 'linear'];\n }\n this.__start = null;\n this.options = options;\n\n if (options.delay) {\n this.__delayTimeout = setTimeout(() => {\n this.__delayTimeout = null;\n window.requestAnimationFrame(t => this.__run(t));\n }, options.delay);\n }\n else {\n window.requestAnimationFrame(t => this.__run(t));\n }\n }\n }\n\n /**\n * @summary Main loop for the animation\n * @param {number} timestamp\n * @private\n */\n __run(timestamp) {\n // the animation has been cancelled\n if (this.__cancelled) {\n return;\n }\n\n // first iteration\n if (this.__start === null) {\n this.__start = timestamp;\n }\n\n // compute progress\n const progress = (timestamp - this.__start) / this.options.duration;\n const current = {};\n\n if (progress < 1.0) {\n // interpolate properties\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.start + (prop.end - prop.start) * this.options.easing(progress);\n }\n });\n\n this.options.onTick(current, progress);\n\n window.requestAnimationFrame(t => this.__run(t));\n }\n else {\n // call onTick one last time with final values\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.end;\n }\n });\n\n this.options.onTick(current, 1.0);\n\n window.requestAnimationFrame(() => {\n this.__resolved = true;\n this.__resolve();\n });\n }\n }\n\n /**\n * @summary Animation chaining\n * @param {Function} [onFulfilled] - Called when the animation is complete, can return a new animation\n * @param {Function} [onRejected] - Called when the animation is cancelled\n * @returns {PSV.Animation}\n */\n then(onFulfilled = null, onRejected = null) {\n const p = new Animation();\n\n // Allow cancellation to climb up the promise chain\n p.__promise.then(null, () => this.cancel());\n\n this.__promise.then(\n () => p.__resolve(onFulfilled ? onFulfilled() : undefined),\n () => p.__reject(onRejected ? onRejected() : undefined)\n );\n\n return p;\n }\n\n /**\n * @summary Alias to `.then(null, onRejected)`\n * @param {Function} onRejected - Called when the animation has been cancelled\n * @returns {PSV.Animation}\n */\n catch(onRejected) {\n return this.then(undefined, onRejected);\n }\n\n /**\n * @summary Alias to `.then(onFinally, onFinally)`\n * @param {Function} onFinally - Called when the animation is either complete or cancelled\n * @returns {PSV.Animation}\n */\n finally(onFinally) {\n return this.then(onFinally, onFinally);\n }\n\n /**\n * @summary Cancels the animation\n */\n cancel() {\n if (!this.__cancelled && !this.__resolved) {\n this.__cancelled = true;\n this.__reject();\n\n if (this.__delayTimeout) {\n window.cancelAnimationFrame(this.__delayTimeout);\n this.__delayTimeout = null;\n }\n }\n }\n\n /**\n * @summary Returns a resolved animation promise\n * @returns {PSV.Animation}\n */\n static resolve() {\n const p = Promise.resolve();\n p.cancel = () => {\n };\n p.finally = (onFinally) => {\n return p.then(onFinally, onFinally);\n };\n return p;\n }\n\n}\n","/**\n * @namespace PSV.components\n */\n\n/**\n * @summary Base component class\n * @memberof PSV.components\n * @abstract\n */\nexport class AbstractComponent {\n\n /**\n * @param {PSV.Viewer | PSV.components.AbstractComponent} parent\n * @param {string} className - CSS class added to the component's container\n */\n constructor(parent, className) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = parent.psv || parent;\n\n /**\n * @member {PSV.Viewer|PSV.components.AbstractComponent}\n * @readonly\n */\n this.parent = parent;\n this.parent.children.push(this);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} visible - Visibility of the component\n */\n this.prop = {\n visible: true,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = className;\n this.parent.container.appendChild(this.container);\n }\n\n /**\n * @summary Destroys the component\n * @protected\n */\n destroy() {\n this.parent.container.removeChild(this.container);\n\n const childIdx = this.parent.children.indexOf(this);\n if (childIdx !== -1) {\n this.parent.children.splice(childIdx, 1);\n }\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n delete this.container;\n delete this.parent;\n delete this.psv;\n delete this.prop;\n }\n\n /**\n * @summary Refresh UI\n * @description Must be be a very lightweight operation\n * @package\n */\n refreshUi() {\n this.children.every((child) => {\n child.refreshUi();\n return this.psv.prop.uiRefresh === true;\n });\n }\n\n /**\n * @summary Displays or hides the component\n */\n toggle() {\n if (this.isVisible()) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n\n /**\n * @summary Hides the component\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Displays the component\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Check if the component is visible\n * @returns {boolean}\n */\n isVisible() {\n return this.prop.visible;\n }\n\n}\n","import { AbstractComponent } from '../components/AbstractComponent';\nimport { PSVError } from '../PSVError';\nimport { isPlainObject, toggleClass } from '../utils';\n\n/**\n * @namespace PSV.buttons\n */\n\n/**\n * @summary Base navbar button class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.buttons\n * @abstract\n */\nexport class AbstractButton extends AbstractComponent {\n\n /**\n * @summary Unique identifier of the button\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary SVG icon name injected in the button\n * @member {string}\n * @readonly\n * @static\n */\n static icon = null;\n\n /**\n * @summary SVG icon name injected in the button when it is active\n * @member {string}\n * @readonly\n * @static\n */\n static iconActive = null;\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} [className] - Additional CSS classes\n * @param {boolean} [collapsable=false] - `true` if the button can be moved to menu when the navbar is too small\n */\n constructor(navbar, className = '', collapsable = false) {\n super(navbar, 'psv-button ' + className);\n\n /**\n * @override\n * @property {string} id - Unique identifier of the button\n * @property {boolean} enabled\n * @property {boolean} supported\n * @property {boolean} collapsed\n * @property {boolean} active\n * @property {number} width\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable: collapsable,\n enabled : true,\n supported : true,\n collapsed : false,\n active : false,\n width : this.container.offsetWidth,\n };\n\n if (this.constructor.icon) {\n this.__setIcon(this.constructor.icon);\n }\n\n if (this.prop.id && this.psv.config.lang[this.prop.id]) {\n this.container.title = this.psv.config.lang[this.prop.id];\n }\n\n this.container.addEventListener('click', (e) => {\n if (this.prop.enabled) {\n this.onClick();\n }\n e.stopPropagation();\n });\n }\n\n /**\n * @package\n */\n checkSupported() {\n const supportedOrObject = this.isSupported();\n if (isPlainObject(supportedOrObject)) {\n if (supportedOrObject.initial === false) {\n this.hide();\n this.prop.supported = false;\n }\n\n supportedOrObject.promise.then((supported) => {\n if (!this.prop) {\n return; // the component has been destroyed\n }\n this.prop.supported = supported;\n if (!supported && this.prop.visible) {\n this.hide();\n }\n else if (supported && !this.prop.visible) {\n this.show();\n }\n });\n }\n else if (!supportedOrObject) {\n this.hide();\n this.prop.supported = false;\n }\n }\n\n /**\n * @summary Checks if the button can be displayed\n * @returns {boolean|{initial: boolean, promise: Promise}}\n */\n isSupported() {\n return true;\n }\n\n /**\n * @summary Changes the active state of the button\n * @param {boolean} [active] - forced state\n */\n toggleActive(active) {\n this.prop.active = active !== undefined ? active : !this.prop.active;\n toggleClass(this.container, 'psv-button--active', this.prop.active);\n\n if (this.constructor.iconActive) {\n this.__setIcon(this.prop.active ? this.constructor.iconActive : this.constructor.icon);\n }\n }\n\n /**\n * @override\n */\n show(refresh = true) {\n if (!this.isVisible()) {\n this.prop.visible = true;\n if (!this.prop.collapsed) {\n this.container.style.display = '';\n }\n if (refresh) {\n this.psv.refreshUi(`show button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @override\n */\n hide(refresh = true) {\n if (this.isVisible()) {\n this.prop.visible = false;\n this.container.style.display = 'none';\n if (refresh) {\n this.psv.refreshUi(`hide button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @summary Disables the button\n */\n disable() {\n this.container.classList.add('psv-button--disabled');\n this.prop.enabled = false;\n }\n\n /**\n * @summary Enables the button\n */\n enable() {\n this.container.classList.remove('psv-button--disabled');\n this.prop.enabled = true;\n }\n\n /**\n * @summary Collapses the button in the navbar menu\n */\n collapse() {\n this.prop.collapsed = true;\n this.container.style.display = 'none';\n }\n\n /**\n * @summary Uncollapses the button from the navbar menu\n */\n uncollapse() {\n this.prop.collapsed = false;\n if (this.prop.visible) {\n this.container.style.display = '';\n }\n }\n\n /**\n * @summary Set the button icon\n * @param {string} icon SVG\n * @param {HTMLElement} [container] - default is the main button container\n * @private\n */\n __setIcon(icon, container = this.container) {\n if (icon) {\n container.innerHTML = icon;\n // classList not supported on IE11, className is read-only !!!!\n container.querySelector('svg').setAttribute('class', 'psv-button-svg');\n }\n else {\n container.innerHTML = '';\n }\n }\n\n /**\n * @summary Action when the button is clicked\n * @private\n * @abstract\n */\n onClick() {\n throw new PSVError(`onClick not implemented for button \"${this.prop.id}\".`);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport playActive from '../icons/play-active.svg';\nimport play from '../icons/play.svg';\nimport { AbstractButton } from './AbstractButton';\n\nimport '../styles/buttons/autorotate.scss';\n\n/**\n * @summary Navigation bar autorotate button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AutorotateButton extends AbstractButton {\n\n static id = 'autorotate';\n static icon = play;\n static iconActive = playActive;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-autorotate-button', true);\n\n this.psv.on(EVENTS.AUTOROTATE, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.AUTOROTATE, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.AUTOROTATE: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles autorotate\n */\n onClick() {\n this.psv.toggleAutorotate();\n }\n\n}\n","import { addClasses } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar custom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CustomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {PSV.NavbarCustomButton} config\n */\n constructor(navbar, config) {\n super(navbar, 'psv-custom-button', config.collapsable !== false);\n\n /**\n * @member {Object}\n * @readonly\n * @private\n */\n this.config = config;\n\n if (this.config.id) {\n this.prop.id = this.config.id;\n }\n else {\n this.prop.id = 'psvButton-' + Math.random().toString(36).substr(2, 9);\n }\n\n if (this.config.className) {\n addClasses(this.container, this.config.className);\n }\n\n if (this.config.title) {\n this.container.title = this.config.title;\n }\n\n if (this.config.content) {\n this.container.innerHTML = this.config.content;\n }\n\n this.width = this.container.offsetWidth;\n\n if (this.config.enabled === false) {\n this.disable();\n }\n\n if (this.config.visible === false) {\n this.hide();\n }\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.config;\n\n super.destroy();\n }\n\n /**\n * @override\n * @description Calls user method\n */\n onClick() {\n if (this.config.onClick) {\n this.config.onClick.apply(this.psv);\n }\n }\n\n}\n","import { AbstractButton } from './AbstractButton';\nimport download from '../icons/download.svg';\n\n/**\n * @summary Navigation bar download button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DownloadButton extends AbstractButton {\n\n static id = 'download';\n static icon = download;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-download-button', true);\n }\n\n /**\n * @override\n * @description Asks the browser to download the panorama source file\n */\n onClick() {\n const link = document.createElement('a');\n link.href = this.psv.config.panorama;\n link.download = this.psv.config.panorama;\n this.psv.container.appendChild(link);\n link.click();\n\n setTimeout(() => {\n this.psv.container.removeChild(link);\n }, 100);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport fullscreenIn from '../icons/fullscreen-in.svg';\nimport fullscreenOut from '../icons/fullscreen-out.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar fullscreen button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class FullscreenButton extends AbstractButton {\n\n static id = 'fullscreen';\n static icon = fullscreenIn;\n static iconActive = fullscreenOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-fullscreen-button');\n\n this.psv.on(EVENTS.FULLSCREEN_UPDATED, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.FULLSCREEN_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * Handle events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.FULLSCREEN_UPDATED: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles fullscreen\n */\n onClick() {\n this.psv.toggleFullscreen();\n }\n\n}\n","import { BUTTON_DATA } from '../data/constants';\nimport { dasherize } from '../utils';\n\nconst HTML_BUTTON_DATA = 'data-' + dasherize(BUTTON_DATA);\n\n/**\n * @summary Menu template\n * @param {AbstractButton[]} buttons\n * @param {PSV.Viewer} psv\n * @returns {string}\n */\nexport default (buttons, psv) => `\n
\n

${psv.config.lang.menu}

\n
    \n ${buttons.map(button => `\n
  • \n ${button.container.innerHTML}\n

    ${button.container.title}

    \n
  • \n `).join('')}\n
\n
\n`;\n","import { BUTTON_DATA, EVENTS, IDS } from '../data/constants';\nimport menuIcon from '../icons/menu.svg';\nimport menuTemplate from '../templates/menu';\nimport { getClosest } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar menu button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MenuButton extends AbstractButton {\n\n static id = 'menu';\n static icon = menuIcon;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-menu-button');\n\n this.psv.on(EVENTS.OPEN_PANEL, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.OPEN_PANEL, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === IDS.MENU); break;\n case EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n this.__hideMenu();\n }\n\n /**\n * @override\n */\n show(refresh) {\n super.show(refresh);\n\n if (this.prop.active) {\n this.__showMenu();\n }\n }\n\n /**\n * @override\n * @description Toggles menu\n */\n onClick() {\n if (this.prop.active) {\n this.__hideMenu();\n }\n else {\n this.__showMenu();\n }\n }\n\n __showMenu() {\n this.psv.panel.show({\n id : IDS.MENU,\n content : menuTemplate(this.parent.collapsed, this.psv),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? getClosest(e.target, 'li') : undefined;\n const buttonId = li ? li.dataset[BUTTON_DATA] : undefined;\n\n if (buttonId) {\n this.parent.getButton(buttonId).onClick();\n this.__hideMenu();\n }\n },\n });\n }\n\n __hideMenu() {\n if (this.psv.panel) {\n this.psv.panel.hide(IDS.MENU);\n }\n }\n\n}\n","/**\n * @summary General information about the system\n * @constant\n * @memberOf PSV\n * @property {boolean} loaded - Indicates if the system has been loaded yet\n * @property {Function} load - Loads the system if not already loaded\n * @property {number} pixelRatio\n * @property {boolean} isWebGLSupported\n * @property {number} maxTextureWidth\n * @property {number} maxCanvasWidth\n * @property {string} mouseWheelEvent\n * @property {string} fullscreenEvent\n * @property {Promise} isTouchEnabled\n */\nexport const SYSTEM = {\n loaded : false,\n pixelRatio : 1,\n isWebGLSupported: false,\n isTouchEnabled : null,\n maxTextureWidth : 0,\n maxCanvasWidth : 0,\n mouseWheelEvent : null,\n fullscreenEvent : null,\n};\n\n/**\n * @summary Loads the system if not already loaded\n */\nSYSTEM.load = () => {\n if (!SYSTEM.loaded) {\n const ctx = getWebGLCtx();\n\n SYSTEM.loaded = true;\n SYSTEM.pixelRatio = window.devicePixelRatio || 1;\n SYSTEM.isWebGLSupported = ctx != null;\n SYSTEM.isTouchEnabled = isTouchEnabled();\n SYSTEM.maxTextureWidth = getMaxTextureWidth(ctx);\n SYSTEM.maxCanvasWidth = getMaxCanvasWidth(SYSTEM.maxTextureWidth);\n SYSTEM.mouseWheelEvent = getMouseWheelEvent();\n SYSTEM.fullscreenEvent = getFullscreenEvent();\n }\n};\n\n/**\n * @summary Tries to return a canvas webgl context\n * @returns {WebGLRenderingContext}\n * @private\n */\nfunction getWebGLCtx() {\n const canvas = document.createElement('canvas');\n const names = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'];\n let context = null;\n\n if (!canvas.getContext) {\n return null;\n }\n\n if (names.some((name) => {\n try {\n context = canvas.getContext(name);\n return context !== null;\n }\n catch (e) {\n return false;\n }\n })) {\n return context;\n }\n else {\n return null;\n }\n}\n\n/**\n * @summary Detects if the user is using a touch screen\n * @returns {Promise}\n * @private\n */\nfunction isTouchEnabled() {\n return new Promise((resolve) => {\n const listener = (e) => {\n if (e) {\n resolve(true);\n }\n else {\n resolve(false);\n }\n\n window.removeEventListener('touchstart', listener);\n };\n\n window.addEventListener('touchstart', listener, false);\n\n // after 10 secs auto-reject the promise\n setTimeout(listener, 10000);\n });\n}\n\n/**\n * @summary Gets max texture width in WebGL context\n * @returns {number}\n * @private\n */\nfunction getMaxTextureWidth(ctx) {\n if (ctx !== null) {\n return ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n }\n else {\n return 0;\n }\n}\n\n/**\n * @summary Gets max canvas width supported by the browser.\n * We only test powers of 2 and height = width / 2 because that's what we need to generate WebGL textures\n * @param maxWidth\n * @return {number}\n * @private\n */\nfunction getMaxCanvasWidth(maxWidth) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = maxWidth;\n canvas.height = maxWidth / 2;\n\n while (canvas.width > 1024) {\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, 1, 1);\n\n try {\n if (ctx.getImageData(0, 0, 1, 1).data[0] === 255) {\n return canvas.width;\n }\n }\n catch (e) {\n // continue\n }\n\n canvas.width /= 2;\n canvas.height /= 2;\n }\n\n return 0;\n}\n\n/**\n * @summary Gets the event name for mouse wheel\n * @returns {string}\n * @private\n */\nfunction getMouseWheelEvent() {\n if ('onwheel' in document.createElement('div')) { // Modern browsers support \"wheel\"\n return 'wheel';\n }\n else if (document.onmousewheel !== undefined) { // Webkit and IE support at least \"mousewheel\"\n return 'mousewheel';\n }\n else { // let's assume that remaining browsers are older Firefox\n return 'DOMMouseScroll';\n }\n}\n\n/**\n * @summary Map between fullsceen method and fullscreen event name\n * @type {Object}\n * @readonly\n * @private\n */\nconst FULLSCREEN_EVT_MAP = {\n exitFullscreen : 'fullscreenchange',\n webkitExitFullscreen: 'webkitfullscreenchange',\n mozCancelFullScreen : 'mozfullscreenchange',\n msExitFullscreen : 'MSFullscreenChange',\n};\n\n\n/**\n * @summary Gets the event name for fullscreen\n * @returns {string}\n * @private\n */\nfunction getFullscreenEvent() {\n const validExits = Object.keys(FULLSCREEN_EVT_MAP).filter(exit => exit in document);\n\n if (validExits.length) {\n return FULLSCREEN_EVT_MAP[validExits[0]];\n }\n else {\n return null;\n }\n}\n","import { Animation } from '../Animation';\nimport { SYSTEM } from '../data/system';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractZoomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-zoom-button', true);\n\n /**\n * @override\n * @property {number} value\n * @property {boolean} buttondown\n * @property {*} longPressTimeout\n * @property {PSV.Animation} longPressAnimation\n */\n this.prop = {\n ...this.prop,\n value : value,\n buttondown : false,\n longPressTimeout : null,\n longPressAnimation: null,\n };\n\n this.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return { initial: true, promise: SYSTEM.isTouchEnabled.then(enabled => !enabled) };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Handles click events\n * @description Zooms in and register long press timer\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.buttondown = true;\n this.prop.longPressTimeout = setTimeout(() => this.__startLongPressInterval(), 100);\n }\n\n /**\n * @summary Continues zooming as long as the user presses the button\n * @private\n */\n __startLongPressInterval() {\n if (!this.prop.buttondown) {\n return;\n }\n\n const end = this.prop.value < 0 ? 0 : 100;\n\n this.prop.longPressAnimation = new Animation({\n properties: {\n zoom: { start: this.psv.prop.zoomLvl, end: end },\n },\n duration : 1500 * Math.abs(this.psv.prop.zoomLvl - end) / 100,\n easing : 'linear',\n onTick : (properties) => {\n this.psv.zoom(properties.zoom);\n },\n })\n .catch(() => {}); // ignore cancellation\n }\n\n /**\n * @summary Handles mouse up events\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled || !this.prop.buttondown) {\n return;\n }\n\n if (this.prop.longPressAnimation) {\n this.prop.longPressAnimation.cancel();\n this.prop.longPressAnimation = null;\n }\n else {\n this.psv.zoom(this.psv.prop.zoomLvl + this.prop.value * this.psv.config.zoomButtonIncrement);\n }\n\n if (this.prop.longPressTimeout) {\n clearTimeout(this.prop.longPressTimeout);\n }\n\n this.prop.buttondown = false;\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomIn from '../icons/zoom-in.svg';\n\n/**\n * @summary Navigation bar zoom-in button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomInButton extends AbstractZoomButton {\n\n static id = 'zoomIn';\n static icon = zoomIn;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 1);\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomOut from '../icons/zoom-out.svg';\n\n/**\n * @summary Navigation bar zoom-out button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomOutButton extends AbstractZoomButton {\n\n static id = 'zoomOut';\n static icon = zoomOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, -1);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { getStyle } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\nimport '../styles/buttons/zoom-range.scss';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class ZoomRangeButton extends AbstractButton {\n\n static id = 'zoomRange';\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-zoom-range');\n\n /**\n * @override\n * @property {boolean} mousedown\n * @property {number} mediaMinWidth\n */\n this.prop = {\n ...this.prop,\n mousedown : false,\n mediaMinWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomRange = document.createElement('div');\n this.zoomRange.className = 'psv-zoom-range-line';\n this.container.appendChild(this.zoomRange);\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomValue = document.createElement('div');\n this.zoomValue.className = 'psv-zoom-range-handle';\n this.zoomRange.appendChild(this.zoomValue);\n\n this.prop.mediaMinWidth = parseInt(getStyle(this.container, 'maxWidth'), 10);\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n\n this.psv.on(EVENTS.ZOOM_UPDATED, this);\n\n if (this.psv.prop.ready) {\n this.__moveZoomValue(this.psv.prop.zoomLvl);\n }\n else {\n this.psv.once(EVENTS.READY, this);\n }\n\n this.refreshUi();\n }\n\n /**\n * @override\n */\n destroy() {\n this.__stopZoomChange();\n\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.zoomRange;\n delete this.zoomValue;\n\n this.psv.off(EVENTS.ZOOM_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__initZoomChangeWithMouse(e); break;\n case 'touchstart': this.__initZoomChangeByTouch(e); break;\n case 'mousemove': this.__changeZoomWithMouse(e); break;\n case 'touchmove': this.__changeZoomByTouch(e); break;\n case 'mouseup': this.__stopZoomChange(e); break;\n case 'touchend': this.__stopZoomChange(e); break;\n case EVENTS.ZOOM_UPDATED: this.__moveZoomValue(e.args[0]); break;\n case EVENTS.READY: this.__moveZoomValue(this.psv.prop.zoomLvl); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return { initial: true, promise: SYSTEM.isTouchEnabled.then(enabled => !enabled) };\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.supported) {\n if (this.psv.prop.size.width <= this.prop.mediaMinWidth && this.prop.visible) {\n this.hide();\n }\n else if (this.psv.prop.size.width > this.prop.mediaMinWidth && !this.prop.visible) {\n this.show();\n }\n }\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Moves the zoom cursor\n * @param {number} level\n * @private\n */\n __moveZoomValue(level) {\n this.zoomValue.style.left = (level / 100 * this.zoomRange.offsetWidth - this.zoomValue.offsetWidth / 2) + 'px';\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __initZoomChangeWithMouse(evt) {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = true;\n this.__changeZoom(evt.clientX);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __initZoomChangeByTouch(evt) {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = true;\n this.__changeZoom(evt.changedTouches[0].clientX);\n }\n\n /**\n * @summary Handles mouse up events\n * @private\n */\n __stopZoomChange() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = false;\n this.prop.buttondown = false;\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __changeZoomWithMouse(evt) {\n if (!this.prop.enabled || !this.prop.mousedown) {\n return;\n }\n\n evt.preventDefault();\n this.__changeZoom(evt.clientX);\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __changeZoomByTouch(evt) {\n if (!this.prop.enabled || !this.prop.mousedown) {\n return;\n }\n this.__changeZoom(evt.changedTouches[0].clientX);\n }\n\n /**\n * @summary Zoom change\n * @param {number} x - mouse/touch position\n * @private\n */\n __changeZoom(x) {\n const userInput = x - this.zoomRange.getBoundingClientRect().left;\n const zoomLevel = userInput / this.zoomRange.offsetWidth * 100;\n this.psv.zoom(zoomLevel);\n }\n\n}\n","import { PSVError } from '../PSVError';\nimport { bound, clone, deepmerge, each, logWarn, parseAngle, parseSpeed } from '../utils';\nimport { ACTIONS } from './constants';\n\n/**\n * @summary Default options\n * @type {PSV.Options}\n * @memberOf PSV\n * @constant\n */\nexport const DEFAULTS = {\n panorama : null,\n container : null,\n caption : null,\n loadingImg : null,\n loadingTxt : 'Loading...',\n size : null,\n fisheye : false,\n minFov : 30,\n maxFov : 90,\n defaultZoomLvl : 50,\n defaultLong : 0,\n defaultLat : 0,\n sphereCorrection : {\n pan : 0,\n tilt: 0,\n roll: 0,\n },\n moveSpeed : 1,\n zoomButtonIncrement: 2,\n autorotateDelay : null,\n autorotateSpeed : '2rpm',\n autorotateLat : null,\n moveInertia : true,\n mousewheel : true,\n mousewheelSpeed : 1,\n mousemove : true,\n captureCursor : false,\n touchmoveTwoFingers: false,\n useXmpData : true,\n panoData : null,\n withCredentials : false,\n navbar : [\n 'autorotate',\n 'zoomOut',\n 'zoomRange',\n 'zoomIn',\n 'download',\n 'caption',\n 'fullscreen',\n ],\n lang : {\n autorotate: 'Automatic rotation',\n zoom : 'Zoom',\n zoomOut : 'Zoom out',\n zoomIn : 'Zoom in',\n download : 'Download',\n fullscreen: 'Fullscreen',\n menu : 'Menu',\n twoFingers: ['Use two fingers to navigate'],\n loadError : 'The panorama can\\'t be loaded',\n },\n keyboard : {\n 'ArrowUp' : ACTIONS.ROTATE_LAT_UP,\n 'ArrowDown' : ACTIONS.ROTATE_LAT_DOWN,\n 'ArrowRight': ACTIONS.ROTATE_LONG_RIGHT,\n 'ArrowLeft' : ACTIONS.ROTATE_LONG_LEFT,\n 'PageUp' : ACTIONS.ZOOM_IN,\n 'PageDown' : ACTIONS.ZOOM_OUT,\n '+' : ACTIONS.ZOOM_IN,\n '-' : ACTIONS.ZOOM_OUT,\n ' ' : ACTIONS.TOGGLE_AUTOROTATE,\n },\n plugins : [],\n};\n\n/**\n * @summary List of unmodifiable options and their error messages\n * @private\n */\nexport const READONLY_OPTIONS = {\n panorama : 'Use setPanorama method to change the panorama',\n panoData : 'Use setPanorama method to change the panorama',\n container: 'Cannot change viewer container',\n plugins : 'Cannot change plugins',\n};\n\n/**\n * @summary Parsers/validators for each option\n * @private\n */\nexport const CONFIG_PARSERS = {\n container : (container) => {\n if (!container) {\n throw new PSVError('No value given for container.');\n }\n return container;\n },\n defaultLat : (defaultLat) => {\n // defaultLat is between -PI/2 and PI/2\n return parseAngle(defaultLat, true);\n },\n minFov : (minFov, config) => {\n // minFov and maxFov must be ordered\n if (config.maxFov < minFov) {\n logWarn('maxFov cannot be lower than minFov');\n // eslint-disable-next-line no-param-reassign\n minFov = config.maxFov;\n }\n // minFov between 1 and 179\n return bound(minFov, 1, 179);\n },\n maxFov : (maxFov, config) => {\n // minFov and maxFov must be ordered\n if (maxFov < config.minFov) {\n // eslint-disable-next-line no-param-reassign\n maxFov = config.minFov;\n }\n // maxFov between 1 and 179\n return bound(maxFov, 1, 179);\n },\n lang : (lang) => {\n return {\n ...DEFAULTS.lang,\n ...lang,\n };\n },\n keyboard : (keyboard) => {\n // keyboard=true becomes the default map\n if (keyboard === true) {\n return clone(DEFAULTS.keyboard);\n }\n return keyboard;\n },\n autorotateLat : (autorotateLat, config) => {\n // default autorotateLat is defaultLat\n if (autorotateLat === null) {\n return parseAngle(config.defaultLat, true);\n }\n // autorotateLat is between -PI/2 and PI/2\n else {\n return parseAngle(autorotateLat, true);\n }\n },\n autorotateSpeed: (autorotateSpeed) => {\n return parseSpeed(autorotateSpeed);\n },\n fisheye : (fisheye) => {\n // translate boolean fisheye to amount\n if (fisheye === true) {\n return 1;\n }\n else if (fisheye === false) {\n return 0;\n }\n return fisheye;\n },\n plugins : (plugins) => {\n return plugins\n .map((plugin) => {\n if (Array.isArray(plugin)) {\n return plugin;\n }\n else {\n return [plugin];\n }\n })\n .filter(plugin => !!plugin[0]);\n },\n};\n\n/**\n * @summary Merge user config with default config and performs validation\n * @param {PSV.Options} options\n * @returns {PSV.Options}\n * @memberOf PSV\n * @private\n */\nexport function getConfig(options) {\n const tempConfig = clone(DEFAULTS);\n deepmerge(tempConfig, options);\n\n const config = {};\n\n each(tempConfig, (value, key) => {\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (CONFIG_PARSERS[key]) {\n config[key] = CONFIG_PARSERS[key](value, tempConfig);\n }\n else {\n config[key] = value;\n }\n });\n\n return config;\n}\n","import { AbstractButton } from './AbstractButton';\nimport { EVENTS } from '../data/constants';\nimport info from '../icons/info.svg';\n\n/**\n * @summary Navigation bar caption button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CaptionButton extends AbstractButton {\n\n static id = 'caption';\n static icon = info;\n\n /**\n * @param {PSV.components.NavbarCaption} caption\n */\n constructor(caption) {\n super(caption, 'psv-button--hover-scale psv-caption-button');\n\n this.psv.on(EVENTS.HIDE_NOTIFICATION, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.HIDE_NOTIFICATION, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.HIDE_NOTIFICATION: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles caption\n */\n onClick() {\n if (this.psv.notification.prop.visible) {\n this.psv.notification.hide();\n }\n else {\n this.psv.notification.show(this.parent.prop.caption);\n this.toggleActive(true);\n }\n }\n\n}\n","import { CaptionButton } from '../buttons/CaptionButton';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Navbar caption class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class NavbarCaption extends AbstractComponent {\n\n static id = 'caption';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} caption\n */\n constructor(navbar, caption) {\n super(navbar, 'psv-caption');\n\n /**\n * @member {PSV.buttons.CaptionButton}\n * @readonly\n * @private\n */\n this.button = new CaptionButton(this);\n this.button.hide();\n\n /**\n * @override\n * @property {string} id\n * @property {boolean} collapsable\n * @property {number} width\n * @property {string} caption\n * @property {boolean} contentVisible - if the content is visible in the navbar\n * @property {number} contentWidth - with of the caption content\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable : false,\n width : this.button.prop.width,\n caption : '',\n contentVisible: true,\n contentWidth : 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-caption-content';\n this.container.appendChild(this.content);\n\n this.setCaption(caption);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.button;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n this.prop.caption = html || '';\n this.content.innerHTML = this.prop.caption;\n\n if (html) {\n this.show(false);\n\n this.content.style.display = '';\n this.prop.contentWidth = this.content.offsetWidth;\n\n this.refreshUi();\n }\n else {\n this.hide();\n }\n }\n\n /**\n * @summary Toggles content and icon depending on available space\n * @private\n */\n refreshUi() {\n const availableWidth = this.container.offsetWidth;\n if (availableWidth >= this.prop.contentWidth && !this.prop.contentVisible) {\n this.content.style.display = '';\n this.prop.contentVisible = true;\n this.button.hide(false);\n }\n else if (availableWidth < this.prop.contentWidth && this.prop.contentVisible) {\n this.content.style.display = 'none';\n this.prop.contentVisible = false;\n this.button.show(false);\n }\n }\n\n}\n","import { AutorotateButton } from '../buttons/AutorotateButton';\nimport { CustomButton } from '../buttons/CustomButton';\nimport { DownloadButton } from '../buttons/DownloadButton';\nimport { FullscreenButton } from '../buttons/FullscreenButton';\nimport { MenuButton } from '../buttons/MenuButton';\nimport { ZoomInButton } from '../buttons/ZoomInButton';\nimport { ZoomOutButton } from '../buttons/ZoomOutButton';\nimport { ZoomRangeButton } from '../buttons/ZoomRangeButton';\nimport { DEFAULTS } from '../data/config';\nimport { PSVError } from '../PSVError';\nimport '../styles/navbar.scss';\nimport { clone, logWarn } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\nimport { NavbarCaption } from './NavbarCaption';\n\n/**\n * @summary List of available buttons\n * @type {Object>}\n * @private\n */\nconst AVAILABLE_BUTTONS = {};\n\n/**\n * @summary Register a new button available for all viewers\n * @param {Class} button\n * @memberOf PSV\n */\nexport function registerButton(button) {\n if (!button.id) {\n throw new PSVError('Button ID is required');\n }\n\n AVAILABLE_BUTTONS[button.id] = button;\n}\n\n[\n AutorotateButton,\n ZoomInButton,\n ZoomRangeButton,\n ZoomOutButton,\n DownloadButton,\n FullscreenButton,\n].forEach(registerButton);\n\n/**\n * @summary Navigation bar class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Navbar extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-navbar');\n\n /**\n * @summary List of buttons of the navbar\n * @member {PSV.buttons.AbstractButton[]}\n * @override\n */\n this.children = [];\n\n /**\n * @summary List of collapsed buttons\n * @member {PSV.buttons.AbstractButton[]}\n * @private\n */\n this.collapsed = [];\n }\n\n /**\n * @summary Change the buttons visible on the navbar\n * @param {string|Array} buttons\n */\n setButtons(buttons) {\n this.children.slice().forEach(item => item.destroy());\n this.children.length = 0;\n\n /* eslint-disable no-new */\n this.__cleanButtons(buttons).forEach((button) => {\n if (typeof button === 'object') {\n new CustomButton(this, button);\n }\n else if (AVAILABLE_BUTTONS[button]) {\n new AVAILABLE_BUTTONS[button](this);\n }\n else if (button === 'caption') {\n new NavbarCaption(this, this.psv.config.caption);\n }\n else if (button === 'zoom') {\n new ZoomOutButton(this);\n new ZoomRangeButton(this);\n new ZoomInButton(this);\n }\n else {\n throw new PSVError('Unknown button ' + button);\n }\n });\n\n new MenuButton(this);\n /* eslint-enable no-new */\n\n this.children.forEach((item) => {\n if (typeof item.checkSupported === 'function') {\n item.checkSupported();\n }\n });\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n const caption = this.getButton('caption', false);\n\n if (!caption) {\n throw new PSVError('Cannot set caption, the navbar caption container is not initialized.');\n }\n\n caption.setCaption(html);\n }\n\n /**\n * @summary Returns a button by its identifier\n * @param {string} id\n * @param {boolean} [warnNotFound=true]\n * @returns {PSV.buttons.AbstractButton}\n */\n getButton(id, warnNotFound = true) {\n let button = null;\n\n this.children.some((item) => {\n if (item.prop.id === id) {\n button = item;\n return true;\n }\n else {\n return false;\n }\n });\n\n if (!button && warnNotFound) {\n logWarn(`button \"${id}\" not found in the navbar`);\n }\n\n return button;\n }\n\n /**\n * @summary Shows the navbar\n */\n show() {\n this.container.classList.add('psv-navbar--open');\n this.prop.visible = true;\n }\n\n /**\n * @summary Hides the navbar\n */\n hide() {\n this.container.classList.remove('psv-navbar--open');\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n refreshUi() {\n super.refreshUi();\n\n if (this.psv.prop.uiRefresh === true) {\n const availableWidth = this.container.offsetWidth;\n\n let totalWidth = 0;\n const visibleButtons = [];\n const collapsableButtons = [];\n\n this.children.forEach((item) => {\n if (item.prop.visible) {\n totalWidth += item.prop.width;\n visibleButtons.push(item);\n if (item.prop.collapsable) {\n collapsableButtons.push(item);\n }\n }\n });\n\n if (!visibleButtons.length) {\n return;\n }\n\n if (availableWidth < totalWidth && collapsableButtons.length > 0) {\n collapsableButtons.forEach(item => item.collapse());\n this.collapsed = collapsableButtons;\n\n this.getButton(MenuButton.id).show(false);\n }\n else if (availableWidth >= totalWidth && this.collapsed.length > 0) {\n this.collapsed.forEach(item => item.uncollapse());\n this.collapsed = [];\n\n this.getButton(MenuButton.id).hide(false);\n }\n\n const caption = this.getButton(NavbarCaption.id, false);\n if (caption) {\n caption.refreshUi();\n }\n }\n }\n\n /**\n * @summary Ensure the buttons configuration is correct\n * @private\n */\n __cleanButtons(buttons) {\n // true becomes the default array\n if (buttons === true) {\n return clone(DEFAULTS.navbar);\n }\n // can be a space or coma separated list\n else if (typeof buttons === 'string') {\n return buttons.split(/[ ,]/);\n }\n else {\n return buttons || [];\n }\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @namespace PSV.plugins\n */\n\n/**\n * @summary Base plugins class\n * @memberof PSV.plugins\n * @abstract\n */\nexport class AbstractPlugin extends EventEmitter {\n\n /**\n * @summary Unique identifier of the plugin\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Destroys the plugin\n * @package\n */\n destroy() {\n delete this.psv;\n }\n\n}\n","import { SYSTEM } from '../data/system';\nimport { getStyle } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\nimport '../styles/loader.scss';\n\n/**\n * @summary Loader class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Loader extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-loader-container');\n\n /**\n * @summary Inner container for vertical center\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.loader = document.createElement('div');\n this.loader.className = 'psv-loader';\n this.container.appendChild(this.loader);\n\n /**\n * @summary Animation canvas\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n this.canvas.className = 'psv-loader-canvas';\n\n this.canvas.width = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.loader.appendChild(this.canvas);\n\n /**\n * @override\n * @property {number} thickness\n * @property {string} current\n */\n this.prop = {\n ...this.prop,\n tickness: (this.loader.offsetWidth - this.loader.clientWidth) / 2 * SYSTEM.pixelRatio,\n current : null,\n };\n\n this.refreshUi();\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.loader;\n delete this.canvas;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.current !== (this.psv.config.loadingImg || this.psv.config.loadingTxt)) {\n if (this.prop.current) {\n this.loader.removeChild(this.loader.lastChild);\n }\n\n let inner;\n if (this.psv.config.loadingImg) {\n inner = document.createElement('img');\n inner.className = 'psv-loader-image';\n inner.src = this.psv.config.loadingImg;\n }\n else if (this.psv.config.loadingTxt) {\n inner = document.createElement('div');\n inner.className = 'psv-loader-text';\n inner.innerHTML = this.psv.config.loadingTxt;\n }\n if (inner) {\n const size = Math.round(Math.sqrt(2 * Math.pow((this.canvas.width / 2 - this.prop.tickness / 2) / SYSTEM.pixelRatio, 2)));\n inner.style.maxWidth = size + 'px';\n inner.style.maxHeight = size + 'px';\n this.loader.appendChild(inner);\n }\n\n this.prop.current = this.psv.config.loadingImg || this.psv.config.loadingTxt;\n }\n }\n\n /**\n * @summary Sets the loader progression\n * @param {number} value - from 0 to 100\n */\n setProgress(value) {\n const context = this.canvas.getContext('2d');\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.lineWidth = this.prop.tickness;\n context.strokeStyle = getStyle(this.loader, 'color');\n\n context.beginPath();\n context.arc(\n this.canvas.width / 2, this.canvas.height / 2,\n this.canvas.width / 2 - this.prop.tickness / 2,\n -Math.PI / 2, value / 100 * 2 * Math.PI - Math.PI / 2\n );\n context.stroke();\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { AbstractComponent } from './AbstractComponent';\n\nimport '../styles/notification.scss';\n\n/**\n * @summary Notification class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Notification extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-notification');\n\n /**\n * @override\n * @property {*} timeout\n */\n this.prop = {\n ...this.prop,\n visible: false,\n timeout: null,\n };\n\n /**\n * Notification content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-notification-content';\n this.container.appendChild(this.content);\n\n this.content.addEventListener('click', () => this.hide());\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a notification on the viewer\n * @param {Object|string} config\n * @param {string} config.content\n * @param {number} [config.timeout]\n * @fires PSV.show-notification\n *\n * @example\n * viewer.showNotification({ content: 'Hello world', timeout: 5000 })\n * @example\n * viewer.showNotification('Hello world')\n */\n show(config) {\n if (this.prop.timeout) {\n clearTimeout(this.prop.timeout);\n this.prop.timeout = null;\n }\n\n if (typeof config === 'string') {\n config = { content: config }; // eslint-disable-line no-param-reassign\n }\n\n this.content.innerHTML = config.content;\n this.prop.visible = true;\n\n this.container.classList.add('psv-notification--visible');\n\n this.psv.trigger(EVENTS.SHOW_NOTIFICATION);\n\n if (config.timeout) {\n this.prop.timeout = setTimeout(() => this.hide(), config.timeout);\n }\n }\n\n /**\n * @summary Hides the notification\n * @fires PSV.hide-notification\n */\n hide() {\n if (this.prop.visible) {\n this.container.classList.remove('psv-notification--visible');\n\n this.prop.visible = false;\n\n this.psv.trigger(EVENTS.HIDE_NOTIFICATION);\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { AbstractComponent } from './AbstractComponent';\nimport { PSVError } from '../PSVError';\n\nimport '../styles/overlay.scss';\n\n/**\n * @summary Overlay class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Overlay extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-overlay');\n\n /**\n * @override\n * @property {string} contentId\n * @property {boolean} dissmisable\n */\n this.prop = {\n ...this.prop,\n contentId : undefined,\n dissmisable: true,\n };\n\n /**\n * Image container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.image = document.createElement('div');\n this.image.className = 'psv-overlay-image';\n this.container.appendChild(this.image);\n\n /**\n * Text container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.text = document.createElement('div');\n this.text.className = 'psv-overlay-text';\n this.container.appendChild(this.text);\n\n /**\n * Subtext container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.subtext = document.createElement('div');\n this.subtext.className = 'psv-overlay-subtext';\n this.container.appendChild(this.subtext);\n\n this.container.addEventListener('mouseup', (e) => {\n e.stopPropagation();\n if (this.prop.dissmisable) {\n this.hide();\n }\n }, true);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.image;\n delete this.text;\n delete this.subtext;\n\n super.destroy();\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Overlay cannot be toggled');\n }\n\n /**\n * @summary Displays an overlay on the viewer\n * @param {Object|string} config\n * @param {string} [config.id]\n * @param {string} config.image\n * @param {string} config.text\n * @param {string} [config.subtext]\n * @param {boolean} [config.dissmisable=true]\n * @fires PSV.show-overlay\n *\n * @example\n * viewer.showOverlay({\n * image: '',\n * text: '....',\n * subtext: '....'\n * })\n */\n show(config) {\n if (typeof config === 'string') {\n config = { text: config }; // eslint-disable-line no-param-reassign\n }\n\n this.prop.contentId = config.id;\n this.prop.dissmisable = config.dissmisable !== false;\n this.image.innerHTML = config.image || '';\n this.text.innerHTML = config.text || '';\n this.subtext.innerHTML = config.subtext || '';\n\n super.show();\n\n this.psv.trigger(EVENTS.SHOW_OVERLAY, config.id);\n }\n\n /**\n * @summary Hides the overlay\n * @param {string} [id]\n * @fires PSV.hide-overlay\n */\n hide(id) {\n if (this.isVisible() && (!id || !this.prop.contentId || this.prop.contentId === id)) {\n const contentId = this.prop.contentId;\n\n super.hide();\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_OVERLAY, contentId);\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\n\nimport '../styles/panel.scss';\nimport { toggleClass } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Minimum width of the panel\n * @type {number}\n * @constant\n * @private\n */\nconst PANEL_MIN_WIDTH = 200;\n\n/**\n * @summary Panel class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Panel extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-panel');\n\n /**\n * @override\n * @property {string} contentId\n * @property {number} mouseX\n * @property {number} mouseY\n * @property {boolean} mousedown\n * @property {function} clickHandler\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId : undefined,\n mouseX : 0,\n mouseY : 0,\n mousedown : false,\n clickHandler: null,\n };\n\n const resizer = document.createElement('div');\n resizer.className = 'psv-panel-resizer';\n this.container.appendChild(resizer);\n\n const closeBtn = document.createElement('div');\n closeBtn.className = 'psv-panel-close-button';\n this.container.appendChild(closeBtn);\n\n /**\n * @summary Content container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-panel-content';\n this.container.appendChild(this.content);\n\n // Stop wheel event bubling from panel\n this.container.addEventListener(SYSTEM.mouseWheelEvent, e => e.stopPropagation());\n\n closeBtn.addEventListener('click', () => this.hide());\n\n // Event for panel resizing + stop bubling\n resizer.addEventListener('mousedown', this);\n resizer.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.prop;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onMouseUp(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Panel cannot be toggled');\n }\n\n /**\n * @summary Shows the panel\n * @param {Object} config\n * @param {string} [config.id]\n * @param {string} config.content\n * @param {boolean} [config.noMargin=false]\n * @param {Function} [config.clickHandler]\n * @fires PSV.open-panel\n */\n show(config) {\n if (typeof config === 'string') {\n config = { content: config }; // eslint-disable-line no-param-reassign\n }\n\n this.prop.contentId = config.id;\n this.prop.visible = true;\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.content.innerHTML = config.content;\n this.content.scrollTop = 0;\n this.container.classList.add('psv-panel--open');\n\n toggleClass(this.content, 'psv-panel-content--no-margin', config.noMargin === true);\n\n if (config.clickHandler) {\n this.prop.clickHandler = config.clickHandler;\n this.content.addEventListener('click', config.clickHandler);\n }\n\n this.psv.trigger(EVENTS.OPEN_PANEL, config.id);\n }\n\n /**\n * @summary Hides the panel\n * @param {string} [id]\n * @fires PSV.close-panel\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.prop.visible = false;\n this.prop.contentId = undefined;\n\n this.content.innerHTML = null;\n this.container.classList.remove('psv-panel--open');\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.psv.trigger(EVENTS.CLOSE_PANEL, contentId);\n }\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n evt.stopPropagation();\n this.__startResize(evt);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n evt.stopPropagation();\n this.__startResize(evt.changedTouches[0]);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.prop.mousedown = false;\n this.content.classList.remove('psv-panel-content--no-interaction');\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.__resize(evt);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown) {\n this.__resize(evt.touches[0]);\n }\n }\n\n /**\n * @summary Initializes the panel resize\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startResize(evt) {\n this.prop.mouseX = evt.clientX;\n this.prop.mouseY = evt.clientY;\n this.prop.mousedown = true;\n this.content.classList.add('psv-panel-content--no-interaction');\n }\n\n /**\n * @summary Resizes the panel\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __resize(evt) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n this.container.style.width = Math.max(PANEL_MIN_WIDTH, this.container.offsetWidth - (x - this.prop.mouseX)) + 'px';\n\n this.prop.mouseX = x;\n this.prop.mouseY = y;\n }\n\n}\n","/**\n * @namespace PSV.services\n */\n\n/**\n * @summary Base services class\n * @memberof PSV.services\n * @abstract\n */\nexport class AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = psv.config;\n\n /**\n * @summary Properties holder\n * @type {Object}\n * @readonly\n */\n this.prop = psv.prop;\n }\n\n /**\n * @summary Destroys the service\n */\n destroy() {\n delete this.psv;\n delete this.config;\n delete this.prop;\n }\n\n}\n","import * as THREE from 'three';\nimport { SPHERE_RADIUS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { parseAngle, parseSpeed } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Collections of data converters for the current viewer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class DataHelper extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n }\n\n /**\n * @summary Converts vertical FOV to zoom level\n * @param {number} fov\n * @returns {number}\n */\n fovToZoomLevel(fov) {\n const temp = Math.round((fov - this.config.minFov) / (this.config.maxFov - this.config.minFov) * 100);\n return temp - 2 * (temp - 50);\n }\n\n /**\n * @summary Converts zoom level to vertical FOV\n * @param {number} level\n * @returns {number}\n */\n zoomLevelToFov(level) {\n return this.config.maxFov + (level / 100) * (this.config.minFov - this.config.maxFov);\n }\n\n /**\n * @summary Convert vertical FOV to horizontal FOV\n * @param {number} vFov\n * @returns {number}\n */\n vFovToHFov(vFov) {\n return THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(vFov) / 2) * this.prop.aspect));\n }\n\n /**\n * @summary Converts a speed into a duration from current position to a new position\n * @param {string|number} value\n * @param {number} angle\n * @returns {number}\n */\n speedToDuration(value, angle) {\n if (!value || typeof value !== 'number') {\n // desired radial speed\n const speed = value ? parseSpeed(value) : this.config.autorotateSpeed;\n // compute duration\n return angle / Math.abs(speed) * 1000;\n }\n else {\n return Math.abs(value);\n }\n }\n\n /**\n * @summary Converts pixel texture coordinates to spherical radians coordinates\n * @param {PSV.Point} point\n * @returns {PSV.Position}\n */\n textureCoordsToSphericalCoords(point) {\n if (this.prop.isCubemap) {\n throw new PSVError('Unable to use texture coords with cubemap.');\n }\n\n const panoData = this.prop.panoData;\n const relativeX = (point.x + panoData.croppedX) / panoData.fullWidth * Math.PI * 2;\n const relativeY = (point.y + panoData.croppedY) / panoData.fullHeight * Math.PI;\n\n return {\n longitude: relativeX >= Math.PI ? relativeX - Math.PI : relativeX + Math.PI,\n latitude : Math.PI / 2 - relativeY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to pixel texture coordinates\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n */\n sphericalCoordsToTextureCoords(position) {\n if (this.prop.isCubemap) {\n throw new PSVError('Unable to use texture coords with cubemap.');\n }\n\n const panoData = this.prop.panoData;\n const relativeLong = position.longitude / Math.PI / 2 * panoData.fullWidth;\n const relativeLat = position.latitude / Math.PI * panoData.fullHeight;\n\n return {\n x: Math.round(position.longitude < Math.PI ? relativeLong + panoData.fullWidth / 2 : relativeLong - panoData.fullWidth / 2) - panoData.croppedX,\n y: Math.round(panoData.fullHeight / 2 - relativeLat) - panoData.croppedY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to a THREE.Vector3\n * @param {PSV.Position} position\n * @returns {external:THREE.Vector3}\n */\n sphericalCoordsToVector3(position) {\n return new THREE.Vector3(\n SPHERE_RADIUS * -Math.cos(position.latitude) * Math.sin(position.longitude),\n SPHERE_RADIUS * Math.sin(position.latitude),\n SPHERE_RADIUS * Math.cos(position.latitude) * Math.cos(position.longitude)\n );\n }\n\n /**\n * @summary Converts a THREE.Vector3 to spherical radians coordinates\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Position}\n */\n vector3ToSphericalCoords(vector) {\n const phi = Math.acos(vector.y / Math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));\n const theta = Math.atan2(vector.x, vector.z);\n\n return {\n longitude: theta < 0 ? -theta : Math.PI * 2 - theta,\n latitude : Math.PI / 2 - phi,\n };\n }\n\n /**\n * @summary Converts position on the viewer to a THREE.Vector3\n * @param {PSV.Point} viewerPoint\n * @returns {external:THREE.Vector3}\n */\n viewerCoordsToVector3(viewerPoint) {\n const screen = new THREE.Vector2(\n 2 * viewerPoint.x / this.prop.size.width - 1,\n -2 * viewerPoint.y / this.prop.size.height + 1\n );\n\n this.psv.renderer.raycaster.setFromCamera(screen, this.psv.renderer.camera);\n\n const intersects = this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children);\n\n if (intersects.length === 1) {\n return intersects[0].point;\n }\n else {\n return null;\n }\n }\n\n /**\n * @summary Converts a THREE.Vector3 to position on the viewer\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Point}\n */\n vector3ToViewerCoords(vector) {\n const vectorClone = vector.clone();\n vectorClone.project(this.psv.renderer.camera);\n\n return {\n x: Math.round((vectorClone.x + 1) / 2 * this.prop.size.width),\n y: Math.round((1 - vectorClone.y) / 2 * this.prop.size.height),\n };\n }\n\n /**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @param {object} object\n * @returns {boolean}\n */\n isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return key1 in object && key2 in object;\n });\n }\n\n /**\n * @summary Converts x/y to latitude/longitude if present and ensure boundaries\n * @param {PSV.ExtendedPosition} position\n * @returns {PSV.Position}\n */\n cleanPosition(position) {\n if ('x' in position && 'y' in position) {\n return this.textureCoordsToSphericalCoords(position);\n }\n else {\n return {\n longitude: parseAngle(position.longitude),\n latitude : parseAngle(position.latitude, true),\n };\n }\n }\n\n /**\n * @summary Ensure a SphereCorrection object is valide\n * @param {PSV.SphereCorrection} sphereCorrection\n * @returns {PSV.SphereCorrection}\n */\n cleanSphereCorrection(sphereCorrection) {\n return {\n pan : parseAngle(sphereCorrection.pan || 0),\n tilt: parseAngle(sphereCorrection.tilt || 0, true),\n roll: parseAngle(sphereCorrection.roll || 0, true, false),\n };\n }\n\n}\n","import { Animation } from '../Animation';\nimport {\n ACTIONS,\n DBLCLICK_DELAY,\n EVENTS,\n IDS,\n INERTIA_WINDOW,\n LONGTOUCH_DELAY,\n TWOFINGERSOVERLAY_DELAY,\n MOVE_THRESHOLD\n} from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport gestureIcon from '../icons/gesture.svg';\nimport { clone, distance, getClosest, getEventKey, isFullscreenEnabled, normalizeWheel, throttle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Events handler\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class EventsHandler extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @property {boolean} moving - is the user moving\n * @property {boolean} zooming - is the user zooming\n * @property {number} startMouseX - start x position of the click/touch\n * @property {number} startMouseY - start y position of the click/touch\n * @property {number} mouseX - current x position of the cursor\n * @property {number} mouseY - current y position of the cursor\n * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y]\n * @property {number} pinchDist - distance between fingers when zooming\n * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks\n * @property {number} dblclickTimeout - timeout id for double click\n * @protected\n */\n this.state = {\n keyboardEnabled : false,\n moving : false,\n zooming : false,\n startMouseX : 0,\n startMouseY : 0,\n mouseX : 0,\n mouseY : 0,\n mouseHistory : [],\n pinchDist : 0,\n dblclickData : null,\n dblclickTimeout : null,\n longtouchTimeout: null,\n twofingersTimeout: null,\n };\n\n /**\n * @summary Throttled wrapper of {@link PSV.Viewer#autoSize}\n * @type {Function}\n * @private\n */\n this.__onResize = throttle(() => this.psv.autoSize(), 50);\n }\n\n /**\n * @summary Initializes event handlers\n * @protected\n */\n init() {\n window.addEventListener('resize', this);\n window.addEventListener('keydown', this);\n this.psv.container.addEventListener('mouseenter', this);\n this.psv.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseleave', this);\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this);\n window.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.addEventListener(SYSTEM.fullscreenEvent, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n window.removeEventListener('resize', this);\n window.removeEventListener('keydown', this);\n this.psv.container.removeEventListener('mouseenter', this);\n this.psv.container.removeEventListener('mousedown', this);\n this.psv.container.removeEventListener('mouseleave', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n window.removeEventListener('touchend', this);\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.removeEventListener(SYSTEM.fullscreenEvent, this);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n clearTimeout(this.state.longtouchTimeout);\n clearTimeout(this.state.twofingersTimeout);\n\n delete this.state;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'resize': this.__onResize(); break;\n case 'keydown': this.__onKeyDown(evt); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchend': this.__onTouchEnd(evt); break;\n case SYSTEM.fullscreenEvent: this.__fullscreenToggled(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (!getClosest(evt.target, '.psv-navbar') && !getClosest(evt.target, '.psv-panel')) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(evt); break;\n case 'mouseenter': this.__onMouseEnter(evt); break;\n case 'touchstart': this.__onTouchStart(evt); break;\n case 'mouseleave': this.__onMouseLeave(evt); break;\n case 'mousemove': this.__onMouseMove(evt); break;\n case 'touchmove': this.__onTouchMove(evt); break;\n case SYSTEM.mouseWheelEvent: this.__onMouseWheel(evt); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n }\n\n /**\n * @summary Enables the keyboard controls\n * @protected\n */\n enableKeyboard() {\n this.state.keyboardEnabled = true;\n }\n\n /**\n * @summary Disables the keyboard controls\n * @protected\n */\n disableKeyboard() {\n this.state.keyboardEnabled = false;\n }\n\n /**\n * @summary Handles keyboard events\n * @param {KeyboardEvent} evt\n * @private\n */\n __onKeyDown(evt) {\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n let dLong = 0;\n let dLat = 0;\n let dZoom = 0;\n\n const key = getEventKey(evt);\n const action = this.config.keyboard[key];\n\n /* eslint-disable */\n switch (action) {\n // @formatter:off\n case ACTIONS.ROTATE_LAT_UP : dLat = 0.01; break;\n case ACTIONS.ROTATE_LAT_DOWN : dLat = -0.01; break;\n case ACTIONS.ROTATE_LONG_RIGHT: dLong = 0.01; break;\n case ACTIONS.ROTATE_LONG_LEFT : dLong = -0.01; break;\n case ACTIONS.ZOOM_IN : dZoom = 1; break;\n case ACTIONS.ZOOM_OUT : dZoom = -1; break;\n case ACTIONS.TOGGLE_AUTOROTATE: this.psv.toggleAutorotate(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (dZoom !== 0) {\n this.psv.zoom(this.prop.zoomLvl + dZoom * this.config.zoomButtonIncrement);\n }\n else if (dLat !== 0 || dLong !== 0) {\n this.psv.rotate({\n longitude: this.prop.position.longitude + dLong * this.prop.moveSpeed * this.prop.hFov,\n latitude : this.prop.position.latitude + dLat * this.prop.moveSpeed * this.prop.vFov,\n });\n }\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse enter events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseEnter(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse leave events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseLeave(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.buttons !== 0) {\n evt.preventDefault();\n this.__move(evt);\n }\n else if (this.config.captureCursor) {\n this.__moveAbsolute(evt);\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (!this.config.touchmoveTwoFingers) {\n this.__startMove(evt.touches[0]);\n evt.preventDefault(); // prevent mouse events emulation\n }\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n this.__click(evt.touches[0], true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.__cancelLongTouch();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n\n if (evt.touches.length === 1) {\n this.__stopMoveZoom();\n }\n else if (evt.touches.length === 0) {\n this.__stopMove(evt.changedTouches[0]);\n }\n\n if (this.config.touchmoveTwoFingers) {\n this.__cancelTwoFingersOverlay();\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (!this.prop.twofingersTimeout) {\n this.prop.twofingersTimeout = setTimeout(() => {\n this.psv.overlay.show({\n id: IDS.TWO_FINGERS,\n image: gestureIcon,\n text: this.config.lang.twoFingers[0],\n });\n }, TWOFINGERSOVERLAY_DELAY);\n }\n }\n else {\n evt.preventDefault();\n this.__move(evt.touches[0]);\n }\n }\n else if (evt.touches.length === 2) {\n evt.preventDefault();\n this.__moveZoom(evt);\n if (this.config.touchmoveTwoFingers) {\n this.__cancelTwoFingersOverlay();\n }\n }\n }\n\n /**\n * @summary Cancel the long touch timer if any\n * @private\n */\n __cancelLongTouch() {\n if (this.prop.longtouchTimeout) {\n clearTimeout(this.prop.longtouchTimeout);\n this.prop.longtouchTimeout = null;\n }\n }\n\n /**\n * @summary Cancel the two fingers overlay timer if any\n * @private\n */\n __cancelTwoFingersOverlay() {\n if (this.prop.twofingersTimeout) {\n clearTimeout(this.prop.twofingersTimeout);\n this.prop.twofingersTimeout = null;\n }\n }\n\n /**\n * @summary Handles mouse wheel events\n * @param {MouseWheelEvent} evt\n * @private\n */\n __onMouseWheel(evt) {\n if (!this.config.mousewheel) {\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n const delta = normalizeWheel(evt).spinY * 5;\n\n if (delta !== 0) {\n this.psv.zoom(this.prop.zoomLvl - delta * this.config.mousewheelSpeed);\n }\n }\n\n /**\n * @summary Handles fullscreen events\n * @param {boolean} [force] force state\n * @fires PSV.fullscreen-updated\n * @package\n */\n __fullscreenToggled(force) {\n this.prop.fullscreen = force !== undefined ? force : isFullscreenEnabled(this.psv.container);\n\n if (this.config.keyboard) {\n if (this.prop.fullscreen) {\n this.psv.startKeyboardControl();\n }\n else {\n this.psv.stopKeyboardControl();\n }\n }\n\n this.psv.trigger(EVENTS.FULLSCREEN_UPDATED, this.prop.fullscreen);\n }\n\n /**\n * @summary Initializes the movement\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startMove(evt) {\n this.psv.stopAutorotate();\n this.psv.stopAnimation()\n .then(() => {\n this.state.mouseX = evt.clientX;\n this.state.mouseY = evt.clientY;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = false;\n\n this.state.mouseHistory.length = 0;\n this.__logMouseMove(evt);\n });\n }\n\n /**\n * @summary Initializes the combines move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __startMoveZoom(evt) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n this.state.pinchDist = distance(p1, p2);\n this.state.mouseX = (p1.x + p2.x) / 2;\n this.state.mouseY = (p1.y + p2.y) / 2;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = true;\n }\n\n /**\n * @summary Stops the movement\n * @description If the move threshold was not reached a click event is triggered, otherwise an animation is launched to simulate inertia\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMove(evt) {\n if (!getClosest(evt.target, '.psv-container')) {\n this.state.moving = false;\n this.state.mouseHistory.length = 0;\n return;\n }\n\n if (this.state.moving) {\n // move threshold to trigger a click\n if (Math.abs(evt.clientX - this.state.startMouseX) < MOVE_THRESHOLD && Math.abs(evt.clientY - this.state.startMouseY) < MOVE_THRESHOLD) {\n this.__click(evt);\n this.state.moving = false;\n }\n // inertia animation\n else if (this.config.moveInertia) {\n this.__logMouseMove(evt);\n this.__stopMoveInertia(evt);\n }\n else {\n this.state.moving = false;\n }\n\n this.state.mouseHistory.length = 0;\n }\n }\n\n /**\n * @summary Stops the combined move and zoom\n * @private\n */\n __stopMoveZoom() {\n this.state.mouseHistory.length = 0;\n this.state.moving = false;\n this.state.zooming = false;\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMoveInertia(evt) {\n const direction = {\n x: evt.clientX - this.state.mouseHistory[0][1],\n y: evt.clientY - this.state.mouseHistory[0][2],\n };\n\n const norm = Math.sqrt(direction.x * direction.x + direction.y * direction.y);\n\n this.prop.animationPromise = new Animation({\n properties: {\n clientX: { start: evt.clientX, end: evt.clientX + direction.x },\n clientY: { start: evt.clientY, end: evt.clientY + direction.y },\n },\n duration : norm * INERTIA_WINDOW / 100,\n easing : 'outCirc',\n onTick : (properties) => {\n this.__move(properties, false);\n },\n })\n .finally(() => {\n this.state.moving = false;\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [longtouch=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(evt, longtouch = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: longtouch || evt.button === 2,\n target : evt.target,\n clientX : evt.clientX,\n clientY : evt.clientY,\n viewerX : evt.clientX - boundingRect.left,\n viewerY : evt.clientY - boundingRect.top,\n };\n\n const intersect = this.psv.dataHelper.viewerCoordsToVector3({\n x: data.viewerX,\n y: data.viewerY,\n });\n\n if (intersect) {\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(intersect);\n data.longitude = sphericalCoords.longitude;\n data.latitude = sphericalCoords.latitude;\n\n // TODO: for cubemap, computes texture's index and coordinates\n if (!this.prop.isCubemap) {\n const textureCoords = this.psv.dataHelper.sphericalCoordsToTextureCoords(data);\n data.textureX = textureCoords.x;\n data.textureY = textureCoords.y;\n }\n\n if (!this.state.dblclickTimeout) {\n this.psv.trigger(EVENTS.CLICK, data);\n\n this.state.dblclickData = clone(data);\n this.state.dblclickTimeout = setTimeout(() => {\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }, DBLCLICK_DELAY);\n }\n else {\n if (Math.abs(this.state.dblclickData.clientX - data.clientX) < MOVE_THRESHOLD\n && Math.abs(this.state.dblclickData.clientY - data.clientY) < MOVE_THRESHOLD) {\n this.psv.trigger(EVENTS.DOUBLE_CLICK, this.state.dblclickData);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }\n }\n }\n\n /**\n * @summary Performs movement\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [log=true]\n * @private\n */\n __move(evt, log) {\n if (this.state.moving) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n const rotation = {\n longitude: (x - this.state.mouseX) / this.prop.size.width * this.prop.moveSpeed * this.prop.hFov * SYSTEM.pixelRatio,\n latitude : (y - this.state.mouseY) / this.prop.size.height * this.prop.moveSpeed * this.prop.vFov * SYSTEM.pixelRatio,\n };\n\n this.psv.rotate({\n longitude: this.prop.position.longitude - rotation.longitude,\n latitude : this.prop.position.latitude + rotation.latitude,\n });\n\n this.state.mouseX = x;\n this.state.mouseY = y;\n\n if (log !== false) {\n this.__logMouseMove(evt);\n }\n }\n }\n\n /**\n * @summary Performs movement absolute to cursor position in viewer\n * @param {MouseEvent} evt\n * @private\n */\n __moveAbsolute(evt) {\n if (this.state.moving) {\n const containerRect = this.psv.container.getBoundingClientRect();\n this.psv.rotate({\n longitude: ((evt.clientX - containerRect.left) / containerRect.width - 0.5) * Math.PI * 2,\n latitude : -((evt.clientY - containerRect.top) / containerRect.height - 0.5) * Math.PI,\n });\n }\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.zooming && this.state.moving) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n const p = distance(p1, p2);\n const delta = 80 * (p - this.state.pinchDist) / this.prop.size.width;\n\n this.psv.zoom(this.prop.zoomLvl + delta);\n\n this.__move({\n clientX: (p1.x + p2.x) / 2,\n clientY: (p1.y + p2.y) / 2,\n });\n\n this.state.pinchDist = p;\n }\n }\n\n /**\n * @summary Stores each mouse position during a mouse move\n * @description Positions older than \"INERTIA_WINDOW\" are removed
\n * Positions before a pause of \"INERTIA_WINDOW\" / 10 are removed\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __logMouseMove(evt) {\n const now = Date.now();\n this.state.mouseHistory.push([now, evt.clientX, evt.clientY]);\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[0][i] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[0][i] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[0][i];\n }\n else {\n i++;\n previous = this.state.mouseHistory[0][i];\n }\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { Animation } from '../Animation';\nimport { CUBE_VERTICES, EVENTS, SPHERE_RADIUS, SPHERE_VERTICES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { logWarn } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Viewer and renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class Renderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @member {number}\n * @private\n */\n this.mainReqid = undefined;\n\n /**\n * @member {external:THREE.WebGLRenderer}\n * @readonly\n * @protected\n */\n this.renderer = null;\n\n /**\n * @member {external:THREE.Scene}\n * @readonly\n * @protected\n */\n this.scene = null;\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = null;\n\n /**\n * @member {external:THREE.Mesh}\n * @readonly\n * @protected\n */\n this.mesh = null;\n\n /**\n * @member {external:THREE.Raycaster}\n * @readonly\n * @protected\n */\n this.raycaster = null;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @protected\n */\n this.canvasContainer = document.createElement('div');\n this.canvasContainer.className = 'psv-canvas-container';\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.psv.container.appendChild(this.canvasContainer);\n\n psv.on(EVENTS.SIZE_UPDATED, (e, size) => {\n if (this.renderer) {\n this.renderer.setSize(size.width, size.height);\n }\n });\n\n psv.on(EVENTS.CONFIG_CHANGED, () => {\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n });\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n // cancel render loop\n if (this.mainReqid) {\n window.cancelAnimationFrame(this.mainReqid);\n }\n\n // destroy ThreeJS view\n if (this.scene) {\n this.__cleanTHREEScene(this.scene);\n }\n\n // remove container\n this.psv.container.removeChild(this.canvasContainer);\n\n delete this.canvasContainer;\n delete this.renderer;\n delete this.scene;\n delete this.camera;\n delete this.mesh;\n delete this.raycaster;\n\n super.destroy();\n }\n\n /**\n * @summary Hides the viewer\n */\n hide() {\n this.canvasContainer.style.opacity = 0;\n }\n\n /**\n * @summary Shows the viewer\n */\n show() {\n this.canvasContainer.style.opacity = 1;\n }\n\n /**\n * @summary Main event loop, calls {@link render} if `prop.needsUpdate` is true\n * @param {number} timestamp\n * @fires PSV.before-render\n * @package\n */\n __renderLoop(timestamp) {\n this.psv.trigger(EVENTS.BEFORE_RENDER, timestamp);\n\n if (this.prop.needsUpdate) {\n this.render();\n this.prop.needsUpdate = false;\n }\n\n this.mainReqid = window.requestAnimationFrame(t => this.__renderLoop(t));\n }\n\n /**\n * @summary Performs a render\n * @description Do not call this method directly, instead call\n * {@link PSV.Viewer#needsUpdate} on {@link PSV.event:before-render}.\n * @fires PSV.render\n */\n render() {\n this.prop.direction = this.psv.dataHelper.sphericalCoordsToVector3(this.prop.position);\n this.camera.position.set(0, 0, 0);\n this.camera.lookAt(this.prop.direction);\n\n if (this.config.fisheye) {\n this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye / 2).negate();\n }\n\n this.camera.aspect = this.prop.aspect;\n this.camera.fov = this.prop.vFov;\n this.camera.updateProjectionMatrix();\n\n this.renderer.render(this.scene, this.camera);\n\n this.psv.trigger(EVENTS.RENDER);\n }\n\n /**\n * @summary Applies the texture to the scene, creates the scene if needed\n * @param {PSV.TextureData} textureData\n * @fires PSV.panorama-loaded\n * @package\n */\n setTexture(textureData) {\n const { texture, panoData } = textureData;\n this.prop.panoData = panoData;\n\n if (!this.scene) {\n this.__createScene();\n }\n\n if (this.prop.isCubemap) {\n for (let i = 0; i < 6; i++) {\n if (this.mesh.material[i].map) {\n this.mesh.material[i].map.dispose();\n }\n\n this.mesh.material[i].map = texture[i];\n }\n }\n else {\n if (this.mesh.material.map) {\n this.mesh.material.map.dispose();\n }\n\n this.mesh.material.map = texture;\n }\n\n this.psv.needsUpdate();\n\n this.psv.trigger(EVENTS.PANORAMA_LOADED);\n }\n\n /**\n * @summary Apply a SphereCorrection to a Mesh\n * @param {PSV.SphereCorrection} sphereCorrection\n * @param {external:THREE.Mesh} [mesh=this.mesh]\n * @package\n */\n setSphereCorrection(sphereCorrection, mesh = this.mesh) {\n const cleanCorrection = this.psv.dataHelper.cleanSphereCorrection(sphereCorrection);\n\n mesh.rotation.set(\n cleanCorrection.tilt,\n cleanCorrection.pan,\n cleanCorrection.roll\n );\n }\n\n /**\n * @summary Creates the 3D scene and GUI components\n * @private\n */\n __createScene() {\n this.raycaster = new THREE.Raycaster();\n\n this.renderer = new THREE.WebGLRenderer();\n this.renderer.setSize(this.prop.size.width, this.prop.size.height);\n this.renderer.setPixelRatio(SYSTEM.pixelRatio);\n\n this.camera = new THREE.PerspectiveCamera(this.prop.vFov, this.prop.size.width / this.prop.size.height, 1, 3 * SPHERE_RADIUS);\n this.camera.position.set(0, 0, 0);\n\n this.scene = new THREE.Scene();\n this.scene.add(this.camera);\n\n if (this.prop.isCubemap) {\n this.mesh = this.__createCubemap();\n }\n else {\n this.mesh = this.__createSphere();\n }\n\n this.scene.add(this.mesh);\n\n // create canvas container\n this.renderer.domElement.className = 'psv-canvas';\n this.canvasContainer.appendChild(this.renderer.domElement);\n }\n\n /**\n * @summary Creates the sphere mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n * @private\n */\n __createSphere(scale = 1) {\n // The middle of the panorama is placed at longitude=0\n const geometry = new THREE.SphereGeometry(SPHERE_RADIUS * scale, SPHERE_VERTICES, SPHERE_VERTICES, -Math.PI / 2);\n\n const material = new THREE.MeshBasicMaterial({\n side: THREE.BackSide,\n });\n\n const mesh = new THREE.Mesh(geometry, material);\n mesh.scale.set(-1, 1, 1);\n\n return mesh;\n }\n\n /**\n * @summary Creates the cube mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n * @private\n */\n __createCubemap(scale = 1) {\n const cubeSize = SPHERE_RADIUS * 2 * scale;\n const geometry = new THREE.BoxGeometry(cubeSize, cubeSize, cubeSize, CUBE_VERTICES, CUBE_VERTICES, CUBE_VERTICES);\n\n const materials = [];\n for (let i = 0; i < 6; i++) {\n materials.push(new THREE.MeshBasicMaterial({\n side: THREE.BackSide,\n }));\n }\n\n const mesh = new THREE.Mesh(geometry, materials);\n mesh.scale.set(1, 1, -1);\n\n return mesh;\n }\n\n /**\n * @summary Performs transition between the current and a new texture\n * @param {PSV.TextureData} textureData\n * @param {PSV.PanoramaOptions} options\n * @returns {PSV.Animation}\n * @package\n */\n transition(textureData, options) {\n const { texture } = textureData;\n\n let positionProvided = this.psv.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n let mesh;\n\n if (this.prop.isCubemap) {\n if (positionProvided) {\n logWarn('cannot perform cubemap transition to different position');\n positionProvided = false;\n }\n\n mesh = this.__createCubemap(0.9);\n\n mesh.material.forEach((material, i) => {\n material.map = texture[i];\n material.transparent = true;\n material.opacity = 0;\n });\n }\n else {\n mesh = this.__createSphere(0.9);\n\n mesh.material.map = texture;\n mesh.material.transparent = true;\n mesh.material.opacity = 0;\n\n if (options.sphereCorrection) {\n this.setSphereCorrection(options.sphereCorrection, mesh);\n }\n }\n\n // rotate the new sphere to make the target position face the camera\n if (positionProvided) {\n const cleanPosition = this.psv.dataHelper.cleanPosition(options);\n\n // Longitude rotation along the vertical axis\n const verticalAxis = new THREE.Vector3(0, 1, 0);\n mesh.rotateOnWorldAxis(verticalAxis, cleanPosition.longitude - this.prop.position.longitude);\n\n // Latitude rotation along the camera horizontal axis\n const horizontalAxis = new THREE.Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new THREE.Vector3())).normalize();\n mesh.rotateOnWorldAxis(horizontalAxis, cleanPosition.latitude - this.prop.position.latitude);\n\n // TODO: find a better way to handle ranges\n if (this.config.latitudeRange || this.config.longitudeRange) {\n this.config.longitudeRange = null;\n this.config.latitudeRange = null;\n logWarn('trying to perform transition with longitudeRange and/or latitudeRange, ranges cleared');\n }\n }\n\n this.scene.add(mesh);\n this.psv.needsUpdate();\n\n return new Animation({\n properties: {\n opacity: { start: 0.0, end: 1.0 },\n zoom : zoomProvided ? { start: this.prop.zoomLvl, end: options.zoom } : undefined,\n },\n duration : options.transition,\n easing : 'outCubic',\n onTick : (properties) => {\n if (this.prop.isCubemap) {\n for (let i = 0; i < 6; i++) {\n mesh.material[i].opacity = properties.opacity;\n }\n }\n else {\n mesh.material.opacity = properties.opacity;\n }\n\n if (zoomProvided) {\n this.psv.zoom(properties.zoom);\n }\n\n this.psv.needsUpdate();\n },\n })\n .then(() => {\n // remove temp sphere and transfer the texture to the main sphere\n this.setTexture(textureData);\n this.scene.remove(mesh);\n\n mesh.geometry.dispose();\n mesh.geometry = null;\n\n if (options.sphereCorrection) {\n this.setSphereCorrection(options.sphereCorrection);\n }\n else {\n this.setSphereCorrection({});\n }\n\n // actually rotate the camera\n if (positionProvided) {\n this.psv.rotate(options);\n }\n });\n }\n\n /**\n * @summary Calls `dispose` on all objects and textures\n * @param {external:THREE.Object3D} object\n * @private\n */\n __cleanTHREEScene(object) {\n object.traverse((item) => {\n if (item.geometry) {\n item.geometry.dispose();\n }\n\n if (item.material) {\n if (Array.isArray(item.material)) {\n item.material.forEach((material) => {\n if (material.map) {\n material.map.dispose();\n }\n\n material.dispose();\n });\n }\n else {\n if (item.material.map) {\n item.material.map.dispose();\n }\n\n item.material.dispose();\n }\n }\n\n if (item.dispose) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import * as THREE from 'three';\nimport { CUBE_HASHMAP, CUBE_MAP } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\nimport { getXMPValue, logWarn, sum } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Texture loader\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TextureLoader extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Current HTTP requests\n * @type {XMLHttpRequest[]}\n * @private\n */\n this.requests = [];\n }\n\n /**\n * @override\n */\n destroy() {\n this.abortLoading();\n super.destroy();\n }\n\n /**\n * @summary Loads the panorama texture(s)\n * @param {string|string[]|PSV.Cubemap} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @package\n */\n loadTexture(panorama, newPanoData) {\n const tempPanorama = [];\n\n if (Array.isArray(panorama)) {\n if (panorama.length !== 6) {\n throw new PSVError('Must provide exactly 6 image paths when using cubemap.');\n }\n\n // reorder images\n for (let i = 0; i < 6; i++) {\n tempPanorama[i] = panorama[CUBE_MAP[i]];\n }\n\n return this.__loadCubemapTexture(tempPanorama);\n }\n else if (typeof panorama === 'object') {\n if (!CUBE_HASHMAP.every(side => !!panorama[side])) {\n throw new PSVError('Must provide exactly left, front, right, back, top, bottom when using cubemap.');\n }\n\n // transform into array\n CUBE_HASHMAP.forEach((side, i) => {\n tempPanorama[i] = panorama[side];\n });\n\n return this.__loadCubemapTexture(tempPanorama);\n }\n else {\n return this.__loadEquirectangularTexture(panorama, newPanoData);\n }\n }\n\n /**\n * @summary Cancels current HTTP requests\n */\n abortLoading() {\n [...this.requests].forEach(r => r.abort());\n }\n\n /**\n * @summary Loads a Blob with FileLoader\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @private\n */\n __loadFile(url, onProgress) {\n return new Promise((resolve, reject) => {\n let progress = 0;\n onProgress && onProgress(progress);\n\n const loader = new THREE.FileLoader();\n\n if (this.config.withCredentials) {\n loader.setWithCredentials(true);\n }\n\n loader.setResponseType('blob');\n\n const request = loader.load(\n url,\n (result) => {\n const rIdx = this.requests.indexOf(request);\n if (rIdx !== -1) this.requests.splice(rIdx, 1);\n\n progress = 100;\n onProgress && onProgress(progress);\n resolve(result);\n },\n (e) => {\n if (e.lengthComputable) {\n const newProgress = e.loaded / e.total * 100;\n if (newProgress > progress) {\n progress = newProgress;\n onProgress && onProgress(progress);\n }\n }\n },\n (err) => {\n const rIdx = this.requests.indexOf(request);\n if (rIdx !== -1) this.requests.splice(rIdx, 1);\n\n reject(err);\n }\n );\n\n // when we hit the cache, the result is the cache value\n if (request instanceof XMLHttpRequest) {\n this.requests.push(request);\n }\n });\n }\n\n /**\n * @summary Loads an Image using FileLoader to have progress events\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @private\n */\n __loadImage(url, onProgress) {\n return this.__loadFile(url, onProgress)\n .then(result => new Promise((resolve, reject) => {\n const img = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve(img);\n };\n img.onerror = reject;\n img.src = URL.createObjectURL(result);\n }));\n }\n\n /**\n * @summmary read a Blob as string\n * @param {Blob} blob\n * @returns {Promise}\n * @private\n */\n __loadBlobAsString(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = reject;\n reader.readAsText(blob);\n });\n }\n\n /**\n * @summary Loads the sphere texture\n * @param {string} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadEquirectangularTexture(panorama, newPanoData) {\n /* eslint no-shadow: [\"error\", {allow: [\"newPanoData\"]}] */\n if (this.prop.isCubemap === true) {\n throw new PSVError('The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.');\n }\n\n this.prop.isCubemap = false;\n\n return (\n newPanoData || !this.config.useXmpData\n ? this.__loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img, newPanoData }))\n : this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(newPanoData => this.__loadImage(panorama).then(img => ({ img, newPanoData })))\n )\n .then(({ img, newPanoData }) => {\n if (typeof newPanoData === 'function') {\n // eslint-disable-next-line no-param-reassign\n newPanoData = newPanoData(img);\n }\n\n const panoData = newPanoData || {\n fullWidth : img.width,\n fullHeight : img.height,\n croppedWidth : img.width,\n croppedHeight: img.height,\n croppedX : 0,\n croppedY : 0,\n };\n\n if (panoData.croppedWidth !== img.width || panoData.croppedHeight !== img.height) {\n logWarn(`Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image\n panoData: ${panoData.croppedWidth}x${panoData.croppedHeight}, image: ${img.width}x${img.height}`);\n }\n\n const texture = this.__createEquirectangularTexture(img, panoData);\n\n return { texture, panoData };\n });\n }\n\n /**\n * @summary Loads the XMP data of an image\n * @param {string} panorama\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadXMP(panorama, onProgress) {\n return this.__loadFile(panorama, onProgress)\n .then(blob => this.__loadBlobAsString(blob))\n .then((binary) => {\n const a = binary.indexOf('');\n const data = binary.substring(a, b);\n let panoData = null;\n\n if (a !== -1 && b !== -1 && data.indexOf('GPano:') !== -1) {\n panoData = {\n fullWidth : parseInt(getXMPValue(data, 'FullPanoWidthPixels'), 10),\n fullHeight : parseInt(getXMPValue(data, 'FullPanoHeightPixels'), 10),\n croppedWidth : parseInt(getXMPValue(data, 'CroppedAreaImageWidthPixels'), 10),\n croppedHeight: parseInt(getXMPValue(data, 'CroppedAreaImageHeightPixels'), 10),\n croppedX : parseInt(getXMPValue(data, 'CroppedAreaLeftPixels'), 10),\n croppedY : parseInt(getXMPValue(data, 'CroppedAreaTopPixels'), 10),\n };\n\n if (!panoData.fullWidth || !panoData.fullHeight || !panoData.croppedWidth || !panoData.croppedHeight) {\n logWarn('invalid XMP data');\n panoData = null;\n }\n }\n\n return panoData;\n });\n }\n\n /**\n * @summary Creates the final texture from image and panorama data\n * @param {Image} img\n * @param {PSV.PanoData} panoData\n * @returns {external:THREE.Texture}\n * @private\n */\n __createEquirectangularTexture(img, panoData) {\n let texture;\n\n // resize image / fill cropped parts with black\n if (panoData.fullWidth > SYSTEM.maxTextureWidth\n || panoData.croppedWidth !== panoData.fullWidth\n || panoData.croppedHeight !== panoData.fullHeight\n ) {\n const resizedPanoData = { ...panoData };\n\n const ratio = SYSTEM.maxCanvasWidth / panoData.fullWidth;\n\n resizedPanoData.fullWidth *= ratio;\n resizedPanoData.fullHeight *= ratio;\n resizedPanoData.croppedWidth *= ratio;\n resizedPanoData.croppedHeight *= ratio;\n resizedPanoData.croppedX *= ratio;\n resizedPanoData.croppedY *= ratio;\n\n const buffer = document.createElement('canvas');\n buffer.width = resizedPanoData.fullWidth;\n buffer.height = resizedPanoData.fullHeight;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img,\n resizedPanoData.croppedX, resizedPanoData.croppedY,\n resizedPanoData.croppedWidth, resizedPanoData.croppedHeight);\n\n texture = new THREE.Texture(buffer);\n }\n else {\n texture = new THREE.Texture(img);\n }\n\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n\n return texture;\n }\n\n /**\n * @summary Load the six textures of the cube\n * @param {string[]} panorama\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadCubemapTexture(panorama) {\n if (this.prop.isCubemap === false) {\n throw new PSVError('The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.');\n }\n\n if (this.config.fisheye) {\n logWarn('fisheye effect with cubemap texture can generate distorsion');\n }\n\n this.prop.isCubemap = true;\n\n const promises = [];\n const progress = [0, 0, 0, 0, 0, 0];\n\n for (let i = 0; i < 6; i++) {\n promises.push(\n this.__loadImage(panorama[i], (p) => {\n progress[i] = p;\n this.psv.loader.setProgress(sum(progress) / 6);\n })\n .then(img => this.__createCubemapTexture(img))\n );\n }\n\n return Promise.all(promises)\n .then(texture => ({ texture }));\n }\n\n /**\n * @summary Creates the final texture from image\n * @param {Image} img\n * @returns {external:THREE.Texture}\n * @private\n */\n __createCubemapTexture(img) {\n let texture;\n\n // resize image\n if (img.width > SYSTEM.maxTextureWidth) {\n const buffer = document.createElement('canvas');\n const ratio = SYSTEM.maxCanvasWidth / img.width;\n\n buffer.width = img.width * ratio;\n buffer.height = img.height * ratio;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img, 0, 0, buffer.width, buffer.height);\n\n texture = new THREE.Texture(buffer);\n }\n else {\n texture = new THREE.Texture(img);\n }\n\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n\n return texture;\n }\n\n /**\n * @summary Preload a panorama file without displaying it\n * @param {string} panorama\n * @returns {Promise}\n */\n preloadPanorama(panorama) {\n return this.loadTexture(panorama);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { addClasses, parsePosition } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\nimport '../styles/tooltip.scss';\n\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\nconst STATE = { NONE: 0, SHOWING: 1, HIDING: 2, READY: 3 };\n\n/**\n * @typedef {Object} PSV.components.Tooltip.Position\n * @summary Object defining the tooltip position\n * @property {number} top - Position of the tip of the arrow of the tooltip, in pixels\n * @property {number} left - Position of the tip of the arrow of the tooltip, in pixels\n * @property {string|string[]} [position='top center'] - Tooltip position toward it's arrow tip.\n * Accepted values are combinations of `top`, `center`, `bottom` and `left`, `center`, `right`\n * @property {Object} [box] - Used when displaying a tooltip on a marker\n * @property {number} [box.width=0]\n * @property {number} [box.height=0]\n */\n\n/**\n * @typedef {PSV.components.Tooltip.Position} PSV.components.Tooltip.Config\n * @summary Object defining the tooltip configuration\n * @property {string} content - HTML content of the tooltip\n * @property {string} [className] - Additional CSS class added to the tooltip\n * @property {*} [data] - Userdata associated to the tooltip\n */\n\n/**\n * @summary Tooltip class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Tooltip extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n * @param {{arrow: number, offset: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} offset\n * @property {number} width\n * @property {number} height\n * @property {string} pos\n * @property {string} state\n * @property {*} data\n */\n this.prop = {\n ...this.prop,\n ...size,\n state : STATE.NONE,\n width : 0,\n height: 0,\n pos : '',\n data : null,\n };\n\n /**\n * Tooltip content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-tooltip-content';\n this.container.appendChild(this.content);\n\n /**\n * Tooltip arrow\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.arrow = document.createElement('div');\n this.arrow.className = 'psv-tooltip-arrow';\n this.container.appendChild(this.arrow);\n\n this.container.addEventListener('transitionend', this);\n\n this.container.style.top = '-1000px';\n this.container.style.left = '-1000px';\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.arrow;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'transitionend': this.__onTransitionEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Tooltip cannot be toggled');\n }\n\n /**\n * @summary Displays the tooltip on the viewer\n * Do not call this method directly, use {@link PSV.services.TooltipRenderer} instead.\n * @param {PSV.components.Tooltip.Config} config\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @package\n */\n show(config) {\n if (this.prop.state !== STATE.NONE) {\n throw new PSVError('Initialized tooltip cannot be re-initialized');\n }\n\n if (config.className) {\n addClasses(this.container, config.className);\n }\n\n this.content.innerHTML = config.content;\n\n const rect = this.container.getBoundingClientRect();\n this.prop.width = rect.right - rect.left;\n this.prop.height = rect.bottom - rect.top;\n\n this.prop.state = STATE.READY;\n\n this.move(config);\n\n this.prop.data = config.data;\n this.prop.state = STATE.SHOWING;\n\n this.psv.trigger(EVENTS.SHOW_TOOLTIP, this.prop.data, this);\n }\n\n /**\n * @summary Moves the tooltip to a new position\n * @param {PSV.components.Tooltip.Position} config\n *\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n move(config) {\n if (this.prop.state !== STATE.SHOWING && this.prop.state !== STATE.READY) {\n throw new PSVError('Uninitialized tooltip cannot be moved');\n }\n\n const t = this.container;\n const a = this.arrow;\n\n if (!config.position) {\n config.position = ['top', 'center'];\n }\n\n // parse position\n if (typeof config.position === 'string') {\n const tempPos = parsePosition(config.position);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse tooltip position \"${config.position}\"`);\n }\n\n config.position = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (config.position[0] === 'center' && config.position[1] === 'center') {\n throw new PSVError('Unable to parse tooltip position \"center center\"');\n }\n\n // compute size\n const style = {\n posClass : config.position.slice(),\n width : this.prop.width,\n height : this.prop.height,\n top : 0,\n left : 0,\n arrowTop : 0,\n arrowLeft: 0,\n };\n\n // set initial position\n this.__computeTooltipPosition(style, config);\n\n // correct position if overflow\n let refresh = false;\n if (style.top < this.prop.offset) {\n style.posClass[0] = 'bottom';\n refresh = true;\n }\n else if (style.top + style.height > this.psv.prop.size.height - this.prop.offset) {\n style.posClass[0] = 'top';\n refresh = true;\n }\n if (style.left < this.prop.offset) {\n style.posClass[1] = 'right';\n refresh = true;\n }\n else if (style.left + style.width > this.psv.prop.size.width - this.prop.offset) {\n style.posClass[1] = 'left';\n refresh = true;\n }\n if (refresh) {\n this.__computeTooltipPosition(style, config);\n }\n\n // apply position\n t.style.top = style.top + 'px';\n t.style.left = style.left + 'px';\n\n a.style.top = style.arrowTop + 'px';\n a.style.left = style.arrowLeft + 'px';\n\n const newPos = style.posClass.join('-');\n if (newPos !== this.prop.pos) {\n t.classList.remove(`psv-tooltip--${this.prop.pos}`);\n\n this.prop.pos = newPos;\n t.classList.add(`psv-tooltip--${this.prop.pos}`);\n }\n }\n\n /**\n * @summary Hides the tooltip\n * @fires PSV.hide-tooltip\n */\n hide() {\n this.container.classList.remove('psv-tooltip--visible');\n this.prop.state = STATE.HIDING;\n\n this.psv.trigger(EVENTS.HIDE_TOOLTIP, this.prop.data);\n }\n\n /**\n * @summary Finalize transition\n * @param {TransitionEvent} e\n * @private\n */\n __onTransitionEnd(e) {\n if (e.propertyName === 'transform') {\n switch (this.prop.state) {\n case STATE.SHOWING:\n this.container.classList.add('psv-tooltip--visible');\n this.prop.state = STATE.READY;\n break;\n\n case STATE.HIDING:\n this.prop.state = STATE.NONE;\n this.destroy();\n break;\n\n default:\n // nothing\n }\n }\n }\n\n /**\n * @summary Computes the position of the tooltip and its arrow\n * @param {Object} style\n * @param {Object} config\n * @private\n */\n __computeTooltipPosition(style, config) {\n let topBottom = false;\n\n if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\n }\n\n switch (style.posClass[0]) {\n case 'bottom':\n style.top = config.top + config.box.height + this.prop.offset + this.prop.arrow;\n style.arrowTop = -this.prop.arrow * 2;\n topBottom = true;\n break;\n\n case 'center':\n style.top = config.top + config.box.height / 2 - style.height / 2;\n style.arrowTop = style.height / 2 - this.prop.arrow;\n break;\n\n case 'top':\n style.top = config.top - style.height - this.prop.offset - this.prop.arrow;\n style.arrowTop = style.height;\n topBottom = true;\n break;\n\n // no default\n }\n\n switch (style.posClass[1]) {\n case 'right':\n if (topBottom) {\n style.left = config.left + config.box.width / 2 - this.prop.offset - this.prop.arrow;\n style.arrowLeft = this.prop.offset;\n }\n else {\n style.left = config.left + config.box.width + this.prop.offset + this.prop.arrow;\n style.arrowLeft = -this.prop.arrow * 2;\n }\n break;\n\n case 'center':\n style.left = config.left + config.box.width / 2 - style.width / 2;\n style.arrowLeft = style.width / 2 - this.prop.arrow;\n break;\n\n case 'left':\n if (topBottom) {\n style.left = config.left - style.width + config.box.width / 2 + this.prop.offset + this.prop.arrow;\n style.arrowLeft = style.width - this.prop.offset - this.prop.arrow * 2;\n }\n else {\n style.left = config.left - style.width - this.prop.offset - this.prop.arrow;\n style.arrowLeft = style.width;\n }\n break;\n\n // no default\n }\n }\n\n}\n","import { Tooltip } from '../components/Tooltip';\nimport { getStyle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Tooltip renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TooltipRenderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n const testTooltip = new Tooltip(this.psv);\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrowSize\n * @property {number} offset\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n offset: parseInt(getStyle(testTooltip.container, 'outlineWidth'), 10),\n };\n\n testTooltip.destroy();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.size;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a tooltip on the viewer\n * @param {PSV.components.Tooltip.Config} config\n * @returns {PSV.components.Tooltip}\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @example\n * viewer.tooltip.create({ content: 'Hello world', top: 200, left: 450, position: 'center bottom'})\n */\n create(config) {\n const tooltip = new Tooltip(this.psv, this.size);\n tooltip.show(config);\n\n return tooltip;\n }\n\n}\n","import * as THREE from 'three';\nimport { EventEmitter } from 'uevent';\nimport { Animation } from './Animation';\nimport { Loader } from './components/Loader';\nimport { Navbar } from './components/Navbar';\nimport { Notification } from './components/Notification';\nimport { Overlay } from './components/Overlay';\nimport { Panel } from './components/Panel';\nimport { CONFIG_PARSERS, DEFAULTS, getConfig, READONLY_OPTIONS } from './data/config';\nimport { CHANGE_EVENTS, EVENTS, IDS, VIEWER_DATA } from './data/constants';\nimport { SYSTEM } from './data/system';\nimport errorIcon from './icons/error.svg';\nimport { PSVError } from './PSVError';\nimport { DataHelper } from './services/DataHelper';\nimport { EventsHandler } from './services/EventsHandler';\nimport { Renderer } from './services/Renderer';\nimport { TextureLoader } from './services/TextureLoader';\nimport { TooltipRenderer } from './services/TooltipRenderer';\nimport './styles/viewer.scss';\nimport {\n bound,\n each,\n exitFullscreen,\n getAngle,\n getShortestArc,\n isFullscreenEnabled,\n requestFullscreen,\n throttle,\n toggleClass\n} from './utils';\n\nTHREE.Cache.enabled = true;\n\n/**\n * @summary Main class\n * @memberOf PSV\n * @extends {external:uEvent.EventEmitter}\n */\nexport class Viewer extends EventEmitter {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n super();\n\n SYSTEM.load();\n\n // must support WebGL\n if (!SYSTEM.isWebGLSupported) {\n throw new PSVError('WebGL is not supported.');\n }\n\n if (SYSTEM.maxCanvasWidth === 0 || SYSTEM.maxTextureWidth === 0) {\n throw new PSVError('Unable to detect system capabilities');\n }\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} ready - when all components are loaded\n * @property {boolean} needsUpdate - if the view needs to be renderer\n * @property {boolean} isCubemap - if the panorama is a cubemap\n * @property {PSV.Position} position - current direction of the camera\n * @property {external:THREE.Vector3} direction - direction of the camera\n * @property {number} zoomLvl - current zoom level\n * @property {number} vFov - vertical FOV\n * @property {number} hFov - horizontal FOV\n * @property {number} aspect - viewer aspect ratio\n * @property {number} moveSpeed - move speed (computed with pixel ratio and configuration moveSpeed)\n * @property {Function} autorotateCb - update callback of the automatic rotation\n * @property {PSV.Animation} animationPromise - promise of the current animation (either go to position or image transition)\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property startTimeout - timeout id of the automatic rotation delay\n * @property {PSV.Size} size - size of the container\n * @property {PSV.PanoData} panoData - panorama metadata\n */\n this.prop = {\n ready : false,\n uiRefresh : false,\n needsUpdate : false,\n fullscreen : false,\n isCubemap : undefined,\n position : {\n longitude: 0,\n latitude : 0,\n },\n direction : null,\n zoomLvl : null,\n vFov : null,\n hFov : null,\n aspect : null,\n moveSpeed : 0.1,\n autorotateCb : null,\n animationPromise: null,\n loadingPromise : null,\n startTimeout : null,\n size : {\n width : 0,\n height: 0,\n },\n panoData : {\n fullWidth : 0,\n fullHeight : 0,\n croppedWidth : 0,\n croppedHeight: 0,\n croppedX : 0,\n croppedY : 0,\n },\n };\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = getConfig(options);\n\n /**\n * @summary Top most parent\n * @member {HTMLElement}\n * @readonly\n */\n this.parent = (typeof options.container === 'string') ? document.getElementById(options.container) : options.container;\n this.parent[VIEWER_DATA] = this;\n\n /**\n * @summary Main container\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.classList.add('psv-container');\n this.parent.appendChild(this.container);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary All plugins\n * @type {Object}\n * @readonly\n * @package\n */\n this.plugins = {};\n\n /**\n * @summary Main render controller\n * @type {PSV.services.Renderer}\n * @readonly\n */\n this.renderer = new Renderer(this);\n\n /**\n * @summary Textures loader\n * @type {PSV.services.TextureLoader}\n * @readonly\n */\n this.textureLoader = new TextureLoader(this);\n\n /**\n * @summary Main event handler\n * @type {PSV.services.EventsHandler}\n * @readonly\n */\n this.eventsHandler = new EventsHandler(this);\n\n /**\n * @summary Utilities to help converting data\n * @type {PSV.services.DataHelper}\n * @readonly\n */\n this.dataHelper = new DataHelper(this);\n\n /**\n * @member {PSV.components.Loader}\n * @readonly\n */\n this.loader = new Loader(this);\n\n /**\n * @member {PSV.components.Navbar}\n * @readonly\n */\n this.navbar = new Navbar(this);\n\n /**\n * @member {PSV.components.Panel}\n * @readonly\n */\n this.panel = new Panel(this);\n\n /**\n * @member {PSV.services.TooltipRenderer}\n * @readonly\n */\n this.tooltip = new TooltipRenderer(this);\n\n /**\n * @member {PSV.components.Notification}\n * @readonly\n */\n this.notification = new Notification(this);\n\n /**\n * @member {PSV.components.Overlay}\n * @readonly\n */\n this.overlay = new Overlay(this);\n\n this.eventsHandler.init();\n\n this.__resizeRefresh = throttle(() => this.refreshUi('resize'), 500);\n\n // apply container size\n this.resize(this.config.size);\n\n // actual move speed depends on pixel-ratio\n this.prop.moveSpeed = THREE.Math.degToRad(this.config.moveSpeed / SYSTEM.pixelRatio);\n\n // init plugins\n this.config.plugins.forEach(([plugin, opts]) => {\n this.plugins[plugin.id] = new plugin(this, opts); // eslint-disable-line new-cap\n });\n\n // init buttons\n this.navbar.setButtons(this.config.navbar);\n\n // load panorama\n if (this.config.panorama) {\n this.setPanorama(this.config.panorama);\n }\n\n SYSTEM.isTouchEnabled.then(enabled => toggleClass(this.container, 'psv--is-touch', enabled));\n\n // enable GUI after first render\n this.once(EVENTS.RENDER, () => {\n if (this.config.navbar) {\n this.container.classList.add('psv--has-navbar');\n this.navbar.show();\n }\n\n // Queue autorotate\n if (this.config.autorotateDelay) {\n this.prop.startTimeout = setTimeout(() => this.startAutorotate(), this.config.autorotateDelay);\n }\n\n this.prop.ready = true;\n\n setTimeout(() => {\n this.refreshUi('init');\n\n this.trigger(EVENTS.READY);\n }, 0);\n });\n }\n\n /**\n * @summary Destroys the viewer\n * @description The memory used by the ThreeJS context is not totally cleared. This will be fixed as soon as possible.\n */\n destroy() {\n this.__stopAll();\n this.stopKeyboardControl();\n this.exitFullscreen();\n\n this.eventsHandler.destroy();\n this.renderer.destroy();\n this.textureLoader.destroy();\n this.dataHelper.destroy();\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n each(this.plugins, plugin => plugin.destroy());\n delete this.plugins;\n\n this.parent.removeChild(this.container);\n delete this.parent[VIEWER_DATA];\n\n delete this.parent;\n delete this.container;\n\n delete this.loader;\n delete this.navbar;\n delete this.panel;\n delete this.tooltip;\n delete this.notification;\n delete this.overlay;\n\n delete this.config;\n }\n\n /**\n * @summary Refresh UI\n * @package\n */\n refreshUi(reason) {\n if (!this.prop.ready) {\n return;\n }\n\n if (!this.prop.uiRefresh) {\n // console.log(`PhotoSphereViewer: UI Refresh, ${reason}`);\n\n this.prop.uiRefresh = true;\n\n this.children.every((child) => {\n child.refreshUi();\n return this.prop.uiRefresh === true;\n });\n\n this.prop.uiRefresh = false;\n }\n else if (this.prop.uiRefresh !== 'new') {\n this.prop.uiRefresh = 'new';\n\n // wait for current refresh to cancel\n setTimeout(() => {\n this.prop.uiRefresh = false;\n this.refreshUi(reason);\n });\n }\n }\n\n /**\n * @summary Returns the instance of a plugin if it exists\n * @param {Class|string} pluginId\n * @returns {PSV.plugins.AbstractPlugin}\n */\n getPlugin(pluginId) {\n return pluginId ? this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId] : null;\n }\n\n /**\n * @summary Returns the current position of the camera\n * @returns {PSV.Position}\n */\n getPosition() {\n return {\n longitude: this.prop.position.longitude,\n latitude : this.prop.position.latitude,\n };\n }\n\n /**\n * @summary Returns the current zoom level\n * @returns {number}\n */\n getZoomLevel() {\n return this.prop.zoomLvl;\n }\n\n /**\n * @summary Returns the current viewer size\n * @returns {PSV.Size}\n */\n getSize() {\n return {\n width : this.prop.size.width,\n height: this.prop.size.height,\n };\n }\n\n /**\n * @summary Checks if the automatic rotation is enabled\n * @returns {boolean}\n */\n isAutorotateEnabled() {\n return !!this.prop.autorotateCb;\n }\n\n /**\n * @summary Checks if the viewer is in fullscreen\n * @returns {boolean}\n */\n isFullscreenEnabled() {\n if (SYSTEM.fullscreenEvent) {\n return isFullscreenEnabled(this.container);\n }\n else {\n return this.prop.fullscreen;\n }\n }\n\n /**\n * @summary Flags the view has changed for the next render\n */\n needsUpdate() {\n this.prop.needsUpdate = true;\n\n if (!this.renderer.mainReqid && this.renderer.renderer) {\n this.renderer.__renderLoop(+new Date());\n }\n }\n\n /**\n * @summary Resizes the canvas when the window is resized\n * @fires PSV.size-updated\n */\n autoSize() {\n if (this.container.clientWidth !== this.prop.size.width || this.container.clientHeight !== this.prop.size.height) {\n this.prop.size.width = Math.round(this.container.clientWidth);\n this.prop.size.height = Math.round(this.container.clientHeight);\n this.prop.aspect = this.prop.size.width / this.prop.size.height;\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.needsUpdate();\n this.trigger(EVENTS.SIZE_UPDATED, this.getSize());\n this.__resizeRefresh();\n }\n }\n\n /**\n * @summary Loads a new panorama file\n * @description Loads a new panorama file, optionally changing the camera position/zoom and activating the transition animation.
\n * If the \"options\" parameter is not defined, the camera will not move and the ongoing animation will continue.
\n * If another loading is already in progress it will be aborted.\n * @param {string|string[]|PSV.Cubemap} path - URL of the new panorama file\n * @param {PSV.PanoramaOptions} [options]\n * @returns {Promise}\n */\n setPanorama(path, options = {}) {\n if (this.prop.loadingPromise !== null) {\n this.textureLoader.abortLoading();\n }\n\n if (!this.prop.ready) {\n if (!('longitude' in options) && !this.prop.isCubemap) {\n options.longitude = this.config.defaultLong;\n }\n if (!('latitude' in options) && !this.prop.isCubemap) {\n options.latitude = this.config.defaultLat;\n }\n if (!('zoom' in options)) {\n options.zoom = this.config.defaultZoomLvl;\n }\n if (!('sphereCorrection' in options)) {\n options.sphereCorrection = this.config.sphereCorrection;\n }\n if (!('panoData' in options)) {\n options.panoData = this.config.panoData;\n }\n }\n\n if (options.transition === undefined || options.transition === true) {\n options.transition = 1500;\n }\n if (options.showLoader === undefined) {\n options.showLoader = true;\n }\n\n const positionProvided = this.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n if (positionProvided || zoomProvided) {\n this.__stopAll();\n }\n\n this.hideError();\n\n this.config.panorama = path;\n\n const done = (err) => {\n if (err && err.type === 'abort') {\n console.warn(err);\n }\n else if (err) {\n this.showError(this.config.lang.loadError);\n console.error(err);\n }\n\n this.loader.hide();\n this.renderer.show();\n\n this.prop.loadingPromise = null;\n\n if (err) {\n return Promise.reject(err);\n }\n else {\n return true;\n }\n };\n\n if (!options.transition || !this.prop.ready) {\n if (options.showLoader || !this.prop.ready) {\n this.loader.show();\n }\n\n this.prop.loadingPromise = this.textureLoader.loadTexture(this.config.panorama, options.panoData)\n .then((textureData) => {\n this.renderer.setTexture(textureData);\n\n if (options.sphereCorrection) {\n this.renderer.setSphereCorrection(options.sphereCorrection);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n if (positionProvided) {\n this.rotate(options);\n }\n })\n .then(done, done);\n }\n else {\n if (options.showLoader) {\n this.loader.show();\n }\n\n this.prop.loadingPromise = this.textureLoader.loadTexture(this.config.panorama)\n .then((textureData) => {\n this.loader.hide();\n\n return this.renderer.transition(textureData, options);\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Update options\n * @param {PSV.Options} options\n * @fires PSV.config-changed\n */\n setOptions(options) {\n each(options, (value, key) => {\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (READONLY_OPTIONS[key]) {\n throw new PSVError(READONLY_OPTIONS[key]);\n }\n\n if (CONFIG_PARSERS[key]) {\n this.config[key] = CONFIG_PARSERS[key](value, options);\n }\n else {\n this.config[key] = value;\n }\n\n switch (key) {\n case 'caption':\n this.navbar.setCaption(value);\n break;\n\n case 'size':\n this.resize(value);\n break;\n\n case 'sphereCorrection':\n this.renderer.setSphereCorrection(value);\n break;\n\n case 'navbar':\n case 'lang':\n this.navbar.setButtons(this.config.navbar);\n break;\n\n case 'moveSpeed':\n this.prop.moveSpeed = THREE.Math.degToRad(value / SYSTEM.pixelRatio);\n break;\n\n case 'minFov':\n case 'maxFov':\n this.prop.zoomLvl = this.dataHelper.fovToZoomLevel(this.prop.vFov);\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n break;\n\n default:\n break;\n }\n });\n\n this.needsUpdate();\n this.refreshUi('set options');\n\n this.trigger(EVENTS.CONFIG_CHANGED, Object.keys(options));\n }\n\n /**\n * @summary Update options\n * @param {string} option\n * @param {any} value\n * @fires PSV.config-changed\n */\n setOption(option, value) {\n this.setOptions({ [option]: value });\n }\n\n /**\n * @summary Starts the automatic rotation\n * @fires PSV.autorotate\n */\n startAutorotate() {\n this.__stopAll();\n\n this.prop.autorotateCb = (() => {\n let last;\n let elapsed;\n\n return (e, timestamp) => {\n elapsed = last === undefined ? 0 : timestamp - last;\n last = timestamp;\n\n this.rotate({\n longitude: this.prop.position.longitude + this.config.autorotateSpeed * elapsed / 1000,\n latitude : this.prop.position.latitude - (this.prop.position.latitude - this.config.autorotateLat) / 200,\n });\n };\n })();\n\n this.on(EVENTS.BEFORE_RENDER, this.prop.autorotateCb);\n\n this.trigger(EVENTS.AUTOROTATE, true);\n }\n\n /**\n * @summary Stops the automatic rotation\n * @fires PSV.autorotate\n */\n stopAutorotate() {\n if (this.prop.startTimeout) {\n clearTimeout(this.prop.startTimeout);\n this.prop.startTimeout = null;\n }\n\n if (this.isAutorotateEnabled()) {\n this.off(EVENTS.BEFORE_RENDER, this.prop.autorotateCb);\n this.prop.autorotateCb = null;\n\n this.trigger(EVENTS.AUTOROTATE, false);\n }\n }\n\n /**\n * @summary Starts or stops the automatic rotation\n * @fires PSV.autorotate\n */\n toggleAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.stopAutorotate();\n }\n else {\n this.startAutorotate();\n }\n }\n\n /**\n * @summary Displays an error message\n * @param {string} message\n */\n showError(message) {\n this.overlay.show({\n id : IDS.ERROR,\n image : errorIcon,\n text : message,\n dissmisable: false,\n });\n }\n\n /**\n * @summary Hides the error message\n */\n hideError() {\n this.overlay.hide(IDS.ERROR);\n }\n\n /**\n * @summary Rotates the view to specific longitude and latitude\n * @param {PSV.ExtendedPosition} position\n * @fires PSV.before-rotate\n * @fires PSV.position-updated\n */\n rotate(position) {\n const e = this.trigger(EVENTS.BEFORE_ROTATE, position);\n if (e.isDefaultPrevented()) {\n return;\n }\n\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ROTATE_POSITION, this.dataHelper.cleanPosition(position));\n\n if (this.prop.position.longitude !== cleanPosition.longitude || this.prop.position.latitude !== cleanPosition.latitude) {\n this.prop.position.longitude = cleanPosition.longitude;\n this.prop.position.latitude = cleanPosition.latitude;\n\n this.needsUpdate();\n\n this.trigger(EVENTS.POSITION_UPDATED, this.getPosition());\n }\n }\n\n /**\n * @summary Rotates and zooms the view with a smooth animation\n * @param {PSV.AnimateOptions} options - position and/or zoom level\n * @returns {PSV.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = this.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n const animProperties = {};\n let duration;\n\n // clean/filter position and compute duration\n if (positionProvided) {\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ANIMATE_POSITION, this.dataHelper.cleanPosition(options));\n\n // longitude offset for shortest arc\n const tOffset = getShortestArc(this.prop.position.longitude, cleanPosition.longitude);\n\n animProperties.longitude = { start: this.prop.position.longitude, end: this.prop.position.longitude + tOffset };\n animProperties.latitude = { start: this.prop.position.latitude, end: cleanPosition.latitude };\n\n duration = this.dataHelper.speedToDuration(options.speed, getAngle(this.prop.position, cleanPosition));\n }\n\n // clean/filter zoom and compute duration\n if (zoomProvided) {\n const dZoom = Math.abs(options.zoom - this.prop.zoomLvl);\n\n animProperties.zoom = { start: this.prop.zoomLvl, end: options.zoom };\n\n if (!duration) {\n // if animating zoom only and a speed is given, use an arbitrary PI/4 to compute the duration\n duration = this.dataHelper.speedToDuration(options.speed, Math.PI / 4 * dZoom / 100);\n }\n }\n\n // if no animation needed\n if (!duration) {\n if (positionProvided) {\n this.rotate(options);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n\n return Animation.resolve();\n }\n\n this.prop.animationPromise = new Animation({\n properties: animProperties,\n duration : duration,\n easing : 'inOutSine',\n onTick : (properties) => {\n if (positionProvided) {\n this.rotate(properties);\n }\n if (zoomProvided) {\n this.zoom(properties.zoom);\n }\n },\n });\n\n return this.prop.animationPromise;\n }\n\n /**\n * @summary Stops the ongoing animation\n * @description The return value is a Promise because the is no guaranty the animation can be stopped synchronously.\n * @returns {Promise} Resolved when the animation has ben cancelled\n */\n stopAnimation() {\n if (this.prop.animationPromise) {\n return new Promise((resolve) => {\n this.prop.animationPromise.finally(resolve);\n this.prop.animationPromise.cancel();\n this.prop.animationPromise = null;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n\n /**\n * @summary Zooms to a specific level between `max_fov` and `min_fov`\n * @param {number} level - new zoom level from 0 to 100\n * @fires PSV.zoom-updated\n */\n zoom(level) {\n const newZoomLvl = bound(level, 0, 100);\n\n if (this.prop.zoomLvl !== newZoomLvl) {\n this.prop.zoomLvl = newZoomLvl;\n this.prop.vFov = this.dataHelper.zoomLevelToFov(this.prop.zoomLvl);\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.needsUpdate();\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n this.rotate(this.prop.position);\n }\n }\n\n /**\n * @summary Increases the zoom level by 1\n */\n zoomIn() {\n this.zoom(this.prop.zoomLvl + this.config.zoomButtonIncrement);\n }\n\n /**\n * @summary Decreases the zoom level by 1\n */\n zoomOut() {\n this.zoom(this.prop.zoomLvl - this.config.zoomButtonIncrement);\n }\n\n /**\n * @summary Resizes the viewer\n * @param {PSV.CssSize} size\n */\n resize(size) {\n ['width', 'height'].forEach((dim) => {\n if (size && size[dim]) {\n if (/^[0-9.]+$/.test(size[dim])) {\n size[dim] += 'px';\n }\n this.parent.style[dim] = size[dim];\n }\n });\n\n this.autoSize();\n }\n\n /**\n * @summary Enters the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n enterFullscreen() {\n if (SYSTEM.fullscreenEvent) {\n requestFullscreen(this.container);\n }\n else {\n this.container.classList.add('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(true);\n }\n }\n\n /**\n * @summary Exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n exitFullscreen() {\n if (this.isFullscreenEnabled()) {\n if (SYSTEM.fullscreenEvent) {\n exitFullscreen();\n }\n else {\n this.container.classList.remove('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(false);\n }\n }\n }\n\n /**\n * @summary Enters or exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n toggleFullscreen() {\n if (!this.isFullscreenEnabled()) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n\n /**\n * @summary Enables the keyboard controls (done automatically when entering fullscreen)\n */\n startKeyboardControl() {\n this.eventsHandler.enableKeyboard();\n }\n\n /**\n * @summary Disables the keyboard controls (done automatically when exiting fullscreen)\n */\n stopKeyboardControl() {\n this.eventsHandler.disableKeyboard();\n }\n\n /**\n * @summary Stops all current animations\n * @private\n */\n __stopAll() {\n this.stopAutorotate();\n this.stopAnimation();\n\n this.trigger(EVENTS.STOP_ALL);\n }\n\n}\n"],"names":["MOVE_THRESHOLD","DBLCLICK_DELAY","LONGTOUCH_DELAY","TWOFINGERSOVERLAY_DELAY","INERTIA_WINDOW","SPHERE_RADIUS","SPHERE_VERTICES","CUBE_VERTICES","CUBE_MAP","CUBE_HASHMAP","BUTTON_DATA","VIEWER_DATA","ACTIONS","ROTATE_LAT_UP","ROTATE_LAT_DOWN","ROTATE_LONG_RIGHT","ROTATE_LONG_LEFT","ZOOM_IN","ZOOM_OUT","TOGGLE_AUTOROTATE","EVENTS","AUTOROTATE","BEFORE_RENDER","BEFORE_ROTATE","CLICK","CLOSE_PANEL","CONFIG_CHANGED","DOUBLE_CLICK","FULLSCREEN_UPDATED","HIDE_NOTIFICATION","HIDE_OVERLAY","HIDE_TOOLTIP","OPEN_PANEL","PANORAMA_LOADED","POSITION_UPDATED","READY","RENDER","SHOW_NOTIFICATION","SHOW_OVERLAY","SHOW_TOOLTIP","SIZE_UPDATED","STOP_ALL","ZOOM_UPDATED","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","IDS","MENU","TWO_FINGERS","ERROR","EASINGS","linear","t","inQuad","outQuad","inOutQuad","inCubic","outCubic","inOutCubic","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","Math","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","toggleClass","element","className","active","classList","currentClassName","getAttribute","currentActive","indexOf","regex","RegExp","undefined","length","replace","setAttribute","toggle","contains","add","remove","addClasses","split","forEach","name","removeClasses","hasParent","el","parent","test","parentNode","getClosest","selector","matches","msMatchesSelector","bind","SVGElement","parentElement","KEYMAP","MS_KEYMAP","Add","Del","Down","Esc","Left","Right","Spacebar","Subtract","Up","getEventKey","evt","key","keyCode","which","isFullscreenEnabled","elt","document","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen","call","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","getStyle","prop","window","getComputedStyle","normalizeWheel","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","spinX","spinY","pixelX","pixelY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","bound","x","min","max","isInteger","value","Number","isFinite","floor","sum","array","reduce","a","b","distance","p1","p2","y","getShortestArc","from","to","tCandidates","candidate","newCandidate","abs","Infinity","getAngle","position1","position2","acos","latitude","longitude","greatArcDistance","λ1","φ1","λ2","φ2","dasherize","str","s","i","toLowerCase","throttle","func","wait","self","args","result","timeout","previous","later","Date","now","apply","remaining","arguments","clearTimeout","setTimeout","isPlainObject","obj","Object","getPrototypeOf","proto","prototype","toString","deepmerge","target","src","first","merge","Array","isArray","e","keys","clone","isEmpty","constructor","each","object","callback","intersect","array1","array2","filter","PSVError","message","Error","captureStackTrace","stack","create","logWarn","console","warn","getXMPValue","data","attr","match","CSS_POSITIONS","top","bottom","left","right","center","parsePosition","tokens","toLocaleLowerCase","slice","xFirst","map","token","reverse","parsed","join","parseFloat","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","THREE","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","isNaN","Animation","options","__cancelled","__resolved","__promise","Promise","resolve","reject","__resolve","__reject","easing","__start","delay","__delayTimeout","requestAnimationFrame","__run","timestamp","progress","duration","current","properties","start","end","onTick","then","onFulfilled","onRejected","p","cancel","catch","finally","onFinally","cancelAnimationFrame","AbstractComponent","psv","children","push","visible","container","createElement","appendChild","destroy","removeChild","childIdx","splice","child","refreshUi","every","uiRefresh","isVisible","hide","show","style","display","AbstractButton","navbar","collapsable","id","enabled","supported","collapsed","width","offsetWidth","icon","__setIcon","config","lang","title","addEventListener","onClick","stopPropagation","checkSupported","supportedOrObject","isSupported","initial","promise","toggleActive","iconActive","refresh","disable","enable","collapse","uncollapse","innerHTML","querySelector","AutorotateButton","on","off","handleEvent","type","toggleAutorotate","play","playActive","CustomButton","random","substr","content","DownloadButton","link","href","panorama","download","click","FullscreenButton","toggleFullscreen","fullscreenIn","fullscreenOut","HTML_BUTTON_DATA","buttons","menu","button","MenuButton","__hideMenu","__showMenu","panel","menuTemplate","noMargin","clickHandler","li","buttonId","dataset","getButton","menuIcon","SYSTEM","loaded","pixelRatio","isWebGLSupported","isTouchEnabled","maxTextureWidth","maxCanvasWidth","mouseWheelEvent","fullscreenEvent","load","ctx","getWebGLCtx","devicePixelRatio","getMaxTextureWidth","getMaxCanvasWidth","getMouseWheelEvent","getFullscreenEvent","canvas","names","context","getContext","some","listener","removeEventListener","getParameter","MAX_TEXTURE_SIZE","maxWidth","height","fillStyle","fillRect","getImageData","onmousewheel","FULLSCREEN_EVT_MAP","validExits","exit","AbstractZoomButton","buttondown","longPressTimeout","longPressAnimation","__onMouseUp","__onMouseDown","__startLongPressInterval","zoom","zoomLvl","zoomButtonIncrement","ZoomInButton","zoomIn","ZoomOutButton","zoomOut","ZoomRangeButton","mousedown","mediaMinWidth","zoomRange","zoomValue","parseInt","ready","__moveZoomValue","once","__stopZoomChange","__initZoomChangeWithMouse","__initZoomChangeByTouch","__changeZoomWithMouse","__changeZoomByTouch","size","level","__changeZoom","clientX","changedTouches","preventDefault","userInput","getBoundingClientRect","zoomLevel","DEFAULTS","caption","loadingImg","loadingTxt","fisheye","minFov","maxFov","defaultZoomLvl","defaultLong","defaultLat","sphereCorrection","pan","tilt","roll","moveSpeed","autorotateDelay","autorotateSpeed","autorotateLat","moveInertia","mousewheel","mousewheelSpeed","mousemove","captureCursor","touchmoveTwoFingers","useXmpData","panoData","withCredentials","autorotate","fullscreen","twoFingers","loadError","keyboard","plugins","READONLY_OPTIONS","CONFIG_PARSERS","plugin","getConfig","tempConfig","hasOwnProperty","CaptionButton","notification","info","NavbarCaption","contentVisible","contentWidth","setCaption","html","availableWidth","AVAILABLE_BUTTONS","registerButton","Navbar","setButtons","item","__cleanButtons","warnNotFound","totalWidth","visibleButtons","collapsableButtons","AbstractPlugin","EventEmitter","Loader","loader","clientWidth","tickness","lastChild","inner","round","maxHeight","setProgress","clearRect","lineWidth","strokeStyle","beginPath","arc","stroke","Notification","trigger","Overlay","contentId","dissmisable","image","text","subtext","PANEL_MIN_WIDTH","Panel","mouseX","mouseY","resizer","closeBtn","__onTouchStart","__onMouseMove","__onTouchMove","scrollTop","__startResize","__resize","touches","clientY","AbstractService","DataHelper","fovToZoomLevel","fov","temp","zoomLevelToFov","vFovToHFov","vFov","radToDeg","atan","tan","aspect","speedToDuration","textureCoordsToSphericalCoords","point","isCubemap","relativeX","croppedX","fullWidth","relativeY","croppedY","fullHeight","sphericalCoordsToTextureCoords","position","relativeLong","relativeLat","sphericalCoordsToVector3","vector3ToSphericalCoords","vector","phi","z","theta","atan2","viewerCoordsToVector3","viewerPoint","screen","renderer","raycaster","setFromCamera","camera","intersects","intersectObjects","scene","vector3ToViewerCoords","vectorClone","project","isExtendedPosition","key1","key2","cleanPosition","cleanSphereCorrection","EventsHandler","state","keyboardEnabled","moving","zooming","startMouseX","startMouseY","mouseHistory","pinchDist","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","__onResize","autoSize","init","__onKeyDown","__onTouchEnd","__fullscreenToggled","__onMouseEnter","__onMouseLeave","__onMouseWheel","enableKeyboard","disableKeyboard","dLong","dLat","dZoom","action","rotate","hFov","__startMove","__stopMove","__move","__moveAbsolute","__click","__cancelLongTouch","__startMoveZoom","__stopMoveZoom","__cancelTwoFingersOverlay","overlay","gestureIcon","__moveZoom","delta","force","startKeyboardControl","stopKeyboardControl","stopAutorotate","stopAnimation","__logMouseMove","__stopMoveInertia","direction","norm","animationPromise","longtouch","boundingRect","rightclick","viewerX","viewerY","dataHelper","sphericalCoords","textureCoords","textureX","textureY","log","rotation","containerRect","Renderer","mainReqid","mesh","canvasContainer","cursor","setSize","__cleanTHREEScene","opacity","__renderLoop","needsUpdate","render","set","lookAt","copy","multiplyScalar","negate","updateProjectionMatrix","setTexture","textureData","texture","__createScene","material","dispose","setSphereCorrection","cleanCorrection","setPixelRatio","__createCubemap","__createSphere","domElement","scale","geometry","side","cubeSize","materials","transition","positionProvided","zoomProvided","transparent","verticalAxis","rotateOnWorldAxis","horizontalAxis","cross","getWorldDirection","normalize","latitudeRange","longitudeRange","traverse","TextureLoader","requests","abortLoading","loadTexture","newPanoData","tempPanorama","__loadCubemapTexture","__loadEquirectangularTexture","r","abort","__loadFile","url","onProgress","setWithCredentials","setResponseType","request","rIdx","lengthComputable","newProgress","total","err","XMLHttpRequest","__loadImage","img","createElementNS","onload","URL","revokeObjectURL","onerror","createObjectURL","__loadBlobAsString","blob","reader","FileReader","readAsText","__loadXMP","croppedWidth","croppedHeight","__createEquirectangularTexture","binary","substring","resizedPanoData","ratio","buffer","drawImage","minFilter","generateMipmaps","promises","__createCubemapTexture","all","preloadPanorama","LEFT_MAP","TOP_MAP","STATE","NONE","SHOWING","HIDING","Tooltip","pos","arrow","__onTransitionEnd","rect","move","tempPos","posClass","arrowTop","arrowLeft","__computeTooltipPosition","offset","newPos","propertyName","topBottom","box","TooltipRenderer","testTooltip","tooltip","Viewer","autorotateCb","loadingPromise","startTimeout","getElementById","textureLoader","eventsHandler","__resizeRefresh","resize","opts","setPanorama","startAutorotate","__stopAll","reason","getPlugin","pluginId","getPosition","getZoomLevel","getSize","isAutorotateEnabled","clientHeight","path","showLoader","hideError","done","showError","error","setOptions","setOption","option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,cAAL;EACD;EACF;EAED;;;EA/0BF;;EAAA,SAk1BE6hB,oBAl1BF,GAk1BE,gCAAuB;EACrB,SAAKuJ,aAAL,CAAmB7K,cAAnB;EACD;EAED;;;EAt1BF;;EAAA,SAy1BEuB,mBAz1BF,GAy1BE,+BAAsB;EACpB,SAAKsJ,aAAL,CAAmB5K,eAAnB;EACD;EAED;;;;EA71BF;;EAAA,SAi2BEkL,SAj2BF,GAi2BE,qBAAY;EACV,SAAK3J,cAAL;EACA,SAAKC,aAAL;EAEA,SAAKvH,OAAL,CAAariB,MAAM,CAACqB,QAApB;EACD,GAt2BH;;EAAA;EAAA,EAA4B+f,mBAA5B;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"photo-sphere-viewer.js","sources":["../src/data/constants.js","../src/utils/browser.js","../src/utils/math.js","../src/utils/misc.js","../src/PSVError.js","../src/utils/psv.js","../src/utils/index.js","../src/Animation.js","../src/components/AbstractComponent.js","../src/buttons/AbstractButton.js","../src/buttons/AutorotateButton.js","../src/buttons/CustomButton.js","../src/buttons/DownloadButton.js","../src/buttons/FullscreenButton.js","../src/buttons/MenuButton.js","../src/data/system.js","../src/buttons/AbstractZoomButton.js","../src/buttons/ZoomInButton.js","../src/buttons/ZoomOutButton.js","../src/buttons/ZoomRangeButton.js","../src/data/config.js","../src/buttons/CaptionButton.js","../src/components/NavbarCaption.js","../src/components/Navbar.js","../src/plugins/AbstractPlugin.js","../src/components/Loader.js","../src/components/Notification.js","../src/components/Overlay.js","../src/components/Panel.js","../src/services/AbstractService.js","../src/services/DataHelper.js","../src/services/EventsHandler.js","../src/services/Renderer.js","../src/services/TextureLoader.js","../src/components/Tooltip.js","../src/services/TooltipRenderer.js","../src/Viewer.js"],"sourcesContent":["/**\n * @namespace PSV.constants\n */\n\n/**\n * @summary Number of pixels bellow which a mouse move will be considered as a click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const MOVE_THRESHOLD = 4;\n\n/**\n * @summary Delay in milliseconds between two clicks to consider a double click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DBLCLICK_DELAY = 300;\n\n/**\n * @summary Delay in milliseconds to emulate a long touch\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const LONGTOUCH_DELAY = 500;\n\n/**\n * @summary Delay in milliseconds to for the two fingers overlay to appear\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const TWOFINGERSOVERLAY_DELAY = 100;\n\n/**\n * @summary Duration in milliseconds of the \"ctrl zoom\" overlay\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const CTRLZOOM_TIMEOUT = 2000;\n\n/**\n * @summary Time size of the mouse position history used to compute inertia\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const INERTIA_WINDOW = 300;\n\n/**\n * @summary Radius of the THREE.SphereGeometry, Half-length of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_RADIUS = 100;\n\n/**\n * @summary Number of vertice of the THREE.SphereGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_VERTICES = 64;\n\n/**\n * @summary Number of vertices of each side of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const CUBE_VERTICES = 8;\n\n/**\n * @summary Order of cube textures for arrays\n * @memberOf PSV.constants\n * @type {number[]}\n * @constant\n */\nexport const CUBE_MAP = [0, 2, 4, 5, 3, 1];\n\n/**\n * @summary Order of cube textures for maps\n * @memberOf PSV.constants\n * @type {string[]}\n * @constant\n */\nexport const CUBE_HASHMAP = ['left', 'right', 'top', 'bottom', 'back', 'front'];\n\n/**\n * @summary Property name added to viewer element\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const VIEWER_DATA = 'photoSphereViewer';\n\n/**\n * @summary Available actions\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const ACTIONS = {\n ROTATE_LAT_UP : 'rotateLatitudeUp',\n ROTATE_LAT_DOWN : 'rotateLatitudeDown',\n ROTATE_LONG_RIGHT: 'rotateLongitudeRight',\n ROTATE_LONG_LEFT : 'rotateLongitudeLeft',\n ZOOM_IN : 'zoomIn',\n ZOOM_OUT : 'zoomOut',\n TOGGLE_AUTOROTATE: 'toggleAutorotate',\n};\n\n/**\n * @summary Available events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event autorotate\n * @memberof PSV\n * @summary Triggered when the automatic rotation is enabled/disabled\n * @param {boolean} enabled\n */\n AUTOROTATE : 'autorotate',\n /**\n * @event before-render\n * @memberof PSV\n * @summary Triggered before a render, used to modify the view\n * @param {number} timestamp - time provided by requestAnimationFrame\n */\n BEFORE_RENDER : 'before-render',\n /**\n * @event before-rotate\n * @memberOf PSV\n * @summary Triggered before a rotate operation, can be cancelled\n * @param {PSV.ExtendedPosition}\n */\n BEFORE_ROTATE : 'before-rotate',\n /**\n * @event click\n * @memberof PSV\n * @summary Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)\n * @param {PSV.ClickData} data\n */\n CLICK : 'click',\n /**\n * @event close-panel\n * @memberof PSV\n * @summary Trigered when the panel is closed\n * @param {string} [id]\n */\n CLOSE_PANEL : 'close-panel',\n /**\n * @event config-changed\n * @memberOf PSV\n * @summary Triggered after a call to setOption/setOptions\n * @param {string[]} name of changed options\n */\n CONFIG_CHANGED : 'config-changed',\n /**\n * @event dblclick\n * @memberof PSV\n * @summary Triggered when the user double clicks on the viewer. The simple `click` event is always fired before `dblclick`\n * @param {PSV.ClickData} data\n */\n DOUBLE_CLICK : 'dblclick',\n /**\n * @event fullscreen-updated\n * @memberof PSV\n * @summary Triggered when the fullscreen mode is enabled/disabled\n * @param {boolean} enabled\n */\n FULLSCREEN_UPDATED: 'fullscreen-updated',\n /**\n * @event hide-notification\n * @memberof PSV\n * @summary Trigered when the notification is hidden\n */\n HIDE_NOTIFICATION : 'hide-notification',\n /**\n * @event hide-overlay\n * @memberof PSV\n * @summary Trigered when the overlay is hidden\n * @param {string} [id]\n */\n HIDE_OVERLAY : 'hide-overlay',\n /**\n * @event hide-tooltip\n * @memberof PSV\n * @summary Trigered when the tooltip is hidden\n * @param {*} Data associated to this tooltip\n */\n HIDE_TOOLTIP : 'hide-tooltip',\n /**\n * @event open-panel\n * @memberof PSV\n * @summary Triggered when the panel is opened\n * @param {string} [id]\n */\n OPEN_PANEL : 'open-panel',\n /**\n * @event panorama-loaded\n * @memberof PSV\n * @summary Triggered when a panorama image has been loaded\n */\n PANORAMA_LOADED : 'panorama-loaded',\n /**\n * @event position-updated\n * @memberof PSV\n * @summary Triggered when the view longitude and/or latitude changes\n * @param {PSV.Position} position\n */\n POSITION_UPDATED : 'position-updated',\n /**\n * @event ready\n * @memberof PSV\n * @summary Triggered when the panorama image has been loaded and the viewer is ready to perform the first render\n */\n READY : 'ready',\n /**\n * @event render\n * @memberof PSV\n * @summary Triggered on each viewer render, **this event is triggered very often**\n */\n RENDER : 'render',\n /**\n * @event show-notification\n * @memberof PSV\n * @summary Trigered when the notification is shown\n */\n SHOW_NOTIFICATION : 'show-notification',\n /**\n * @event show-overlay\n * @memberof PSV\n * @summary Trigered when the overlay is shown\n * @param {string} [id]\n */\n SHOW_OVERLAY : 'show-overlay',\n /**\n * @event show-tooltip\n * @memberof PSV\n * @summary Trigered when the tooltip is shown\n * @param {*} Data associated to this tooltip\n * @param {PSV.components.Tooltip} Instance of the tooltip\n */\n SHOW_TOOLTIP : 'show-tooltip',\n /**\n * @event size-updated\n * @memberof PSV\n * @summary Triggered when the viewer size changes\n * @param {PSV.Size} size\n */\n SIZE_UPDATED : 'size-updated',\n /**\n * @event stop-all\n * @memberof PSV\n * @summary Triggered when all current animations are stopped\n */\n STOP_ALL : 'stop-all',\n /**\n * @event zoom-updated\n * @memberof PSV\n * @summary Triggered when the zoom level changes\n * @param {number} zoomLevel\n */\n ZOOM_UPDATED : 'zoom-updated',\n};\n\n/**\n * @summary Available change events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const CHANGE_EVENTS = {\n /**\n * @event get-animate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of an animation\n */\n GET_ANIMATE_POSITION: 'get-animate-position',\n /**\n * @event get-rotate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of a rotation\n */\n GET_ROTATE_POSITION : 'get-rotate-position',\n};\n\n/**\n * @summary Internal identifiers for various stuff\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const IDS = {\n MENU : 'menu',\n TWO_FINGERS: 'twoFingers',\n CTRL_ZOOM : 'ctrlZoom',\n ERROR : 'error',\n};\n\n/* eslint-disable */\n// @formatter:off\n/**\n * @summary Collection of easing functions\n * @memberOf PSV.constants\n * @see {@link https://gist.github.com/frederickk/6165768}\n * @type {Object}\n * @constant\n */\nexport const EASINGS = {\n linear : (t) => t,\n\n inQuad : (t) => t*t,\n outQuad : (t) => t*(2-t),\n inOutQuad : (t) => t<.5 ? 2*t*t : -1+(4-2*t)*t,\n\n inCubic : (t) => t*t*t,\n outCubic : (t) => (--t)*t*t+1,\n inOutCubic: (t) => t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1,\n\n inQuart : (t) => t*t*t*t,\n outQuart : (t) => 1-(--t)*t*t*t,\n inOutQuart: (t) => t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t,\n\n inQuint : (t) => t*t*t*t*t,\n outQuint : (t) => 1+(--t)*t*t*t*t,\n inOutQuint: (t) => t<.5 ? 16*t*t*t*t*t : 1+16*(--t)*t*t*t*t,\n\n inSine : (t) => 1-Math.cos(t*(Math.PI/2)),\n outSine : (t) => Math.sin(t*(Math.PI/2)),\n inOutSine : (t) => .5-.5*Math.cos(Math.PI*t),\n\n inExpo : (t) => Math.pow(2, 10*(t-1)),\n outExpo : (t) => 1-Math.pow(2, -10*t),\n inOutExpo : (t) => (t=t*2-1)<0 ? .5*Math.pow(2, 10*t) : 1-.5*Math.pow(2, -10*t),\n\n inCirc : (t) => 1-Math.sqrt(1-t*t),\n outCirc : (t) => Math.sqrt(1-(t-1)*(t-1)),\n inOutCirc : (t) => (t*=2)<1 ? .5-.5*Math.sqrt(1-t*t) : .5+.5*Math.sqrt(1-(t-=2)*t)\n};\n// @formatter:on\n/* eslint-enable */\n","/**\n * @summary Toggles a CSS class\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} element\n * @param {string} className\n * @param {boolean} [active] - forced state\n */\nexport function toggleClass(element, className, active) {\n // manual implementation for IE11 and SVGElement\n if (!element.classList) {\n let currentClassName = element.getAttribute('class') || '';\n const currentActive = currentClassName.indexOf(className) !== -1;\n const regex = new RegExp('(?:^|\\\\s)' + className + '(?:\\\\s|$)');\n\n if ((active === undefined || active) && !currentActive) {\n currentClassName += currentClassName.length > 0 ? ' ' + className : className;\n }\n else if (!active) {\n currentClassName = currentClassName.replace(regex, ' ');\n }\n\n element.setAttribute('class', currentClassName);\n }\n else if (active === undefined) {\n element.classList.toggle(className);\n }\n else if (active && !element.classList.contains(className)) {\n element.classList.add(className);\n }\n else if (!active) {\n element.classList.remove(className);\n }\n}\n\n/**\n * @summary Adds one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function addClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, true);\n });\n }\n}\n\n/**\n * @summary Removes one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function removeClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, false);\n });\n }\n}\n\n/**\n * @summary Searches if an element has a particular parent at any level including itself\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @returns {boolean}\n */\nexport function hasParent(el, parent) {\n let test = el;\n\n do {\n if (test === parent) {\n return true;\n }\n test = test.parentNode;\n } while (test);\n\n return false;\n}\n\n/**\n * @summary Gets the closest parent (can by itself)\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} el\n * @param {string} selector\n * @returns {HTMLElement}\n */\nexport function getClosest(el, selector) {\n const matches = el.matches || el.msMatchesSelector;\n let test = el;\n // When el is document or window, the matches does not exist\n if (!matches) {\n return null;\n }\n\n do {\n if (matches.bind(test)(selector)) {\n return test;\n }\n test = test instanceof SVGElement ? test.parentNode : test.parentElement;\n } while (test);\n\n return null;\n}\n\n/**\n * @summary Map between keyboard events `keyCode|which` and `key`\n * @memberOf PSV.utils\n * @type {Object}\n * @readonly\n * @private\n */\nconst KEYMAP = {\n 13 : 'Enter',\n 17 : 'Control',\n 27 : 'Escape',\n 32 : ' ',\n 33 : 'PageUp',\n 34 : 'PageDown',\n 37 : 'ArrowLeft',\n 38 : 'ArrowUp',\n 39 : 'ArrowRight',\n 40 : 'ArrowDown',\n 46 : 'Delete',\n 107: '+',\n 109: '-',\n};\n\n/**\n * @summary Map for non standard keyboard events `key` for IE and Edge\n * @see https://github.com/shvaikalesh/shim-keyboard-event-key\n * @type {Object}\n * @readonly\n * @private\n */\nconst MS_KEYMAP = {\n Add : '+',\n Del : 'Delete',\n Down : 'ArrowDown',\n Esc : 'Escape',\n Left : 'ArrowLeft',\n Right : 'ArrowRight',\n Spacebar: ' ',\n Subtract: '-',\n Up : 'ArrowUp',\n};\n\n/**\n * @summary Returns the key name of a KeyboardEvent\n * @memberOf PSV.utils\n * @param {KeyboardEvent} evt\n * @returns {string}\n */\nexport function getEventKey(evt) {\n let key = evt.key || KEYMAP[evt.keyCode || evt.which];\n\n if (key && MS_KEYMAP[key]) {\n key = MS_KEYMAP[key];\n }\n\n return key;\n}\n\n/**\n * @summary Detects if fullscreen is enabled\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @returns {boolean}\n */\nexport function isFullscreenEnabled(elt) {\n /* eslint-disable-next-line max-len */\n return (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) === elt;\n}\n\n/**\n * @summary Enters fullscreen mode\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n */\nexport function requestFullscreen(elt) {\n /* eslint-disable-next-line max-len */\n (elt.requestFullscreen || elt.mozRequestFullScreen || elt.webkitRequestFullscreen || elt.msRequestFullscreen).call(elt);\n}\n\n/**\n * @summary Exits fullscreen mode\n * @memberOf PSV.utils\n */\nexport function exitFullscreen() {\n /* eslint-disable-next-line max-len */\n (document.exitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.msExitFullscreen).call(document);\n}\n\n/**\n * @summary Gets an element style\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @param {string} prop\n * @returns {*}\n */\nexport function getStyle(elt, prop) {\n return window.getComputedStyle(elt, null)[prop];\n}\n\n/**\n * @summary Normalize mousewheel values accross browsers\n * @memberOf PSV.utils\n * @description From Facebook's Fixed Data Table\n * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js}\n * @copyright Facebook\n * @param {WheelEvent} event\n * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}}\n */\nexport function normalizeWheel(event) {\n const PIXEL_STEP = 10;\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n\n let spinX = 0;\n let spinY = 0;\n let pixelX = 0;\n let pixelY = 0;\n\n // Legacy\n if ('detail' in event) {\n spinY = event.detail;\n }\n if ('wheelDelta' in event) {\n spinY = -event.wheelDelta / 120;\n }\n if ('wheelDeltaY' in event) {\n spinY = -event.wheelDeltaY / 120;\n }\n if ('wheelDeltaX' in event) {\n spinX = -event.wheelDeltaX / 120;\n }\n\n // side scrolling on FF with DOMMouseScroll\n if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n spinX = spinY;\n spinY = 0;\n }\n\n pixelX = spinX * PIXEL_STEP;\n pixelY = spinY * PIXEL_STEP;\n\n if ('deltaY' in event) {\n pixelY = event.deltaY;\n }\n if ('deltaX' in event) {\n pixelX = event.deltaX;\n }\n\n if ((pixelX || pixelY) && event.deltaMode) {\n // delta in LINE units\n if (event.deltaMode === 1) {\n pixelX *= LINE_HEIGHT;\n pixelY *= LINE_HEIGHT;\n }\n // delta in PAGE units\n else {\n pixelX *= PAGE_HEIGHT;\n pixelY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pixelX && !spinX) {\n spinX = (pixelX < 1) ? -1 : 1;\n }\n if (pixelY && !spinY) {\n spinY = (pixelY < 1) ? -1 : 1;\n }\n\n return { spinX, spinY, pixelX, pixelY };\n}\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * Returns the distance between two points on a sphere of radius one\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Transforms a string to dash-case{@link https://github.com/shahata/dasherize}\n * @memberOf PSV.utils\n * @param {string} str\n * @returns {string}\n */\nexport function dasherize(str) {\n return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {\n return (i > 0 ? '-' : '') + s.toLowerCase();\n });\n}\n\n/**\n * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n * @memberOf PSV.utils\n * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401}\n * @param {Function} func\n * @param {number} wait\n * @returns {Function}\n */\nexport function throttle(func, wait) {\n /* eslint-disable */\n let self, args, result;\n let timeout;\n let previous = 0;\n const later = function() {\n previous = Date.now();\n timeout = undefined;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n };\n return function() {\n const now = Date.now();\n if (!previous) {\n previous = now;\n }\n const remaining = wait - (now - previous);\n self = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n previous = now;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n }\n else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n /* eslint-enable */\n}\n\n/**\n * @summary Test if an object is a plain object\n * @memberOf PSV.utils\n * @description Test if an object is a plain object, i.e. is constructed\n * by the built-in Object constructor and inherits directly from Object.prototype\n * or null. Some built-in objects pass the test, e.g. Math which is a plain object\n * and some host or exotic objects may pass also.\n * {@link http://stackoverflow.com/a/5878101/1207670}\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isPlainObject(obj) {\n // Basic check for Type object that's not null\n if (typeof obj === 'object' && obj !== null) {\n // If Object.getPrototypeOf supported, use it\n if (typeof Object.getPrototypeOf === 'function') {\n const proto = Object.getPrototypeOf(obj);\n return proto === Object.prototype || proto === null;\n }\n\n // Otherwise, use internal class\n // This should be reliable as if getPrototypeOf not supported, is pre-ES5\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n // Not an object\n return false;\n}\n\n/**\n * @summary Merges the enumerable attributes of two objects\n * @memberOf PSV.utils\n * @description Replaces arrays and alters the target object.\n * @copyright Nicholas Fisher \n * @param {Object} target\n * @param {Object} src\n * @returns {Object} target\n */\nexport function deepmerge(target, src) {\n /* eslint-disable */\n let first = src;\n\n return (function merge(target, src) {\n if (Array.isArray(src)) {\n if (!target || !Array.isArray(target)) {\n target = [];\n }\n else {\n target.length = 0;\n }\n src.forEach(function(e, i) {\n target[i] = merge(null, e);\n });\n }\n else if (typeof src === 'object') {\n if (!target || Array.isArray(target)) {\n target = {};\n }\n Object.keys(src).forEach(function(key) {\n if (typeof src[key] !== 'object' || !src[key] || !isPlainObject(src[key])) {\n target[key] = src[key];\n }\n else if (src[key] != first) {\n if (!target[key]) {\n target[key] = merge(null, src[key]);\n }\n else {\n merge(target[key], src[key]);\n }\n }\n });\n }\n else {\n target = src;\n }\n\n return target;\n }(target, src));\n /* eslint-enable */\n}\n\n/**\n * @summary Deeply clones an object\n * @memberOf PSV.utils\n * @param {Object} src\n * @returns {Object}\n */\nexport function clone(src) {\n return deepmerge(null, src);\n}\n\n/**\n * @summery Test of an object is empty\n * @memberOf PSV.utils\n * @param {object} obj\n * @returns {boolean}\n */\nexport function isEmpty(obj) {\n return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);\n}\n\n/**\n * @summary Loops over enumerable properties of an object\n * @memberOf PSV.utils\n * @param {Object} object\n * @param {Function} callback\n */\nexport function each(object, callback) {\n Object.keys(object).forEach((key) => {\n callback(object[key], key);\n });\n}\n\n/**\n * @summary Returns the intersection between two arrays\n * @memberOf PSV.utils\n * @template T\n * @param {T[]} array1\n * @param {T[]} array2\n * @returns {T[]}\n */\nexport function intersect(array1, array2) {\n return array1.filter(value => array2.indexOf(value) !== -1);\n}\n","/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound } from './math';\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (string)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n return result[1];\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n return result[1];\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|object} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.Math.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.Math.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = (zeroCenter ? parsed + Math.PI : parsed) % (Math.PI * 2);\n\n if (parsed < 0) {\n parsed += Math.PI * 2;\n }\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n","/**\n * @namespace PSV.utils\n */\n\nexport * from './browser.js';\nexport * from './math.js';\nexport * from './misc.js';\nexport * from './psv.js';\n","import { EASINGS } from './data/constants';\nimport { each } from './utils';\n\n/**\n * @callback OnTick\n * @summary Function called for each animation frame with computed properties\n * @memberOf PSV.Animation\n * @param {Object.} properties - current values\n * @param {float} progress - 0 to 1\n */\n\n/**\n * @summary Interpolation helper for animations\n * @memberOf PSV\n * @description\n * Implements the Promise API with an additional \"cancel\" and \"finally\" methods.\n * The promise is resolved when the animation is complete and rejected if the animation is cancelled.\n * @example\n * new Animation({\n * properties: {\n * width: {start: 100, end: 200}\n * },\n * duration: 5000,\n * onTick: (properties) => element.style.width = `${properties.width}px`;\n * })\n */\nexport class Animation {\n\n /**\n * @param {Object} options\n * @param {Object.} options.properties\n * @param {number} options.properties[].start\n * @param {number} options.properties[].end\n * @param {number} options.duration\n * @param {number} [options.delay=0]\n * @param {string} [options.easing='linear']\n * @param {PSV.Animation.OnTick} options.onTick - called on each frame\n */\n constructor(options) {\n this.__cancelled = false;\n this.__resolved = false;\n\n this.__promise = new Promise((resolve, reject) => {\n this.__resolve = resolve;\n this.__reject = reject;\n });\n\n if (options) {\n if (!options.easing || typeof options.easing === 'string') {\n options.easing = EASINGS[options.easing || 'linear'];\n }\n this.__start = null;\n this.options = options;\n\n if (options.delay) {\n this.__delayTimeout = setTimeout(() => {\n this.__delayTimeout = null;\n window.requestAnimationFrame(t => this.__run(t));\n }, options.delay);\n }\n else {\n window.requestAnimationFrame(t => this.__run(t));\n }\n }\n }\n\n /**\n * @summary Main loop for the animation\n * @param {number} timestamp\n * @private\n */\n __run(timestamp) {\n // the animation has been cancelled\n if (this.__cancelled) {\n return;\n }\n\n // first iteration\n if (this.__start === null) {\n this.__start = timestamp;\n }\n\n // compute progress\n const progress = (timestamp - this.__start) / this.options.duration;\n const current = {};\n\n if (progress < 1.0) {\n // interpolate properties\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.start + (prop.end - prop.start) * this.options.easing(progress);\n }\n });\n\n this.options.onTick(current, progress);\n\n window.requestAnimationFrame(t => this.__run(t));\n }\n else {\n // call onTick one last time with final values\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.end;\n }\n });\n\n this.options.onTick(current, 1.0);\n\n window.requestAnimationFrame(() => {\n this.__resolved = true;\n this.__resolve();\n });\n }\n }\n\n /**\n * @summary Animation chaining\n * @param {Function} [onFulfilled] - Called when the animation is complete, can return a new animation\n * @param {Function} [onRejected] - Called when the animation is cancelled\n * @returns {PSV.Animation}\n */\n then(onFulfilled = null, onRejected = null) {\n const p = new Animation();\n\n // Allow cancellation to climb up the promise chain\n p.__promise.then(null, () => this.cancel());\n\n this.__promise.then(\n () => p.__resolve(onFulfilled ? onFulfilled() : undefined),\n () => p.__reject(onRejected ? onRejected() : undefined)\n );\n\n return p;\n }\n\n /**\n * @summary Alias to `.then(null, onRejected)`\n * @param {Function} onRejected - Called when the animation has been cancelled\n * @returns {PSV.Animation}\n */\n catch(onRejected) {\n return this.then(undefined, onRejected);\n }\n\n /**\n * @summary Alias to `.then(onFinally, onFinally)`\n * @param {Function} onFinally - Called when the animation is either complete or cancelled\n * @returns {PSV.Animation}\n */\n finally(onFinally) {\n return this.then(onFinally, onFinally);\n }\n\n /**\n * @summary Cancels the animation\n */\n cancel() {\n if (!this.__cancelled && !this.__resolved) {\n this.__cancelled = true;\n this.__reject();\n\n if (this.__delayTimeout) {\n window.cancelAnimationFrame(this.__delayTimeout);\n this.__delayTimeout = null;\n }\n }\n }\n\n /**\n * @summary Returns a resolved animation promise\n * @returns {PSV.Animation}\n */\n static resolve() {\n const p = Promise.resolve();\n p.cancel = () => {\n };\n p.finally = (onFinally) => {\n return p.then(onFinally, onFinally);\n };\n return p;\n }\n\n}\n","/**\n * @namespace PSV.components\n */\n\n/**\n * @summary Base component class\n * @memberof PSV.components\n * @abstract\n */\nexport class AbstractComponent {\n\n /**\n * @param {PSV.Viewer | PSV.components.AbstractComponent} parent\n * @param {string} className - CSS class added to the component's container\n */\n constructor(parent, className) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = parent.psv || parent;\n\n /**\n * @member {PSV.Viewer|PSV.components.AbstractComponent}\n * @readonly\n */\n this.parent = parent;\n this.parent.children.push(this);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} visible - Visibility of the component\n */\n this.prop = {\n visible: true,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = className;\n this.parent.container.appendChild(this.container);\n }\n\n /**\n * @summary Destroys the component\n * @protected\n */\n destroy() {\n this.parent.container.removeChild(this.container);\n\n const childIdx = this.parent.children.indexOf(this);\n if (childIdx !== -1) {\n this.parent.children.splice(childIdx, 1);\n }\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n delete this.container;\n delete this.parent;\n delete this.psv;\n delete this.prop;\n }\n\n /**\n * @summary Refresh UI\n * @description Must be be a very lightweight operation\n * @package\n */\n refreshUi() {\n this.children.every((child) => {\n child.refreshUi();\n return this.psv.prop.uiRefresh === true;\n });\n }\n\n /**\n * @summary Displays or hides the component\n */\n toggle() {\n if (this.isVisible()) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n\n /**\n * @summary Hides the component\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Displays the component\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Check if the component is visible\n * @returns {boolean}\n */\n isVisible() {\n return this.prop.visible;\n }\n\n}\n","import { AbstractComponent } from '../components/AbstractComponent';\nimport { PSVError } from '../PSVError';\nimport { isPlainObject, toggleClass } from '../utils';\n\n/**\n * @namespace PSV.buttons\n */\n\n/**\n * @summary Base navbar button class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.buttons\n * @abstract\n */\nexport class AbstractButton extends AbstractComponent {\n\n /**\n * @summary Unique identifier of the button\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary SVG icon name injected in the button\n * @member {string}\n * @readonly\n * @static\n */\n static icon = null;\n\n /**\n * @summary SVG icon name injected in the button when it is active\n * @member {string}\n * @readonly\n * @static\n */\n static iconActive = null;\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} [className] - Additional CSS classes\n * @param {boolean} [collapsable=false] - `true` if the button can be moved to menu when the navbar is too small\n */\n constructor(navbar, className = '', collapsable = false) {\n super(navbar, 'psv-button ' + className);\n\n /**\n * @override\n * @property {string} id - Unique identifier of the button\n * @property {boolean} enabled\n * @property {boolean} supported\n * @property {boolean} collapsed\n * @property {boolean} active\n * @property {number} width\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable: collapsable,\n enabled : true,\n supported : true,\n collapsed : false,\n active : false,\n width : this.container.offsetWidth,\n };\n\n if (this.constructor.icon) {\n this.__setIcon(this.constructor.icon);\n }\n\n if (this.prop.id && this.psv.config.lang[this.prop.id]) {\n this.container.title = this.psv.config.lang[this.prop.id];\n }\n\n this.container.addEventListener('click', (e) => {\n if (this.prop.enabled) {\n this.onClick();\n }\n e.stopPropagation();\n });\n }\n\n /**\n * @package\n */\n checkSupported() {\n const supportedOrObject = this.isSupported();\n if (isPlainObject(supportedOrObject)) {\n if (supportedOrObject.initial === false) {\n this.hide();\n this.prop.supported = false;\n }\n\n supportedOrObject.promise.then((supported) => {\n if (!this.prop) {\n return; // the component has been destroyed\n }\n this.prop.supported = supported;\n if (!supported && this.prop.visible) {\n this.hide();\n }\n else if (supported && !this.prop.visible) {\n this.show();\n }\n });\n }\n else if (!supportedOrObject) {\n this.hide();\n this.prop.supported = false;\n }\n }\n\n /**\n * @summary Checks if the button can be displayed\n * @returns {boolean|{initial: boolean, promise: Promise}}\n */\n isSupported() {\n return true;\n }\n\n /**\n * @summary Changes the active state of the button\n * @param {boolean} [active] - forced state\n */\n toggleActive(active) {\n this.prop.active = active !== undefined ? active : !this.prop.active;\n toggleClass(this.container, 'psv-button--active', this.prop.active);\n\n if (this.constructor.iconActive) {\n this.__setIcon(this.prop.active ? this.constructor.iconActive : this.constructor.icon);\n }\n }\n\n /**\n * @override\n */\n show(refresh = true) {\n if (!this.isVisible()) {\n this.prop.visible = true;\n if (!this.prop.collapsed) {\n this.container.style.display = '';\n }\n if (refresh) {\n this.psv.refreshUi(`show button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @override\n */\n hide(refresh = true) {\n if (this.isVisible()) {\n this.prop.visible = false;\n this.container.style.display = 'none';\n if (refresh) {\n this.psv.refreshUi(`hide button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @summary Disables the button\n */\n disable() {\n this.container.classList.add('psv-button--disabled');\n this.prop.enabled = false;\n }\n\n /**\n * @summary Enables the button\n */\n enable() {\n this.container.classList.remove('psv-button--disabled');\n this.prop.enabled = true;\n }\n\n /**\n * @summary Collapses the button in the navbar menu\n */\n collapse() {\n this.prop.collapsed = true;\n this.container.style.display = 'none';\n }\n\n /**\n * @summary Uncollapses the button from the navbar menu\n */\n uncollapse() {\n this.prop.collapsed = false;\n if (this.prop.visible) {\n this.container.style.display = '';\n }\n }\n\n /**\n * @summary Set the button icon\n * @param {string} icon SVG\n * @param {HTMLElement} [container] - default is the main button container\n * @private\n */\n __setIcon(icon, container = this.container) {\n if (icon) {\n container.innerHTML = icon;\n // classList not supported on IE11, className is read-only !!!!\n container.querySelector('svg').setAttribute('class', 'psv-button-svg');\n }\n else {\n container.innerHTML = '';\n }\n }\n\n /**\n * @summary Action when the button is clicked\n * @private\n * @abstract\n */\n onClick() {\n throw new PSVError(`onClick not implemented for button \"${this.prop.id}\".`);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport playActive from '../icons/play-active.svg';\nimport play from '../icons/play.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar autorotate button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AutorotateButton extends AbstractButton {\n\n static id = 'autorotate';\n static icon = play;\n static iconActive = playActive;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-autorotate-button', true);\n\n this.psv.on(EVENTS.AUTOROTATE, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.AUTOROTATE, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.AUTOROTATE: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles autorotate\n */\n onClick() {\n this.psv.toggleAutorotate();\n }\n\n}\n","import { addClasses } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar custom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CustomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {PSV.NavbarCustomButton} config\n */\n constructor(navbar, config) {\n super(navbar, 'psv-custom-button', config.collapsable !== false);\n\n /**\n * @member {Object}\n * @readonly\n * @private\n */\n this.config = config;\n\n if (this.config.id) {\n this.prop.id = this.config.id;\n }\n else {\n this.prop.id = 'psvButton-' + Math.random().toString(36).substr(2, 9);\n }\n\n if (this.config.className) {\n addClasses(this.container, this.config.className);\n }\n\n if (this.config.title) {\n this.container.title = this.config.title;\n }\n\n if (this.config.content) {\n this.container.innerHTML = this.config.content;\n }\n\n this.width = this.container.offsetWidth;\n\n if (this.config.enabled === false) {\n this.disable();\n }\n\n if (this.config.visible === false) {\n this.hide();\n }\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.config;\n\n super.destroy();\n }\n\n /**\n * @override\n * @description Calls user method\n */\n onClick() {\n if (this.config.onClick) {\n this.config.onClick.apply(this.psv);\n }\n }\n\n}\n","import { AbstractButton } from './AbstractButton';\nimport download from '../icons/download.svg';\n\n/**\n * @summary Navigation bar download button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DownloadButton extends AbstractButton {\n\n static id = 'download';\n static icon = download;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-download-button', true);\n }\n\n /**\n * @override\n * @description Asks the browser to download the panorama source file\n */\n onClick() {\n const link = document.createElement('a');\n link.href = this.psv.config.panorama;\n link.download = this.psv.config.panorama;\n this.psv.container.appendChild(link);\n link.click();\n\n setTimeout(() => {\n this.psv.container.removeChild(link);\n }, 100);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport fullscreenIn from '../icons/fullscreen-in.svg';\nimport fullscreenOut from '../icons/fullscreen-out.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar fullscreen button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class FullscreenButton extends AbstractButton {\n\n static id = 'fullscreen';\n static icon = fullscreenIn;\n static iconActive = fullscreenOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-fullscreen-button');\n\n this.psv.on(EVENTS.FULLSCREEN_UPDATED, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.FULLSCREEN_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * Handle events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.FULLSCREEN_UPDATED: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles fullscreen\n */\n onClick() {\n this.psv.toggleFullscreen();\n }\n\n}\n","import { EVENTS, IDS } from '../data/constants';\nimport menuIcon from '../icons/menu.svg';\nimport { dasherize, getClosest } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar menu button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MenuButton extends AbstractButton {\n\n static id = 'menu';\n static icon = menuIcon;\n\n /**\n * @summary Property name added to buttons list\n * @type {string}\n * @constant\n */\n static BUTTON_DATA = 'psvButton';\n\n /**\n * @summary Menu template\n * @param {AbstractButton[]} buttons\n * @param {PSV.Viewer} psv\n * @param {string} dataKey\n * @returns {string}\n */\n static MENU_TEMPLATE = (buttons, psv, dataKey) => `\n
\n

${menuIcon} ${psv.config.lang.menu}

\n
    \n ${buttons.map(button => `\n
  • \n ${button.container.innerHTML}\n ${button.container.title}\n
  • \n `).join('')}\n
\n
\n`;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-menu-button');\n\n this.psv.on(EVENTS.OPEN_PANEL, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.OPEN_PANEL, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === IDS.MENU); break;\n case EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n this.__hideMenu();\n }\n\n /**\n * @override\n */\n show(refresh) {\n super.show(refresh);\n\n if (this.prop.active) {\n this.__showMenu();\n }\n }\n\n /**\n * @override\n * @description Toggles menu\n */\n onClick() {\n if (this.prop.active) {\n this.__hideMenu();\n }\n else {\n this.__showMenu();\n }\n }\n\n __showMenu() {\n this.psv.panel.show({\n id : IDS.MENU,\n content : MenuButton.MENU_TEMPLATE(this.parent.collapsed, this.psv, dasherize(MenuButton.BUTTON_DATA)),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? getClosest(e.target, 'li') : undefined;\n const buttonId = li ? li.dataset[MenuButton.BUTTON_DATA] : undefined;\n\n if (buttonId) {\n this.parent.getButton(buttonId).onClick();\n this.__hideMenu();\n }\n },\n });\n }\n\n __hideMenu() {\n if (this.psv.panel) {\n this.psv.panel.hide(IDS.MENU);\n }\n }\n\n}\n","/**\n * @summary General information about the system\n * @constant\n * @memberOf PSV\n * @property {boolean} loaded - Indicates if the system has been loaded yet\n * @property {Function} load - Loads the system if not already loaded\n * @property {number} pixelRatio\n * @property {boolean} isWebGLSupported\n * @property {number} maxTextureWidth\n * @property {number} maxCanvasWidth\n * @property {string} mouseWheelEvent\n * @property {string} fullscreenEvent\n * @property {Promise} isTouchEnabled\n */\nexport const SYSTEM = {\n loaded : false,\n pixelRatio : 1,\n isWebGLSupported: false,\n isTouchEnabled : null,\n maxTextureWidth : 0,\n maxCanvasWidth : 0,\n mouseWheelEvent : null,\n fullscreenEvent : null,\n};\n\n/**\n * @summary Loads the system if not already loaded\n */\nSYSTEM.load = () => {\n if (!SYSTEM.loaded) {\n const ctx = getWebGLCtx();\n\n SYSTEM.loaded = true;\n SYSTEM.pixelRatio = window.devicePixelRatio || 1;\n SYSTEM.isWebGLSupported = ctx != null;\n SYSTEM.isTouchEnabled = isTouchEnabled();\n SYSTEM.maxTextureWidth = getMaxTextureWidth(ctx);\n SYSTEM.maxCanvasWidth = getMaxCanvasWidth(SYSTEM.maxTextureWidth);\n SYSTEM.mouseWheelEvent = getMouseWheelEvent();\n SYSTEM.fullscreenEvent = getFullscreenEvent();\n }\n};\n\n/**\n * @summary Tries to return a canvas webgl context\n * @returns {WebGLRenderingContext}\n * @private\n */\nfunction getWebGLCtx() {\n const canvas = document.createElement('canvas');\n const names = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'];\n let context = null;\n\n if (!canvas.getContext) {\n return null;\n }\n\n if (names.some((name) => {\n try {\n context = canvas.getContext(name);\n return context !== null;\n }\n catch (e) {\n return false;\n }\n })) {\n return context;\n }\n else {\n return null;\n }\n}\n\n/**\n * @summary Detects if the user is using a touch screen\n * @returns {Promise}\n * @private\n */\nfunction isTouchEnabled() {\n return new Promise((resolve) => {\n const listener = (e) => {\n if (e) {\n resolve(true);\n }\n else {\n resolve(false);\n }\n\n window.removeEventListener('touchstart', listener);\n };\n\n window.addEventListener('touchstart', listener, false);\n\n // after 10 secs auto-reject the promise\n setTimeout(listener, 10000);\n });\n}\n\n/**\n * @summary Gets max texture width in WebGL context\n * @returns {number}\n * @private\n */\nfunction getMaxTextureWidth(ctx) {\n if (ctx !== null) {\n return ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n }\n else {\n return 0;\n }\n}\n\n/**\n * @summary Gets max canvas width supported by the browser.\n * We only test powers of 2 and height = width / 2 because that's what we need to generate WebGL textures\n * @param maxWidth\n * @return {number}\n * @private\n */\nfunction getMaxCanvasWidth(maxWidth) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = maxWidth;\n canvas.height = maxWidth / 2;\n\n while (canvas.width > 1024) {\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, 1, 1);\n\n try {\n if (ctx.getImageData(0, 0, 1, 1).data[0] === 255) {\n return canvas.width;\n }\n }\n catch (e) {\n // continue\n }\n\n canvas.width /= 2;\n canvas.height /= 2;\n }\n\n return 0;\n}\n\n/**\n * @summary Gets the event name for mouse wheel\n * @returns {string}\n * @private\n */\nfunction getMouseWheelEvent() {\n if ('onwheel' in document.createElement('div')) { // Modern browsers support \"wheel\"\n return 'wheel';\n }\n else if (document.onmousewheel !== undefined) { // Webkit and IE support at least \"mousewheel\"\n return 'mousewheel';\n }\n else { // let's assume that remaining browsers are older Firefox\n return 'DOMMouseScroll';\n }\n}\n\n/**\n * @summary Map between fullsceen method and fullscreen event name\n * @type {Object}\n * @readonly\n * @private\n */\nconst FULLSCREEN_EVT_MAP = {\n exitFullscreen : 'fullscreenchange',\n webkitExitFullscreen: 'webkitfullscreenchange',\n mozCancelFullScreen : 'mozfullscreenchange',\n msExitFullscreen : 'MSFullscreenChange',\n};\n\n\n/**\n * @summary Gets the event name for fullscreen\n * @returns {string}\n * @private\n */\nfunction getFullscreenEvent() {\n const validExits = Object.keys(FULLSCREEN_EVT_MAP).filter(exit => exit in document);\n\n if (validExits.length) {\n return FULLSCREEN_EVT_MAP[validExits[0]];\n }\n else {\n return null;\n }\n}\n","import { Animation } from '../Animation';\nimport { SYSTEM } from '../data/system';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractZoomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-zoom-button');\n\n /**\n * @override\n * @property {number} value\n * @property {boolean} buttondown\n * @property {*} longPressTimeout\n * @property {PSV.Animation} longPressAnimation\n */\n this.prop = {\n ...this.prop,\n value : value,\n buttondown : false,\n longPressTimeout : null,\n longPressAnimation: null,\n };\n\n this.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return { initial: true, promise: SYSTEM.isTouchEnabled.then(enabled => !enabled) };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Handles click events\n * @description Zooms in and register long press timer\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.buttondown = true;\n this.prop.longPressTimeout = setTimeout(() => this.__startLongPressInterval(), 100);\n }\n\n /**\n * @summary Continues zooming as long as the user presses the button\n * @private\n */\n __startLongPressInterval() {\n if (!this.prop.buttondown) {\n return;\n }\n\n const end = this.prop.value < 0 ? 0 : 100;\n\n this.prop.longPressAnimation = new Animation({\n properties: {\n zoom: { start: this.psv.prop.zoomLvl, end: end },\n },\n duration : 1500 * Math.abs(this.psv.prop.zoomLvl - end) / 100,\n easing : 'linear',\n onTick : (properties) => {\n this.psv.zoom(properties.zoom);\n },\n })\n .catch(() => {}); // ignore cancellation\n }\n\n /**\n * @summary Handles mouse up events\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled || !this.prop.buttondown) {\n return;\n }\n\n if (this.prop.longPressAnimation) {\n this.prop.longPressAnimation.cancel();\n this.prop.longPressAnimation = null;\n }\n else {\n this.psv.zoom(this.psv.prop.zoomLvl + this.prop.value * this.psv.config.zoomButtonIncrement);\n }\n\n if (this.prop.longPressTimeout) {\n clearTimeout(this.prop.longPressTimeout);\n }\n\n this.prop.buttondown = false;\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomIn from '../icons/zoom-in.svg';\n\n/**\n * @summary Navigation bar zoom-in button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomInButton extends AbstractZoomButton {\n\n static id = 'zoomIn';\n static icon = zoomIn;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 1);\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomOut from '../icons/zoom-out.svg';\n\n/**\n * @summary Navigation bar zoom-out button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomOutButton extends AbstractZoomButton {\n\n static id = 'zoomOut';\n static icon = zoomOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, -1);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { getStyle } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class ZoomRangeButton extends AbstractButton {\n\n static id = 'zoomRange';\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-zoom-range');\n\n /**\n * @override\n * @property {boolean} mousedown\n * @property {number} mediaMinWidth\n */\n this.prop = {\n ...this.prop,\n mousedown : false,\n mediaMinWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomRange = document.createElement('div');\n this.zoomRange.className = 'psv-zoom-range-line';\n this.container.appendChild(this.zoomRange);\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomValue = document.createElement('div');\n this.zoomValue.className = 'psv-zoom-range-handle';\n this.zoomRange.appendChild(this.zoomValue);\n\n this.prop.mediaMinWidth = parseInt(getStyle(this.container, 'maxWidth'), 10);\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n\n this.psv.on(EVENTS.ZOOM_UPDATED, this);\n\n if (this.psv.prop.ready) {\n this.__moveZoomValue(this.psv.prop.zoomLvl);\n }\n else {\n this.psv.once(EVENTS.READY, this);\n }\n\n this.refreshUi();\n }\n\n /**\n * @override\n */\n destroy() {\n this.__stopZoomChange();\n\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.zoomRange;\n delete this.zoomValue;\n\n this.psv.off(EVENTS.ZOOM_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__initZoomChangeWithMouse(e); break;\n case 'touchstart': this.__initZoomChangeByTouch(e); break;\n case 'mousemove': this.__changeZoomWithMouse(e); break;\n case 'touchmove': this.__changeZoomByTouch(e); break;\n case 'mouseup': this.__stopZoomChange(e); break;\n case 'touchend': this.__stopZoomChange(e); break;\n case EVENTS.ZOOM_UPDATED: this.__moveZoomValue(e.args[0]); break;\n case EVENTS.READY: this.__moveZoomValue(this.psv.prop.zoomLvl); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return { initial: true, promise: SYSTEM.isTouchEnabled.then(enabled => !enabled) };\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.supported) {\n if (this.psv.prop.size.width <= this.prop.mediaMinWidth && this.prop.visible) {\n this.hide();\n }\n else if (this.psv.prop.size.width > this.prop.mediaMinWidth && !this.prop.visible) {\n this.show();\n }\n }\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Moves the zoom cursor\n * @param {number} level\n * @private\n */\n __moveZoomValue(level) {\n this.zoomValue.style.left = (level / 100 * this.zoomRange.offsetWidth - this.zoomValue.offsetWidth / 2) + 'px';\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __initZoomChangeWithMouse(evt) {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = true;\n this.__changeZoom(evt.clientX);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __initZoomChangeByTouch(evt) {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = true;\n this.__changeZoom(evt.changedTouches[0].clientX);\n }\n\n /**\n * @summary Handles mouse up events\n * @private\n */\n __stopZoomChange() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.mousedown = false;\n this.prop.buttondown = false;\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __changeZoomWithMouse(evt) {\n if (!this.prop.enabled || !this.prop.mousedown) {\n return;\n }\n\n evt.preventDefault();\n this.__changeZoom(evt.clientX);\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __changeZoomByTouch(evt) {\n if (!this.prop.enabled || !this.prop.mousedown) {\n return;\n }\n this.__changeZoom(evt.changedTouches[0].clientX);\n }\n\n /**\n * @summary Zoom change\n * @param {number} x - mouse/touch position\n * @private\n */\n __changeZoom(x) {\n const userInput = x - this.zoomRange.getBoundingClientRect().left;\n const zoomLevel = userInput / this.zoomRange.offsetWidth * 100;\n this.psv.zoom(zoomLevel);\n }\n\n}\n","import { PSVError } from '../PSVError';\nimport { bound, clone, deepmerge, each, logWarn, parseAngle, parseSpeed } from '../utils';\nimport { ACTIONS } from './constants';\n\n/**\n * @summary Default options\n * @type {PSV.Options}\n * @memberOf PSV\n * @constant\n */\nexport const DEFAULTS = {\n panorama : null,\n container : null,\n caption : null,\n loadingImg : null,\n loadingTxt : 'Loading...',\n size : null,\n fisheye : false,\n minFov : 30,\n maxFov : 90,\n defaultZoomLvl : 50,\n defaultLong : 0,\n defaultLat : 0,\n sphereCorrection : {\n pan : 0,\n tilt: 0,\n roll: 0,\n },\n moveSpeed : 1,\n zoomButtonIncrement: 2,\n autorotateDelay : null,\n autorotateSpeed : '2rpm',\n autorotateLat : null,\n moveInertia : true,\n mousewheel : true,\n mousewheelSpeed : 1,\n mousemove : true,\n captureCursor : false,\n mousewheelCtrlKey : false,\n touchmoveTwoFingers: false,\n useXmpData : true,\n panoData : null,\n withCredentials : false,\n navbar : [\n 'autorotate',\n 'zoomOut',\n 'zoomRange',\n 'zoomIn',\n 'download',\n 'caption',\n 'fullscreen',\n ],\n lang : {\n autorotate: 'Automatic rotation',\n zoom : 'Zoom',\n zoomOut : 'Zoom out',\n zoomIn : 'Zoom in',\n download : 'Download',\n fullscreen: 'Fullscreen',\n menu : 'Menu',\n twoFingers: 'Use two fingers to navigate',\n ctrlZoom : 'Use ctrl + scroll to zoom the image',\n loadError : 'The panorama can\\'t be loaded',\n },\n keyboard : {\n 'ArrowUp' : ACTIONS.ROTATE_LAT_UP,\n 'ArrowDown' : ACTIONS.ROTATE_LAT_DOWN,\n 'ArrowRight': ACTIONS.ROTATE_LONG_RIGHT,\n 'ArrowLeft' : ACTIONS.ROTATE_LONG_LEFT,\n 'PageUp' : ACTIONS.ZOOM_IN,\n 'PageDown' : ACTIONS.ZOOM_OUT,\n '+' : ACTIONS.ZOOM_IN,\n '-' : ACTIONS.ZOOM_OUT,\n ' ' : ACTIONS.TOGGLE_AUTOROTATE,\n },\n plugins : [],\n};\n\n/**\n * @summary List of unmodifiable options and their error messages\n * @private\n */\nexport const READONLY_OPTIONS = {\n panorama : 'Use setPanorama method to change the panorama',\n panoData : 'Use setPanorama method to change the panorama',\n container: 'Cannot change viewer container',\n plugins : 'Cannot change plugins',\n};\n\n/**\n * @summary Parsers/validators for each option\n * @private\n */\nexport const CONFIG_PARSERS = {\n container : (container) => {\n if (!container) {\n throw new PSVError('No value given for container.');\n }\n return container;\n },\n defaultLat : (defaultLat) => {\n // defaultLat is between -PI/2 and PI/2\n return parseAngle(defaultLat, true);\n },\n minFov : (minFov, config) => {\n // minFov and maxFov must be ordered\n if (config.maxFov < minFov) {\n logWarn('maxFov cannot be lower than minFov');\n // eslint-disable-next-line no-param-reassign\n minFov = config.maxFov;\n }\n // minFov between 1 and 179\n return bound(minFov, 1, 179);\n },\n maxFov : (maxFov, config) => {\n // minFov and maxFov must be ordered\n if (maxFov < config.minFov) {\n // eslint-disable-next-line no-param-reassign\n maxFov = config.minFov;\n }\n // maxFov between 1 and 179\n return bound(maxFov, 1, 179);\n },\n lang : (lang) => {\n if (Array.isArray(lang.twoFingers)) {\n logWarn('lang.twoFingers must not be an array');\n lang.twoFingers = lang.twoFingers[0];\n }\n return {\n ...DEFAULTS.lang,\n ...lang,\n };\n },\n keyboard : (keyboard) => {\n // keyboard=true becomes the default map\n if (keyboard === true) {\n return clone(DEFAULTS.keyboard);\n }\n return keyboard;\n },\n autorotateLat : (autorotateLat, config) => {\n // default autorotateLat is defaultLat\n if (autorotateLat === null) {\n return parseAngle(config.defaultLat, true);\n }\n // autorotateLat is between -PI/2 and PI/2\n else {\n return parseAngle(autorotateLat, true);\n }\n },\n autorotateSpeed: (autorotateSpeed) => {\n return parseSpeed(autorotateSpeed);\n },\n fisheye : (fisheye) => {\n // translate boolean fisheye to amount\n if (fisheye === true) {\n return 1;\n }\n else if (fisheye === false) {\n return 0;\n }\n return fisheye;\n },\n plugins : (plugins) => {\n return plugins\n .map((plugin) => {\n if (Array.isArray(plugin)) {\n return plugin;\n }\n else {\n return [plugin];\n }\n })\n .filter(plugin => !!plugin[0]);\n },\n};\n\n/**\n * @summary Merge user config with default config and performs validation\n * @param {PSV.Options} options\n * @returns {PSV.Options}\n * @memberOf PSV\n * @private\n */\nexport function getConfig(options) {\n const tempConfig = clone(DEFAULTS);\n deepmerge(tempConfig, options);\n\n const config = {};\n\n each(tempConfig, (value, key) => {\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (CONFIG_PARSERS[key]) {\n config[key] = CONFIG_PARSERS[key](value, tempConfig);\n }\n else {\n config[key] = value;\n }\n });\n\n return config;\n}\n","import { AbstractButton } from './AbstractButton';\nimport { EVENTS } from '../data/constants';\nimport info from '../icons/info.svg';\n\n/**\n * @summary Navigation bar caption button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CaptionButton extends AbstractButton {\n\n static id = 'caption';\n static icon = info;\n\n /**\n * @param {PSV.components.NavbarCaption} caption\n */\n constructor(caption) {\n super(caption, 'psv-button--hover-scale psv-caption-button');\n\n this.psv.on(EVENTS.HIDE_NOTIFICATION, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.HIDE_NOTIFICATION, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.HIDE_NOTIFICATION: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles caption\n */\n onClick() {\n if (this.psv.notification.prop.visible) {\n this.psv.notification.hide();\n }\n else {\n this.psv.notification.show(this.parent.prop.caption);\n this.toggleActive(true);\n }\n }\n\n}\n","import { CaptionButton } from '../buttons/CaptionButton';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Navbar caption class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class NavbarCaption extends AbstractComponent {\n\n static id = 'caption';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} caption\n */\n constructor(navbar, caption) {\n super(navbar, 'psv-caption');\n\n /**\n * @member {PSV.buttons.CaptionButton}\n * @readonly\n * @private\n */\n this.button = new CaptionButton(this);\n this.button.hide();\n\n /**\n * @override\n * @property {string} id\n * @property {boolean} collapsable\n * @property {number} width\n * @property {string} caption\n * @property {boolean} contentVisible - if the content is visible in the navbar\n * @property {number} contentWidth - with of the caption content\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable : false,\n width : this.button.prop.width,\n caption : '',\n contentVisible: true,\n contentWidth : 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-caption-content';\n this.container.appendChild(this.content);\n\n this.setCaption(caption);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.button;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n this.prop.caption = html || '';\n this.content.innerHTML = this.prop.caption;\n\n if (html) {\n this.show(false);\n\n this.content.style.display = '';\n this.prop.contentWidth = this.content.offsetWidth;\n\n this.refreshUi();\n }\n else {\n this.hide();\n }\n }\n\n /**\n * @summary Toggles content and icon depending on available space\n * @private\n */\n refreshUi() {\n const availableWidth = this.container.offsetWidth;\n if (availableWidth >= this.prop.contentWidth && !this.prop.contentVisible) {\n this.content.style.display = '';\n this.prop.contentVisible = true;\n this.button.hide(false);\n }\n else if (availableWidth < this.prop.contentWidth && this.prop.contentVisible) {\n this.content.style.display = 'none';\n this.prop.contentVisible = false;\n this.button.show(false);\n }\n }\n\n}\n","import { AutorotateButton } from '../buttons/AutorotateButton';\nimport { CustomButton } from '../buttons/CustomButton';\nimport { DownloadButton } from '../buttons/DownloadButton';\nimport { FullscreenButton } from '../buttons/FullscreenButton';\nimport { MenuButton } from '../buttons/MenuButton';\nimport { ZoomInButton } from '../buttons/ZoomInButton';\nimport { ZoomOutButton } from '../buttons/ZoomOutButton';\nimport { ZoomRangeButton } from '../buttons/ZoomRangeButton';\nimport { DEFAULTS } from '../data/config';\nimport { PSVError } from '../PSVError';\nimport { clone, logWarn } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\nimport { NavbarCaption } from './NavbarCaption';\n\n/**\n * @summary List of available buttons\n * @type {Object>}\n * @private\n */\nconst AVAILABLE_BUTTONS = {};\n\n/**\n * @summary Register a new button available for all viewers\n * @param {Class} button\n * @memberOf PSV\n */\nexport function registerButton(button) {\n if (!button.id) {\n throw new PSVError('Button ID is required');\n }\n\n AVAILABLE_BUTTONS[button.id] = button;\n}\n\n[\n AutorotateButton,\n ZoomInButton,\n ZoomRangeButton,\n ZoomOutButton,\n DownloadButton,\n FullscreenButton,\n].forEach(registerButton);\n\n/**\n * @summary Navigation bar class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Navbar extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-navbar');\n\n /**\n * @summary List of buttons of the navbar\n * @member {PSV.buttons.AbstractButton[]}\n * @override\n */\n this.children = [];\n\n /**\n * @summary List of collapsed buttons\n * @member {PSV.buttons.AbstractButton[]}\n * @private\n */\n this.collapsed = [];\n }\n\n /**\n * @summary Change the buttons visible on the navbar\n * @param {string|Array} buttons\n */\n setButtons(buttons) {\n this.children.slice().forEach(item => item.destroy());\n this.children.length = 0;\n\n /* eslint-disable no-new */\n this.__cleanButtons(buttons).forEach((button) => {\n if (typeof button === 'object') {\n new CustomButton(this, button);\n }\n else if (AVAILABLE_BUTTONS[button]) {\n new AVAILABLE_BUTTONS[button](this);\n }\n else if (button === 'caption') {\n new NavbarCaption(this, this.psv.config.caption);\n }\n else if (button === 'zoom') {\n new ZoomOutButton(this);\n new ZoomRangeButton(this);\n new ZoomInButton(this);\n }\n else {\n throw new PSVError('Unknown button ' + button);\n }\n });\n\n new MenuButton(this);\n /* eslint-enable no-new */\n\n this.children.forEach((item) => {\n if (typeof item.checkSupported === 'function') {\n item.checkSupported();\n }\n });\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n const caption = this.getButton('caption', false);\n\n if (!caption) {\n throw new PSVError('Cannot set caption, the navbar caption container is not initialized.');\n }\n\n caption.setCaption(html);\n }\n\n /**\n * @summary Returns a button by its identifier\n * @param {string} id\n * @param {boolean} [warnNotFound=true]\n * @returns {PSV.buttons.AbstractButton}\n */\n getButton(id, warnNotFound = true) {\n let button = null;\n\n this.children.some((item) => {\n if (item.prop.id === id) {\n button = item;\n return true;\n }\n else {\n return false;\n }\n });\n\n if (!button && warnNotFound) {\n logWarn(`button \"${id}\" not found in the navbar`);\n }\n\n return button;\n }\n\n /**\n * @summary Shows the navbar\n */\n show() {\n this.container.classList.add('psv-navbar--open');\n this.prop.visible = true;\n }\n\n /**\n * @summary Hides the navbar\n */\n hide() {\n this.container.classList.remove('psv-navbar--open');\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n refreshUi() {\n super.refreshUi();\n\n if (this.psv.prop.uiRefresh === true) {\n const availableWidth = this.container.offsetWidth;\n\n let totalWidth = 0;\n const visibleButtons = [];\n const collapsableButtons = [];\n\n this.children.forEach((item) => {\n if (item.prop.visible) {\n totalWidth += item.prop.width;\n visibleButtons.push(item);\n if (item.prop.collapsable) {\n collapsableButtons.push(item);\n }\n }\n });\n\n if (!visibleButtons.length) {\n return;\n }\n\n if (availableWidth < totalWidth && collapsableButtons.length > 0) {\n collapsableButtons.forEach(item => item.collapse());\n this.collapsed = collapsableButtons;\n\n this.getButton(MenuButton.id).show(false);\n }\n else if (availableWidth >= totalWidth && this.collapsed.length > 0) {\n this.collapsed.forEach(item => item.uncollapse());\n this.collapsed = [];\n\n this.getButton(MenuButton.id).hide(false);\n }\n\n const caption = this.getButton(NavbarCaption.id, false);\n if (caption) {\n caption.refreshUi();\n }\n }\n }\n\n /**\n * @summary Ensure the buttons configuration is correct\n * @private\n */\n __cleanButtons(buttons) {\n // true becomes the default array\n if (buttons === true) {\n return clone(DEFAULTS.navbar);\n }\n // can be a space or coma separated list\n else if (typeof buttons === 'string') {\n return buttons.split(/[ ,]/);\n }\n else {\n return buttons || [];\n }\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @namespace PSV.plugins\n */\n\n/**\n * @summary Base plugins class\n * @memberof PSV.plugins\n * @abstract\n */\nexport class AbstractPlugin extends EventEmitter {\n\n /**\n * @summary Unique identifier of the plugin\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Destroys the plugin\n * @package\n */\n destroy() {\n delete this.psv;\n }\n\n}\n","import { SYSTEM } from '../data/system';\nimport { getStyle } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Loader class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Loader extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-loader-container');\n\n /**\n * @summary Inner container for vertical center\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.loader = document.createElement('div');\n this.loader.className = 'psv-loader';\n this.container.appendChild(this.loader);\n\n /**\n * @summary Animation canvas\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n this.canvas.className = 'psv-loader-canvas';\n\n this.canvas.width = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.loader.appendChild(this.canvas);\n\n /**\n * @override\n * @property {number} thickness\n * @property {string} current\n */\n this.prop = {\n ...this.prop,\n tickness: (this.loader.offsetWidth - this.loader.clientWidth) / 2 * SYSTEM.pixelRatio,\n current : null,\n };\n\n this.refreshUi();\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.loader;\n delete this.canvas;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.current !== (this.psv.config.loadingImg || this.psv.config.loadingTxt)) {\n if (this.prop.current) {\n this.loader.removeChild(this.loader.lastChild);\n }\n\n let inner;\n if (this.psv.config.loadingImg) {\n inner = document.createElement('img');\n inner.className = 'psv-loader-image';\n inner.src = this.psv.config.loadingImg;\n }\n else if (this.psv.config.loadingTxt) {\n inner = document.createElement('div');\n inner.className = 'psv-loader-text';\n inner.innerHTML = this.psv.config.loadingTxt;\n }\n if (inner) {\n const size = Math.round(Math.sqrt(2 * Math.pow((this.canvas.width / 2 - this.prop.tickness / 2) / SYSTEM.pixelRatio, 2)));\n inner.style.maxWidth = size + 'px';\n inner.style.maxHeight = size + 'px';\n this.loader.appendChild(inner);\n }\n\n this.prop.current = this.psv.config.loadingImg || this.psv.config.loadingTxt;\n }\n }\n\n /**\n * @summary Sets the loader progression\n * @param {number} value - from 0 to 100\n */\n setProgress(value) {\n const context = this.canvas.getContext('2d');\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.lineWidth = this.prop.tickness;\n context.strokeStyle = getStyle(this.loader, 'color');\n\n context.beginPath();\n context.arc(\n this.canvas.width / 2, this.canvas.height / 2,\n this.canvas.width / 2 - this.prop.tickness / 2,\n -Math.PI / 2, value / 100 * 2 * Math.PI - Math.PI / 2\n );\n context.stroke();\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Notification class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Notification extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-notification');\n\n /**\n * @override\n * @property {*} timeout\n */\n this.prop = {\n ...this.prop,\n visible: false,\n timeout: null,\n };\n\n /**\n * Notification content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-notification-content';\n this.container.appendChild(this.content);\n\n this.content.addEventListener('click', () => this.hide());\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a notification on the viewer\n * @param {Object|string} config\n * @param {string} config.content\n * @param {number} [config.timeout]\n * @fires PSV.show-notification\n *\n * @example\n * viewer.showNotification({ content: 'Hello world', timeout: 5000 })\n * @example\n * viewer.showNotification('Hello world')\n */\n show(config) {\n if (this.prop.timeout) {\n clearTimeout(this.prop.timeout);\n this.prop.timeout = null;\n }\n\n if (typeof config === 'string') {\n config = { content: config }; // eslint-disable-line no-param-reassign\n }\n\n this.content.innerHTML = config.content;\n this.prop.visible = true;\n\n this.container.classList.add('psv-notification--visible');\n\n this.psv.trigger(EVENTS.SHOW_NOTIFICATION);\n\n if (config.timeout) {\n this.prop.timeout = setTimeout(() => this.hide(), config.timeout);\n }\n }\n\n /**\n * @summary Hides the notification\n * @fires PSV.hide-notification\n */\n hide() {\n if (this.prop.visible) {\n this.container.classList.remove('psv-notification--visible');\n\n this.prop.visible = false;\n\n this.psv.trigger(EVENTS.HIDE_NOTIFICATION);\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { AbstractComponent } from './AbstractComponent';\nimport { PSVError } from '../PSVError';\n\n/**\n * @summary Overlay class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Overlay extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-overlay');\n\n /**\n * @override\n * @property {string} contentId\n * @property {boolean} dissmisable\n */\n this.prop = {\n ...this.prop,\n contentId : undefined,\n dissmisable: true,\n };\n\n /**\n * Image container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.image = document.createElement('div');\n this.image.className = 'psv-overlay-image';\n this.container.appendChild(this.image);\n\n /**\n * Text container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.text = document.createElement('div');\n this.text.className = 'psv-overlay-text';\n this.container.appendChild(this.text);\n\n /**\n * Subtext container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.subtext = document.createElement('div');\n this.subtext.className = 'psv-overlay-subtext';\n this.container.appendChild(this.subtext);\n\n this.container.addEventListener('mouseup', (e) => {\n e.stopPropagation();\n if (this.prop.dissmisable) {\n this.hide();\n }\n }, true);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.image;\n delete this.text;\n delete this.subtext;\n\n super.destroy();\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Overlay cannot be toggled');\n }\n\n /**\n * @summary Displays an overlay on the viewer\n * @param {Object|string} config\n * @param {string} [config.id]\n * @param {string} config.image\n * @param {string} config.text\n * @param {string} [config.subtext]\n * @param {boolean} [config.dissmisable=true]\n * @fires PSV.show-overlay\n *\n * @example\n * viewer.showOverlay({\n * image: '',\n * text: '....',\n * subtext: '....'\n * })\n */\n show(config) {\n if (typeof config === 'string') {\n config = { text: config }; // eslint-disable-line no-param-reassign\n }\n\n this.prop.contentId = config.id;\n this.prop.dissmisable = config.dissmisable !== false;\n this.image.innerHTML = config.image || '';\n this.text.innerHTML = config.text || '';\n this.subtext.innerHTML = config.subtext || '';\n\n super.show();\n\n this.psv.trigger(EVENTS.SHOW_OVERLAY, config.id);\n }\n\n /**\n * @summary Hides the overlay\n * @param {string} [id]\n * @fires PSV.hide-overlay\n */\n hide(id) {\n if (this.isVisible() && (!id || !this.prop.contentId || this.prop.contentId === id)) {\n const contentId = this.prop.contentId;\n\n super.hide();\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_OVERLAY, contentId);\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\nimport { toggleClass } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Minimum width of the panel\n * @type {number}\n * @constant\n * @private\n */\nconst PANEL_MIN_WIDTH = 200;\n\n/**\n * @summary Panel class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Panel extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-panel');\n\n /**\n * @override\n * @property {string} contentId\n * @property {number} mouseX\n * @property {number} mouseY\n * @property {boolean} mousedown\n * @property {function} clickHandler\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId : undefined,\n mouseX : 0,\n mouseY : 0,\n mousedown : false,\n clickHandler: null,\n };\n\n const resizer = document.createElement('div');\n resizer.className = 'psv-panel-resizer';\n this.container.appendChild(resizer);\n\n const closeBtn = document.createElement('div');\n closeBtn.className = 'psv-panel-close-button';\n this.container.appendChild(closeBtn);\n\n /**\n * @summary Content container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-panel-content';\n this.container.appendChild(this.content);\n\n // Stop wheel event bubling from panel\n this.container.addEventListener(SYSTEM.mouseWheelEvent, e => e.stopPropagation());\n\n closeBtn.addEventListener('click', () => this.hide());\n\n // Event for panel resizing + stop bubling\n resizer.addEventListener('mousedown', this);\n resizer.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.prop;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onMouseUp(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Panel cannot be toggled');\n }\n\n /**\n * @summary Shows the panel\n * @param {Object} config\n * @param {string} [config.id]\n * @param {string} config.content\n * @param {boolean} [config.noMargin=false]\n * @param {Function} [config.clickHandler]\n * @fires PSV.open-panel\n */\n show(config) {\n if (typeof config === 'string') {\n config = { content: config }; // eslint-disable-line no-param-reassign\n }\n\n this.prop.contentId = config.id;\n this.prop.visible = true;\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.content.innerHTML = config.content;\n this.content.scrollTop = 0;\n this.container.classList.add('psv-panel--open');\n\n toggleClass(this.content, 'psv-panel-content--no-margin', config.noMargin === true);\n\n if (config.clickHandler) {\n this.prop.clickHandler = config.clickHandler;\n this.content.addEventListener('click', config.clickHandler);\n }\n\n this.psv.trigger(EVENTS.OPEN_PANEL, config.id);\n }\n\n /**\n * @summary Hides the panel\n * @param {string} [id]\n * @fires PSV.close-panel\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.prop.visible = false;\n this.prop.contentId = undefined;\n\n this.content.innerHTML = null;\n this.container.classList.remove('psv-panel--open');\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.psv.trigger(EVENTS.CLOSE_PANEL, contentId);\n }\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n evt.stopPropagation();\n this.__startResize(evt);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n evt.stopPropagation();\n this.__startResize(evt.changedTouches[0]);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.prop.mousedown = false;\n this.content.classList.remove('psv-panel-content--no-interaction');\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.__resize(evt);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown) {\n this.__resize(evt.touches[0]);\n }\n }\n\n /**\n * @summary Initializes the panel resize\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startResize(evt) {\n this.prop.mouseX = evt.clientX;\n this.prop.mouseY = evt.clientY;\n this.prop.mousedown = true;\n this.content.classList.add('psv-panel-content--no-interaction');\n }\n\n /**\n * @summary Resizes the panel\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __resize(evt) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n this.container.style.width = Math.max(PANEL_MIN_WIDTH, this.container.offsetWidth - (x - this.prop.mouseX)) + 'px';\n\n this.prop.mouseX = x;\n this.prop.mouseY = y;\n }\n\n}\n","/**\n * @namespace PSV.services\n */\n\n/**\n * @summary Base services class\n * @memberof PSV.services\n * @abstract\n */\nexport class AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = psv.config;\n\n /**\n * @summary Properties holder\n * @type {Object}\n * @readonly\n */\n this.prop = psv.prop;\n }\n\n /**\n * @summary Destroys the service\n */\n destroy() {\n delete this.psv;\n delete this.config;\n delete this.prop;\n }\n\n}\n","import * as THREE from 'three';\nimport { SPHERE_RADIUS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { parseAngle, parseSpeed } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Collections of data converters for the current viewer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class DataHelper extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n }\n\n /**\n * @summary Converts vertical FOV to zoom level\n * @param {number} fov\n * @returns {number}\n */\n fovToZoomLevel(fov) {\n const temp = Math.round((fov - this.config.minFov) / (this.config.maxFov - this.config.minFov) * 100);\n return temp - 2 * (temp - 50);\n }\n\n /**\n * @summary Converts zoom level to vertical FOV\n * @param {number} level\n * @returns {number}\n */\n zoomLevelToFov(level) {\n return this.config.maxFov + (level / 100) * (this.config.minFov - this.config.maxFov);\n }\n\n /**\n * @summary Convert vertical FOV to horizontal FOV\n * @param {number} vFov\n * @returns {number}\n */\n vFovToHFov(vFov) {\n return THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(vFov) / 2) * this.prop.aspect));\n }\n\n /**\n * @summary Converts a speed into a duration from current position to a new position\n * @param {string|number} value\n * @param {number} angle\n * @returns {number}\n */\n speedToDuration(value, angle) {\n if (!value || typeof value !== 'number') {\n // desired radial speed\n const speed = value ? parseSpeed(value) : this.config.autorotateSpeed;\n // compute duration\n return angle / Math.abs(speed) * 1000;\n }\n else {\n return Math.abs(value);\n }\n }\n\n /**\n * @summary Converts pixel texture coordinates to spherical radians coordinates\n * @param {PSV.Point} point\n * @returns {PSV.Position}\n */\n textureCoordsToSphericalCoords(point) {\n if (this.prop.isCubemap) {\n throw new PSVError('Unable to use texture coords with cubemap.');\n }\n\n const panoData = this.prop.panoData;\n const relativeX = (point.x + panoData.croppedX) / panoData.fullWidth * Math.PI * 2;\n const relativeY = (point.y + panoData.croppedY) / panoData.fullHeight * Math.PI;\n\n return {\n longitude: relativeX >= Math.PI ? relativeX - Math.PI : relativeX + Math.PI,\n latitude : Math.PI / 2 - relativeY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to pixel texture coordinates\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n */\n sphericalCoordsToTextureCoords(position) {\n if (this.prop.isCubemap) {\n throw new PSVError('Unable to use texture coords with cubemap.');\n }\n\n const panoData = this.prop.panoData;\n const relativeLong = position.longitude / Math.PI / 2 * panoData.fullWidth;\n const relativeLat = position.latitude / Math.PI * panoData.fullHeight;\n\n return {\n x: Math.round(position.longitude < Math.PI ? relativeLong + panoData.fullWidth / 2 : relativeLong - panoData.fullWidth / 2) - panoData.croppedX,\n y: Math.round(panoData.fullHeight / 2 - relativeLat) - panoData.croppedY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to a THREE.Vector3\n * @param {PSV.Position} position\n * @returns {external:THREE.Vector3}\n */\n sphericalCoordsToVector3(position) {\n return new THREE.Vector3(\n SPHERE_RADIUS * -Math.cos(position.latitude) * Math.sin(position.longitude),\n SPHERE_RADIUS * Math.sin(position.latitude),\n SPHERE_RADIUS * Math.cos(position.latitude) * Math.cos(position.longitude)\n );\n }\n\n /**\n * @summary Converts a THREE.Vector3 to spherical radians coordinates\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Position}\n */\n vector3ToSphericalCoords(vector) {\n const phi = Math.acos(vector.y / Math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));\n const theta = Math.atan2(vector.x, vector.z);\n\n return {\n longitude: theta < 0 ? -theta : Math.PI * 2 - theta,\n latitude : Math.PI / 2 - phi,\n };\n }\n\n /**\n * @summary Converts position on the viewer to a THREE.Vector3\n * @param {PSV.Point} viewerPoint\n * @returns {external:THREE.Vector3}\n */\n viewerCoordsToVector3(viewerPoint) {\n const screen = new THREE.Vector2(\n 2 * viewerPoint.x / this.prop.size.width - 1,\n -2 * viewerPoint.y / this.prop.size.height + 1\n );\n\n this.psv.renderer.raycaster.setFromCamera(screen, this.psv.renderer.camera);\n\n const intersects = this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children);\n\n if (intersects.length === 1) {\n return intersects[0].point;\n }\n else {\n return null;\n }\n }\n\n /**\n * @summary Converts a THREE.Vector3 to position on the viewer\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Point}\n */\n vector3ToViewerCoords(vector) {\n const vectorClone = vector.clone();\n vectorClone.project(this.psv.renderer.camera);\n\n return {\n x: Math.round((vectorClone.x + 1) / 2 * this.prop.size.width),\n y: Math.round((1 - vectorClone.y) / 2 * this.prop.size.height),\n };\n }\n\n /**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @param {object} object\n * @returns {boolean}\n */\n isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return key1 in object && key2 in object;\n });\n }\n\n /**\n * @summary Converts x/y to latitude/longitude if present and ensure boundaries\n * @param {PSV.ExtendedPosition} position\n * @returns {PSV.Position}\n */\n cleanPosition(position) {\n if ('x' in position && 'y' in position) {\n return this.textureCoordsToSphericalCoords(position);\n }\n else {\n return {\n longitude: parseAngle(position.longitude),\n latitude : parseAngle(position.latitude, true),\n };\n }\n }\n\n /**\n * @summary Ensure a SphereCorrection object is valide\n * @param {PSV.SphereCorrection} sphereCorrection\n * @returns {PSV.SphereCorrection}\n */\n cleanSphereCorrection(sphereCorrection) {\n return {\n pan : parseAngle(sphereCorrection.pan || 0),\n tilt: parseAngle(sphereCorrection.tilt || 0, true),\n roll: parseAngle(sphereCorrection.roll || 0, true, false),\n };\n }\n\n}\n","import { Animation } from '../Animation';\nimport {\n ACTIONS,\n CTRLZOOM_TIMEOUT,\n DBLCLICK_DELAY,\n EVENTS,\n IDS,\n INERTIA_WINDOW,\n LONGTOUCH_DELAY,\n TWOFINGERSOVERLAY_DELAY,\n MOVE_THRESHOLD\n} from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport gestureIcon from '../icons/gesture.svg';\nimport mousewheelIcon from '../icons/mousewheel.svg';\nimport { clone, distance, getClosest, getEventKey, isFullscreenEnabled, normalizeWheel, throttle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Events handler\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class EventsHandler extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @property {boolean} moving - is the user moving\n * @property {boolean} zooming - is the user zooming\n * @property {number} startMouseX - start x position of the click/touch\n * @property {number} startMouseY - start y position of the click/touch\n * @property {number} mouseX - current x position of the cursor\n * @property {number} mouseY - current y position of the cursor\n * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y]\n * @property {number} pinchDist - distance between fingers when zooming\n * @property {boolean} ctrlKeyDown - when the Ctrl key is pressed\n * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks\n * @property {number} dblclickTimeout - timeout id for double click\n * @property {number} twofingersTimeout - timeout id for \"two fingers\" overlay\n * @property {number} ctrlZoomTimeout - timeout id for \"ctrol zoom\" overlay\n * @protected\n */\n this.state = {\n keyboardEnabled : false,\n moving : false,\n zooming : false,\n startMouseX : 0,\n startMouseY : 0,\n mouseX : 0,\n mouseY : 0,\n mouseHistory : [],\n pinchDist : 0,\n ctrlKeyDown : false,\n dblclickData : null,\n dblclickTimeout : null,\n longtouchTimeout : null,\n twofingersTimeout: null,\n ctrlZoomTimeout : null,\n };\n\n /**\n * @summary Throttled wrapper of {@link PSV.Viewer#autoSize}\n * @type {Function}\n * @private\n */\n this.__onResize = throttle(() => this.psv.autoSize(), 50);\n }\n\n /**\n * @summary Initializes event handlers\n * @protected\n */\n init() {\n window.addEventListener('resize', this);\n window.addEventListener('keydown', this);\n window.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseenter', this);\n this.psv.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseleave', this);\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this);\n window.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.addEventListener(SYSTEM.fullscreenEvent, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n window.removeEventListener('resize', this);\n window.removeEventListener('keydown', this);\n window.removeEventListener('keyup', this);\n this.psv.container.removeEventListener('mouseenter', this);\n this.psv.container.removeEventListener('mousedown', this);\n this.psv.container.removeEventListener('mouseleave', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n window.removeEventListener('touchend', this);\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.removeEventListener(SYSTEM.fullscreenEvent, this);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n clearTimeout(this.state.longtouchTimeout);\n clearTimeout(this.state.twofingersTimeout);\n clearTimeout(this.state.ctrlZoomTimeout);\n\n delete this.state;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'resize': this.__onResize(); break;\n case 'keydown': this.__onKeyDown(evt); break;\n case 'keyup': this.__onKeyUp(); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchend': this.__onTouchEnd(evt); break;\n case SYSTEM.fullscreenEvent: this.__fullscreenToggled(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (!getClosest(evt.target, '.psv-navbar') && !getClosest(evt.target, '.psv-panel')) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(evt); break;\n case 'mouseenter': this.__onMouseEnter(evt); break;\n case 'touchstart': this.__onTouchStart(evt); break;\n case 'mouseleave': this.__onMouseLeave(evt); break;\n case 'mousemove': this.__onMouseMove(evt); break;\n case 'touchmove': this.__onTouchMove(evt); break;\n case SYSTEM.mouseWheelEvent: this.__onMouseWheel(evt); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n }\n\n /**\n * @summary Enables the keyboard controls\n * @protected\n */\n enableKeyboard() {\n this.state.keyboardEnabled = true;\n }\n\n /**\n * @summary Disables the keyboard controls\n * @protected\n */\n disableKeyboard() {\n this.state.keyboardEnabled = false;\n }\n\n /**\n * @summary Handles keyboard events\n * @param {KeyboardEvent} evt\n * @private\n */\n __onKeyDown(evt) {\n const key = getEventKey(evt);\n\n if (this.config.mousewheelCtrlKey) {\n this.state.ctrlKeyDown = key === 'Control';\n\n if (this.state.ctrlKeyDown) {\n clearTimeout(this.state.ctrlZoomTimeout);\n this.psv.overlay.hide(IDS.CTRL_ZOOM);\n }\n }\n\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n let dLong = 0;\n let dLat = 0;\n let dZoom = 0;\n\n /* eslint-disable */\n switch (this.config.keyboard[key]) {\n // @formatter:off\n case ACTIONS.ROTATE_LAT_UP : dLat = 0.01; break;\n case ACTIONS.ROTATE_LAT_DOWN : dLat = -0.01; break;\n case ACTIONS.ROTATE_LONG_RIGHT: dLong = 0.01; break;\n case ACTIONS.ROTATE_LONG_LEFT : dLong = -0.01; break;\n case ACTIONS.ZOOM_IN : dZoom = 1; break;\n case ACTIONS.ZOOM_OUT : dZoom = -1; break;\n case ACTIONS.TOGGLE_AUTOROTATE: this.psv.toggleAutorotate(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (dZoom !== 0) {\n this.psv.zoom(this.prop.zoomLvl + dZoom * this.config.zoomButtonIncrement);\n }\n else if (dLat !== 0 || dLong !== 0) {\n this.psv.rotate({\n longitude: this.prop.position.longitude + dLong * this.prop.moveSpeed * this.prop.hFov,\n latitude : this.prop.position.latitude + dLat * this.prop.moveSpeed * this.prop.vFov,\n });\n }\n }\n\n /**\n * @summary Handles keyboard events\n * @private\n */\n __onKeyUp() {\n this.state.ctrlKeyDown = false;\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse enter events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseEnter(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse leave events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseLeave(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.buttons !== 0) {\n evt.preventDefault();\n this.__move(evt);\n }\n else if (this.config.captureCursor) {\n this.__moveAbsolute(evt);\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (!this.config.touchmoveTwoFingers) {\n this.__startMove(evt.touches[0]);\n evt.preventDefault(); // prevent mouse events emulation\n }\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n this.__click(evt.touches[0], true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.__cancelLongTouch();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n\n if (evt.touches.length === 1) {\n this.__stopMoveZoom();\n }\n else if (evt.touches.length === 0) {\n this.__stopMove(evt.changedTouches[0]);\n }\n\n if (this.config.touchmoveTwoFingers) {\n this.__cancelTwoFingersOverlay();\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (!this.prop.twofingersTimeout) {\n this.prop.twofingersTimeout = setTimeout(() => {\n this.psv.overlay.show({\n id: IDS.TWO_FINGERS,\n image: gestureIcon,\n text: this.config.lang.twoFingers,\n });\n }, TWOFINGERSOVERLAY_DELAY);\n }\n }\n else {\n evt.preventDefault();\n this.__move(evt.touches[0]);\n }\n }\n else if (evt.touches.length === 2) {\n evt.preventDefault();\n this.__moveZoom(evt);\n if (this.config.touchmoveTwoFingers) {\n this.__cancelTwoFingersOverlay();\n }\n }\n }\n\n /**\n * @summary Cancel the long touch timer if any\n * @private\n */\n __cancelLongTouch() {\n if (this.prop.longtouchTimeout) {\n clearTimeout(this.prop.longtouchTimeout);\n this.prop.longtouchTimeout = null;\n }\n }\n\n /**\n * @summary Cancel the two fingers overlay timer if any\n * @private\n */\n __cancelTwoFingersOverlay() {\n if (this.prop.twofingersTimeout) {\n clearTimeout(this.prop.twofingersTimeout);\n this.prop.twofingersTimeout = null;\n }\n }\n\n /**\n * @summary Handles mouse wheel events\n * @param {WheelEvent} evt\n * @private\n */\n __onMouseWheel(evt) {\n if (!this.config.mousewheel) {\n return;\n }\n\n if (this.config.mousewheelCtrlKey && !this.state.ctrlKeyDown) {\n this.psv.overlay.show({\n id: IDS.CTRL_ZOOM,\n image: mousewheelIcon,\n text: this.config.lang.ctrlZoom,\n });\n\n clearTimeout(this.state.ctrlZoomTimeout);\n this.state.ctrlZoomTimeout = setTimeout(() => this.psv.overlay.hide(IDS.CTRL_ZOOM), CTRLZOOM_TIMEOUT);\n\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n const delta = normalizeWheel(evt).spinY * 5;\n\n if (delta !== 0) {\n this.psv.zoom(this.prop.zoomLvl - delta * this.config.mousewheelSpeed);\n }\n }\n\n /**\n * @summary Handles fullscreen events\n * @param {boolean} [force] force state\n * @fires PSV.fullscreen-updated\n * @package\n */\n __fullscreenToggled(force) {\n this.prop.fullscreen = force !== undefined ? force : isFullscreenEnabled(this.psv.container);\n\n if (this.config.keyboard) {\n if (this.prop.fullscreen) {\n this.psv.startKeyboardControl();\n }\n else {\n this.psv.stopKeyboardControl();\n }\n }\n\n this.psv.trigger(EVENTS.FULLSCREEN_UPDATED, this.prop.fullscreen);\n }\n\n /**\n * @summary Initializes the movement\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startMove(evt) {\n this.psv.stopAutorotate();\n this.psv.stopAnimation()\n .then(() => {\n this.state.mouseX = evt.clientX;\n this.state.mouseY = evt.clientY;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = false;\n\n this.state.mouseHistory.length = 0;\n this.__logMouseMove(evt);\n });\n }\n\n /**\n * @summary Initializes the combines move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __startMoveZoom(evt) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n this.state.pinchDist = distance(p1, p2);\n this.state.mouseX = (p1.x + p2.x) / 2;\n this.state.mouseY = (p1.y + p2.y) / 2;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = true;\n }\n\n /**\n * @summary Stops the movement\n * @description If the move threshold was not reached a click event is triggered, otherwise an animation is launched to simulate inertia\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMove(evt) {\n if (!getClosest(evt.target, '.psv-container')) {\n this.state.moving = false;\n this.state.mouseHistory.length = 0;\n return;\n }\n\n if (this.state.moving) {\n // move threshold to trigger a click\n if (Math.abs(evt.clientX - this.state.startMouseX) < MOVE_THRESHOLD && Math.abs(evt.clientY - this.state.startMouseY) < MOVE_THRESHOLD) {\n this.__click(evt);\n this.state.moving = false;\n }\n // inertia animation\n else if (this.config.moveInertia) {\n this.__logMouseMove(evt);\n this.__stopMoveInertia(evt);\n }\n else {\n this.state.moving = false;\n }\n\n this.state.mouseHistory.length = 0;\n }\n }\n\n /**\n * @summary Stops the combined move and zoom\n * @private\n */\n __stopMoveZoom() {\n this.state.mouseHistory.length = 0;\n this.state.moving = false;\n this.state.zooming = false;\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMoveInertia(evt) {\n const direction = {\n x: evt.clientX - this.state.mouseHistory[0][1],\n y: evt.clientY - this.state.mouseHistory[0][2],\n };\n\n const norm = Math.sqrt(direction.x * direction.x + direction.y * direction.y);\n\n this.prop.animationPromise = new Animation({\n properties: {\n clientX: { start: evt.clientX, end: evt.clientX + direction.x },\n clientY: { start: evt.clientY, end: evt.clientY + direction.y },\n },\n duration : norm * INERTIA_WINDOW / 100,\n easing : 'outCirc',\n onTick : (properties) => {\n this.__move(properties, false);\n },\n })\n .finally(() => {\n this.state.moving = false;\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [longtouch=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(evt, longtouch = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: longtouch || evt.button === 2,\n target : evt.target,\n clientX : evt.clientX,\n clientY : evt.clientY,\n viewerX : evt.clientX - boundingRect.left,\n viewerY : evt.clientY - boundingRect.top,\n };\n\n const intersect = this.psv.dataHelper.viewerCoordsToVector3({\n x: data.viewerX,\n y: data.viewerY,\n });\n\n if (intersect) {\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(intersect);\n data.longitude = sphericalCoords.longitude;\n data.latitude = sphericalCoords.latitude;\n\n // TODO: for cubemap, computes texture's index and coordinates\n if (!this.prop.isCubemap) {\n const textureCoords = this.psv.dataHelper.sphericalCoordsToTextureCoords(data);\n data.textureX = textureCoords.x;\n data.textureY = textureCoords.y;\n }\n\n if (!this.state.dblclickTimeout) {\n this.psv.trigger(EVENTS.CLICK, data);\n\n this.state.dblclickData = clone(data);\n this.state.dblclickTimeout = setTimeout(() => {\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }, DBLCLICK_DELAY);\n }\n else {\n if (Math.abs(this.state.dblclickData.clientX - data.clientX) < MOVE_THRESHOLD\n && Math.abs(this.state.dblclickData.clientY - data.clientY) < MOVE_THRESHOLD) {\n this.psv.trigger(EVENTS.DOUBLE_CLICK, this.state.dblclickData);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }\n }\n }\n\n /**\n * @summary Performs movement\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [log=true]\n * @private\n */\n __move(evt, log) {\n if (this.state.moving) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n const rotation = {\n longitude: (x - this.state.mouseX) / this.prop.size.width * this.prop.moveSpeed * this.prop.hFov * SYSTEM.pixelRatio,\n latitude : (y - this.state.mouseY) / this.prop.size.height * this.prop.moveSpeed * this.prop.vFov * SYSTEM.pixelRatio,\n };\n\n this.psv.rotate({\n longitude: this.prop.position.longitude - rotation.longitude,\n latitude : this.prop.position.latitude + rotation.latitude,\n });\n\n this.state.mouseX = x;\n this.state.mouseY = y;\n\n if (log !== false) {\n this.__logMouseMove(evt);\n }\n }\n }\n\n /**\n * @summary Performs movement absolute to cursor position in viewer\n * @param {MouseEvent} evt\n * @private\n */\n __moveAbsolute(evt) {\n if (this.state.moving) {\n const containerRect = this.psv.container.getBoundingClientRect();\n this.psv.rotate({\n longitude: ((evt.clientX - containerRect.left) / containerRect.width - 0.5) * Math.PI * 2,\n latitude : -((evt.clientY - containerRect.top) / containerRect.height - 0.5) * Math.PI,\n });\n }\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.zooming && this.state.moving) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n const p = distance(p1, p2);\n const delta = 80 * (p - this.state.pinchDist) / this.prop.size.width;\n\n this.psv.zoom(this.prop.zoomLvl + delta);\n\n this.__move({\n clientX: (p1.x + p2.x) / 2,\n clientY: (p1.y + p2.y) / 2,\n });\n\n this.state.pinchDist = p;\n }\n }\n\n /**\n * @summary Stores each mouse position during a mouse move\n * @description Positions older than \"INERTIA_WINDOW\" are removed
\n * Positions before a pause of \"INERTIA_WINDOW\" / 10 are removed\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __logMouseMove(evt) {\n const now = Date.now();\n this.state.mouseHistory.push([now, evt.clientX, evt.clientY]);\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[0][i] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[0][i] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[0][i];\n }\n else {\n i++;\n previous = this.state.mouseHistory[0][i];\n }\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { Animation } from '../Animation';\nimport { CUBE_VERTICES, EVENTS, SPHERE_RADIUS, SPHERE_VERTICES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { logWarn } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Viewer and renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class Renderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @member {number}\n * @private\n */\n this.mainReqid = undefined;\n\n /**\n * @member {external:THREE.WebGLRenderer}\n * @readonly\n * @protected\n */\n this.renderer = null;\n\n /**\n * @member {external:THREE.Scene}\n * @readonly\n * @protected\n */\n this.scene = null;\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = null;\n\n /**\n * @member {external:THREE.Mesh}\n * @readonly\n * @protected\n */\n this.mesh = null;\n\n /**\n * @member {external:THREE.Raycaster}\n * @readonly\n * @protected\n */\n this.raycaster = null;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @protected\n */\n this.canvasContainer = document.createElement('div');\n this.canvasContainer.className = 'psv-canvas-container';\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.psv.container.appendChild(this.canvasContainer);\n\n psv.on(EVENTS.SIZE_UPDATED, (e, size) => {\n if (this.renderer) {\n this.renderer.setSize(size.width, size.height);\n }\n });\n\n psv.on(EVENTS.CONFIG_CHANGED, () => {\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n });\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n // cancel render loop\n if (this.mainReqid) {\n window.cancelAnimationFrame(this.mainReqid);\n }\n\n // destroy ThreeJS view\n if (this.scene) {\n this.__cleanTHREEScene(this.scene);\n }\n\n // remove container\n this.psv.container.removeChild(this.canvasContainer);\n\n delete this.canvasContainer;\n delete this.renderer;\n delete this.scene;\n delete this.camera;\n delete this.mesh;\n delete this.raycaster;\n\n super.destroy();\n }\n\n /**\n * @summary Hides the viewer\n */\n hide() {\n this.canvasContainer.style.opacity = 0;\n }\n\n /**\n * @summary Shows the viewer\n */\n show() {\n this.canvasContainer.style.opacity = 1;\n }\n\n /**\n * @summary Main event loop, calls {@link render} if `prop.needsUpdate` is true\n * @param {number} timestamp\n * @fires PSV.before-render\n * @package\n */\n __renderLoop(timestamp) {\n this.psv.trigger(EVENTS.BEFORE_RENDER, timestamp);\n\n if (this.prop.needsUpdate) {\n this.render();\n this.prop.needsUpdate = false;\n }\n\n this.mainReqid = window.requestAnimationFrame(t => this.__renderLoop(t));\n }\n\n /**\n * @summary Performs a render\n * @description Do not call this method directly, instead call\n * {@link PSV.Viewer#needsUpdate} on {@link PSV.event:before-render}.\n * @fires PSV.render\n */\n render() {\n this.prop.direction = this.psv.dataHelper.sphericalCoordsToVector3(this.prop.position);\n this.camera.position.set(0, 0, 0);\n this.camera.lookAt(this.prop.direction);\n\n if (this.config.fisheye) {\n this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye / 2).negate();\n }\n\n this.camera.aspect = this.prop.aspect;\n this.camera.fov = this.prop.vFov;\n this.camera.updateProjectionMatrix();\n\n this.renderer.render(this.scene, this.camera);\n\n this.psv.trigger(EVENTS.RENDER);\n }\n\n /**\n * @summary Applies the texture to the scene, creates the scene if needed\n * @param {PSV.TextureData} textureData\n * @fires PSV.panorama-loaded\n * @package\n */\n setTexture(textureData) {\n const { texture, panoData } = textureData;\n this.prop.panoData = panoData;\n\n if (!this.scene) {\n this.__createScene();\n }\n\n if (this.prop.isCubemap) {\n for (let i = 0; i < 6; i++) {\n if (this.mesh.material[i].map) {\n this.mesh.material[i].map.dispose();\n }\n\n this.mesh.material[i].map = texture[i];\n }\n }\n else {\n if (this.mesh.material.map) {\n this.mesh.material.map.dispose();\n }\n\n this.mesh.material.map = texture;\n }\n\n this.psv.needsUpdate();\n\n this.psv.trigger(EVENTS.PANORAMA_LOADED);\n }\n\n /**\n * @summary Apply a SphereCorrection to a Mesh\n * @param {PSV.SphereCorrection} sphereCorrection\n * @param {external:THREE.Mesh} [mesh=this.mesh]\n * @package\n */\n setSphereCorrection(sphereCorrection, mesh = this.mesh) {\n const cleanCorrection = this.psv.dataHelper.cleanSphereCorrection(sphereCorrection);\n\n mesh.rotation.set(\n cleanCorrection.tilt,\n cleanCorrection.pan,\n cleanCorrection.roll\n );\n }\n\n /**\n * @summary Creates the 3D scene and GUI components\n * @private\n */\n __createScene() {\n this.raycaster = new THREE.Raycaster();\n\n this.renderer = new THREE.WebGLRenderer();\n this.renderer.setSize(this.prop.size.width, this.prop.size.height);\n this.renderer.setPixelRatio(SYSTEM.pixelRatio);\n\n this.camera = new THREE.PerspectiveCamera(this.prop.vFov, this.prop.size.width / this.prop.size.height, 1, 3 * SPHERE_RADIUS);\n this.camera.position.set(0, 0, 0);\n\n this.scene = new THREE.Scene();\n this.scene.add(this.camera);\n\n if (this.prop.isCubemap) {\n this.mesh = this.__createCubemap();\n }\n else {\n this.mesh = this.__createSphere();\n }\n\n this.scene.add(this.mesh);\n\n // create canvas container\n this.renderer.domElement.className = 'psv-canvas';\n this.canvasContainer.appendChild(this.renderer.domElement);\n }\n\n /**\n * @summary Creates the sphere mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n * @private\n */\n __createSphere(scale = 1) {\n // The middle of the panorama is placed at longitude=0\n const geometry = new THREE.SphereGeometry(SPHERE_RADIUS * scale, SPHERE_VERTICES, SPHERE_VERTICES, -Math.PI / 2);\n\n const material = new THREE.MeshBasicMaterial({\n side: THREE.BackSide,\n });\n\n const mesh = new THREE.Mesh(geometry, material);\n mesh.scale.set(-1, 1, 1);\n\n return mesh;\n }\n\n /**\n * @summary Creates the cube mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n * @private\n */\n __createCubemap(scale = 1) {\n const cubeSize = SPHERE_RADIUS * 2 * scale;\n const geometry = new THREE.BoxGeometry(cubeSize, cubeSize, cubeSize, CUBE_VERTICES, CUBE_VERTICES, CUBE_VERTICES);\n\n const materials = [];\n for (let i = 0; i < 6; i++) {\n materials.push(new THREE.MeshBasicMaterial({\n side: THREE.BackSide,\n }));\n }\n\n const mesh = new THREE.Mesh(geometry, materials);\n mesh.scale.set(1, 1, -1);\n\n return mesh;\n }\n\n /**\n * @summary Performs transition between the current and a new texture\n * @param {PSV.TextureData} textureData\n * @param {PSV.PanoramaOptions} options\n * @returns {PSV.Animation}\n * @package\n */\n transition(textureData, options) {\n const { texture } = textureData;\n\n let positionProvided = this.psv.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n let mesh;\n\n if (this.prop.isCubemap) {\n if (positionProvided) {\n logWarn('cannot perform cubemap transition to different position');\n positionProvided = false;\n }\n\n mesh = this.__createCubemap(0.9);\n\n mesh.material.forEach((material, i) => {\n material.map = texture[i];\n material.transparent = true;\n material.opacity = 0;\n });\n }\n else {\n mesh = this.__createSphere(0.9);\n\n mesh.material.map = texture;\n mesh.material.transparent = true;\n mesh.material.opacity = 0;\n\n if (options.sphereCorrection) {\n this.setSphereCorrection(options.sphereCorrection, mesh);\n }\n }\n\n // rotate the new sphere to make the target position face the camera\n if (positionProvided) {\n const cleanPosition = this.psv.dataHelper.cleanPosition(options);\n\n // Longitude rotation along the vertical axis\n const verticalAxis = new THREE.Vector3(0, 1, 0);\n mesh.rotateOnWorldAxis(verticalAxis, cleanPosition.longitude - this.prop.position.longitude);\n\n // Latitude rotation along the camera horizontal axis\n const horizontalAxis = new THREE.Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new THREE.Vector3())).normalize();\n mesh.rotateOnWorldAxis(horizontalAxis, cleanPosition.latitude - this.prop.position.latitude);\n\n // TODO: find a better way to handle ranges\n if (this.config.latitudeRange || this.config.longitudeRange) {\n this.config.longitudeRange = null;\n this.config.latitudeRange = null;\n logWarn('trying to perform transition with longitudeRange and/or latitudeRange, ranges cleared');\n }\n }\n\n this.scene.add(mesh);\n this.psv.needsUpdate();\n\n return new Animation({\n properties: {\n opacity: { start: 0.0, end: 1.0 },\n zoom : zoomProvided ? { start: this.prop.zoomLvl, end: options.zoom } : undefined,\n },\n duration : options.transition,\n easing : 'outCubic',\n onTick : (properties) => {\n if (this.prop.isCubemap) {\n for (let i = 0; i < 6; i++) {\n mesh.material[i].opacity = properties.opacity;\n }\n }\n else {\n mesh.material.opacity = properties.opacity;\n }\n\n if (zoomProvided) {\n this.psv.zoom(properties.zoom);\n }\n\n this.psv.needsUpdate();\n },\n })\n .then(() => {\n // remove temp sphere and transfer the texture to the main sphere\n this.setTexture(textureData);\n this.scene.remove(mesh);\n\n mesh.geometry.dispose();\n mesh.geometry = null;\n\n if (options.sphereCorrection) {\n this.setSphereCorrection(options.sphereCorrection);\n }\n else {\n this.setSphereCorrection({});\n }\n\n // actually rotate the camera\n if (positionProvided) {\n this.psv.rotate(options);\n }\n });\n }\n\n /**\n * @summary Calls `dispose` on all objects and textures\n * @param {external:THREE.Object3D} object\n * @private\n */\n __cleanTHREEScene(object) {\n object.traverse((item) => {\n if (item.geometry) {\n item.geometry.dispose();\n }\n\n if (item.material) {\n if (Array.isArray(item.material)) {\n item.material.forEach((material) => {\n if (material.map) {\n material.map.dispose();\n }\n\n material.dispose();\n });\n }\n else {\n if (item.material.map) {\n item.material.map.dispose();\n }\n\n item.material.dispose();\n }\n }\n\n if (item.dispose && !(item instanceof THREE.Scene)) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import * as THREE from 'three';\nimport { CUBE_HASHMAP, CUBE_MAP } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\nimport { getXMPValue, logWarn, sum } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Texture loader\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TextureLoader extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Current HTTP requests\n * @type {XMLHttpRequest[]}\n * @private\n */\n this.requests = [];\n }\n\n /**\n * @override\n */\n destroy() {\n this.abortLoading();\n super.destroy();\n }\n\n /**\n * @summary Loads the panorama texture(s)\n * @param {string|string[]|PSV.Cubemap} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @package\n */\n loadTexture(panorama, newPanoData) {\n const tempPanorama = [];\n\n if (Array.isArray(panorama)) {\n if (panorama.length !== 6) {\n throw new PSVError('Must provide exactly 6 image paths when using cubemap.');\n }\n\n // reorder images\n for (let i = 0; i < 6; i++) {\n tempPanorama[i] = panorama[CUBE_MAP[i]];\n }\n\n return this.__loadCubemapTexture(tempPanorama);\n }\n else if (typeof panorama === 'object') {\n if (!CUBE_HASHMAP.every(side => !!panorama[side])) {\n throw new PSVError('Must provide exactly left, front, right, back, top, bottom when using cubemap.');\n }\n\n // transform into array\n CUBE_HASHMAP.forEach((side, i) => {\n tempPanorama[i] = panorama[side];\n });\n\n return this.__loadCubemapTexture(tempPanorama);\n }\n else {\n return this.__loadEquirectangularTexture(panorama, newPanoData);\n }\n }\n\n /**\n * @summary Cancels current HTTP requests\n */\n abortLoading() {\n [...this.requests].forEach(r => r.abort());\n }\n\n /**\n * @summary Loads a Blob with FileLoader\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @private\n */\n __loadFile(url, onProgress) {\n return new Promise((resolve, reject) => {\n let progress = 0;\n onProgress && onProgress(progress);\n\n const loader = new THREE.FileLoader();\n\n if (this.config.withCredentials) {\n loader.setWithCredentials(true);\n }\n\n loader.setResponseType('blob');\n\n const request = loader.load(\n url,\n (result) => {\n const rIdx = this.requests.indexOf(request);\n if (rIdx !== -1) this.requests.splice(rIdx, 1);\n\n progress = 100;\n onProgress && onProgress(progress);\n resolve(result);\n },\n (e) => {\n if (e.lengthComputable) {\n const newProgress = e.loaded / e.total * 100;\n if (newProgress > progress) {\n progress = newProgress;\n onProgress && onProgress(progress);\n }\n }\n },\n (err) => {\n const rIdx = this.requests.indexOf(request);\n if (rIdx !== -1) this.requests.splice(rIdx, 1);\n\n reject(err);\n }\n );\n\n // when we hit the cache, the result is the cache value\n if (request instanceof XMLHttpRequest) {\n this.requests.push(request);\n }\n });\n }\n\n /**\n * @summary Loads an Image using FileLoader to have progress events\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @private\n */\n __loadImage(url, onProgress) {\n return this.__loadFile(url, onProgress)\n .then(result => new Promise((resolve, reject) => {\n const img = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve(img);\n };\n img.onerror = reject;\n img.src = URL.createObjectURL(result);\n }));\n }\n\n /**\n * @summmary read a Blob as string\n * @param {Blob} blob\n * @returns {Promise}\n * @private\n */\n __loadBlobAsString(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = reject;\n reader.readAsText(blob);\n });\n }\n\n /**\n * @summary Loads the sphere texture\n * @param {string} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadEquirectangularTexture(panorama, newPanoData) {\n /* eslint no-shadow: [\"error\", {allow: [\"newPanoData\"]}] */\n if (this.prop.isCubemap === true) {\n throw new PSVError('The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.');\n }\n\n this.prop.isCubemap = false;\n\n return (\n newPanoData || !this.config.useXmpData\n ? this.__loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img, newPanoData }))\n : this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(newPanoData => this.__loadImage(panorama).then(img => ({ img, newPanoData })))\n )\n .then(({ img, newPanoData }) => {\n if (typeof newPanoData === 'function') {\n // eslint-disable-next-line no-param-reassign\n newPanoData = newPanoData(img);\n }\n\n const panoData = newPanoData || {\n fullWidth : img.width,\n fullHeight : img.height,\n croppedWidth : img.width,\n croppedHeight: img.height,\n croppedX : 0,\n croppedY : 0,\n };\n\n if (panoData.croppedWidth !== img.width || panoData.croppedHeight !== img.height) {\n logWarn(`Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image\n panoData: ${panoData.croppedWidth}x${panoData.croppedHeight}, image: ${img.width}x${img.height}`);\n }\n\n const texture = this.__createEquirectangularTexture(img, panoData);\n\n return { texture, panoData };\n });\n }\n\n /**\n * @summary Loads the XMP data of an image\n * @param {string} panorama\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadXMP(panorama, onProgress) {\n return this.__loadFile(panorama, onProgress)\n .then(blob => this.__loadBlobAsString(blob))\n .then((binary) => {\n const a = binary.indexOf('');\n const data = binary.substring(a, b);\n let panoData = null;\n\n if (a !== -1 && b !== -1 && data.indexOf('GPano:') !== -1) {\n panoData = {\n fullWidth : parseInt(getXMPValue(data, 'FullPanoWidthPixels'), 10),\n fullHeight : parseInt(getXMPValue(data, 'FullPanoHeightPixels'), 10),\n croppedWidth : parseInt(getXMPValue(data, 'CroppedAreaImageWidthPixels'), 10),\n croppedHeight: parseInt(getXMPValue(data, 'CroppedAreaImageHeightPixels'), 10),\n croppedX : parseInt(getXMPValue(data, 'CroppedAreaLeftPixels'), 10),\n croppedY : parseInt(getXMPValue(data, 'CroppedAreaTopPixels'), 10),\n };\n\n if (!panoData.fullWidth || !panoData.fullHeight || !panoData.croppedWidth || !panoData.croppedHeight) {\n logWarn('invalid XMP data');\n panoData = null;\n }\n }\n\n return panoData;\n });\n }\n\n /**\n * @summary Creates the final texture from image and panorama data\n * @param {Image} img\n * @param {PSV.PanoData} panoData\n * @returns {external:THREE.Texture}\n * @private\n */\n __createEquirectangularTexture(img, panoData) {\n let texture;\n\n // resize image / fill cropped parts with black\n if (panoData.fullWidth > SYSTEM.maxTextureWidth\n || panoData.croppedWidth !== panoData.fullWidth\n || panoData.croppedHeight !== panoData.fullHeight\n ) {\n const resizedPanoData = { ...panoData };\n\n const ratio = SYSTEM.maxCanvasWidth / panoData.fullWidth;\n\n resizedPanoData.fullWidth *= ratio;\n resizedPanoData.fullHeight *= ratio;\n resizedPanoData.croppedWidth *= ratio;\n resizedPanoData.croppedHeight *= ratio;\n resizedPanoData.croppedX *= ratio;\n resizedPanoData.croppedY *= ratio;\n\n const buffer = document.createElement('canvas');\n buffer.width = resizedPanoData.fullWidth;\n buffer.height = resizedPanoData.fullHeight;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img,\n resizedPanoData.croppedX, resizedPanoData.croppedY,\n resizedPanoData.croppedWidth, resizedPanoData.croppedHeight);\n\n texture = new THREE.Texture(buffer);\n }\n else {\n texture = new THREE.Texture(img);\n }\n\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n\n return texture;\n }\n\n /**\n * @summary Load the six textures of the cube\n * @param {string[]} panorama\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadCubemapTexture(panorama) {\n if (this.prop.isCubemap === false) {\n throw new PSVError('The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.');\n }\n\n if (this.config.fisheye) {\n logWarn('fisheye effect with cubemap texture can generate distorsion');\n }\n\n this.prop.isCubemap = true;\n\n const promises = [];\n const progress = [0, 0, 0, 0, 0, 0];\n\n for (let i = 0; i < 6; i++) {\n promises.push(\n this.__loadImage(panorama[i], (p) => {\n progress[i] = p;\n this.psv.loader.setProgress(sum(progress) / 6);\n })\n .then(img => this.__createCubemapTexture(img))\n );\n }\n\n return Promise.all(promises)\n .then(texture => ({ texture }));\n }\n\n /**\n * @summary Creates the final texture from image\n * @param {Image} img\n * @returns {external:THREE.Texture}\n * @private\n */\n __createCubemapTexture(img) {\n let texture;\n\n // resize image\n if (img.width > SYSTEM.maxTextureWidth) {\n const buffer = document.createElement('canvas');\n const ratio = SYSTEM.maxCanvasWidth / img.width;\n\n buffer.width = img.width * ratio;\n buffer.height = img.height * ratio;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img, 0, 0, buffer.width, buffer.height);\n\n texture = new THREE.Texture(buffer);\n }\n else {\n texture = new THREE.Texture(img);\n }\n\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n\n return texture;\n }\n\n /**\n * @summary Preload a panorama file without displaying it\n * @param {string} panorama\n * @returns {Promise}\n */\n preloadPanorama(panorama) {\n return this.loadTexture(panorama);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { addClasses, parsePosition } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\nconst STATE = { NONE: 0, SHOWING: 1, HIDING: 2, READY: 3 };\n\n/**\n * @typedef {Object} PSV.components.Tooltip.Position\n * @summary Object defining the tooltip position\n * @property {number} top - Position of the tip of the arrow of the tooltip, in pixels\n * @property {number} left - Position of the tip of the arrow of the tooltip, in pixels\n * @property {string|string[]} [position='top center'] - Tooltip position toward it's arrow tip.\n * Accepted values are combinations of `top`, `center`, `bottom` and `left`, `center`, `right`\n * @property {Object} [box] - Used when displaying a tooltip on a marker\n * @property {number} [box.width=0]\n * @property {number} [box.height=0]\n */\n\n/**\n * @typedef {PSV.components.Tooltip.Position} PSV.components.Tooltip.Config\n * @summary Object defining the tooltip configuration\n * @property {string} content - HTML content of the tooltip\n * @property {string} [className] - Additional CSS class added to the tooltip\n * @property {*} [data] - Userdata associated to the tooltip\n */\n\n/**\n * @summary Tooltip class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Tooltip extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n * @param {{arrow: number, offset: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} offset\n * @property {number} width\n * @property {number} height\n * @property {string} pos\n * @property {string} state\n * @property {*} data\n */\n this.prop = {\n ...this.prop,\n ...size,\n state : STATE.NONE,\n width : 0,\n height: 0,\n pos : '',\n data : null,\n };\n\n /**\n * Tooltip content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-tooltip-content';\n this.container.appendChild(this.content);\n\n /**\n * Tooltip arrow\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.arrow = document.createElement('div');\n this.arrow.className = 'psv-tooltip-arrow';\n this.container.appendChild(this.arrow);\n\n this.container.addEventListener('transitionend', this);\n\n this.container.style.top = '-1000px';\n this.container.style.left = '-1000px';\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.arrow;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'transitionend': this.__onTransitionEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n toggle() {\n throw new PSVError('Tooltip cannot be toggled');\n }\n\n /**\n * @summary Displays the tooltip on the viewer\n * Do not call this method directly, use {@link PSV.services.TooltipRenderer} instead.\n * @param {PSV.components.Tooltip.Config} config\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @package\n */\n show(config) {\n if (this.prop.state !== STATE.NONE) {\n throw new PSVError('Initialized tooltip cannot be re-initialized');\n }\n\n if (config.className) {\n addClasses(this.container, config.className);\n }\n\n this.content.innerHTML = config.content;\n\n const rect = this.container.getBoundingClientRect();\n this.prop.width = rect.right - rect.left;\n this.prop.height = rect.bottom - rect.top;\n\n this.prop.state = STATE.READY;\n\n this.move(config);\n\n this.prop.data = config.data;\n this.prop.state = STATE.SHOWING;\n\n this.psv.trigger(EVENTS.SHOW_TOOLTIP, this.prop.data, this);\n }\n\n /**\n * @summary Moves the tooltip to a new position\n * @param {PSV.components.Tooltip.Position} config\n *\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n move(config) {\n if (this.prop.state !== STATE.SHOWING && this.prop.state !== STATE.READY) {\n throw new PSVError('Uninitialized tooltip cannot be moved');\n }\n\n const t = this.container;\n const a = this.arrow;\n\n if (!config.position) {\n config.position = ['top', 'center'];\n }\n\n // parse position\n if (typeof config.position === 'string') {\n const tempPos = parsePosition(config.position);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse tooltip position \"${config.position}\"`);\n }\n\n config.position = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (config.position[0] === 'center' && config.position[1] === 'center') {\n throw new PSVError('Unable to parse tooltip position \"center center\"');\n }\n\n // compute size\n const style = {\n posClass : config.position.slice(),\n width : this.prop.width,\n height : this.prop.height,\n top : 0,\n left : 0,\n arrowTop : 0,\n arrowLeft: 0,\n };\n\n // set initial position\n this.__computeTooltipPosition(style, config);\n\n // correct position if overflow\n let refresh = false;\n if (style.top < this.prop.offset) {\n style.posClass[0] = 'bottom';\n refresh = true;\n }\n else if (style.top + style.height > this.psv.prop.size.height - this.prop.offset) {\n style.posClass[0] = 'top';\n refresh = true;\n }\n if (style.left < this.prop.offset) {\n style.posClass[1] = 'right';\n refresh = true;\n }\n else if (style.left + style.width > this.psv.prop.size.width - this.prop.offset) {\n style.posClass[1] = 'left';\n refresh = true;\n }\n if (refresh) {\n this.__computeTooltipPosition(style, config);\n }\n\n // apply position\n t.style.top = style.top + 'px';\n t.style.left = style.left + 'px';\n\n a.style.top = style.arrowTop + 'px';\n a.style.left = style.arrowLeft + 'px';\n\n const newPos = style.posClass.join('-');\n if (newPos !== this.prop.pos) {\n t.classList.remove(`psv-tooltip--${this.prop.pos}`);\n\n this.prop.pos = newPos;\n t.classList.add(`psv-tooltip--${this.prop.pos}`);\n }\n }\n\n /**\n * @summary Hides the tooltip\n * @fires PSV.hide-tooltip\n */\n hide() {\n this.container.classList.remove('psv-tooltip--visible');\n this.prop.state = STATE.HIDING;\n\n this.psv.trigger(EVENTS.HIDE_TOOLTIP, this.prop.data);\n }\n\n /**\n * @summary Finalize transition\n * @param {TransitionEvent} e\n * @private\n */\n __onTransitionEnd(e) {\n if (e.propertyName === 'transform') {\n switch (this.prop.state) {\n case STATE.SHOWING:\n this.container.classList.add('psv-tooltip--visible');\n this.prop.state = STATE.READY;\n break;\n\n case STATE.HIDING:\n this.prop.state = STATE.NONE;\n this.destroy();\n break;\n\n default:\n // nothing\n }\n }\n }\n\n /**\n * @summary Computes the position of the tooltip and its arrow\n * @param {Object} style\n * @param {Object} config\n * @private\n */\n __computeTooltipPosition(style, config) {\n let topBottom = false;\n\n if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\n }\n\n switch (style.posClass[0]) {\n case 'bottom':\n style.top = config.top + config.box.height + this.prop.offset + this.prop.arrow;\n style.arrowTop = -this.prop.arrow * 2;\n topBottom = true;\n break;\n\n case 'center':\n style.top = config.top + config.box.height / 2 - style.height / 2;\n style.arrowTop = style.height / 2 - this.prop.arrow;\n break;\n\n case 'top':\n style.top = config.top - style.height - this.prop.offset - this.prop.arrow;\n style.arrowTop = style.height;\n topBottom = true;\n break;\n\n // no default\n }\n\n switch (style.posClass[1]) {\n case 'right':\n if (topBottom) {\n style.left = config.left + config.box.width / 2 - this.prop.offset - this.prop.arrow;\n style.arrowLeft = this.prop.offset;\n }\n else {\n style.left = config.left + config.box.width + this.prop.offset + this.prop.arrow;\n style.arrowLeft = -this.prop.arrow * 2;\n }\n break;\n\n case 'center':\n style.left = config.left + config.box.width / 2 - style.width / 2;\n style.arrowLeft = style.width / 2 - this.prop.arrow;\n break;\n\n case 'left':\n if (topBottom) {\n style.left = config.left - style.width + config.box.width / 2 + this.prop.offset + this.prop.arrow;\n style.arrowLeft = style.width - this.prop.offset - this.prop.arrow * 2;\n }\n else {\n style.left = config.left - style.width - this.prop.offset - this.prop.arrow;\n style.arrowLeft = style.width;\n }\n break;\n\n // no default\n }\n }\n\n}\n","import { Tooltip } from '../components/Tooltip';\nimport { getStyle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Tooltip renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TooltipRenderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n const testTooltip = new Tooltip(this.psv);\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrowSize\n * @property {number} offset\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n offset: parseInt(getStyle(testTooltip.container, 'outlineWidth'), 10),\n };\n\n testTooltip.destroy();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.size;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a tooltip on the viewer\n * @param {PSV.components.Tooltip.Config} config\n * @returns {PSV.components.Tooltip}\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @example\n * viewer.tooltip.create({ content: 'Hello world', top: 200, left: 450, position: 'center bottom'})\n */\n create(config) {\n const tooltip = new Tooltip(this.psv, this.size);\n tooltip.show(config);\n\n return tooltip;\n }\n\n}\n","import * as THREE from 'three';\nimport { EventEmitter } from 'uevent';\nimport { Animation } from './Animation';\nimport { Loader } from './components/Loader';\nimport { Navbar } from './components/Navbar';\nimport { Notification } from './components/Notification';\nimport { Overlay } from './components/Overlay';\nimport { Panel } from './components/Panel';\nimport { CONFIG_PARSERS, DEFAULTS, getConfig, READONLY_OPTIONS } from './data/config';\nimport { CHANGE_EVENTS, EVENTS, IDS, VIEWER_DATA } from './data/constants';\nimport { SYSTEM } from './data/system';\nimport errorIcon from './icons/error.svg';\nimport { PSVError } from './PSVError';\nimport { DataHelper } from './services/DataHelper';\nimport { EventsHandler } from './services/EventsHandler';\nimport { Renderer } from './services/Renderer';\nimport { TextureLoader } from './services/TextureLoader';\nimport { TooltipRenderer } from './services/TooltipRenderer';\nimport {\n bound,\n each,\n exitFullscreen,\n getAngle,\n getShortestArc,\n isFullscreenEnabled,\n requestFullscreen,\n throttle,\n toggleClass\n} from './utils';\n\nTHREE.Cache.enabled = true;\n\n/**\n * @summary Main class\n * @memberOf PSV\n * @extends {external:uEvent.EventEmitter}\n */\nexport class Viewer extends EventEmitter {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n super();\n\n SYSTEM.load();\n\n // must support WebGL\n if (!SYSTEM.isWebGLSupported) {\n throw new PSVError('WebGL is not supported.');\n }\n\n if (SYSTEM.maxCanvasWidth === 0 || SYSTEM.maxTextureWidth === 0) {\n throw new PSVError('Unable to detect system capabilities');\n }\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} ready - when all components are loaded\n * @property {boolean} needsUpdate - if the view needs to be renderer\n * @property {boolean} isCubemap - if the panorama is a cubemap\n * @property {PSV.Position} position - current direction of the camera\n * @property {external:THREE.Vector3} direction - direction of the camera\n * @property {number} zoomLvl - current zoom level\n * @property {number} vFov - vertical FOV\n * @property {number} hFov - horizontal FOV\n * @property {number} aspect - viewer aspect ratio\n * @property {number} moveSpeed - move speed (computed with pixel ratio and configuration moveSpeed)\n * @property {Function} autorotateCb - update callback of the automatic rotation\n * @property {PSV.Animation} animationPromise - promise of the current animation (either go to position or image transition)\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property startTimeout - timeout id of the automatic rotation delay\n * @property {PSV.Size} size - size of the container\n * @property {PSV.PanoData} panoData - panorama metadata\n */\n this.prop = {\n ready : false,\n uiRefresh : false,\n needsUpdate : false,\n fullscreen : false,\n isCubemap : undefined,\n position : {\n longitude: 0,\n latitude : 0,\n },\n direction : null,\n zoomLvl : null,\n vFov : null,\n hFov : null,\n aspect : null,\n moveSpeed : 0.1,\n autorotateCb : null,\n animationPromise: null,\n loadingPromise : null,\n startTimeout : null,\n size : {\n width : 0,\n height: 0,\n },\n panoData : {\n fullWidth : 0,\n fullHeight : 0,\n croppedWidth : 0,\n croppedHeight: 0,\n croppedX : 0,\n croppedY : 0,\n },\n };\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = getConfig(options);\n\n /**\n * @summary Top most parent\n * @member {HTMLElement}\n * @readonly\n */\n this.parent = (typeof options.container === 'string') ? document.getElementById(options.container) : options.container;\n this.parent[VIEWER_DATA] = this;\n\n /**\n * @summary Main container\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.classList.add('psv-container');\n this.parent.appendChild(this.container);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary All plugins\n * @type {Object}\n * @readonly\n * @package\n */\n this.plugins = {};\n\n /**\n * @summary Main render controller\n * @type {PSV.services.Renderer}\n * @readonly\n */\n this.renderer = new Renderer(this);\n\n /**\n * @summary Textures loader\n * @type {PSV.services.TextureLoader}\n * @readonly\n */\n this.textureLoader = new TextureLoader(this);\n\n /**\n * @summary Main event handler\n * @type {PSV.services.EventsHandler}\n * @readonly\n */\n this.eventsHandler = new EventsHandler(this);\n\n /**\n * @summary Utilities to help converting data\n * @type {PSV.services.DataHelper}\n * @readonly\n */\n this.dataHelper = new DataHelper(this);\n\n /**\n * @member {PSV.components.Loader}\n * @readonly\n */\n this.loader = new Loader(this);\n\n /**\n * @member {PSV.components.Navbar}\n * @readonly\n */\n this.navbar = new Navbar(this);\n\n /**\n * @member {PSV.components.Panel}\n * @readonly\n */\n this.panel = new Panel(this);\n\n /**\n * @member {PSV.services.TooltipRenderer}\n * @readonly\n */\n this.tooltip = new TooltipRenderer(this);\n\n /**\n * @member {PSV.components.Notification}\n * @readonly\n */\n this.notification = new Notification(this);\n\n /**\n * @member {PSV.components.Overlay}\n * @readonly\n */\n this.overlay = new Overlay(this);\n\n this.eventsHandler.init();\n\n this.__resizeRefresh = throttle(() => this.refreshUi('resize'), 500);\n\n // apply container size\n this.resize(this.config.size);\n\n // actual move speed depends on pixel-ratio\n this.prop.moveSpeed = THREE.Math.degToRad(this.config.moveSpeed / SYSTEM.pixelRatio);\n\n // init plugins\n this.config.plugins.forEach(([plugin, opts]) => {\n this.plugins[plugin.id] = new plugin(this, opts); // eslint-disable-line new-cap\n });\n\n // init buttons\n this.navbar.setButtons(this.config.navbar);\n\n // load panorama\n if (this.config.panorama) {\n this.setPanorama(this.config.panorama);\n }\n\n SYSTEM.isTouchEnabled.then(enabled => toggleClass(this.container, 'psv--is-touch', enabled));\n\n // enable GUI after first render\n this.once(EVENTS.RENDER, () => {\n if (this.config.navbar) {\n this.container.classList.add('psv--has-navbar');\n this.navbar.show();\n }\n\n // Queue autorotate\n if (this.config.autorotateDelay) {\n this.prop.startTimeout = setTimeout(() => this.startAutorotate(), this.config.autorotateDelay);\n }\n\n this.prop.ready = true;\n\n setTimeout(() => {\n this.refreshUi('init');\n\n this.trigger(EVENTS.READY);\n }, 0);\n });\n }\n\n /**\n * @summary Destroys the viewer\n * @description The memory used by the ThreeJS context is not totally cleared. This will be fixed as soon as possible.\n */\n destroy() {\n this.__stopAll();\n this.stopKeyboardControl();\n this.exitFullscreen();\n\n this.eventsHandler.destroy();\n this.renderer.destroy();\n this.textureLoader.destroy();\n this.dataHelper.destroy();\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n each(this.plugins, plugin => plugin.destroy());\n delete this.plugins;\n\n this.parent.removeChild(this.container);\n delete this.parent[VIEWER_DATA];\n\n delete this.parent;\n delete this.container;\n\n delete this.loader;\n delete this.navbar;\n delete this.panel;\n delete this.tooltip;\n delete this.notification;\n delete this.overlay;\n\n delete this.config;\n }\n\n /**\n * @summary Refresh UI\n * @package\n */\n refreshUi(reason) {\n if (!this.prop.ready) {\n return;\n }\n\n if (!this.prop.uiRefresh) {\n // console.log(`PhotoSphereViewer: UI Refresh, ${reason}`);\n\n this.prop.uiRefresh = true;\n\n this.children.every((child) => {\n child.refreshUi();\n return this.prop.uiRefresh === true;\n });\n\n this.prop.uiRefresh = false;\n }\n else if (this.prop.uiRefresh !== 'new') {\n this.prop.uiRefresh = 'new';\n\n // wait for current refresh to cancel\n setTimeout(() => {\n this.prop.uiRefresh = false;\n this.refreshUi(reason);\n });\n }\n }\n\n /**\n * @summary Returns the instance of a plugin if it exists\n * @param {Class|string} pluginId\n * @returns {PSV.plugins.AbstractPlugin}\n */\n getPlugin(pluginId) {\n return pluginId ? this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId] : null;\n }\n\n /**\n * @summary Returns the current position of the camera\n * @returns {PSV.Position}\n */\n getPosition() {\n return {\n longitude: this.prop.position.longitude,\n latitude : this.prop.position.latitude,\n };\n }\n\n /**\n * @summary Returns the current zoom level\n * @returns {number}\n */\n getZoomLevel() {\n return this.prop.zoomLvl;\n }\n\n /**\n * @summary Returns the current viewer size\n * @returns {PSV.Size}\n */\n getSize() {\n return {\n width : this.prop.size.width,\n height: this.prop.size.height,\n };\n }\n\n /**\n * @summary Checks if the automatic rotation is enabled\n * @returns {boolean}\n */\n isAutorotateEnabled() {\n return !!this.prop.autorotateCb;\n }\n\n /**\n * @summary Checks if the viewer is in fullscreen\n * @returns {boolean}\n */\n isFullscreenEnabled() {\n if (SYSTEM.fullscreenEvent) {\n return isFullscreenEnabled(this.container);\n }\n else {\n return this.prop.fullscreen;\n }\n }\n\n /**\n * @summary Flags the view has changed for the next render\n */\n needsUpdate() {\n this.prop.needsUpdate = true;\n\n if (!this.renderer.mainReqid && this.renderer.renderer) {\n this.renderer.__renderLoop(+new Date());\n }\n }\n\n /**\n * @summary Resizes the canvas when the window is resized\n * @fires PSV.size-updated\n */\n autoSize() {\n if (this.container.clientWidth !== this.prop.size.width || this.container.clientHeight !== this.prop.size.height) {\n this.prop.size.width = Math.round(this.container.clientWidth);\n this.prop.size.height = Math.round(this.container.clientHeight);\n this.prop.aspect = this.prop.size.width / this.prop.size.height;\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.needsUpdate();\n this.trigger(EVENTS.SIZE_UPDATED, this.getSize());\n this.__resizeRefresh();\n }\n }\n\n /**\n * @summary Loads a new panorama file\n * @description Loads a new panorama file, optionally changing the camera position/zoom and activating the transition animation.
\n * If the \"options\" parameter is not defined, the camera will not move and the ongoing animation will continue.
\n * If another loading is already in progress it will be aborted.\n * @param {string|string[]|PSV.Cubemap} path - URL of the new panorama file\n * @param {PSV.PanoramaOptions} [options]\n * @returns {Promise}\n */\n setPanorama(path, options = {}) {\n if (this.prop.loadingPromise !== null) {\n this.textureLoader.abortLoading();\n }\n\n if (!this.prop.ready) {\n if (!('longitude' in options) && !this.prop.isCubemap) {\n options.longitude = this.config.defaultLong;\n }\n if (!('latitude' in options) && !this.prop.isCubemap) {\n options.latitude = this.config.defaultLat;\n }\n if (!('zoom' in options)) {\n options.zoom = this.config.defaultZoomLvl;\n }\n if (!('sphereCorrection' in options)) {\n options.sphereCorrection = this.config.sphereCorrection;\n }\n if (!('panoData' in options)) {\n options.panoData = this.config.panoData;\n }\n }\n\n if (options.transition === undefined || options.transition === true) {\n options.transition = 1500;\n }\n if (options.showLoader === undefined) {\n options.showLoader = true;\n }\n\n const positionProvided = this.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n if (positionProvided || zoomProvided) {\n this.__stopAll();\n }\n\n this.hideError();\n\n this.config.panorama = path;\n\n const done = (err) => {\n if (err && err.type === 'abort') {\n console.warn(err);\n }\n else if (err) {\n this.showError(this.config.lang.loadError);\n console.error(err);\n }\n\n this.loader.hide();\n this.renderer.show();\n\n this.prop.loadingPromise = null;\n\n if (err) {\n return Promise.reject(err);\n }\n else {\n return true;\n }\n };\n\n if (!options.transition || !this.prop.ready) {\n if (options.showLoader || !this.prop.ready) {\n this.loader.show();\n }\n\n this.prop.loadingPromise = this.textureLoader.loadTexture(this.config.panorama, options.panoData)\n .then((textureData) => {\n this.renderer.setTexture(textureData);\n\n if (options.sphereCorrection) {\n this.renderer.setSphereCorrection(options.sphereCorrection);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n if (positionProvided) {\n this.rotate(options);\n }\n })\n .then(done, done);\n }\n else {\n if (options.showLoader) {\n this.loader.show();\n }\n\n this.prop.loadingPromise = this.textureLoader.loadTexture(this.config.panorama)\n .then((textureData) => {\n this.loader.hide();\n\n return this.renderer.transition(textureData, options);\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Update options\n * @param {PSV.Options} options\n * @fires PSV.config-changed\n */\n setOptions(options) {\n each(options, (value, key) => {\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (READONLY_OPTIONS[key]) {\n throw new PSVError(READONLY_OPTIONS[key]);\n }\n\n if (CONFIG_PARSERS[key]) {\n this.config[key] = CONFIG_PARSERS[key](value, options);\n }\n else {\n this.config[key] = value;\n }\n\n switch (key) {\n case 'caption':\n this.navbar.setCaption(value);\n break;\n\n case 'size':\n this.resize(value);\n break;\n\n case 'sphereCorrection':\n this.renderer.setSphereCorrection(value);\n break;\n\n case 'navbar':\n case 'lang':\n this.navbar.setButtons(this.config.navbar);\n break;\n\n case 'moveSpeed':\n this.prop.moveSpeed = THREE.Math.degToRad(value / SYSTEM.pixelRatio);\n break;\n\n case 'minFov':\n case 'maxFov':\n this.prop.zoomLvl = this.dataHelper.fovToZoomLevel(this.prop.vFov);\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n break;\n\n default:\n break;\n }\n });\n\n this.needsUpdate();\n this.refreshUi('set options');\n\n this.trigger(EVENTS.CONFIG_CHANGED, Object.keys(options));\n }\n\n /**\n * @summary Update options\n * @param {string} option\n * @param {any} value\n * @fires PSV.config-changed\n */\n setOption(option, value) {\n this.setOptions({ [option]: value });\n }\n\n /**\n * @summary Starts the automatic rotation\n * @fires PSV.autorotate\n */\n startAutorotate() {\n this.__stopAll();\n\n this.prop.autorotateCb = (() => {\n let last;\n let elapsed;\n\n return (e, timestamp) => {\n elapsed = last === undefined ? 0 : timestamp - last;\n last = timestamp;\n\n this.rotate({\n longitude: this.prop.position.longitude + this.config.autorotateSpeed * elapsed / 1000,\n latitude : this.prop.position.latitude - (this.prop.position.latitude - this.config.autorotateLat) / 200,\n });\n };\n })();\n\n this.on(EVENTS.BEFORE_RENDER, this.prop.autorotateCb);\n\n this.trigger(EVENTS.AUTOROTATE, true);\n }\n\n /**\n * @summary Stops the automatic rotation\n * @fires PSV.autorotate\n */\n stopAutorotate() {\n if (this.prop.startTimeout) {\n clearTimeout(this.prop.startTimeout);\n this.prop.startTimeout = null;\n }\n\n if (this.isAutorotateEnabled()) {\n this.off(EVENTS.BEFORE_RENDER, this.prop.autorotateCb);\n this.prop.autorotateCb = null;\n\n this.trigger(EVENTS.AUTOROTATE, false);\n }\n }\n\n /**\n * @summary Starts or stops the automatic rotation\n * @fires PSV.autorotate\n */\n toggleAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.stopAutorotate();\n }\n else {\n this.startAutorotate();\n }\n }\n\n /**\n * @summary Displays an error message\n * @param {string} message\n */\n showError(message) {\n this.overlay.show({\n id : IDS.ERROR,\n image : errorIcon,\n text : message,\n dissmisable: false,\n });\n }\n\n /**\n * @summary Hides the error message\n */\n hideError() {\n this.overlay.hide(IDS.ERROR);\n }\n\n /**\n * @summary Rotates the view to specific longitude and latitude\n * @param {PSV.ExtendedPosition} position\n * @fires PSV.before-rotate\n * @fires PSV.position-updated\n */\n rotate(position) {\n const e = this.trigger(EVENTS.BEFORE_ROTATE, position);\n if (e.isDefaultPrevented()) {\n return;\n }\n\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ROTATE_POSITION, this.dataHelper.cleanPosition(position));\n\n if (this.prop.position.longitude !== cleanPosition.longitude || this.prop.position.latitude !== cleanPosition.latitude) {\n this.prop.position.longitude = cleanPosition.longitude;\n this.prop.position.latitude = cleanPosition.latitude;\n\n this.needsUpdate();\n\n this.trigger(EVENTS.POSITION_UPDATED, this.getPosition());\n }\n }\n\n /**\n * @summary Rotates and zooms the view with a smooth animation\n * @param {PSV.AnimateOptions} options - position and/or zoom level\n * @returns {PSV.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = this.dataHelper.isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n const animProperties = {};\n let duration;\n\n // clean/filter position and compute duration\n if (positionProvided) {\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ANIMATE_POSITION, this.dataHelper.cleanPosition(options));\n\n // longitude offset for shortest arc\n const tOffset = getShortestArc(this.prop.position.longitude, cleanPosition.longitude);\n\n animProperties.longitude = { start: this.prop.position.longitude, end: this.prop.position.longitude + tOffset };\n animProperties.latitude = { start: this.prop.position.latitude, end: cleanPosition.latitude };\n\n duration = this.dataHelper.speedToDuration(options.speed, getAngle(this.prop.position, cleanPosition));\n }\n\n // clean/filter zoom and compute duration\n if (zoomProvided) {\n const dZoom = Math.abs(options.zoom - this.prop.zoomLvl);\n\n animProperties.zoom = { start: this.prop.zoomLvl, end: options.zoom };\n\n if (!duration) {\n // if animating zoom only and a speed is given, use an arbitrary PI/4 to compute the duration\n duration = this.dataHelper.speedToDuration(options.speed, Math.PI / 4 * dZoom / 100);\n }\n }\n\n // if no animation needed\n if (!duration) {\n if (positionProvided) {\n this.rotate(options);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n\n return Animation.resolve();\n }\n\n this.prop.animationPromise = new Animation({\n properties: animProperties,\n duration : duration,\n easing : 'inOutSine',\n onTick : (properties) => {\n if (positionProvided) {\n this.rotate(properties);\n }\n if (zoomProvided) {\n this.zoom(properties.zoom);\n }\n },\n });\n\n return this.prop.animationPromise;\n }\n\n /**\n * @summary Stops the ongoing animation\n * @description The return value is a Promise because the is no guaranty the animation can be stopped synchronously.\n * @returns {Promise} Resolved when the animation has ben cancelled\n */\n stopAnimation() {\n if (this.prop.animationPromise) {\n return new Promise((resolve) => {\n this.prop.animationPromise.finally(resolve);\n this.prop.animationPromise.cancel();\n this.prop.animationPromise = null;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n\n /**\n * @summary Zooms to a specific level between `max_fov` and `min_fov`\n * @param {number} level - new zoom level from 0 to 100\n * @fires PSV.zoom-updated\n */\n zoom(level) {\n const newZoomLvl = bound(level, 0, 100);\n\n if (this.prop.zoomLvl !== newZoomLvl) {\n this.prop.zoomLvl = newZoomLvl;\n this.prop.vFov = this.dataHelper.zoomLevelToFov(this.prop.zoomLvl);\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.needsUpdate();\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n this.rotate(this.prop.position);\n }\n }\n\n /**\n * @summary Increases the zoom level by 1\n */\n zoomIn() {\n this.zoom(this.prop.zoomLvl + this.config.zoomButtonIncrement);\n }\n\n /**\n * @summary Decreases the zoom level by 1\n */\n zoomOut() {\n this.zoom(this.prop.zoomLvl - this.config.zoomButtonIncrement);\n }\n\n /**\n * @summary Resizes the viewer\n * @param {PSV.CssSize} size\n */\n resize(size) {\n ['width', 'height'].forEach((dim) => {\n if (size && size[dim]) {\n if (/^[0-9.]+$/.test(size[dim])) {\n size[dim] += 'px';\n }\n this.parent.style[dim] = size[dim];\n }\n });\n\n this.autoSize();\n }\n\n /**\n * @summary Enters the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n enterFullscreen() {\n if (SYSTEM.fullscreenEvent) {\n requestFullscreen(this.container);\n }\n else {\n this.container.classList.add('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(true);\n }\n }\n\n /**\n * @summary Exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n exitFullscreen() {\n if (this.isFullscreenEnabled()) {\n if (SYSTEM.fullscreenEvent) {\n exitFullscreen();\n }\n else {\n this.container.classList.remove('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(false);\n }\n }\n }\n\n /**\n * @summary Enters or exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n toggleFullscreen() {\n if (!this.isFullscreenEnabled()) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n\n /**\n * @summary Enables the keyboard controls (done automatically when entering fullscreen)\n */\n startKeyboardControl() {\n this.eventsHandler.enableKeyboard();\n }\n\n /**\n * @summary Disables the keyboard controls (done automatically when exiting fullscreen)\n */\n stopKeyboardControl() {\n this.eventsHandler.disableKeyboard();\n }\n\n /**\n * @summary Stops all current animations\n * @private\n */\n __stopAll() {\n this.stopAutorotate();\n this.stopAnimation();\n\n this.trigger(EVENTS.STOP_ALL);\n }\n\n}\n"],"names":["MOVE_THRESHOLD","DBLCLICK_DELAY","LONGTOUCH_DELAY","TWOFINGERSOVERLAY_DELAY","CTRLZOOM_TIMEOUT","INERTIA_WINDOW","SPHERE_RADIUS","SPHERE_VERTICES","CUBE_VERTICES","CUBE_MAP","CUBE_HASHMAP","VIEWER_DATA","ACTIONS","ROTATE_LAT_UP","ROTATE_LAT_DOWN","ROTATE_LONG_RIGHT","ROTATE_LONG_LEFT","ZOOM_IN","ZOOM_OUT","TOGGLE_AUTOROTATE","EVENTS","AUTOROTATE","BEFORE_RENDER","BEFORE_ROTATE","CLICK","CLOSE_PANEL","CONFIG_CHANGED","DOUBLE_CLICK","FULLSCREEN_UPDATED","HIDE_NOTIFICATION","HIDE_OVERLAY","HIDE_TOOLTIP","OPEN_PANEL","PANORAMA_LOADED","POSITION_UPDATED","READY","RENDER","SHOW_NOTIFICATION","SHOW_OVERLAY","SHOW_TOOLTIP","SIZE_UPDATED","STOP_ALL","ZOOM_UPDATED","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","IDS","MENU","TWO_FINGERS","CTRL_ZOOM","ERROR","EASINGS","linear","t","inQuad","outQuad","inOutQuad","inCubic","outCubic","inOutCubic","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","Math","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","toggleClass","element","className","active","classList","currentClassName","getAttribute","currentActive","indexOf","regex","RegExp","undefined","length","replace","setAttribute","toggle","contains","add","remove","addClasses","split","forEach","name","removeClasses","hasParent","el","parent","test","parentNode","getClosest","selector","matches","msMatchesSelector","bind","SVGElement","parentElement","KEYMAP","MS_KEYMAP","Add","Del","Down","Esc","Left","Right","Spacebar","Subtract","Up","getEventKey","evt","key","keyCode","which","isFullscreenEnabled","elt","document","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen","call","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","getStyle","prop","window","getComputedStyle","normalizeWheel","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","spinX","spinY","pixelX","pixelY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","bound","x","min","max","isInteger","value","Number","isFinite","floor","sum","array","reduce","a","b","distance","p1","p2","y","getShortestArc","from","to","tCandidates","candidate","newCandidate","abs","Infinity","getAngle","position1","position2","acos","latitude","longitude","greatArcDistance","λ1","φ1","λ2","φ2","dasherize","str","s","i","toLowerCase","throttle","func","wait","self","args","result","timeout","previous","later","Date","now","apply","remaining","arguments","clearTimeout","setTimeout","isPlainObject","obj","Object","getPrototypeOf","proto","prototype","toString","deepmerge","target","src","first","merge","Array","isArray","e","keys","clone","isEmpty","constructor","each","object","callback","intersect","array1","array2","filter","PSVError","message","Error","captureStackTrace","stack","create","logWarn","console","warn","getXMPValue","data","attr","match","CSS_POSITIONS","top","bottom","left","right","center","parsePosition","tokens","toLocaleLowerCase","slice","xFirst","map","token","reverse","parsed","join","parseFloat","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","THREE","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","isNaN","Animation","options","__cancelled","__resolved","__promise","Promise","resolve","reject","__resolve","__reject","easing","__start","delay","__delayTimeout","requestAnimationFrame","__run","timestamp","progress","duration","current","properties","start","end","onTick","then","onFulfilled","onRejected","p","cancel","catch","finally","onFinally","cancelAnimationFrame","AbstractComponent","psv","children","push","visible","container","createElement","appendChild","destroy","removeChild","childIdx","splice","child","refreshUi","every","uiRefresh","isVisible","hide","show","style","display","AbstractButton","navbar","collapsable","id","enabled","supported","collapsed","width","offsetWidth","icon","__setIcon","config","lang","title","addEventListener","onClick","stopPropagation","checkSupported","supportedOrObject","isSupported","initial","promise","toggleActive","iconActive","refresh","disable","enable","collapse","uncollapse","innerHTML","querySelector","AutorotateButton","on","off","handleEvent","type","toggleAutorotate","play","playActive","CustomButton","random","substr","content","DownloadButton","link","href","panorama","download","click","FullscreenButton","toggleFullscreen","fullscreenIn","fullscreenOut","MenuButton","__hideMenu","__showMenu","panel","MENU_TEMPLATE","BUTTON_DATA","noMargin","clickHandler","li","buttonId","dataset","getButton","menuIcon","buttons","dataKey","menu","button","SYSTEM","loaded","pixelRatio","isWebGLSupported","isTouchEnabled","maxTextureWidth","maxCanvasWidth","mouseWheelEvent","fullscreenEvent","load","ctx","getWebGLCtx","devicePixelRatio","getMaxTextureWidth","getMaxCanvasWidth","getMouseWheelEvent","getFullscreenEvent","canvas","names","context","getContext","some","listener","removeEventListener","getParameter","MAX_TEXTURE_SIZE","maxWidth","height","fillStyle","fillRect","getImageData","onmousewheel","FULLSCREEN_EVT_MAP","validExits","exit","AbstractZoomButton","buttondown","longPressTimeout","longPressAnimation","__onMouseUp","__onMouseDown","__startLongPressInterval","zoom","zoomLvl","zoomButtonIncrement","ZoomInButton","zoomIn","ZoomOutButton","zoomOut","ZoomRangeButton","mousedown","mediaMinWidth","zoomRange","zoomValue","parseInt","ready","__moveZoomValue","once","__stopZoomChange","__initZoomChangeWithMouse","__initZoomChangeByTouch","__changeZoomWithMouse","__changeZoomByTouch","size","level","__changeZoom","clientX","changedTouches","preventDefault","userInput","getBoundingClientRect","zoomLevel","DEFAULTS","caption","loadingImg","loadingTxt","fisheye","minFov","maxFov","defaultZoomLvl","defaultLong","defaultLat","sphereCorrection","pan","tilt","roll","moveSpeed","autorotateDelay","autorotateSpeed","autorotateLat","moveInertia","mousewheel","mousewheelSpeed","mousemove","captureCursor","mousewheelCtrlKey","touchmoveTwoFingers","useXmpData","panoData","withCredentials","autorotate","fullscreen","twoFingers","ctrlZoom","loadError","keyboard","plugins","READONLY_OPTIONS","CONFIG_PARSERS","plugin","getConfig","tempConfig","hasOwnProperty","CaptionButton","notification","info","NavbarCaption","contentVisible","contentWidth","setCaption","html","availableWidth","AVAILABLE_BUTTONS","registerButton","Navbar","setButtons","item","__cleanButtons","warnNotFound","totalWidth","visibleButtons","collapsableButtons","AbstractPlugin","EventEmitter","Loader","loader","clientWidth","tickness","lastChild","inner","round","maxHeight","setProgress","clearRect","lineWidth","strokeStyle","beginPath","arc","stroke","Notification","trigger","Overlay","contentId","dissmisable","image","text","subtext","PANEL_MIN_WIDTH","Panel","mouseX","mouseY","resizer","closeBtn","__onTouchStart","__onMouseMove","__onTouchMove","scrollTop","__startResize","__resize","touches","clientY","AbstractService","DataHelper","fovToZoomLevel","fov","temp","zoomLevelToFov","vFovToHFov","vFov","radToDeg","atan","tan","aspect","speedToDuration","textureCoordsToSphericalCoords","point","isCubemap","relativeX","croppedX","fullWidth","relativeY","croppedY","fullHeight","sphericalCoordsToTextureCoords","position","relativeLong","relativeLat","sphericalCoordsToVector3","vector3ToSphericalCoords","vector","phi","z","theta","atan2","viewerCoordsToVector3","viewerPoint","screen","renderer","raycaster","setFromCamera","camera","intersects","intersectObjects","scene","vector3ToViewerCoords","vectorClone","project","isExtendedPosition","key1","key2","cleanPosition","cleanSphereCorrection","EventsHandler","state","keyboardEnabled","moving","zooming","startMouseX","startMouseY","mouseHistory","pinchDist","ctrlKeyDown","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","ctrlZoomTimeout","__onResize","autoSize","init","__onKeyDown","__onKeyUp","__onTouchEnd","__fullscreenToggled","__onMouseEnter","__onMouseLeave","__onMouseWheel","enableKeyboard","disableKeyboard","overlay","dLong","dLat","dZoom","rotate","hFov","__startMove","__stopMove","__move","__moveAbsolute","__click","__cancelLongTouch","__startMoveZoom","__stopMoveZoom","__cancelTwoFingersOverlay","gestureIcon","__moveZoom","mousewheelIcon","delta","force","startKeyboardControl","stopKeyboardControl","stopAutorotate","stopAnimation","__logMouseMove","__stopMoveInertia","direction","norm","animationPromise","longtouch","boundingRect","rightclick","viewerX","viewerY","dataHelper","sphericalCoords","textureCoords","textureX","textureY","log","rotation","containerRect","Renderer","mainReqid","mesh","canvasContainer","cursor","setSize","__cleanTHREEScene","opacity","__renderLoop","needsUpdate","render","set","lookAt","copy","multiplyScalar","negate","updateProjectionMatrix","setTexture","textureData","texture","__createScene","material","dispose","setSphereCorrection","cleanCorrection","setPixelRatio","__createCubemap","__createSphere","domElement","scale","geometry","side","cubeSize","materials","transition","positionProvided","zoomProvided","transparent","verticalAxis","rotateOnWorldAxis","horizontalAxis","cross","getWorldDirection","normalize","latitudeRange","longitudeRange","traverse","TextureLoader","requests","abortLoading","loadTexture","newPanoData","tempPanorama","__loadCubemapTexture","__loadEquirectangularTexture","r","abort","__loadFile","url","onProgress","setWithCredentials","setResponseType","request","rIdx","lengthComputable","newProgress","total","err","XMLHttpRequest","__loadImage","img","createElementNS","onload","URL","revokeObjectURL","onerror","createObjectURL","__loadBlobAsString","blob","reader","FileReader","readAsText","__loadXMP","croppedWidth","croppedHeight","__createEquirectangularTexture","binary","substring","resizedPanoData","ratio","buffer","drawImage","minFilter","generateMipmaps","promises","__createCubemapTexture","all","preloadPanorama","LEFT_MAP","TOP_MAP","STATE","NONE","SHOWING","HIDING","Tooltip","pos","arrow","__onTransitionEnd","rect","move","tempPos","posClass","arrowTop","arrowLeft","__computeTooltipPosition","offset","newPos","propertyName","topBottom","box","TooltipRenderer","testTooltip","tooltip","Viewer","autorotateCb","loadingPromise","startTimeout","getElementById","textureLoader","eventsHandler","__resizeRefresh","resize","opts","setPanorama","startAutorotate","__stopAll","reason","getPlugin","pluginId","getPosition","getZoomLevel","getSize","isAutorotateEnabled","clientHeight","path","showLoader","hideError","done","showError","error","setOptions","setOption","option","last","elapsed","errorIcon","isDefaultPrevented","change","animate","animProperties","tOffset","newZoomLvl","dim","enterFullscreen"],"mappings":";;;;;;;;;;;;EAAA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACO,IAAMA,cAAc,GAAG,CAAvB;EAEP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,cAAc,GAAG,GAAvB;EAEP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,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EAepB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAO,eArBA;;EAsBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,KAAK,EAAe,OA5BA;;EA6BpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAS,aAnCA;;EAoCpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,cAAc,EAAM,gBA1CA;;EA2CpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,UAjDA;;EAkDpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,kBAAkB,EAAE,oBAxDA;;EAyDpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAG,mBA9DA;;EA+DpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cArEA;;EAsEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA5EA;;EA6EpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,UAAU,EAAU,YAnFA;;EAoFpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAK,iBAzFA;;EA0FpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,gBAAgB,EAAI,kBAhGA;;EAiGpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,KAAK,EAAe,OAtGA;;EAuGpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,MAAM,EAAc,QA5GA;;EA6GpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAG,mBAlHA;;EAmHpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAzHA;;EA0HpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAjIA;;EAkIpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAxIA;;EAyIpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,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,CAAmBjL,mBAAnB,CAAuC,KAAvC;EACD;EACF;EACF;EAED;EACF;EACA;EACA;EAr0BA;;EAAA,SAs0BEvQ,gBAt0BF,GAs0BE,4BAAmB;EACjB,QAAI,CAAC,KAAK9Q,mBAAL,EAAL,EAAiC;EAC/B,WAAKwuB,eAAL;EACD,KAFD,MAGK;EACH,WAAK5tB,cAAL;EACD;EACF;EAED;EACF;EACA;EAj1BA;;EAAA,SAk1BEmiB,oBAl1BF,GAk1BE,gCAAuB;EACrB,SAAKuJ,aAAL,CAAmB7K,cAAnB;EACD;EAED;EACF;EACA;EAx1BA;;EAAA,SAy1BEuB,mBAz1BF,GAy1BE,+BAAsB;EACpB,SAAKsJ,aAAL,CAAmB5K,eAAnB;EACD;EAED;EACF;EACA;EACA;EAh2BA;;EAAA,SAi2BEkL,SAj2BF,GAi2BE,qBAAY;EACV,SAAK3J,cAAL;EACA,SAAKC,aAAL;EAEA,SAAK1H,OAAL,CAAaziB,MAAM,CAACqB,QAApB;EACD,GAt2BH;;EAAA;EAAA,EAA4BmgB,mBAA5B;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/autorotate-keypoints.js b/dist/plugins/autorotate-keypoints.js index 4b8289b90..4c672fd21 100644 --- a/dist/plugins/autorotate-keypoints.js +++ b/dist/plugins/autorotate-keypoints.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.AutorotateKeypointsPlugin = factory(global.PhotoSphereViewer))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.AutorotateKeypointsPlugin = factory(global.PhotoSphereViewer))); }(this, (function (photoSphereViewer) { 'use strict'; function _extends() { @@ -119,7 +119,7 @@ _this.markers = _this.psv.getPlugin('markers'); - if (options == null ? void 0 : options.keypoints) { + if (options != null && options.keypoints) { _this.setKeypoints(options.keypoints); } diff --git a/dist/plugins/autorotate-keypoints.js.map b/dist/plugins/autorotate-keypoints.js.map index fce11a393..1ab01a986 100644 --- a/dist/plugins/autorotate-keypoints.js.map +++ b/dist/plugins/autorotate-keypoints.js.map @@ -1 +1 @@ -{"version":3,"file":"autorotate-keypoints.js","sources":["../../src/plugins/autorotate-keypoints/index.js"],"sourcesContent":["import { AbstractPlugin, CONSTANTS, PSVError, utils } from 'photo-sphere-viewer';\n\n/**\n * @typedef {PSV.ExtendedPosition|string|Object} PSV.plugins.AutorotateKeypointsPlugin.Keypoints\n * @summary Definition of keypoints for automatic rotation, can be a position object, a marker id or an object with the following properties\n * @property {string} [markerId]\n * @property {PSV.ExtendedPosition} [position]\n * @property {string|{content: string, position: string}} [tooltip]\n * @property {number} [pause=0]\n */\n\n/**\n * @typedef {Object} PSV.plugins.AutorotateKeypointsPlugin.Options\n * @property {boolean} [startFromClosest=true] - start from the closest keypoint instead of the first keypoint\n * @property {PSV.plugins.AutorotateKeypointsPlugin.Keypoints[]} keypoints\n */\n\n/**\n * @summary Number of steps between each points\n * @type {number}\n * @constant\n * @private\n */\nconst NUM_STEPS = 16;\n\nconst serializePt = position => [position.longitude, position.latitude];\n\n\n/**\n * @summary Replaces the standard autorotate animation by a smooth transition between multiple points\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class AutorotateKeypointsPlugin extends AbstractPlugin {\n\n static id = 'autorotate-keypoints';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.AutorotateKeypointsPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @property {number} idx - current index in keypoints\n * @property {number[][]} curve - curve between idx and idx + 1\n * @property {number[]} startPt - start point of the current step\n * @property {number[]} endPt - end point of the current step\n * @property {number} startTime - start time of the current step\n * @property {number} stepDuration - expected duration of the step\n * @property {number} remainingPause - time remaining for the pause\n * @property {number} lastTime - previous timestamp in render loop\n * @property {PSV.components.Tooltip} tooltip - currently displayed tooltip\n * @private\n */\n this.state = {};\n\n /**\n * @member {PSV.plugins.AutorotateKeypointsPlugin.Options}\n * @private\n */\n this.config = {\n startFromClosest: true,\n ...options,\n keypoints : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = this.psv.getPlugin('markers');\n\n if (options?.keypoints) {\n this.setKeypoints(options.keypoints);\n }\n\n this.psv.on(CONSTANTS.EVENTS.AUTOROTATE, this);\n }\n\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.AUTOROTATE, this);\n\n delete this.keypoints;\n delete this.state;\n\n super.destroy();\n }\n\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.AUTOROTATE) {\n this.__configure();\n }\n }\n\n /**\n * @summary Changes the keypoints\n * @param {PSV.plugins.AutorotateKeypointsPlugin.Keypoints[]} keypoints\n */\n setKeypoints(keypoints) {\n if (keypoints?.length < 2) {\n throw new PSVError('At least two points are required');\n }\n\n this.keypoints = utils.clone(keypoints);\n\n if (this.keypoints) {\n this.keypoints.forEach((pt, i) => {\n if (typeof pt === 'string') {\n // eslint-disable-next-line no-param-reassign\n pt = { markerId: pt };\n }\n else if (this.psv.dataHelper.isExtendedPosition(pt)) {\n // eslint-disable-next-line no-param-reassign\n pt = { position: pt };\n }\n if (pt.markerId) {\n if (!this.markers) {\n throw new PSVError(`Keypoint #${i} references a marker but markers plugin is not loaded`);\n }\n const marker = this.markers.getMarker(pt.markerId);\n pt.position = serializePt(marker.props.position);\n }\n else if (pt.position) {\n pt.position = serializePt(this.psv.dataHelper.cleanPosition(pt.position));\n }\n else {\n throw new PSVError(`Keypoint #${i} is missing marker or position`);\n }\n\n if (typeof pt.tooltip === 'string') {\n pt.tooltip = { content: pt.tooltip };\n }\n\n this.keypoints[i] = pt;\n });\n }\n\n this.__configure();\n }\n\n /**\n * @private\n */\n __configure() {\n if (!this.psv.isAutorotateEnabled() || !this.keypoints) {\n this.__hideTooltip();\n this.state = {};\n return;\n }\n\n this.state = {\n idx : -1,\n curve : [],\n startPt : null,\n endPt : null,\n startTime : null,\n stepDuration : null,\n remainingPause: null,\n lastTime : null,\n tooltip : null,\n };\n\n if (this.config.startFromClosest) {\n const index = this.__findMinIndex(this.keypoints, (keypoint) => {\n return utils.greatArcDistance(keypoint.position, serializePt(this.psv.prop.position));\n });\n\n this.keypoints.push(...this.keypoints.splice(0, index));\n }\n\n const autorotateCb = (e, timestamp) => {\n // initialisation\n if (!this.state.startTime) {\n this.state.endPt = serializePt(this.psv.prop.position);\n this.__nextStep();\n\n this.state.startTime = timestamp;\n this.state.lastTime = timestamp;\n }\n\n this.__nextFrame(timestamp);\n };\n\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this.psv.prop.autorotateCb);\n this.psv.prop.autorotateCb = autorotateCb;\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this.psv.prop.autorotateCb);\n }\n\n /**\n * @private\n */\n __incrementIdx() {\n this.state.idx++;\n if (this.state.idx === this.keypoints.length) {\n this.state.idx = 0;\n }\n }\n\n /**\n * @private\n */\n __showTooltip() {\n const keypoint = this.keypoints[this.state.idx];\n\n if (keypoint.tooltip) {\n const position = this.psv.dataHelper.vector3ToViewerCoords(this.psv.prop.direction);\n\n this.state.tooltip = this.psv.tooltip.create({\n content : keypoint.tooltip.content,\n position: keypoint.tooltip.position,\n top : position.y,\n left : position.x,\n });\n }\n else if (keypoint.markerId) {\n const marker = this.markers.getMarker(keypoint.markerId);\n marker.showTooltip();\n this.state.tooltip = marker.tooltip;\n }\n }\n\n /**\n * @private\n */\n __hideTooltip() {\n if (this.state.tooltip) {\n const keypoint = this.keypoints[this.state.idx];\n\n if (keypoint.tooltip) {\n this.state.tooltip.hide();\n }\n else if (keypoint.markerId) {\n const marker = this.markers.getMarker(keypoint.markerId);\n marker.hideTooltip();\n }\n\n this.state.tooltip = null;\n }\n }\n\n /**\n * @private\n */\n __nextPoint() {\n // get the 4 points necessary to compute the current movement\n // one point before and two points before current\n const workPoints = [];\n if (this.state.idx === -1) {\n workPoints.push(\n serializePt(this.psv.prop.position),\n serializePt(this.psv.prop.position),\n this.keypoints[0].position,\n this.keypoints[1].position\n );\n }\n else {\n for (let i = -1; i < 3; i++) {\n const keypoint = this.state.idx + i < 0\n ? this.keypoints[this.keypoints.length - 1]\n : this.keypoints[(this.state.idx + i) % this.keypoints.length];\n workPoints.push(keypoint.position);\n }\n }\n\n // apply offsets to avoid crossing the origin\n const workPoints2 = [workPoints[0].slice(0)];\n\n let k = 0;\n for (let i = 1; i <= 3; i++) {\n const d = workPoints[i - 1][0] - workPoints[i][0];\n if (d > Math.PI) { // crossed the origin left to right\n k += 1;\n }\n else if (d < -Math.PI) { // crossed the origin right to left\n k -= 1;\n }\n if (k !== 0 && i === 1) {\n // do not modify first point, apply the reverse offset the the previous point instead\n workPoints2[0][0] -= k * 2 * Math.PI;\n k = 0;\n }\n workPoints2.push([workPoints[i][0] + k * 2 * Math.PI, workPoints[i][1]]);\n }\n\n // only keep the curve for the current movement\n this.state.curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS)\n .slice(NUM_STEPS, NUM_STEPS * 2);\n\n if (this.state.idx !== -1) {\n this.state.remainingPause = this.keypoints[this.state.idx].pause;\n\n if (this.state.remainingPause) {\n this.__showTooltip();\n }\n else {\n this.__incrementIdx();\n }\n }\n else {\n this.__incrementIdx();\n }\n }\n\n /**\n * @private\n */\n __nextStep() {\n if (this.state.curve.length === 0) {\n this.__nextPoint();\n\n // reset transformation made to the previous point\n this.state.endPt[0] = utils.parseAngle(this.state.endPt[0]);\n }\n\n // target next point\n this.state.startPt = this.state.endPt;\n this.state.endPt = this.state.curve.shift();\n\n // compute duration from distance and speed\n const distance = utils.greatArcDistance(this.state.startPt, this.state.endPt);\n this.state.stepDuration = distance * 1000 / Math.abs(this.psv.config.autorotateSpeed);\n\n if (distance === 0) { // edge case\n this.__nextStep();\n }\n }\n\n /**\n * @private\n */\n __nextFrame(timestamp) {\n const ellapsed = timestamp - this.state.lastTime;\n this.state.lastTime = timestamp;\n\n // currently paused\n if (this.state.remainingPause) {\n this.state.remainingPause = Math.max(0, this.state.remainingPause - ellapsed);\n if (this.state.remainingPause > 0) {\n return;\n }\n else {\n this.__hideTooltip();\n this.__incrementIdx();\n this.state.startTime = timestamp;\n }\n }\n\n let progress = (timestamp - this.state.startTime) / this.state.stepDuration;\n if (progress >= 1) {\n this.__nextStep();\n progress = 0;\n this.state.startTime = timestamp;\n }\n\n this.psv.rotate({\n longitude: this.state.startPt[0] + (this.state.endPt[0] - this.state.startPt[0]) * progress,\n latitude : this.state.startPt[1] + (this.state.endPt[1] - this.state.startPt[1]) * progress,\n }, true);\n }\n\n /**\n * @summary Interpolate curvature points using cardinal spline\n * {@link https://stackoverflow.com/a/15528789/1207670}\n * @param {number[][]} pts\n * @param {number} [tension=0.5]\n * @param {number} [numOfSegments=16]\n * @returns {number[][]}\n * @private\n */\n __getCurvePoints(pts, tension = 0.5, numOfSegments = 16) {\n const res = [];\n\n // The algorithm require a previous and next point to the actual point array.\n const _pts = pts.slice(0);\n _pts.unshift(pts[0]);\n _pts.push(pts[pts.length - 1]);\n\n // 1. loop through each point\n // 2. loop through each segment\n for (let i = 1; i < _pts.length - 2; i++) {\n // calc tension vectors\n const t1x = (_pts[i + 1][0] - _pts[i - 1][0]) * tension;\n const t2x = (_pts[i + 2][0] - _pts[i][0]) * tension;\n\n const t1y = (_pts[i + 1][1] - _pts[i - 1][1]) * tension;\n const t2y = (_pts[i + 2][1] - _pts[i][1]) * tension;\n\n for (let t = 1; t <= numOfSegments; t++) {\n // calc step\n const st = t / numOfSegments;\n\n const st3 = Math.pow(st, 3);\n const st2 = Math.pow(st, 2);\n\n // calc cardinals\n const c1 = 2 * st3 - 3 * st2 + 1;\n const c2 = -2 * st3 + 3 * st2;\n const c3 = st3 - 2 * st2 + st;\n const c4 = st3 - st2;\n\n // calc x and y cords with common control vectors\n const x = c1 * _pts[i][0] + c2 * _pts[i + 1][0] + c3 * t1x + c4 * t2x;\n const y = c1 * _pts[i][1] + c2 * _pts[i + 1][1] + c3 * t1y + c4 * t2y;\n\n // store points in array\n res.push([x, y]);\n }\n }\n\n return res;\n }\n\n __findMinIndex(array, mapper) {\n let idx = 0;\n let current = Number.MAX_VALUE;\n\n array.forEach((item, i) => {\n const value = mapper ? mapper(item) : item;\n if (value < current) {\n current = value;\n idx = i;\n }\n });\n\n return idx;\n }\n\n}\n"],"names":["NUM_STEPS","serializePt","position","longitude","latitude","AutorotateKeypointsPlugin","psv","options","state","config","startFromClosest","keypoints","markers","getPlugin","setKeypoints","on","CONSTANTS","EVENTS","AUTOROTATE","destroy","off","handleEvent","e","type","__configure","length","PSVError","utils","clone","forEach","pt","i","markerId","dataHelper","isExtendedPosition","marker","getMarker","props","cleanPosition","tooltip","content","isAutorotateEnabled","__hideTooltip","idx","curve","startPt","endPt","startTime","stepDuration","remainingPause","lastTime","index","__findMinIndex","keypoint","greatArcDistance","prop","push","splice","autorotateCb","timestamp","__nextStep","__nextFrame","BEFORE_RENDER","__incrementIdx","__showTooltip","vector3ToViewerCoords","direction","create","top","y","left","x","showTooltip","hide","hideTooltip","__nextPoint","workPoints","workPoints2","slice","k","d","Math","PI","__getCurvePoints","pause","parseAngle","shift","distance","abs","autorotateSpeed","ellapsed","max","progress","rotate","pts","tension","numOfSegments","res","_pts","unshift","t1x","t2x","t1y","t2y","t","st","st3","pow","st2","c1","c2","c3","c4","array","mapper","current","Number","MAX_VALUE","item","value","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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ACnE,CAAD,CAAJ,CAAQ,CAAR,CAAL,GAAkB+E,EAAE,GAAGZ,IAAI,CAACnE,CAAC,GAAG,CAAL,CAAJ,CAAY,CAAZ,CAAvB,GAAwCgF,EAAE,GAAGX,GAA7C,GAAmDY,EAAE,GAAGX,GAAlE;EACA,YAAMhC,CAAC,GAAGwC,EAAE,GAAGX,IAAI,CAACnE,CAAD,CAAJ,CAAQ,CAAR,CAAL,GAAkB+E,EAAE,GAAGZ,IAAI,CAACnE,CAAC,GAAG,CAAL,CAAJ,CAAY,CAAZ,CAAvB,GAAwCgF,EAAE,GAAGT,GAA7C,GAAmDU,EAAE,GAAGT,GAAlE,CAfuC;;EAkBvCN,QAAAA,GAAG,CAACzC,IAAJ,CAAS,CAACe,CAAD,EAAIF,CAAJ,CAAT;EACD;EACF;;EAED,WAAO4B,GAAP;EACD;;WAED7C,iBAAA,wBAAe6D,KAAf,EAAsBC,MAAtB,EAA8B;EAC5B,QAAIvE,GAAG,GAAG,CAAV;EACA,QAAIwE,OAAO,GAAGC,MAAM,CAACC,SAArB;EAEAJ,IAAAA,KAAK,CAACpF,OAAN,CAAc,UAACyF,IAAD,EAAOvF,CAAP,EAAa;EACzB,UAAMwF,KAAK,GAAGL,MAAM,GAAGA,MAAM,CAACI,IAAD,CAAT,GAAkBA,IAAtC;;EACA,UAAIC,KAAK,GAAGJ,OAAZ,EAAqB;EACnBA,QAAAA,OAAO,GAAGI,KAAV;EACA5E,QAAAA,GAAG,GAAGZ,CAAN;EACD;EACF,KAND;EAQA,WAAOY,GAAP;EACD;;;IA3YoD6E;;EAAlCnH,0BAEZoH,KAAK;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"autorotate-keypoints.js","sources":["../../src/plugins/autorotate-keypoints/index.js"],"sourcesContent":["import { AbstractPlugin, CONSTANTS, PSVError, utils } from 'photo-sphere-viewer';\n\n/**\n * @typedef {PSV.ExtendedPosition|string|Object} PSV.plugins.AutorotateKeypointsPlugin.Keypoints\n * @summary Definition of keypoints for automatic rotation, can be a position object, a marker id or an object with the following properties\n * @property {string} [markerId]\n * @property {PSV.ExtendedPosition} [position]\n * @property {string|{content: string, position: string}} [tooltip]\n * @property {number} [pause=0]\n */\n\n/**\n * @typedef {Object} PSV.plugins.AutorotateKeypointsPlugin.Options\n * @property {boolean} [startFromClosest=true] - start from the closest keypoint instead of the first keypoint\n * @property {PSV.plugins.AutorotateKeypointsPlugin.Keypoints[]} keypoints\n */\n\n/**\n * @summary Number of steps between each points\n * @type {number}\n * @constant\n * @private\n */\nconst NUM_STEPS = 16;\n\nconst serializePt = position => [position.longitude, position.latitude];\n\n\n/**\n * @summary Replaces the standard autorotate animation by a smooth transition between multiple points\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class AutorotateKeypointsPlugin extends AbstractPlugin {\n\n static id = 'autorotate-keypoints';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.AutorotateKeypointsPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @property {number} idx - current index in keypoints\n * @property {number[][]} curve - curve between idx and idx + 1\n * @property {number[]} startPt - start point of the current step\n * @property {number[]} endPt - end point of the current step\n * @property {number} startTime - start time of the current step\n * @property {number} stepDuration - expected duration of the step\n * @property {number} remainingPause - time remaining for the pause\n * @property {number} lastTime - previous timestamp in render loop\n * @property {PSV.components.Tooltip} tooltip - currently displayed tooltip\n * @private\n */\n this.state = {};\n\n /**\n * @member {PSV.plugins.AutorotateKeypointsPlugin.Options}\n * @private\n */\n this.config = {\n startFromClosest: true,\n ...options,\n keypoints : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = this.psv.getPlugin('markers');\n\n if (options?.keypoints) {\n this.setKeypoints(options.keypoints);\n }\n\n this.psv.on(CONSTANTS.EVENTS.AUTOROTATE, this);\n }\n\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.AUTOROTATE, this);\n\n delete this.keypoints;\n delete this.state;\n\n super.destroy();\n }\n\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.AUTOROTATE) {\n this.__configure();\n }\n }\n\n /**\n * @summary Changes the keypoints\n * @param {PSV.plugins.AutorotateKeypointsPlugin.Keypoints[]} keypoints\n */\n setKeypoints(keypoints) {\n if (keypoints?.length < 2) {\n throw new PSVError('At least two points are required');\n }\n\n this.keypoints = utils.clone(keypoints);\n\n if (this.keypoints) {\n this.keypoints.forEach((pt, i) => {\n if (typeof pt === 'string') {\n // eslint-disable-next-line no-param-reassign\n pt = { markerId: pt };\n }\n else if (this.psv.dataHelper.isExtendedPosition(pt)) {\n // eslint-disable-next-line no-param-reassign\n pt = { position: pt };\n }\n if (pt.markerId) {\n if (!this.markers) {\n throw new PSVError(`Keypoint #${i} references a marker but markers plugin is not loaded`);\n }\n const marker = this.markers.getMarker(pt.markerId);\n pt.position = serializePt(marker.props.position);\n }\n else if (pt.position) {\n pt.position = serializePt(this.psv.dataHelper.cleanPosition(pt.position));\n }\n else {\n throw new PSVError(`Keypoint #${i} is missing marker or position`);\n }\n\n if (typeof pt.tooltip === 'string') {\n pt.tooltip = { content: pt.tooltip };\n }\n\n this.keypoints[i] = pt;\n });\n }\n\n this.__configure();\n }\n\n /**\n * @private\n */\n __configure() {\n if (!this.psv.isAutorotateEnabled() || !this.keypoints) {\n this.__hideTooltip();\n this.state = {};\n return;\n }\n\n this.state = {\n idx : -1,\n curve : [],\n startPt : null,\n endPt : null,\n startTime : null,\n stepDuration : null,\n remainingPause: null,\n lastTime : null,\n tooltip : null,\n };\n\n if (this.config.startFromClosest) {\n const index = this.__findMinIndex(this.keypoints, (keypoint) => {\n return utils.greatArcDistance(keypoint.position, serializePt(this.psv.prop.position));\n });\n\n this.keypoints.push(...this.keypoints.splice(0, index));\n }\n\n const autorotateCb = (e, timestamp) => {\n // initialisation\n if (!this.state.startTime) {\n this.state.endPt = serializePt(this.psv.prop.position);\n this.__nextStep();\n\n this.state.startTime = timestamp;\n this.state.lastTime = timestamp;\n }\n\n this.__nextFrame(timestamp);\n };\n\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this.psv.prop.autorotateCb);\n this.psv.prop.autorotateCb = autorotateCb;\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this.psv.prop.autorotateCb);\n }\n\n /**\n * @private\n */\n __incrementIdx() {\n this.state.idx++;\n if (this.state.idx === this.keypoints.length) {\n this.state.idx = 0;\n }\n }\n\n /**\n * @private\n */\n __showTooltip() {\n const keypoint = this.keypoints[this.state.idx];\n\n if (keypoint.tooltip) {\n const position = this.psv.dataHelper.vector3ToViewerCoords(this.psv.prop.direction);\n\n this.state.tooltip = this.psv.tooltip.create({\n content : keypoint.tooltip.content,\n position: keypoint.tooltip.position,\n top : position.y,\n left : position.x,\n });\n }\n else if (keypoint.markerId) {\n const marker = this.markers.getMarker(keypoint.markerId);\n marker.showTooltip();\n this.state.tooltip = marker.tooltip;\n }\n }\n\n /**\n * @private\n */\n __hideTooltip() {\n if (this.state.tooltip) {\n const keypoint = this.keypoints[this.state.idx];\n\n if (keypoint.tooltip) {\n this.state.tooltip.hide();\n }\n else if (keypoint.markerId) {\n const marker = this.markers.getMarker(keypoint.markerId);\n marker.hideTooltip();\n }\n\n this.state.tooltip = null;\n }\n }\n\n /**\n * @private\n */\n __nextPoint() {\n // get the 4 points necessary to compute the current movement\n // one point before and two points before current\n const workPoints = [];\n if (this.state.idx === -1) {\n workPoints.push(\n serializePt(this.psv.prop.position),\n serializePt(this.psv.prop.position),\n this.keypoints[0].position,\n this.keypoints[1].position\n );\n }\n else {\n for (let i = -1; i < 3; i++) {\n const keypoint = this.state.idx + i < 0\n ? this.keypoints[this.keypoints.length - 1]\n : this.keypoints[(this.state.idx + i) % this.keypoints.length];\n workPoints.push(keypoint.position);\n }\n }\n\n // apply offsets to avoid crossing the origin\n const workPoints2 = [workPoints[0].slice(0)];\n\n let k = 0;\n for (let i = 1; i <= 3; i++) {\n const d = workPoints[i - 1][0] - workPoints[i][0];\n if (d > Math.PI) { // crossed the origin left to right\n k += 1;\n }\n else if (d < -Math.PI) { // crossed the origin right to left\n k -= 1;\n }\n if (k !== 0 && i === 1) {\n // do not modify first point, apply the reverse offset the the previous point instead\n workPoints2[0][0] -= k * 2 * Math.PI;\n k = 0;\n }\n workPoints2.push([workPoints[i][0] + k * 2 * Math.PI, workPoints[i][1]]);\n }\n\n // only keep the curve for the current movement\n this.state.curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS)\n .slice(NUM_STEPS, NUM_STEPS * 2);\n\n if (this.state.idx !== -1) {\n this.state.remainingPause = this.keypoints[this.state.idx].pause;\n\n if (this.state.remainingPause) {\n this.__showTooltip();\n }\n else {\n this.__incrementIdx();\n }\n }\n else {\n this.__incrementIdx();\n }\n }\n\n /**\n * @private\n */\n __nextStep() {\n if (this.state.curve.length === 0) {\n this.__nextPoint();\n\n // reset transformation made to the previous point\n this.state.endPt[0] = utils.parseAngle(this.state.endPt[0]);\n }\n\n // target next point\n this.state.startPt = this.state.endPt;\n this.state.endPt = this.state.curve.shift();\n\n // compute duration from distance and speed\n const distance = utils.greatArcDistance(this.state.startPt, this.state.endPt);\n this.state.stepDuration = distance * 1000 / Math.abs(this.psv.config.autorotateSpeed);\n\n if (distance === 0) { // edge case\n this.__nextStep();\n }\n }\n\n /**\n * @private\n */\n __nextFrame(timestamp) {\n const ellapsed = timestamp - this.state.lastTime;\n this.state.lastTime = timestamp;\n\n // currently paused\n if (this.state.remainingPause) {\n this.state.remainingPause = Math.max(0, this.state.remainingPause - ellapsed);\n if (this.state.remainingPause > 0) {\n return;\n }\n else {\n this.__hideTooltip();\n this.__incrementIdx();\n this.state.startTime = timestamp;\n }\n }\n\n let progress = (timestamp - this.state.startTime) / this.state.stepDuration;\n if (progress >= 1) {\n this.__nextStep();\n progress = 0;\n this.state.startTime = timestamp;\n }\n\n this.psv.rotate({\n longitude: this.state.startPt[0] + (this.state.endPt[0] - this.state.startPt[0]) * progress,\n latitude : this.state.startPt[1] + (this.state.endPt[1] - this.state.startPt[1]) * progress,\n }, true);\n }\n\n /**\n * @summary Interpolate curvature points using cardinal spline\n * {@link https://stackoverflow.com/a/15528789/1207670}\n * @param {number[][]} pts\n * @param {number} [tension=0.5]\n * @param {number} [numOfSegments=16]\n * @returns {number[][]}\n * @private\n */\n __getCurvePoints(pts, tension = 0.5, numOfSegments = 16) {\n const res = [];\n\n // The algorithm require a previous and next point to the actual point array.\n const _pts = pts.slice(0);\n _pts.unshift(pts[0]);\n _pts.push(pts[pts.length - 1]);\n\n // 1. loop through each point\n // 2. loop through each segment\n for (let i = 1; i < _pts.length - 2; i++) {\n // calc tension vectors\n const t1x = (_pts[i + 1][0] - _pts[i - 1][0]) * tension;\n const t2x = (_pts[i + 2][0] - _pts[i][0]) * tension;\n\n const t1y = (_pts[i + 1][1] - _pts[i - 1][1]) * tension;\n const t2y = (_pts[i + 2][1] - _pts[i][1]) * tension;\n\n for (let t = 1; t <= numOfSegments; t++) {\n // calc step\n const st = t / numOfSegments;\n\n const st3 = Math.pow(st, 3);\n const st2 = Math.pow(st, 2);\n\n // calc cardinals\n const c1 = 2 * st3 - 3 * st2 + 1;\n const c2 = -2 * st3 + 3 * st2;\n const c3 = st3 - 2 * st2 + st;\n const c4 = st3 - st2;\n\n // calc x and y cords with common control vectors\n const x = c1 * _pts[i][0] + c2 * _pts[i + 1][0] + c3 * t1x + c4 * t2x;\n const y = c1 * _pts[i][1] + c2 * _pts[i + 1][1] + c3 * t1y + c4 * t2y;\n\n // store points in array\n res.push([x, y]);\n }\n }\n\n return res;\n }\n\n __findMinIndex(array, mapper) {\n let idx = 0;\n let current = Number.MAX_VALUE;\n\n array.forEach((item, i) => {\n const value = mapper ? mapper(item) : item;\n if (value < current) {\n current = value;\n idx = i;\n }\n });\n\n return idx;\n }\n\n}\n"],"names":["NUM_STEPS","serializePt","position","longitude","latitude","AutorotateKeypointsPlugin","psv","options","state","config","startFromClosest","keypoints","markers","getPlugin","setKeypoints","on","CONSTANTS","EVENTS","AUTOROTATE","destroy","off","handleEvent","e","type","__configure","length","PSVError","utils","clone","forEach","pt","i","markerId","dataHelper","isExtendedPosition","marker","getMarker","props","cleanPosition","tooltip","content","isAutorotateEnabled","__hideTooltip","idx","curve","startPt","endPt","startTime","stepDuration","remainingPause","lastTime","index","__findMinIndex","keypoint","greatArcDistance","prop","push","splice","autorotateCb","timestamp","__nextStep","__nextFrame","BEFORE_RENDER","__incrementIdx","__showTooltip","vector3ToViewerCoords","direction","create","top","y","left","x","showTooltip","hide","hideTooltip","__nextPoint","workPoints","workPoints2","slice","k","d","Math","PI","__getCurvePoints","pause","parseAngle","shift","distance","abs","autorotateSpeed","ellapsed","max","progress","rotate","pts","tension","numOfSegments","res","_pts","unshift","t1x","t2x","t1y","t2y","t","st","st3","pow","st2","c1","c2","c3","c4","array","mapper","current","Number","MAX_VALUE","item","value","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EACA,IAAMA,SAAS,GAAG,EAAlB;;EAEA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAAAC,QAAQ;EAAA,SAAI,CAACA,QAAQ,CAACC,SAAV,EAAqBD,QAAQ,CAACE,QAA9B,CAAJ;EAAA,CAA5B;EAGA;EACA;EACA;EACA;EACA;;;MACqBC;;;EAInB;EACF;EACA;EACA;EACE,qCAAYC,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA;;EACxB,uCAAMD,GAAN;EAEA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EACI,UAAKE,KAAL,GAAa,EAAb;EAEA;EACJ;EACA;EACA;;EACI,UAAKC,MAAL;EACEC,MAAAA,gBAAgB,EAAE;EADpB,OAEKH,OAFL;EAGEI,MAAAA,SAAS,E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lE,CAfuC;;EAkBvCN,QAAAA,GAAG,CAACzC,IAAJ,CAAS,CAACe,CAAD,EAAIF,CAAJ,CAAT;EACD;EACF;;EAED,WAAO4B,GAAP;EACD;;WAED7C,iBAAA,wBAAe6D,KAAf,EAAsBC,MAAtB,EAA8B;EAC5B,QAAIvE,GAAG,GAAG,CAAV;EACA,QAAIwE,OAAO,GAAGC,MAAM,CAACC,SAArB;EAEAJ,IAAAA,KAAK,CAACpF,OAAN,CAAc,UAACyF,IAAD,EAAOvF,CAAP,EAAa;EACzB,UAAMwF,KAAK,GAAGL,MAAM,GAAGA,MAAM,CAACI,IAAD,CAAT,GAAkBA,IAAtC;;EACA,UAAIC,KAAK,GAAGJ,OAAZ,EAAqB;EACnBA,QAAAA,OAAO,GAAGI,KAAV;EACA5E,QAAAA,GAAG,GAAGZ,CAAN;EACD;EACF,KAND;EAQA,WAAOY,GAAP;EACD;;;IA3YoD6E;;EAAlCnH,0BAEZoH,KAAK;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/gyroscope.js b/dist/plugins/gyroscope.js index 1bd5dbebd..7beed298e 100644 --- a/dist/plugins/gyroscope.js +++ b/dist/plugins/gyroscope.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer'), require('three')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'three'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.GyroscopePlugin = factory(global.PhotoSphereViewer, global.THREE))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.GyroscopePlugin = factory(global.PhotoSphereViewer, global.THREE))); }(this, (function (photoSphereViewer, THREE) { 'use strict'; function _extends() { @@ -49,7 +49,7 @@ var DeviceOrientationControls = function DeviceOrientationControls(object) { var scope = this; var changeEvent = { - type: "change" + type: 'change' }; var EPS = 0.000001; this.object = object; @@ -147,7 +147,7 @@ DeviceOrientationControls.prototype = Object.create(THREE.EventDispatcher.prototype); DeviceOrientationControls.prototype.constructor = DeviceOrientationControls; - var compass = "\n"; + var compass = "\n"; /** * @summary Navigation bar gyroscope button class @@ -240,6 +240,7 @@ /** * @typedef {Object} PSV.plugins.GyroscopePlugin.Options + * @property {boolean} [touchmove=true] - allows to pan horizontally when the gyroscope is enabled (requires global `mousemove=true`) * @property {boolean} [absolutePosition=false] - when true the view will ignore the current direction when enabling gyroscope control */ // add gyroscope button @@ -292,6 +293,7 @@ */ _this.config = _extends({ + touchmove: true, absolutePosition: false }, options); /** @@ -487,7 +489,10 @@ _proto.__onRotate = function __onRotate(e) { if (this.isEnabled()) { e.preventDefault(); - this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude; + + if (this.config.touchmove) { + this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude; + } } } /** @@ -503,7 +508,6 @@ } else if ('DeviceOrientationEvent' in window) { return new Promise(function (resolve) { var listener = function listener(e) { - /* eslint-disable-next-line no-restricted-globals */ resolve(e && e.alpha !== null && !isNaN(e.alpha)); window.removeEventListener('deviceorientation', listener); }; diff --git a/dist/plugins/gyroscope.js.map b/dist/plugins/gyroscope.js.map index f43556aeb..61fd04265 100644 --- a/dist/plugins/gyroscope.js.map +++ b/dist/plugins/gyroscope.js.map @@ -1 +1 @@ -{"version":3,"file":"gyroscope.js","sources":["../../three-examples/controls/DeviceOrientationControls.js","../../src/plugins/gyroscope/GyroscopeButton.js","../../src/plugins/gyroscope/index.js"],"sourcesContent":["import {\n\tEuler,\n\tEventDispatcher,\n\tMathUtils,\n\tQuaternion,\n\tVector3\n} from \"../../../build/three.module.js\";\n\n/**\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nvar DeviceOrientationControls = function ( object ) {\n\n\tvar scope = this;\n\tvar changeEvent = { type: \"change\" };\n\tvar EPS = 0.000001;\n\n\tthis.object = object;\n\tthis.object.rotation.reorder( 'YXZ' );\n\n\tthis.enabled = true;\n\n\tthis.deviceOrientation = {};\n\tthis.screenOrientation = 0;\n\n\tthis.alphaOffset = 0; // radians\n\n\tvar onDeviceOrientationChangeEvent = function ( event ) {\n\n\t\tscope.deviceOrientation = event;\n\n\t};\n\n\tvar onScreenOrientationChangeEvent = function () {\n\n\t\tscope.screenOrientation = window.orientation || 0;\n\n\t};\n\n\t// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n\tvar setObjectQuaternion = function () {\n\n\t\tvar zee = new Vector3( 0, 0, 1 );\n\n\t\tvar euler = new Euler();\n\n\t\tvar q0 = new Quaternion();\n\n\t\tvar q1 = new Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n\t\treturn function ( quaternion, alpha, beta, gamma, orient ) {\n\n\t\t\teuler.set( beta, alpha, - gamma, 'YXZ' ); // 'ZXY' for the device, but 'YXZ' for us\n\n\t\t\tquaternion.setFromEuler( euler ); // orient the device\n\n\t\t\tquaternion.multiply( q1 ); // camera looks out the back of the device, not the top\n\n\t\t\tquaternion.multiply( q0.setFromAxisAngle( zee, - orient ) ); // adjust for screen orientation\n\n\t\t};\n\n\t}();\n\n\tthis.connect = function () {\n\n\t\tonScreenOrientationChangeEvent(); // run once on load\n\n\t\t// iOS 13+\n\n\t\tif ( window.DeviceOrientationEvent !== undefined && typeof window.DeviceOrientationEvent.requestPermission === 'function' ) {\n\n\t\t\twindow.DeviceOrientationEvent.requestPermission().then( function ( response ) {\n\n\t\t\t\tif ( response == 'granted' ) {\n\n\t\t\t\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\t\t\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\t\t\t}\n\n\t\t\t} ).catch( function ( error ) {\n\n\t\t\t\tconsole.error( 'THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:', error );\n\n\t\t\t} );\n\n\t\t} else {\n\n\t\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\t}\n\n\t\tscope.enabled = true;\n\n\t};\n\n\tthis.disconnect = function () {\n\n\t\twindow.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\tscope.enabled = false;\n\n\t};\n\n\tthis.update = ( function () {\n\n\t\tvar lastQuaternion = new Quaternion();\n\n\t\treturn function () {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tvar device = scope.deviceOrientation;\n\n\t\t\tif ( device ) {\n\n\t\t\t\tvar alpha = device.alpha ? MathUtils.degToRad( device.alpha ) + scope.alphaOffset : 0; // Z\n\n\t\t\t\tvar beta = device.beta ? MathUtils.degToRad( device.beta ) : 0; // X'\n\n\t\t\t\tvar gamma = device.gamma ? MathUtils.degToRad( device.gamma ) : 0; // Y''\n\n\t\t\t\tvar orient = scope.screenOrientation ? MathUtils.degToRad( scope.screenOrientation ) : 0; // O\n\n\t\t\t\tsetObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n\t\t\t\tif ( 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {\n\n\t\t\t\t\tlastQuaternion.copy( scope.object.quaternion );\n\t\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\n\t} )();\n\n\tthis.dispose = function () {\n\n\t\tscope.disconnect();\n\n\t};\n\n\tthis.connect();\n\n};\n\nDeviceOrientationControls.prototype = Object.create( EventDispatcher.prototype );\nDeviceOrientationControls.prototype.constructor = DeviceOrientationControls;\n\nexport { DeviceOrientationControls };\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport compass from './compass.svg';\nimport GyroscopePlugin from './index';\n\n/**\n * @summary Navigation bar gyroscope button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class GyroscopeButton extends AbstractButton {\n\n static id = 'gyroscope';\n static icon = compass;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-gyroscope-button', true);\n\n /**\n * @type {PSV.plugins.GyroscopePlugin}\n * @readonly\n * @private\n */\n this.plugin = this.psv.getPlugin(GyroscopePlugin.id);\n\n if (this.plugin) {\n this.plugin.on(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, this);\n }\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !this.plugin ? false : { initial: false, promise: this.plugin.prop.isSupported };\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED) {\n this.toggleActive(e.args[0]);\n }\n }\n\n /**\n * @override\n * @description Toggles gyroscope control\n */\n onClick() {\n this.plugin.toggle();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, registerButton, utils } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\nimport { DeviceOrientationControls } from 'three/examples/jsm/controls/DeviceOrientationControls';\nimport { GyroscopeButton } from './GyroscopeButton';\n\n/**\n * @typedef {Object} external:THREE.DeviceOrientationControls\n * @summary {@link https://github.com/mrdoob/three.js/blob/dev/examples/jsm/controls/DeviceOrientationControls.js}\n */\n\n/**\n * @typedef {Object} PSV.plugins.GyroscopePlugin.Options\n * @property {boolean} [absolutePosition=false] - when true the view will ignore the current direction when enabling gyroscope control\n */\n\n\n// add gyroscope button\nDEFAULTS.navbar.splice(-1, 0, GyroscopeButton.id);\nDEFAULTS.lang[GyroscopeButton.id] = 'Gyroscope';\nregisterButton(GyroscopeButton);\n\n\n/**\n * @summary Adds gyroscope controls on mobile devices\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class GyroscopePlugin extends AbstractPlugin {\n\n static id = 'gyroscope';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.GyroscopePlugin\n * @constant\n */\n static EVENTS = {\n GYROSCOPE_UPDATED: 'gyroscope-updated',\n };\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.GyroscopePlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @private\n * @property {Promise} isSupported - indicates of the gyroscope API is available\n * @property {number} alphaOffset - current alpha offset for gyroscope controls\n * @property {Function} orientationCb - update callback of the device orientation\n * @property {boolean} config_moveInertia - original config \"moveInertia\"\n */\n this.prop = {\n isSupported : this.__checkSupport(),\n alphaOffset : 0,\n orientationCb : null,\n config_moveInertia: true,\n };\n\n /**\n * @member {PSV.plugins.GyroscopePlugin.Options}\n * @private\n */\n this.config = {\n absolutePosition: false,\n ...options,\n };\n\n /**\n * @member {external:THREE.DeviceOrientationControls}\n * @private\n */\n this.controls = null;\n\n this.psv.on(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.on(CONSTANTS.EVENTS.BEFORE_ROTATE, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.off(CONSTANTS.EVENTS.BEFORE_ROTATE, this);\n\n this.stop();\n\n delete this.controls;\n delete this.prop;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.STOP_ALL:\n this.stop();\n break;\n case CONSTANTS.EVENTS.BEFORE_ROTATE:\n this.__onRotate(e);\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Checks if the gyroscope is enabled\n * @returns {boolean}\n */\n isEnabled() {\n return !!this.prop.orientationCb;\n }\n\n /**\n * @summary Enables the gyroscope navigation if available\n * @returns {Promise}\n * @fires PSV.plugins.GyroscopePlugin.gyroscope-updated\n * @throws {PSV.PSVError} if the gyroscope API is not available/granted\n */\n start() {\n return this.prop.isSupported\n .then((supported) => {\n if (supported) {\n return this.__requestPermission();\n }\n else {\n utils.logWarn('gyroscope not available');\n return Promise.reject();\n }\n })\n .then((granted) => {\n if (granted) {\n return Promise.resolve();\n }\n else {\n utils.logWarn('gyroscope not allowed');\n return Promise.reject();\n }\n })\n .then(() => {\n this.psv.__stopAll();\n\n // disable inertia\n this.prop.config_moveInertia = this.psv.config.moveInertia;\n this.psv.config.moveInertia = false;\n\n this.__configure();\n\n /**\n * @event gyroscope-updated\n * @memberof PSV.plugins.GyroscopePlugin\n * @summary Triggered when the gyroscope mode is enabled/disabled\n * @param {boolean} enabled\n */\n this.trigger(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, true);\n });\n }\n\n /**\n * @summary Disables the gyroscope navigation\n * @fires PSV.plugins.GyroscopePlugin.gyroscope-updated\n */\n stop() {\n if (this.isEnabled()) {\n this.controls.disconnect();\n\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this.prop.orientationCb);\n this.prop.orientationCb = null;\n\n this.psv.config.moveInertia = this.prop.config_moveInertia;\n\n this.trigger(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, false);\n }\n }\n\n /**\n * @summary Enables or disables the gyroscope navigation\n */\n toggle() {\n if (this.isEnabled()) {\n this.stop();\n }\n else {\n this.start();\n }\n }\n\n /**\n * @summary Attaches the {@link external:THREE.DeviceOrientationControls} to the camera\n * @private\n */\n __configure() {\n if (!this.controls) {\n this.controls = new DeviceOrientationControls(this.psv.renderer.camera);\n }\n else {\n this.controls.connect();\n }\n\n // force reset\n this.controls.deviceOrientation = null;\n this.controls.screenOrientation = 0;\n this.controls.alphaOffset = 0;\n this.prop.alphaOffset = this.config.absolutePosition ? 0 : null;\n\n this.prop.orientationCb = () => {\n if (!this.controls.deviceOrientation) {\n return;\n }\n\n // on first run compute the offset depending on the current viewer position and device orientation\n if (this.prop.alphaOffset === null) {\n this.controls.update();\n\n const direction = new THREE.Vector3();\n this.psv.renderer.camera.getWorldDirection(direction);\n\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(direction);\n this.prop.alphaOffset = sphericalCoords.longitude - this.psv.prop.position.longitude;\n }\n else {\n this.controls.alphaOffset = this.prop.alphaOffset;\n this.controls.update();\n\n this.psv.renderer.camera.getWorldDirection(this.psv.prop.direction);\n this.psv.prop.direction.multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(this.psv.prop.direction);\n this.psv.prop.position.longitude = sphericalCoords.longitude;\n this.psv.prop.position.latitude = sphericalCoords.latitude;\n\n this.psv.needsUpdate();\n }\n };\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this.prop.orientationCb);\n }\n\n /**\n * @summary Intercepts moves and offsets the alpha angle\n * @param {external:uEvent.Event} e\n * @private\n */\n __onRotate(e) {\n if (this.isEnabled()) {\n e.preventDefault();\n\n this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude;\n }\n }\n\n /**\n * @summary Detects if device orientation is supported\n * @returns {Promise}\n * @private\n */\n __checkSupport() {\n if ('DeviceMotionEvent' in window && typeof DeviceMotionEvent.requestPermission === 'function') {\n return Promise.resolve(true);\n }\n else if ('DeviceOrientationEvent' in window) {\n return new Promise((resolve) => {\n const listener = (e) => {\n /* eslint-disable-next-line no-restricted-globals */\n resolve(e && e.alpha !== null && !isNaN(e.alpha));\n\n window.removeEventListener('deviceorientation', listener);\n };\n\n window.addEventListener('deviceorientation', listener, false);\n\n // after 2 secs, auto-reject the promise\n setTimeout(listener, 2000);\n });\n }\n else {\n return Promise.resolve(false);\n }\n }\n\n /**\n * @summary Request permission to the motion API\n * @returns {Promise}\n * @private\n */\n __requestPermission() {\n if ('DeviceMotionEvent' in window && typeof DeviceMotionEvent.requestPermission === 'function') {\n return DeviceOrientationEvent.requestPermission()\n .then(response => response === 'granted')\n .catch(() => false);\n }\n else {\n return Promise.resolve(true);\n }\n }\n\n}\n"],"names":["DeviceOrientationControls","object","scope","changeEvent","type","EPS","rotation","reorder","enabled","deviceOrientation","screenOrientation","alphaOffset","onDeviceOrientationChangeEvent","event","onScreenOrientationChangeEvent","window","orientation","setObjectQuaternion","zee","Vector3","euler","Euler","q0","Quaternion","q1","Math","sqrt","quaternion","alpha","beta","gamma","orient","set","setFromEuler","multiply","setFromAxisAngle","connect","DeviceOrientationEvent","undefined","requestPermission","then","response","addEventListener","catch","error","console","disconnect","removeEventListener","update","lastQuaternion","device","MathUtils","degToRad","dot","copy","dispatchEvent","dispose","prototype","Object","create","EventDispatcher","constructor","GyroscopeButton","navbar","plugin","psv","getPlugin","GyroscopePlugin","id","on","EVENTS","GYROSCOPE_UPDATED","destroy","off","isSupported","initial","promise","prop","handleEvent","e","toggleActive","args","onClick","toggle","AbstractButton","icon","compass","DEFAULTS","splice","lang","registerButton","options","__checkSupport","orientationCb","config_moveInertia","config","absolutePosition","controls","CONSTANTS","STOP_ALL","BEFORE_ROTATE","stop","__onRotate","isEnabled","start","supported","__requestPermission","utils","logWarn","Promise","reject","granted","resolve","__stopAll","moveInertia","__configure","trigger","BEFORE_RENDER","renderer","camera","direction","THREE","getWorldDirection","sphericalCoords","dataHelper","vector3ToSphericalCoords","longitude","position","multiplyScalar","SPHERE_RADIUS","latitude","needsUpdate","preventDefault","DeviceMotionEvent","listener","isNaN","setTimeout","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;;;;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vD,CAAD,EAAO;EACtB;EACAiC,UAAAA,OAAO,CAACjC,CAAC,IAAIA,CAAC,CAACnD,KAAF,KAAY,IAAjB,IAAyB,CAAC2G,KAAK,CAACxD,CAAC,CAACnD,KAAH,CAAhC,CAAP;EAEAb,UAAAA,MAAM,CAACgC,mBAAP,CAA2B,mBAA3B,EAAgDuF,QAAhD;EACD,SALD;;EAOAvH,QAAAA,MAAM,CAAC2B,gBAAP,CAAwB,mBAAxB,EAA6C4F,QAA7C,EAAuD,KAAvD,EAR8B;;EAW9BE,QAAAA,UAAU,CAACF,QAAD,EAAW,IAAX,CAAV;EACD,OAZM,CAAP;EAaD,KAdI,MAeA;EACH,aAAOzB,OAAO,CAACG,OAAR,CAAgB,KAAhB,CAAP;EACD;EACF;EAED;;;;;;;WAKAN,sBAAA,+BAAsB;EACpB,QAAI,uBAAuB3F,MAAvB,IAAiC,OAAOsH,iBAAiB,CAAC9F,iBAAzB,KAA+C,UAApF,EAAgG;EAC9F,aAAOF,sBAAsB,CAACE,iBAAvB,GACJC,IADI,CACC,UAAAC,QAAQ;EAAA,eAAIA,QAAQ,KAAK,SAAjB;EAAA,OADT,EAEJE,KAFI,CAEE;EAAA,eAAM,KAAN;EAAA,OAFF,CAAP;EAGD,KAJD,MAKK;EACH,aAAOkE,OAAO,CAACG,OAAR,CAAgB,IAAhB,CAAP;EACD;EACF;;;IAnR0CyB;;EAAxBtE,gBAEZC,KAAK;EAFOD,gBAUZG,SAAS;EACdC,EAAAA,iBAAiB,EAAE;EADL;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gyroscope.js","sources":["../../three-examples/controls/DeviceOrientationControls.js","../../src/plugins/gyroscope/GyroscopeButton.js","../../src/plugins/gyroscope/index.js"],"sourcesContent":["import {\n\tEuler,\n\tEventDispatcher,\n\tMathUtils,\n\tQuaternion,\n\tVector3\n} from '../../../build/three.module.js';\n\n/**\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nvar DeviceOrientationControls = function ( object ) {\n\n\tvar scope = this;\n\tvar changeEvent = { type: 'change' };\n\tvar EPS = 0.000001;\n\n\tthis.object = object;\n\tthis.object.rotation.reorder( 'YXZ' );\n\n\tthis.enabled = true;\n\n\tthis.deviceOrientation = {};\n\tthis.screenOrientation = 0;\n\n\tthis.alphaOffset = 0; // radians\n\n\tvar onDeviceOrientationChangeEvent = function ( event ) {\n\n\t\tscope.deviceOrientation = event;\n\n\t};\n\n\tvar onScreenOrientationChangeEvent = function () {\n\n\t\tscope.screenOrientation = window.orientation || 0;\n\n\t};\n\n\t// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n\tvar setObjectQuaternion = function () {\n\n\t\tvar zee = new Vector3( 0, 0, 1 );\n\n\t\tvar euler = new Euler();\n\n\t\tvar q0 = new Quaternion();\n\n\t\tvar q1 = new Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n\t\treturn function ( quaternion, alpha, beta, gamma, orient ) {\n\n\t\t\teuler.set( beta, alpha, - gamma, 'YXZ' ); // 'ZXY' for the device, but 'YXZ' for us\n\n\t\t\tquaternion.setFromEuler( euler ); // orient the device\n\n\t\t\tquaternion.multiply( q1 ); // camera looks out the back of the device, not the top\n\n\t\t\tquaternion.multiply( q0.setFromAxisAngle( zee, - orient ) ); // adjust for screen orientation\n\n\t\t};\n\n\t}();\n\n\tthis.connect = function () {\n\n\t\tonScreenOrientationChangeEvent(); // run once on load\n\n\t\t// iOS 13+\n\n\t\tif ( window.DeviceOrientationEvent !== undefined && typeof window.DeviceOrientationEvent.requestPermission === 'function' ) {\n\n\t\t\twindow.DeviceOrientationEvent.requestPermission().then( function ( response ) {\n\n\t\t\t\tif ( response == 'granted' ) {\n\n\t\t\t\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\t\t\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\t\t\t}\n\n\t\t\t} ).catch( function ( error ) {\n\n\t\t\t\tconsole.error( 'THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:', error );\n\n\t\t\t} );\n\n\t\t} else {\n\n\t\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\t}\n\n\t\tscope.enabled = true;\n\n\t};\n\n\tthis.disconnect = function () {\n\n\t\twindow.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\tscope.enabled = false;\n\n\t};\n\n\tthis.update = ( function () {\n\n\t\tvar lastQuaternion = new Quaternion();\n\n\t\treturn function () {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tvar device = scope.deviceOrientation;\n\n\t\t\tif ( device ) {\n\n\t\t\t\tvar alpha = device.alpha ? MathUtils.degToRad( device.alpha ) + scope.alphaOffset : 0; // Z\n\n\t\t\t\tvar beta = device.beta ? MathUtils.degToRad( device.beta ) : 0; // X'\n\n\t\t\t\tvar gamma = device.gamma ? MathUtils.degToRad( device.gamma ) : 0; // Y''\n\n\t\t\t\tvar orient = scope.screenOrientation ? MathUtils.degToRad( scope.screenOrientation ) : 0; // O\n\n\t\t\t\tsetObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n\t\t\t\tif ( 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {\n\n\t\t\t\t\tlastQuaternion.copy( scope.object.quaternion );\n\t\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\n\t} )();\n\n\tthis.dispose = function () {\n\n\t\tscope.disconnect();\n\n\t};\n\n\tthis.connect();\n\n};\n\nDeviceOrientationControls.prototype = Object.create( EventDispatcher.prototype );\nDeviceOrientationControls.prototype.constructor = DeviceOrientationControls;\n\nexport { DeviceOrientationControls };\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport compass from './compass.svg';\nimport GyroscopePlugin from './index';\n\n/**\n * @summary Navigation bar gyroscope button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class GyroscopeButton extends AbstractButton {\n\n static id = 'gyroscope';\n static icon = compass;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-gyroscope-button', true);\n\n /**\n * @type {PSV.plugins.GyroscopePlugin}\n * @readonly\n * @private\n */\n this.plugin = this.psv.getPlugin(GyroscopePlugin.id);\n\n if (this.plugin) {\n this.plugin.on(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, this);\n }\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !this.plugin ? false : { initial: false, promise: this.plugin.prop.isSupported };\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED) {\n this.toggleActive(e.args[0]);\n }\n }\n\n /**\n * @override\n * @description Toggles gyroscope control\n */\n onClick() {\n this.plugin.toggle();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, registerButton, utils } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\nimport { DeviceOrientationControls } from 'three/examples/jsm/controls/DeviceOrientationControls';\nimport { GyroscopeButton } from './GyroscopeButton';\n\n/**\n * @typedef {Object} external:THREE.DeviceOrientationControls\n * @summary {@link https://github.com/mrdoob/three.js/blob/dev/examples/jsm/controls/DeviceOrientationControls.js}\n */\n\n/**\n * @typedef {Object} PSV.plugins.GyroscopePlugin.Options\n * @property {boolean} [touchmove=true] - allows to pan horizontally when the gyroscope is enabled (requires global `mousemove=true`)\n * @property {boolean} [absolutePosition=false] - when true the view will ignore the current direction when enabling gyroscope control\n */\n\n\n// add gyroscope button\nDEFAULTS.navbar.splice(-1, 0, GyroscopeButton.id);\nDEFAULTS.lang[GyroscopeButton.id] = 'Gyroscope';\nregisterButton(GyroscopeButton);\n\n\n/**\n * @summary Adds gyroscope controls on mobile devices\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class GyroscopePlugin extends AbstractPlugin {\n\n static id = 'gyroscope';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.GyroscopePlugin\n * @constant\n */\n static EVENTS = {\n GYROSCOPE_UPDATED: 'gyroscope-updated',\n };\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.GyroscopePlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @private\n * @property {Promise} isSupported - indicates of the gyroscope API is available\n * @property {number} alphaOffset - current alpha offset for gyroscope controls\n * @property {Function} orientationCb - update callback of the device orientation\n * @property {boolean} config_moveInertia - original config \"moveInertia\"\n */\n this.prop = {\n isSupported : this.__checkSupport(),\n alphaOffset : 0,\n orientationCb : null,\n config_moveInertia: true,\n };\n\n /**\n * @member {PSV.plugins.GyroscopePlugin.Options}\n * @private\n */\n this.config = {\n touchmove : true,\n absolutePosition: false,\n ...options,\n };\n\n /**\n * @member {external:THREE.DeviceOrientationControls}\n * @private\n */\n this.controls = null;\n\n this.psv.on(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.on(CONSTANTS.EVENTS.BEFORE_ROTATE, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.off(CONSTANTS.EVENTS.BEFORE_ROTATE, this);\n\n this.stop();\n\n delete this.controls;\n delete this.prop;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.STOP_ALL:\n this.stop();\n break;\n case CONSTANTS.EVENTS.BEFORE_ROTATE:\n this.__onRotate(e);\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Checks if the gyroscope is enabled\n * @returns {boolean}\n */\n isEnabled() {\n return !!this.prop.orientationCb;\n }\n\n /**\n * @summary Enables the gyroscope navigation if available\n * @returns {Promise}\n * @fires PSV.plugins.GyroscopePlugin.gyroscope-updated\n * @throws {PSV.PSVError} if the gyroscope API is not available/granted\n */\n start() {\n return this.prop.isSupported\n .then((supported) => {\n if (supported) {\n return this.__requestPermission();\n }\n else {\n utils.logWarn('gyroscope not available');\n return Promise.reject();\n }\n })\n .then((granted) => {\n if (granted) {\n return Promise.resolve();\n }\n else {\n utils.logWarn('gyroscope not allowed');\n return Promise.reject();\n }\n })\n .then(() => {\n this.psv.__stopAll();\n\n // disable inertia\n this.prop.config_moveInertia = this.psv.config.moveInertia;\n this.psv.config.moveInertia = false;\n\n this.__configure();\n\n /**\n * @event gyroscope-updated\n * @memberof PSV.plugins.GyroscopePlugin\n * @summary Triggered when the gyroscope mode is enabled/disabled\n * @param {boolean} enabled\n */\n this.trigger(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, true);\n });\n }\n\n /**\n * @summary Disables the gyroscope navigation\n * @fires PSV.plugins.GyroscopePlugin.gyroscope-updated\n */\n stop() {\n if (this.isEnabled()) {\n this.controls.disconnect();\n\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this.prop.orientationCb);\n this.prop.orientationCb = null;\n\n this.psv.config.moveInertia = this.prop.config_moveInertia;\n\n this.trigger(GyroscopePlugin.EVENTS.GYROSCOPE_UPDATED, false);\n }\n }\n\n /**\n * @summary Enables or disables the gyroscope navigation\n */\n toggle() {\n if (this.isEnabled()) {\n this.stop();\n }\n else {\n this.start();\n }\n }\n\n /**\n * @summary Attaches the {@link external:THREE.DeviceOrientationControls} to the camera\n * @private\n */\n __configure() {\n if (!this.controls) {\n this.controls = new DeviceOrientationControls(this.psv.renderer.camera);\n }\n else {\n this.controls.connect();\n }\n\n // force reset\n this.controls.deviceOrientation = null;\n this.controls.screenOrientation = 0;\n this.controls.alphaOffset = 0;\n this.prop.alphaOffset = this.config.absolutePosition ? 0 : null;\n\n this.prop.orientationCb = () => {\n if (!this.controls.deviceOrientation) {\n return;\n }\n\n // on first run compute the offset depending on the current viewer position and device orientation\n if (this.prop.alphaOffset === null) {\n this.controls.update();\n\n const direction = new THREE.Vector3();\n this.psv.renderer.camera.getWorldDirection(direction);\n\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(direction);\n this.prop.alphaOffset = sphericalCoords.longitude - this.psv.prop.position.longitude;\n }\n else {\n this.controls.alphaOffset = this.prop.alphaOffset;\n this.controls.update();\n\n this.psv.renderer.camera.getWorldDirection(this.psv.prop.direction);\n this.psv.prop.direction.multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(this.psv.prop.direction);\n this.psv.prop.position.longitude = sphericalCoords.longitude;\n this.psv.prop.position.latitude = sphericalCoords.latitude;\n\n this.psv.needsUpdate();\n }\n };\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this.prop.orientationCb);\n }\n\n /**\n * @summary Intercepts moves and offsets the alpha angle\n * @param {external:uEvent.Event} e\n * @private\n */\n __onRotate(e) {\n if (this.isEnabled()) {\n e.preventDefault();\n\n if (this.config.touchmove) {\n this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude;\n }\n }\n }\n\n /**\n * @summary Detects if device orientation is supported\n * @returns {Promise}\n * @private\n */\n __checkSupport() {\n if ('DeviceMotionEvent' in window && typeof DeviceMotionEvent.requestPermission === 'function') {\n return Promise.resolve(true);\n }\n else if ('DeviceOrientationEvent' in window) {\n return new Promise((resolve) => {\n const listener = (e) => {\n resolve(e && e.alpha !== null && !isNaN(e.alpha));\n\n window.removeEventListener('deviceorientation', listener);\n };\n\n window.addEventListener('deviceorientation', listener, false);\n\n // after 2 secs, auto-reject the promise\n setTimeout(listener, 2000);\n });\n }\n else {\n return Promise.resolve(false);\n }\n }\n\n /**\n * @summary Request permission to the motion API\n * @returns {Promise}\n * @private\n */\n __requestPermission() {\n if ('DeviceMotionEvent' in window && typeof DeviceMotionEvent.requestPermission === 'function') {\n return DeviceOrientationEvent.requestPermission()\n .then(response => response === 'granted')\n .catch(() => false);\n }\n else {\n return Promise.resolve(true);\n }\n }\n\n}\n"],"names":["DeviceOrientationControls","object","scope","changeEvent","type","EPS","rotation","reorder","enabled","deviceOrientation","screenOrientation","alphaOffset","onDeviceOrientationChangeEvent","event","onScreenOrientationChangeEvent","window","orientation","setObjectQuaternion","zee","Vector3","euler","Euler","q0","Quaternion","q1","Math","sqrt","quaternion","alpha","beta","gamma","orient","set","setFromEuler","multiply","setFromAxisAngle","connect","DeviceOrientationEvent","undefined","requestPermission","then","response","addEventListener","catch","error","console","disconnect","removeEventListener","update","lastQuaternion","device","MathUtils","degToRad","dot","copy","dispatchEvent","dispose","prototype","Object","create","EventDispatcher","constructor","GyroscopeButton","navbar","plugin","psv","getPlugin","GyroscopePlugin","id","on","EVENTS","GYROSCOPE_UPDATED","destroy","off","isSupported","initial","promise","prop","handleEvent","e","toggleActive","args","onClick","toggle","AbstractButton","icon","compass","DEFAULTS","splice","lang","registerButton","options","__checkSupport","orientationCb","config_moveInertia","config","touchmove","absolutePosition","controls","CONSTANTS","STOP_ALL","BEFORE_ROTATE","stop","__onRotate","isEnabled","start","supported","__requestPermission","utils","logWarn","Promise","reject","granted","resolve","__stopAll","moveInertia","__configure","trigger","BEFORE_RENDER","renderer","camera","direction","THREE","getWorldDirection","sphericalCoords","dataHelper","vector3ToSphericalCoords","longitude","position","multiplyScalar","SPHERE_RADIUS","latitude","needsUpdate","preventDefault","DeviceMotionEvent","listener","isNaN","setTimeout","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;;EAEA,IAAIA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ACD;EACF;;;IArR0CyB;;EAAxBvE,gBAEZC,KAAK;EAFOD,gBAUZG,SAAS;EACdC,EAAAA,iBAAiB,EAAE;EADL;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/markers.css b/dist/plugins/markers.css index c0f0260d6..019eb39cc 100644 --- a/dist/plugins/markers.css +++ b/dist/plugins/markers.css @@ -1,7 +1,7 @@ /*! - * Photo Sphere Viewer 4.0.7 + * Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel + * @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ .psv-markers { @@ -49,86 +49,4 @@ .psv-marker--has-tooltip, .psv-marker--has-content { cursor: pointer; } - -.psv-markers-list { - list-style: none; - margin: 0; - padding: 0; - overflow: hidden; -} - -.psv-markers-list-title { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font: 24px sans-serif; - margin: 24px 0; -} - -.psv-markers-list-title svg { - width: 24px; - height: 24px; - margin: 0 12px; -} - -.psv-markers-list-item { - clear: both; - min-height: 20px; - padding: 0.5em 1em; - cursor: pointer; - -webkit-transform: translateX(0); - transform: translateX(0); - -webkit-transition: -webkit-transform 0.3s ease-in-out; - transition: -webkit-transform 0.3s ease-in-out; - transition: transform 0.3s ease-in-out; - transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out; -} - -.psv-markers-list-item::before { - content: ""; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 10px; - margin-left: -10px; -} - -.psv-markers-list-item:nth-child(odd), .psv-markers-list-item:nth-child(odd)::before { - background: rgba(255, 255, 255, 0.1); -} - -.psv-markers-list-item:nth-child(even), .psv-markers-list-item:nth-child(even)::before { - background: transparent; -} - -.psv-markers-list-image { - float: left; - width: 20px; -} - -.psv-markers-list .psv-button-svg * { - fill: currentColor; -} - -.psv-markers-list-name { - margin: 0; - padding: 0; -} - -.psv-markers-list-image + .psv-markers-list-name { - padding-left: calc(20px + 0.5em); -} - -.psv-container:not(.psv--is-touch) .psv-markers-list-item:hover { - -webkit-transform: translateX(10px); - transform: translateX(10px); - -webkit-transition: -webkit-transform 0.1s ease-in-out; - transition: -webkit-transform 0.1s ease-in-out; - transition: transform 0.1s ease-in-out; - transition: transform 0.1s ease-in-out, -webkit-transform 0.1s ease-in-out; -} /*# sourceMappingURL=markers.css.map */ \ No newline at end of file diff --git a/dist/plugins/markers.css.map b/dist/plugins/markers.css.map index 713812a79..ebe90ec76 100644 --- a/dist/plugins/markers.css.map +++ b/dist/plugins/markers.css.map @@ -1 +1 @@ -{"version":3,"sources":["","style.scss%23sass","style.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,yBAAA;KAAA,sBAAA;MAAA,qBAAA;UAAA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;ACCF;;ADAE;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;ECGJ,WAAA;AACA;;ADDA;EACE,aAAA;ACIF;;ADHE;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,wBAAA;EACA,4BAAA;ACMJ;;ADLE;ECQF,cAAA;EDNI,UAAA;ACQJ;;ADPE;EACE,cAAA;ACUJ;;ADTE;EACE,eAAA;ACYJ;;ADVA;EACE,gBAAA;EACA,SAAA;EACA,UAAA;EACA,gBAAA;ACaF;;ADZE;EACE,oBAAA;EAAA,oBAAA;EAAA,aAAA;EACA,yBAAA;MAAA,sBAAA;UAAA,mBAAA;EACA,qBAAA;EACA,cAAA;ACeJ;;ADdI;EACE,WAAA;EACA,YAAA;EACA,cAAA;ACiBN;;ADhBE;EACE,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,gCAAA;UAAA,wBAAA;EACA,sDAAA;EAAA,8CAAA;EAAA,sCAAA;EAAA,0EAAA;ACmBJ;;ADlBI;EACE,WAAA;EACA,kBAAA;ECqBN,MAAA;EDnBM,OAAA;EACA,YAAA;EACA,WAAA;EACA,kBAAA;ACqBN;;ADpBI;EACE,oCAAA;ACuBN;;ADtBI;EACE,uBAAA;ACyBN;;ADxBE;EACE,WAAA;EACA,WAAA;AC2BJ;;AD1BE;EACE,kBAAA;AC6BJ;;AD5BE;EACE,SAAA;EACA,UAAA;AC+BJ;;AD9BE;EACE,gCAAA;ACiCJ;;AD/BA;EACE,mCAAA;UAAA,2BAAA;EACA,sDAAA;EAAA,8CAAA;EAAA,sCAAA;EAAA,0EAAA;ACkCF","file":"markers.css","sourcesContent":[null,".psv-markers {\n user-select: none;\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%; }\n .psv-markers-svg-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 20; }\n\n.psv-marker {\n display: none; }\n .psv-marker--normal {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n background-size: contain;\n background-repeat: no-repeat; }\n .psv-marker--transparent {\n display: block;\n opacity: 0; }\n .psv-marker--visible {\n display: block; }\n .psv-marker--has-tooltip, .psv-marker--has-content {\n cursor: pointer; }\n\n.psv-markers-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n .psv-markers-list-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 0; }\n .psv-markers-list-title svg {\n width: 24px;\n height: 24px;\n margin: 0 12px; }\n .psv-markers-list-item {\n clear: both;\n min-height: 20px;\n padding: 0.5em 1em;\n cursor: pointer;\n transform: translateX(0);\n transition: transform .3s ease-in-out; }\n .psv-markers-list-item::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n margin-left: -10px; }\n .psv-markers-list-item:nth-child(odd), .psv-markers-list-item:nth-child(odd)::before {\n background: rgba(255, 255, 255, 0.1); }\n .psv-markers-list-item:nth-child(even), .psv-markers-list-item:nth-child(even)::before {\n background: transparent; }\n .psv-markers-list-image {\n float: left;\n width: 20px; }\n .psv-markers-list .psv-button-svg * {\n fill: currentColor; }\n .psv-markers-list-name {\n margin: 0;\n padding: 0; }\n .psv-markers-list-image + .psv-markers-list-name {\n padding-left: calc(20px + 0.5em); }\n\n.psv-container:not(.psv--is-touch) .psv-markers-list-item:hover {\n transform: translateX(10px);\n transition: transform .1s ease-in-out; }\n",".psv-markers {\n user-select: none;\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%; }\n .psv-markers-svg-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 20; }\n\n.psv-marker {\n display: none; }\n .psv-marker--normal {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n background-size: contain;\n background-repeat: no-repeat; }\n .psv-marker--transparent {\n display: block;\n opacity: 0; }\n .psv-marker--visible {\n display: block; }\n .psv-marker--has-tooltip, .psv-marker--has-content {\n cursor: pointer; }\n\n.psv-markers-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n .psv-markers-list-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 0; }\n .psv-markers-list-title svg {\n width: 24px;\n height: 24px;\n margin: 0 12px; }\n .psv-markers-list-item {\n clear: both;\n min-height: 20px;\n padding: 0.5em 1em;\n cursor: pointer;\n transform: translateX(0);\n transition: transform .3s ease-in-out; }\n .psv-markers-list-item::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 10px;\n margin-left: -10px; }\n .psv-markers-list-item:nth-child(odd), .psv-markers-list-item:nth-child(odd)::before {\n background: rgba(255, 255, 255, 0.1); }\n .psv-markers-list-item:nth-child(even), .psv-markers-list-item:nth-child(even)::before {\n background: transparent; }\n .psv-markers-list-image {\n float: left;\n width: 20px; }\n .psv-markers-list .psv-button-svg * {\n fill: currentColor; }\n .psv-markers-list-name {\n margin: 0;\n padding: 0; }\n .psv-markers-list-image + .psv-markers-list-name {\n padding-left: calc(20px + 0.5em); }\n\n.psv-container:not(.psv--is-touch) .psv-markers-list-item:hover {\n transform: translateX(10px);\n transition: transform .1s ease-in-out; }\n"]} \ No newline at end of file +{"version":3,"sources":["","style.scss%23sass","style.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,yBAAA;KAAA,sBAAA;MAAA,qBAAA;UAAA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;ACCF;;ADAE;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;ECGJ,WAAA;AACA;;ADDA;EACE,aAAA;ACIF;;ADHE;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,wBAAA;EACA,4BAAA;ACMJ;;ADLE;EACE,cAAA;EACA,UAAA;ACQJ;;ADPE;EACE,cAAA;ACUJ;;ADTE;EACE,eAAA;ACYJ","file":"markers.css","sourcesContent":[null,".psv-markers {\n user-select: none;\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%; }\n .psv-markers-svg-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 20; }\n\n.psv-marker {\n display: none; }\n .psv-marker--normal {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n background-size: contain;\n background-repeat: no-repeat; }\n .psv-marker--transparent {\n display: block;\n opacity: 0; }\n .psv-marker--visible {\n display: block; }\n .psv-marker--has-tooltip, .psv-marker--has-content {\n cursor: pointer; }\n",".psv-markers {\n user-select: none;\n position: absolute;\n z-index: 10;\n width: 100%;\n height: 100%; }\n .psv-markers-svg-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 20; }\n\n.psv-marker {\n display: none; }\n .psv-marker--normal {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n background-size: contain;\n background-repeat: no-repeat; }\n .psv-marker--transparent {\n display: block;\n opacity: 0; }\n .psv-marker--visible {\n display: block; }\n .psv-marker--has-tooltip, .psv-marker--has-content {\n cursor: pointer; }\n"]} \ No newline at end of file diff --git a/dist/plugins/markers.js b/dist/plugins/markers.js index 6c09bf969..3b7d12851 100644 --- a/dist/plugins/markers.js +++ b/dist/plugins/markers.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer'), require('three')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'three'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.MarkersPlugin = factory(global.PhotoSphereViewer, global.THREE))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.MarkersPlugin = factory(global.PhotoSphereViewer, global.THREE))); }(this, (function (photoSphereViewer, THREE) { 'use strict'; function _extends() { @@ -710,7 +710,7 @@ return Marker; }(); - var pin = "\n"; + var pin = "\n"; /** * @summary Navigation bar markers button class @@ -1042,7 +1042,7 @@ _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.CONFIG_CHANGED, _assertThisInitialized(_this)); - if (options == null ? void 0 : options.markers) { + if (options != null && options.markers) { _this.psv.once(photoSphereViewer.CONSTANTS.EVENTS.READY, function () { _this.setMarkers(options.markers); }); @@ -1447,7 +1447,7 @@ var marker = this.getMarker(markerId); - if (marker == null ? void 0 : (_marker$config = marker.config) == null ? void 0 : _marker$config.content) { + if (marker != null && (_marker$config = marker.config) != null && _marker$config.content) { this.psv.panel.show({ id: MarkersPlugin.ID_PANEL_MARKER, content: marker.config.content @@ -1827,7 +1827,7 @@ var targetMarker = this.__getTargetMarker(e.target); - if (targetMarker == null ? void 0 : targetMarker.isPoly()) { + if (targetMarker != null && targetMarker.isPoly()) { marker = targetMarker; } // do not hide if we enter the tooltip itself while hovering a polygon else if (this.prop.hoveringMarker && this.__targetOnTooltip(e.target, this.prop.hoveringMarker.tooltip)) { @@ -1843,7 +1843,7 @@ if (!this.prop.showAllTooltips) { marker.showTooltip(e); } - } else if ((_this$prop$hoveringMa = this.prop.hoveringMarker) == null ? void 0 : _this$prop$hoveringMa.isPoly()) { + } else if ((_this$prop$hoveringMa = this.prop.hoveringMarker) != null && _this$prop$hoveringMa.isPoly()) { this.trigger(MarkersPlugin.EVENTS.LEAVE_MARKER, this.prop.hoveringMarker); if (!this.prop.showAllTooltips) { @@ -1974,8 +1974,8 @@ MarkersPlugin.ID_PANEL_MARKERS_LIST = 'markersList'; MarkersPlugin.MARKERS_LIST_TEMPLATE = function (markers, title, dataKey) { - return "\n
\n

" + icon + " " + title + "

\n
    \n " + markers.map(function (marker) { - return "\n
  • \n " + (marker.type === 'image' ? "" : '') + "\n

    " + marker.getListContent() + "

    \n
  • \n "; + return "\n
    \n

    " + icon + " " + title + "

    \n
      \n " + markers.map(function (marker) { + return "\n
    • \n " + (marker.type === 'image' ? "" : '') + "\n " + marker.getListContent() + "\n
    • \n "; }).join('') + "\n
    \n
    \n"; }; diff --git a/dist/plugins/markers.js.map b/dist/plugins/markers.js.map index dd1584921..2d7cc8384 100644 --- a/dist/plugins/markers.js.map +++ b/dist/plugins/markers.js.map @@ -1 +1 @@ -{"version":3,"file":"markers.js","sources":["../../src/plugins/markers/utils.js","../../src/plugins/markers/Marker.js","../../src/plugins/markers/MarkersButton.js","../../src/plugins/markers/MarkersListButton.js","../../src/plugins/markers/index.js"],"sourcesContent":["import { CONSTANTS, utils } from 'photo-sphere-viewer';\n\n/**\n * Returns intermediary point between two points on the sphere\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @param {number} f\n * @returns {number[]}\n * @private\n */\nexport function greatArcIntermediaryPoint(p1, p2, f) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const r = utils.greatArcDistance(p1, p2) * CONSTANTS.SPHERE_RADIUS;\n const a = Math.sin((1 - f) * r) / Math.sin(r / CONSTANTS.SPHERE_RADIUS);\n const b = Math.sin(f * r) / Math.sin(r);\n const x = a * Math.cos(φ1) * Math.cos(λ1) + b * Math.cos(φ2) * Math.cos(λ2);\n const y = a * Math.cos(φ1) * Math.sin(λ1) + b * Math.cos(φ2) * Math.sin(λ2);\n const z = a * Math.sin(φ1) + b * Math.sin(φ2);\n\n return [\n Math.atan2(y, x),\n Math.atan2(z, Math.sqrt(x * x + y * y)),\n ];\n}\n\n/**\n * @summary Computes the center point of a polygon\n * @todo Get \"visual center\" (https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc)\n * @param {number[][]} polygon\n * @returns {number[]}\n * @private\n */\nexport function getPolygonCenter(polygon) {\n const sum = polygon.reduce((intermediary, point) => [intermediary[0] + point[0], intermediary[1] + point[1]]);\n return [sum[0] / polygon.length, sum[1] / polygon.length];\n}\n\n/**\n * @summary Computes the middle point of a polyline\n * @param {number[][]} polyline\n * @returns {number[]}\n * @private\n */\nexport function getPolylineCenter(polyline) {\n // compute each segment length + total length\n let length = 0;\n const lengths = [];\n\n for (let i = 0; i < polyline.length - 1; i++) {\n const l = utils.greatArcDistance(polyline[i], polyline[i + 1]) * CONSTANTS.SPHERE_RADIUS;\n\n lengths.push(l);\n length += l;\n }\n\n // iterate until length / 2\n let consumed = 0;\n\n for (let i = 0; i < polyline.length - 1; i++) {\n // once the segment containing the middle point is found, computes the intermediary point\n if (consumed + lengths[i] > length / 2) {\n const r = (length / 2 - consumed) / lengths[i];\n return greatArcIntermediaryPoint(polyline[i], polyline[i + 1], r);\n }\n\n consumed += lengths[i];\n }\n\n // this never happens\n return polyline[Math.round(polyline.length / 2)];\n}\n","import { CONSTANTS, PSVError, utils } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport { getPolygonCenter, getPolylineCenter } from './utils';\n\n/**\n * @summary Types of marker\n * @memberOf PSV.plugins.MarkersPlugin\n * @enum {string}\n * @constant\n * @private\n */\nconst MARKER_TYPES = {\n image : 'image',\n html : 'html',\n polygonPx : 'polygonPx',\n polygonRad : 'polygonRad',\n polylinePx : 'polylinePx',\n polylineRad: 'polylineRad',\n square : 'square',\n rect : 'rect',\n circle : 'circle',\n ellipse : 'ellipse',\n path : 'path',\n};\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Properties\n * @summary Marker properties, see {@link http://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options}\n */\n\n/**\n * @summary Object representing a marker\n * @memberOf PSV.plugins.MarkersPlugin\n */\nexport class Marker {\n\n /**\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {PSV.Viewer} psv\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(properties, psv) {\n if (!properties.id) {\n throw new PSVError('missing marker id');\n }\n\n if (properties.image && (!properties.width || !properties.height)) {\n throw new PSVError('missing marker width/height');\n }\n\n if (properties.image || properties.html) {\n if ((!('x' in properties) || !('y' in properties)) && (!('latitude' in properties) || !('longitude' in properties))) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n }\n\n /**\n * @member {PSV.Viewer}\n * @readonly\n * @protected\n */\n this.psv = psv;\n\n /**\n * @member {string}\n * @readonly\n */\n this.id = properties.id;\n\n /**\n * @member {string}\n * @readonly\n */\n this.type = Marker.getType(properties, false);\n\n /**\n * @member {boolean}\n * @protected\n */\n this.visible = true;\n\n /**\n * @member {HTMLElement|SVGElement}\n * @readonly\n */\n this.$el = null;\n\n /**\n * @summary Original configuration of the marker\n * @member {PSV.plugins.MarkersPlugin.Properties}\n * @readonly\n */\n this.config = {};\n\n /**\n * @summary User data associated to the marker\n * @member {any}\n */\n this.data = undefined;\n\n /**\n * @summary Tooltip instance for this marker\n * @member {PSV.components.Tooltip}\n */\n this.tooltip = null;\n\n /**\n * @summary Computed properties\n * @member {Object}\n * @protected\n * @property {boolean} inViewport\n * @property {boolean} dynamicSize\n * @property {PSV.Point} anchor\n * @property {PSV.Position} position - position in spherical coordinates\n * @property {PSV.Point} position2D - position in viewer coordinates\n * @property {external:THREE.Vector3[]} positions3D - positions in 3D space\n * @property {number} width\n * @property {number} height\n * @property {*} def\n */\n this.props = {\n inViewport : false,\n dynamicSize: false,\n anchor : null,\n position : null,\n position2D : null,\n positions3D: null,\n width : null,\n height : null,\n def : null,\n };\n\n // create element\n if (this.isNormal()) {\n this.$el = document.createElement('div');\n }\n else if (this.isPolygon()) {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, 'polygon');\n }\n else if (this.isPolyline()) {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, 'polyline');\n }\n else {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, this.type);\n }\n\n this.$el.id = `psv-marker-${this.id}`;\n this.$el[MarkersPlugin.MARKER_DATA] = this;\n\n this.update(properties);\n }\n\n /**\n * @summary Destroys the marker\n */\n destroy() {\n delete this.$el[MarkersPlugin.MARKER_DATA];\n delete this.$el;\n delete this.config;\n delete this.props;\n delete this.psv;\n }\n\n /**\n * @summary Checks if it is a normal marker (image or html)\n * @returns {boolean}\n */\n isNormal() {\n return this.type === MARKER_TYPES.image\n || this.type === MARKER_TYPES.html;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline marker\n * @returns {boolean}\n */\n isPoly() {\n return this.isPolygon()\n || this.isPolyline();\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using pixel coordinates\n * @returns {boolean}\n */\n isPolyPx() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polylinePx;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using radian coordinates\n * @returns {boolean}\n */\n isPolyRad() {\n return this.type === MARKER_TYPES.polygonRad\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is a polygon marker\n * @returns {boolean}\n */\n isPolygon() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polygonRad;\n }\n\n /**\n * @summary Checks if it is a polyline marker\n * @returns {boolean}\n */\n isPolyline() {\n return this.type === MARKER_TYPES.polylinePx\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is an SVG marker\n * @returns {boolean}\n */\n isSvg() {\n return this.type === MARKER_TYPES.square\n || this.type === MARKER_TYPES.rect\n || this.type === MARKER_TYPES.circle\n || this.type === MARKER_TYPES.ellipse\n || this.type === MARKER_TYPES.path;\n }\n\n /**\n * @summary Computes marker scale from zoom level\n * @param {number} zoomLevel\n * @returns {number}\n */\n getScale(zoomLevel) {\n if (Array.isArray(this.config.scale)) {\n return this.config.scale[0] + (this.config.scale[1] - this.config.scale[0]) * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n else if (typeof this.config.scale === 'function') {\n return this.config.scale(zoomLevel);\n }\n else if (typeof this.config.scale === 'number') {\n return this.config.scale * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n else {\n return 1;\n }\n }\n\n /**\n * @summary Returns the markers list content for the marker, it can be either :\n * - the `listContent`\n * - the `tooltip.content`\n * - the `html`\n * - the `id`\n * @returns {*}\n */\n getListContent() {\n if (this.config.listContent) {\n return this.config.listContent;\n }\n else if (this.config.tooltip) {\n return this.config.tooltip.content;\n }\n else if (this.config.html) {\n return this.config.html;\n }\n else {\n return this.id;\n }\n }\n\n /**\n * @summary Display the tooltip of this marker\n * @param {{clientX: number, clientY: number}} [mousePosition]\n */\n showTooltip(mousePosition) {\n if (this.visible && this.config.tooltip && this.props.position2D) {\n const config = {\n content : this.config.tooltip.content,\n position: this.config.tooltip.position,\n data : this,\n };\n\n if (this.isPoly()) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n config.box = { // separate the tooltip from the cursor\n width : this.psv.tooltip.size.arrow * 2,\n height: this.psv.tooltip.size.arrow * 2,\n };\n\n if (mousePosition) {\n config.top = mousePosition.clientY - boundingRect.top - this.psv.tooltip.size.arrow / 2;\n config.left = mousePosition.clientX - boundingRect.left - this.psv.tooltip.size.arrow;\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n }\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n config.box = {\n width : this.props.width,\n height: this.props.height,\n };\n }\n\n if (this.tooltip) {\n this.tooltip.move(config);\n }\n else {\n this.tooltip = this.psv.tooltip.create(config);\n }\n }\n }\n\n /**\n * @summary Hides the tooltip of this marker\n */\n hideTooltip() {\n if (this.tooltip) {\n this.tooltip.hide();\n this.tooltip = null;\n }\n }\n\n /**\n * @summary Updates the marker with new properties\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @throws {PSV.PSVError} when trying to change the marker's type\n */\n update(properties) {\n const newType = Marker.getType(properties, true);\n\n if (newType !== undefined && newType !== this.type) {\n throw new PSVError('cannot change marker type');\n }\n\n utils.deepmerge(this.config, properties);\n this.data = this.config.data;\n\n this.visible = properties.visible !== false;\n\n // reset CSS class\n if (this.isNormal()) {\n this.$el.setAttribute('class', 'psv-marker psv-marker--normal');\n }\n else {\n this.$el.setAttribute('class', 'psv-marker psv-marker--svg');\n }\n\n // add CSS classes\n if (this.config.className) {\n utils.addClasses(this.$el, this.config.className);\n }\n if (this.config.tooltip) {\n utils.addClasses(this.$el, 'psv-marker--has-tooltip');\n if (typeof this.config.tooltip === 'string') {\n this.config.tooltip = { content: this.config.tooltip };\n }\n }\n if (this.config.content) {\n utils.addClasses(this.$el, 'psv-marler--has-content');\n }\n\n // apply style\n if (this.config.style) {\n utils.deepmerge(this.$el.style, this.config.style);\n }\n\n // parse anchor\n this.props.anchor = utils.parsePosition(this.config.anchor);\n\n if (this.isNormal()) {\n this.__updateNormal();\n }\n else if (this.isPoly()) {\n this.__updatePoly();\n }\n else {\n this.__updateSvg();\n }\n }\n\n /**\n * @summary Updates a normal marker\n * @private\n */\n __updateNormal() {\n if (this.config.width && this.config.height) {\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n this.$el.style.width = this.config.width + 'px';\n this.$el.style.height = this.config.height + 'px';\n }\n else {\n this.props.dynamicSize = true;\n }\n\n if (this.config.image) {\n this.props.def = this.config.image;\n this.$el.style.backgroundImage = `url(${this.config.image})`;\n }\n else if (this.config.html) {\n this.props.def = this.config.html;\n this.$el.innerHTML = this.config.html;\n }\n\n // set anchor\n this.$el.style.transformOrigin = `${this.props.anchor.x * 100}% ${this.props.anchor.y * 100}%`;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates an SVG marker\n * @private\n */\n __updateSvg() {\n this.props.dynamicSize = true;\n\n // set content\n switch (this.type) {\n case MARKER_TYPES.square:\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.square,\n height: this.config.square,\n };\n break;\n\n case MARKER_TYPES.rect:\n if (Array.isArray(this.config.rect)) {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect[0],\n height: this.config.rect[1],\n };\n }\n else {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect.width,\n height: this.config.rect.height,\n };\n }\n break;\n\n case MARKER_TYPES.circle:\n this.props.def = {\n cx: this.config.circle,\n cy: this.config.circle,\n r : this.config.circle,\n };\n break;\n\n case MARKER_TYPES.ellipse:\n if (Array.isArray(this.config.ellipse)) {\n this.props.def = {\n cx: this.config.ellipse[0],\n cy: this.config.ellipse[1],\n rx: this.config.ellipse[0],\n ry: this.config.ellipse[1],\n };\n }\n else {\n this.props.def = {\n cx: this.config.ellipse.rx,\n cy: this.config.ellipse.ry,\n rx: this.config.ellipse.rx,\n ry: this.config.ellipse.ry,\n };\n }\n break;\n\n case MARKER_TYPES.path:\n this.props.def = {\n d: this.config.path,\n };\n break;\n\n // no default\n }\n\n utils.each(this.props.def, (value, prop) => {\n this.$el.setAttributeNS(null, prop, value);\n });\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n }\n else {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates a polygon marker\n * @private\n */\n __updatePoly() {\n this.props.dynamicSize = true;\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n\n if (this.isPolyline() && !this.config.svgStyle.fill) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n }\n }\n else if (this.isPolygon()) {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n else if (this.isPolyline()) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n this.$el.setAttributeNS(null, 'stroke', 'rgb(0,0,0)');\n }\n\n // fold arrays: [1,2,3,4] => [[1,2],[3,4]]\n const actualPoly = this.config.polygonPx || this.config.polygonRad || this.config.polylinePx || this.config.polylineRad;\n if (!Array.isArray(actualPoly[0])) {\n for (let i = 0; i < actualPoly.length; i++) {\n actualPoly.splice(i, 2, [actualPoly[i], actualPoly[i + 1]]);\n }\n }\n\n // convert texture coordinates to spherical coordinates\n if (this.isPolyPx()) {\n this.props.def = actualPoly.map((coord) => {\n const sphericalCoords = this.psv.dataHelper.textureCoordsToSphericalCoords({ x: coord[0], y: coord[1] });\n return [sphericalCoords.longitude, sphericalCoords.latitude];\n });\n }\n // clean angles\n else {\n this.props.def = actualPoly.map((coord) => {\n return [utils.parseAngle(coord[0]), utils.parseAngle(coord[1], true)];\n });\n }\n\n const centroid = this.isPolygon()\n ? getPolygonCenter(this.props.def)\n : getPolylineCenter(this.props.def);\n\n this.props.position = {\n longitude: centroid[0],\n latitude : centroid[1],\n };\n\n // compute x/y/z positions\n this.props.positions3D = this.props.def.map((coord) => {\n return this.psv.dataHelper.sphericalCoordsToVector3({ longitude: coord[0], latitude: coord[1] });\n });\n }\n\n /**\n * @summary Determines the type of a marker by the available properties\n * @param {Marker.Properties} properties\n * @param {boolean} [allowNone=false]\n * @returns {string}\n * @throws {PSV.PSVError} when the marker's type cannot be found\n */\n static getType(properties, allowNone = false) {\n const found = [];\n\n utils.each(MARKER_TYPES, (type) => {\n if (type in properties) {\n found.push(type);\n }\n });\n\n if (found.length === 0 && !allowNone) {\n throw new PSVError(`missing marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n else if (found.length > 1) {\n throw new PSVError(`multiple marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n\n return found[0];\n }\n\n}\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport pin from './pin.svg';\n\n/**\n * @summary Navigation bar markers button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersButton extends AbstractButton {\n\n static id = 'markers';\n static icon = pin;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin(MarkersPlugin.id);\n\n if (this.plugin) {\n this.plugin.on(MarkersPlugin.EVENTS.SHOW_MARKERS, this);\n this.plugin.on(MarkersPlugin.EVENTS.HIDE_MARKERS, this);\n\n this.toggleActive(true);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(MarkersPlugin.EVENTS.SHOW_MARKERS, this);\n this.plugin.off(MarkersPlugin.EVENTS.HIDE_MARKERS, this);\n }\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case MarkersPlugin.EVENTS.SHOW_MARKERS: this.toggleActive(true); break;\n case MarkersPlugin.EVENTS.HIDE_MARKERS: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers\n */\n onClick() {\n if (this.plugin.prop.visible) {\n this.plugin.hide();\n }\n else {\n this.plugin.show();\n }\n }\n\n}\n","import { AbstractButton, CONSTANTS } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport pinList from './pin-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersListButton extends AbstractButton {\n\n static id = 'markersList';\n static icon = pinList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-list-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin(MarkersPlugin.id);\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === MarkersPlugin.ID_PANEL_MARKERS_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers list\n */\n onClick() {\n this.plugin.toggleMarkersList();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\nimport { Marker } from './Marker';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\nimport icon from './pin-list.svg';\nimport './style.scss';\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Options\n * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event.\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers]\n */\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.SelectMarkerData\n * @summary Data of the `select-marker` event\n * @property {boolean} dblclick - if the selection originated from a double click, the simple click is always fired before the double click\n * @property {boolean} rightclick - if the selection originated from a right click\n */\n\n\n// add markers buttons\nDEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf('caption'), 0, MarkersButton.id, MarkersListButton.id);\nDEFAULTS.lang[MarkersButton.id] = 'Markers';\nDEFAULTS.lang[MarkersListButton.id] = 'Markers list';\nregisterButton(MarkersButton);\nregisterButton(MarkersListButton);\n\n\n/**\n * @summary Displays various markers on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class MarkersPlugin extends AbstractPlugin {\n\n static id = 'markers';\n\n /**\n * @summary Available events\n * @enum {string}\n * @constant\n */\n static EVENTS = {\n GOTO_MARKER_DONE : 'goto-marker-done',\n LEAVE_MARKER : 'leave-marker',\n OVER_MARKER : 'over-marker',\n RENDER_MARKERS_LIST: 'render-markers-list',\n SELECT_MARKER : 'select-marker',\n SELECT_MARKER_LIST : 'select-marker-list',\n UNSELECT_MARKER : 'unselect-marker',\n HIDE_MARKERS : 'hide-markers',\n SHOW_MARKERS : 'show-markers',\n };\n\n /**\n * @summary Namespace for SVG creation\n * @type {string}\n * @constant\n */\n static SVG_NS = 'http://www.w3.org/2000/svg';\n\n /**\n * @summary Property name added to marker elements\n * @type {string}\n * @constant\n */\n static MARKER_DATA = 'psvMarker';\n\n /**\n * @summary Panel identifier for marker content\n * @type {string}\n * @constant\n */\n static ID_PANEL_MARKER = 'marker';\n\n /**\n * @summary Panel identifier for markers list\n * @type {string}\n * @constant\n */\n static ID_PANEL_MARKERS_LIST = 'markersList';\n\n /**\n * @summary Markers list template\n * @param {PSV.Marker[]} markers\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n */\n static MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => `\n
    \n

    ${icon} ${title}

    \n
      \n ${markers.map(marker => `\n
    • \n ${marker.type === 'image' ? `` : ''}\n

      ${marker.getListContent()}

      \n
    • \n `).join('')}\n
    \n
    \n`;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.MarkersPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = 'psv-markers';\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.psv.container.appendChild(this.container);\n\n /**\n * @summary All registered markers\n * @member {Object}\n */\n this.markers = {};\n\n /**\n * @type {Object}\n * @property {boolean} visible - Visibility of the component\n * @property {PSV.plugins.MarkersPlugin.Marker} currentMarker - Last selected marker\n * @property {PSV.plugins.MarkersPlugin.Marker} hoveringMarker - Marker under the cursor\n * @private\n */\n this.prop = {\n visible : true,\n currentMarker : null,\n hoveringMarker: null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin.Options}\n */\n this.config = {\n clickEventOnMarker: false,\n ...options,\n };\n\n /**\n * @member {SVGElement}\n * @readonly\n */\n this.svgContainer = document.createElementNS(MarkersPlugin.SVG_NS, 'svg');\n this.svgContainer.setAttribute('class', 'psv-markers-svg-container');\n this.container.appendChild(this.svgContainer);\n\n // Markers events via delegation\n this.container.addEventListener('mouseenter', this, true);\n this.container.addEventListener('mouseleave', this, true);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('contextmenu', this);\n\n // Viewer events\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n this.psv.on(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n if (options?.markers) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.setMarkers(options.markers);\n });\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.clearMarkers(false);\n\n this.container.removeEventListener('mouseenter', this);\n this.container.removeEventListener('mouseleave', this);\n this.container.removeEventListener('mousemove', this);\n this.container.removeEventListener('contextmenu', this);\n\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n this.psv.off(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n this.psv.container.removeChild(this.container);\n\n delete this.svgContainer;\n delete this.markers;\n delete this.container;\n delete this.prop;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mouseenter': this.__onMouseEnter(e); break;\n case 'mouseleave': this.__onMouseLeave(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'contextmenu': this.__onContextMenu(e); break;\n case CONSTANTS.EVENTS.CLICK: this.__onClick(e, e.args[0], false); break;\n case CONSTANTS.EVENTS.DOUBLE_CLICK: this.__onClick(e, e.args[0], true); break;\n case CONSTANTS.EVENTS.RENDER: this.renderMarkers(); break;\n case CONSTANTS.EVENTS.CONFIG_CHANGED:\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @fires PSV.plugins.MarkersPlugin.show-markers\n */\n show() {\n this.prop.visible = true;\n\n this.renderMarkers();\n\n /**\n * @event show-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are shown\n */\n this.trigger(MarkersPlugin.EVENTS.SHOW_MARKERS);\n }\n\n /**\n * @override\n * @fires PSV.plugins.MarkersPlugin.hide-markers\n */\n hide() {\n this.prop.visible = false;\n\n this.renderMarkers();\n\n /**\n * @event hide-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are hidden\n */\n this.trigger(MarkersPlugin.EVENTS.HIDE_MARKERS);\n }\n\n /**\n * @summary Toggles the visibility of all tooltips\n */\n toggleAllTooltips() {\n this.prop.showAllTooltips = !this.prop.showAllTooltips;\n this.renderMarkers();\n }\n\n /**\n * @summary Displays all tooltips\n */\n showAllTooltips() {\n this.prop.showAllTooltips = true;\n this.renderMarkers();\n }\n\n /**\n * @summary Hides all tooltips\n */\n hideAllTooltips() {\n this.prop.showAllTooltips = false;\n this.renderMarkers();\n }\n\n /**\n * @summary Return the total number of markers\n * @returns {number}\n */\n getNbMarkers() {\n return Object.keys(this.markers).length;\n }\n\n /**\n * @summary Adds a new marker to viewer\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker's id is missing or already exists\n */\n addMarker(properties, render = true) {\n if (this.markers[properties.id]) {\n throw new PSVError(`marker \"${properties.id}\" already exists`);\n }\n\n const marker = new Marker(properties, this.psv);\n\n if (marker.isNormal()) {\n this.container.appendChild(marker.$el);\n }\n else {\n this.svgContainer.appendChild(marker.$el);\n }\n\n this.markers[marker.id] = marker;\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n\n return marker;\n }\n\n /**\n * @summary Returns the internal marker object for a marker id\n * @param {string} markerId\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker cannot be found\n */\n getMarker(markerId) {\n const id = typeof markerId === 'object' ? markerId.id : markerId;\n\n if (!this.markers[id]) {\n throw new PSVError(`cannot find marker \"${id}\"`);\n }\n\n return this.markers[id];\n }\n\n /**\n * @summary Returns the last marker selected by the user\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n getCurrentMarker() {\n return this.prop.currentMarker;\n }\n\n /**\n * @summary Updates the existing marker with the same id\n * @description Every property can be changed but you can't change its type (Eg: `image` to `html`).\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n updateMarker(properties, render = true) {\n const marker = this.getMarker(properties.id);\n\n marker.update(properties);\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n\n return marker;\n }\n\n /**\n * @summary Removes a marker from the viewer\n * @param {*} markerOrId\n * @param {boolean} [render=true] - renders the marker immediately\n */\n removeMarker(markerOrId, render = true) {\n const marker = this.getMarker(markerOrId);\n\n if (marker.isNormal()) {\n this.container.removeChild(marker.$el);\n }\n else {\n this.svgContainer.removeChild(marker.$el);\n }\n\n if (this.prop.hoveringMarker === marker) {\n this.prop.hoveringMarker = null;\n }\n\n if (this.prop.currentMarker === marker) {\n this.prop.currentMarker = null;\n }\n\n marker.hideTooltip();\n\n marker.destroy();\n delete this.markers[marker.id];\n\n if (render) {\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Replaces all markers\n * @param {PSV.plugins.MarkersPlugin.Properties[]} markers\n * @param {boolean} [render=true] - renders the marker immediately\n */\n setMarkers(markers, render = true) {\n this.clearMarkers(false);\n\n utils.each(markers, marker => this.addMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Removes all markers\n * @param {boolean} [render=true] - renders the markers immediately\n */\n clearMarkers(render = true) {\n utils.each(this.markers, marker => this.removeMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Rotate the view to face the marker\n * @param {string} markerId\n * @param {string|number} [speed] - rotates smoothy, see {@link PSV.Viewer#animate}\n * @fires PSV.plugins.MarkersPlugin.goto-marker-done\n * @return {PSV.Animation} A promise that will be resolved when the animation finishes\n */\n gotoMarker(markerId, speed) {\n const marker = this.getMarker(markerId);\n\n return this.psv.animate({\n ...marker.props.position,\n speed,\n })\n .then(() => {\n /**\n * @event goto-marker-done\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the animation to a marker is done\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.GOTO_MARKER_DONE, marker);\n });\n }\n\n /**\n * @summary Hides a marker\n * @param {string} markerId\n */\n hideMarker(markerId) {\n this.getMarker(markerId).visible = false;\n this.renderMarkers();\n }\n\n /**\n * @summary Shows a marker\n * @param {string} markerId\n */\n showMarker(markerId) {\n this.getMarker(markerId).visible = true;\n this.renderMarkers();\n }\n\n /**\n * @summary Toggles a marker\n * @param {string} markerId\n */\n toggleMarker(markerId) {\n this.getMarker(markerId).visible ^= true;\n this.renderMarkers();\n }\n\n /**\n * @summary Toggles the visibility of markers list\n */\n toggleMarkersList() {\n if (this.psv.panel.prop.contentId === MarkersPlugin.ID_PANEL_MARKERS_LIST) {\n this.hideMarkersList();\n }\n else {\n this.showMarkersList();\n }\n }\n\n /**\n * @summary Opens the panel with the content of the marker\n * @param {string} markerId\n */\n showMarkerPanel(markerId) {\n const marker = this.getMarker(markerId);\n\n if (marker?.config?.content) {\n this.psv.panel.show({\n id : MarkersPlugin.ID_PANEL_MARKER,\n content: marker.config.content,\n });\n }\n else {\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKER);\n }\n }\n\n /**\n * @summary Opens side panel with list of markers\n * @fires PSV.plugins.MarkersPlugin.filter:render-markers-list\n */\n showMarkersList() {\n let markers = [];\n utils.each(this.markers, (marker) => {\n if (marker.visible && !marker.config.hideList) {\n markers.push(marker);\n }\n });\n\n /**\n * @event filter:render-markers-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Used to alter the list of markers displayed on the side-panel\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @returns {PSV.plugins.MarkersPlugin.Marker[]}\n */\n markers = this.change(MarkersPlugin.EVENTS.RENDER_MARKERS_LIST, markers);\n\n this.psv.panel.show({\n id : MarkersPlugin.ID_PANEL_MARKERS_LIST,\n content : MarkersPlugin.MARKERS_LIST_TEMPLATE(\n markers,\n this.psv.config.lang.markers,\n utils.dasherize(MarkersPlugin.MARKER_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const markerId = li ? li.dataset[MarkersPlugin.MARKER_DATA] : undefined;\n\n if (markerId) {\n const marker = this.getMarker(markerId);\n\n /**\n * @event select-marker-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker is selected from the side panel\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.SELECT_MARKER_LIST, marker);\n\n this.gotoMarker(marker, 1000);\n this.hideMarkersList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of markers\n */\n hideMarkersList() {\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKERS_LIST);\n }\n\n /**\n * @summary Updates the visibility and the position of all markers\n */\n renderMarkers() {\n utils.each(this.markers, (marker) => {\n let isVisible = this.prop.visible && marker.visible;\n\n if (isVisible && marker.isPoly()) {\n const positions = this.__getPolyPositions(marker);\n isVisible = positions.length > (marker.isPolygon() ? 2 : 1);\n\n if (isVisible) {\n marker.props.position2D = this.__getMarkerPosition(marker);\n\n const points = positions.map(pos => pos.x + ',' + pos.y).join(' ');\n\n marker.$el.setAttributeNS(null, 'points', points);\n }\n }\n else if (isVisible) {\n if (marker.props.dynamicSize) {\n this.__updateMarkerSize(marker);\n }\n\n const scale = marker.getScale(this.psv.getZoomLevel());\n const position = this.__getMarkerPosition(marker, scale);\n isVisible = this.__isMarkerVisible(marker, position);\n\n if (isVisible) {\n marker.props.position2D = position;\n\n if (marker.isSvg()) {\n let transform = `translate(${position.x}, ${position.y})`;\n if (scale !== 1) {\n transform += ` scale(${scale}, ${scale})`;\n }\n\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n let transform = `translate3D(${position.x}px, ${position.y}px, 0px)`;\n if (scale !== 1) {\n transform += ` scale(${scale}, ${scale})`;\n }\n\n marker.$el.style.transform = transform;\n }\n }\n }\n\n marker.props.inViewport = isVisible;\n utils.toggleClass(marker.$el, 'psv-marker--visible', isVisible);\n\n if (marker.props.inViewport && (this.prop.showAllTooltips || (marker === this.prop.hoveringMarker && !marker.isPoly()))) {\n marker.showTooltip();\n }\n else if (!marker.props.inViewport || marker !== this.prop.hoveringMarker) {\n marker.hideTooltip();\n }\n });\n }\n\n /**\n * @summary Determines if a point marker is visible
    \n * It tests if the point is in the general direction of the camera, then check if it's in the viewport\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.Point} position\n * @returns {boolean}\n * @private\n */\n __isMarkerVisible(marker, position) {\n return marker.props.positions3D[0].dot(this.psv.prop.direction) > 0\n && position.x + marker.props.width >= 0\n && position.x - marker.props.width <= this.psv.prop.size.width\n && position.y + marker.props.height >= 0\n && position.y - marker.props.height <= this.psv.prop.size.height;\n }\n\n /**\n * @summary Computes the real size of a marker\n * @description This is done by removing all it's transformations (if any) and making it visible\n * before querying its bounding rect\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __updateMarkerSize(marker) {\n utils.addClasses(marker.$el, 'psv-marker--transparent');\n\n let transform;\n if (marker.isSvg()) {\n transform = marker.$el.getAttributeNS(null, 'transform');\n marker.$el.removeAttributeNS(null, 'transform');\n }\n else {\n transform = marker.$el.style.transform;\n marker.$el.style.transform = '';\n }\n\n const rect = marker.$el.getBoundingClientRect();\n marker.props.width = rect.width;\n marker.props.height = rect.height;\n\n utils.removeClasses(marker.$el, 'psv-marker--transparent');\n\n if (transform) {\n if (marker.isSvg()) {\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n marker.$el.style.transform = transform;\n }\n }\n\n // the size is no longer dynamic once known\n marker.props.dynamicSize = false;\n }\n\n /**\n * @summary Computes viewer coordinates of a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {number} [scale=1]\n * @returns {PSV.Point}\n * @private\n */\n __getMarkerPosition(marker, scale = 1) {\n if (marker.isPoly()) {\n return this.psv.dataHelper.vector3ToViewerCoords(this.psv.dataHelper.sphericalCoordsToVector3(marker.props.position));\n }\n else {\n const position = this.psv.dataHelper.vector3ToViewerCoords(marker.props.positions3D[0]);\n\n position.x -= marker.props.width * marker.props.anchor.x * scale;\n position.y -= marker.props.height * marker.props.anchor.y * scale;\n\n return position;\n }\n }\n\n /**\n * @summary Computes viewer coordinates of each point of a polygon/polyline
    \n * It handles points behind the camera by creating intermediary points suitable for the projector\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point[]}\n * @private\n */\n __getPolyPositions(marker) {\n const nbVectors = marker.props.positions3D.length;\n\n // compute if each vector is visible\n const positions3D = marker.props.positions3D.map((vector) => {\n return {\n vector : vector,\n visible: vector.dot(this.psv.prop.direction) > 0,\n };\n });\n\n // get pairs of visible/invisible vectors for each invisible vector connected to a visible vector\n const toBeComputed = [];\n positions3D.forEach((pos, i) => {\n if (!pos.visible) {\n const neighbours = [\n i === 0 ? positions3D[nbVectors - 1] : positions3D[i - 1],\n i === nbVectors - 1 ? positions3D[0] : positions3D[i + 1],\n ];\n\n neighbours.forEach((neighbour) => {\n if (neighbour.visible) {\n toBeComputed.push({\n visible : neighbour,\n invisible: pos,\n index : i,\n });\n }\n });\n }\n });\n\n // compute intermediary vector for each pair (the loop is reversed for splice to insert at the right place)\n toBeComputed.reverse().forEach((pair) => {\n positions3D.splice(pair.index, 0, {\n vector : this.__getPolyIntermediaryPoint(pair.visible.vector, pair.invisible.vector),\n visible: true,\n });\n });\n\n // translate vectors to screen pos\n return positions3D\n .filter(pos => pos.visible)\n .map(pos => this.psv.dataHelper.vector3ToViewerCoords(pos.vector));\n }\n\n /**\n * Given one point in the same direction of the camera and one point behind the camera,\n * computes an intermediary point on the great circle delimiting the half sphere visible by the camera.\n * The point is shifted by .01 rad because the projector cannot handle points exactly on this circle.\n * TODO : does not work with fisheye view (must not use the great circle)\n * {@link http://math.stackexchange.com/a/1730410/327208}\n * @param P1 {external:THREE.Vector3}\n * @param P2 {external:THREE.Vector3}\n * @returns {external:THREE.Vector3}\n * @private\n */\n __getPolyIntermediaryPoint(P1, P2) {\n const C = this.psv.prop.direction.clone().normalize();\n const N = new THREE.Vector3().crossVectors(P1, P2).normalize();\n const V = new THREE.Vector3().crossVectors(N, P1).normalize();\n const X = P1.clone().multiplyScalar(-C.dot(V));\n const Y = V.clone().multiplyScalar(C.dot(P1));\n const H = new THREE.Vector3().addVectors(X, Y).normalize();\n const a = new THREE.Vector3().crossVectors(H, C);\n return H.applyAxisAngle(a, 0.01).multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n }\n\n /**\n * @summary Returns the marker associated to an event target\n * @param {EventTarget} target\n * @param {boolean} [closest=false]\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @private\n */\n __getTargetMarker(target, closest = false) {\n const target2 = closest ? utils.getClosest(target, '.psv-marker') : target;\n return target2 ? target2[MarkersPlugin.MARKER_DATA] : undefined;\n }\n\n /**\n * @summary Checks if an event target is in the tooltip\n * @param {EventTarget} target\n * @param {PSV.components.Tooltip} tooltip\n * @returns {boolean}\n * @private\n */\n __targetOnTooltip(target, tooltip) {\n return target && tooltip ? utils.hasParent(target, tooltip.container) : false;\n }\n\n /**\n * @summary Handles mouse enter events, show the tooltip for non polygon markers\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseEnter(e) {\n const marker = this.__getTargetMarker(e.target);\n\n if (marker && !marker.isPoly()) {\n this.prop.hoveringMarker = marker;\n\n /**\n * @event over-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor hover a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.OVER_MARKER, marker);\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n }\n\n /**\n * @summary Handles mouse leave events, hide the tooltip\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @private\n */\n __onMouseLeave(e) {\n const marker = this.__getTargetMarker(e.target);\n\n // do not hide if we enter the tooltip itself while hovering a polygon\n if (marker && !(marker.isPoly() && this.__targetOnTooltip(e.relatedTarget, marker.tooltip))) {\n /**\n * @event leave-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor away from a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.LEAVE_MARKER, marker);\n\n this.prop.hoveringMarker = null;\n\n if (!this.prop.showAllTooltips) {\n marker.hideTooltip();\n }\n }\n }\n\n /**\n * @summary Handles mouse move events, refreshUi the tooltip for polygon markers\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseMove(e) {\n let marker;\n const targetMarker = this.__getTargetMarker(e.target);\n\n if (targetMarker?.isPoly()) {\n marker = targetMarker;\n }\n // do not hide if we enter the tooltip itself while hovering a polygon\n else if (this.prop.hoveringMarker && this.__targetOnTooltip(e.target, this.prop.hoveringMarker.tooltip)) {\n marker = this.prop.hoveringMarker;\n }\n\n if (marker) {\n if (!this.prop.hoveringMarker) {\n this.trigger(MarkersPlugin.EVENTS.OVER_MARKER, marker);\n\n this.prop.hoveringMarker = marker;\n }\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n else if (this.prop.hoveringMarker?.isPoly()) {\n this.trigger(MarkersPlugin.EVENTS.LEAVE_MARKER, this.prop.hoveringMarker);\n\n if (!this.prop.showAllTooltips) {\n this.prop.hoveringMarker.hideTooltip();\n }\n\n this.prop.hoveringMarker = null;\n }\n }\n\n /**\n * @summary Handles context menu events\n * @param {MouseWheelEvent} evt\n * @private\n */\n __onContextMenu(evt) {\n if (!utils.getClosest(evt.target, '.psv-marker')) {\n return true;\n }\n\n evt.preventDefault();\n return false;\n }\n\n /**\n * @summary Handles mouse click events, select the marker and open the panel if necessary\n * @param {Event} e\n * @param {Object} data\n * @param {boolean} dblclick\n * @fires PSV.plugins.MarkersPlugin.select-marker\n * @fires PSV.plugins.MarkersPlugin.unselect-marker\n * @private\n */\n __onClick(e, data, dblclick) {\n const marker = this.__getTargetMarker(data.target, true);\n\n if (marker) {\n this.prop.currentMarker = marker;\n\n /**\n * @event select-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler\n * with {@link PSV.plugins.MarkersPlugin.getCurrentMarker}\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.plugins.MarkersPlugin.SelectMarkerData} data\n */\n this.trigger(MarkersPlugin.EVENTS.SELECT_MARKER, marker, {\n dblclick : dblclick,\n rightclick: data.rightclick,\n });\n\n if (this.config.clickEventOnMarker) {\n // add the marker to event data\n data.marker = marker;\n }\n else {\n e.stopPropagation();\n }\n\n // the marker could have been deleted in an event handler\n if (this.markers[marker.id]) {\n this.showMarkerPanel(marker.id);\n }\n }\n else if (this.prop.currentMarker) {\n /**\n * @event unselect-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker was selected and the user clicks elsewhere\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.UNSELECT_MARKER, this.prop.currentMarker);\n\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKER);\n\n this.prop.currentMarker = null;\n }\n }\n\n /**\n * @summary Updates the visiblity of the panel and the buttons\n * @private\n */\n __refreshUi() {\n const nbMarkers = this.getNbMarkers();\n const markersButton = this.psv.navbar.getButton(MarkersButton.id, false);\n const markersListButton = this.psv.navbar.getButton(MarkersListButton.id, false);\n\n if (nbMarkers === 0) {\n markersButton?.hide();\n markersListButton?.hide();\n\n if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKERS_LIST)) {\n this.psv.panel.hide();\n }\n else if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKER)) {\n this.psv.panel.hide();\n }\n }\n else {\n markersButton?.show();\n markersListButton?.show();\n\n if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKERS_LIST)) {\n this.showMarkersList();\n }\n else if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKER)) {\n this.prop.currentMarker ? this.showMarkerPanel(this.prop.currentMarker) : this.psv.panel.hide();\n }\n }\n }\n\n}\n"],"names":["greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","utils","greatArcDistance","CONSTANTS","SPHERE_RADIUS","a","Math","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","sum","reduce","intermediary","point","length","getPolylineCenter","polyline","lengths","i","l","push","consumed","round","MARKER_TYPES","image","html","polygonPx","polygonRad","polylinePx","polylineRad","square","rect","circle","ellipse","path","Marker","properties","psv","id","PSVError","width","height","type","getType","visible","$el","config","data","undefined","tooltip","props","inViewport","dynamicSize","anchor","position","position2D","positions3D","def","isNormal","document","createElement","isPolygon","createElementNS","MarkersPlugin","SVG_NS","isPolyline","MARKER_DATA","update","destroy","isPoly","isPolyPx","isPolyRad","isSvg","getScale","zoomLevel","Array","isArray","scale","EASINGS","inQuad","getListContent","listContent","content","showTooltip","mousePosition","boundingRect","container","getBoundingClientRect","box","size","arrow","top","clientY","left","clientX","move","create","hideTooltip","hide","newType","deepmerge","setAttribute","className","addClasses","style","parsePosition","__updateNormal","__updatePoly","__updateSvg","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","d","each","value","prop","setAttributeNS","svgStyle","dasherize","fill","actualPoly","splice","map","coord","sphericalCoords","textureCoordsToSphericalCoords","longitude","latitude","parseAngle","centroid","allowNone","found","Object","keys","join","MarkersButton","navbar","plugin","getPlugin","on","EVENTS","SHOW_MARKERS","HIDE_MARKERS","toggleActive","off","isSupported","handleEvent","e","onClick","show","AbstractButton","icon","pin","MarkersListButton","OPEN_PANEL","CLOSE_PANEL","args","ID_PANEL_MARKERS_LIST","toggleMarkersList","pinList","DEFAULTS","indexOf","lang","registerButton","options","cursor","mousemove","appendChild","markers","currentMarker","hoveringMarker","clickEventOnMarker","svgContainer","addEventListener","CLICK","DOUBLE_CLICK","RENDER","CONFIG_CHANGED","once","READY","setMarkers","clearMarkers","removeEventListener","removeChild","__onMouseEnter","__onMouseLeave","__onMouseMove","__onContextMenu","__onClick","renderMarkers","trigger","toggleAllTooltips","showAllTooltips","hideAllTooltips","getNbMarkers","addMarker","render","marker","__refreshUi","getMarker","markerId","getCurrentMarker","updateMarker","removeMarker","markerOrId","gotoMarker","speed","animate","then","GOTO_MARKER_DONE","hideMarker","showMarker","toggleMarker","panel","contentId","hideMarkersList","showMarkersList","showMarkerPanel","ID_PANEL_MARKER","hideList","change","RENDER_MARKERS_LIST","MARKERS_LIST_TEMPLATE","noMargin","clickHandler","li","target","getClosest","dataset","SELECT_MARKER_LIST","isVisible","positions","__getPolyPositions","__getMarkerPosition","points","pos","__updateMarkerSize","getZoomLevel","__isMarkerVisible","transform","toggleClass","dot","direction","getAttributeNS","removeAttributeNS","removeClasses","vector3ToViewerCoords","nbVectors","vector","toBeComputed","forEach","neighbours","neighbour","invisible","index","reverse","pair","__getPolyIntermediaryPoint","filter","P1","P2","C","clone","normalize","N","THREE","crossVectors","V","X","multiplyScalar","Y","H","addVectors","applyAxisAngle","__getTargetMarker","closest","target2","__targetOnTooltip","hasParent","OVER_MARKER","relatedTarget","LEAVE_MARKER","targetMarker","evt","preventDefault","dblclick","SELECT_MARKER","rightclick","stopPropagation","UNSELECT_MARKER","nbMarkers","markersButton","getButton","markersListButton","AbstractPlugin","title","dataKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;;;;;;;;;;EASO,SAASA,yBAAT,CAAmCC,EAAnC,EAAuCC,EAAvC,EAA2CC,CAA3C,EAA8C;EAAA,MAC5CC,EAD4C,GAClCH,EADkC;EAAA,MACxCI,EADwC,GAClCJ,EADkC;EAAA,MAE5CK,EAF4C,GAElCJ,EAFkC;EAAA,MAExCK,EAFwC,GAElCL,EAFkC;EAInD,MAAMM,CAAC,GAAGC,uBAAK,CAACC,gBAAN,CAAuBT,EAAvB,EAA2BC,EAA3B,IAAiCS,2BAAS,CAACC,aAArD;EACA,MAAMC,CAAC,GAAGC,IAAI,CAACC,GAAL,CAAS,CAAC,IAAIZ,CAAL,IAAUK,CAAnB,IAAwBM,IAAI,CAACC,GAAL,CAASP,CAAC,GAAGG,2BAAS,CAACC,aAAvB,CAAlC;EACA,MAAMI,CAAC,GAAGF,IAAI,CAACC,GAAL,CAASZ,CAAC,GAAGK,CAAb,IAAkBM,IAAI,CAACC,GAAL,CAASP,CAAT,CAA5B;EACA,MAAMS,CAAC,GAAGJ,CAAC,GAAGC,IAAI,CAACI,GAAL,CAASb,EAAT,CAAJ,GAAmBS,IAAI,CAACI,GAAL,CAASd,EAAT,CAAnB,GAAkCY,CAAC,GAAGF,IAAI,CAACI,GAAL,CAASX,EAAT,CAAJ,GAAmBO,IAAI,CAACI,GAAL,CAASZ,EAAT,CAA/D;EACA,MAAMa,CAAC,GAAGN,CAAC,GAAGC,IAAI,CAACI,GAAL,CAASb,EAAT,CAAJ,GAAmBS,IAAI,CAACC,GAAL,CAASX,EAAT,CAAnB,GAAkCY,CAAC,GAAGF,IAAI,CAACI,GAAL,CAASX,EAAT,CAAJ,GAAmBO,IAAI,CAACC,GAAL,CAAST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ASdD,EAAAA,YAAY,EAAS;EATP;EATGrF,cA0BZC,SAAS;EA1BGD,cAiCZG,cAAc;EAjCFH,cAwCZkK,kBAAkB;EAxCNlK,cA+CZqG,wBAAwB;;EA/CZrG,cAwDZsK,wBAAwB,UAACtD,OAAD,EAAU+H,KAAV,EAAiBC,OAAjB;EAAA,mGAEMjJ,IAFN,SAEcgJ,KAFd,sDAI3B/H,OAAO,CAAC9C,GAAR,CAAY,UAAA2E,MAAM;EAAA,+BACTmG,OADS,WACGnG,MAAM,CAAC9J,MAAP,CAAcR,EADjB,0CACqDsK,MAAM,CAAC9J,MAAP,CAAcwD,SAAd,IAA2B,EADhF,qBAEhBsG,MAAM,CAAClK,IAAP,KAAgB,OAAhB,oDAAsEkK,MAAM,CAAC9J,MAAP,CAActB,KAApF,YAAiG,EAFjF,oDAGiBoL,MAAM,CAAC5H,cAAP,EAHjB;EAAA,GAAlB,EAKC6D,IALD,CAKM,EALN,CAJ2B;EAAA;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"markers.js","sources":["../../src/plugins/markers/utils.js","../../src/plugins/markers/Marker.js","../../src/plugins/markers/MarkersButton.js","../../src/plugins/markers/MarkersListButton.js","../../src/plugins/markers/index.js"],"sourcesContent":["import { CONSTANTS, utils } from 'photo-sphere-viewer';\n\n/**\n * Returns intermediary point between two points on the sphere\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @param {number} f\n * @returns {number[]}\n * @private\n */\nexport function greatArcIntermediaryPoint(p1, p2, f) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const r = utils.greatArcDistance(p1, p2) * CONSTANTS.SPHERE_RADIUS;\n const a = Math.sin((1 - f) * r) / Math.sin(r / CONSTANTS.SPHERE_RADIUS);\n const b = Math.sin(f * r) / Math.sin(r);\n const x = a * Math.cos(φ1) * Math.cos(λ1) + b * Math.cos(φ2) * Math.cos(λ2);\n const y = a * Math.cos(φ1) * Math.sin(λ1) + b * Math.cos(φ2) * Math.sin(λ2);\n const z = a * Math.sin(φ1) + b * Math.sin(φ2);\n\n return [\n Math.atan2(y, x),\n Math.atan2(z, Math.sqrt(x * x + y * y)),\n ];\n}\n\n/**\n * @summary Computes the center point of a polygon\n * @todo Get \"visual center\" (https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc)\n * @param {number[][]} polygon\n * @returns {number[]}\n * @private\n */\nexport function getPolygonCenter(polygon) {\n const sum = polygon.reduce((intermediary, point) => [intermediary[0] + point[0], intermediary[1] + point[1]]);\n return [sum[0] / polygon.length, sum[1] / polygon.length];\n}\n\n/**\n * @summary Computes the middle point of a polyline\n * @param {number[][]} polyline\n * @returns {number[]}\n * @private\n */\nexport function getPolylineCenter(polyline) {\n // compute each segment length + total length\n let length = 0;\n const lengths = [];\n\n for (let i = 0; i < polyline.length - 1; i++) {\n const l = utils.greatArcDistance(polyline[i], polyline[i + 1]) * CONSTANTS.SPHERE_RADIUS;\n\n lengths.push(l);\n length += l;\n }\n\n // iterate until length / 2\n let consumed = 0;\n\n for (let i = 0; i < polyline.length - 1; i++) {\n // once the segment containing the middle point is found, computes the intermediary point\n if (consumed + lengths[i] > length / 2) {\n const r = (length / 2 - consumed) / lengths[i];\n return greatArcIntermediaryPoint(polyline[i], polyline[i + 1], r);\n }\n\n consumed += lengths[i];\n }\n\n // this never happens\n return polyline[Math.round(polyline.length / 2)];\n}\n","import { CONSTANTS, PSVError, utils } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport { getPolygonCenter, getPolylineCenter } from './utils';\n\n/**\n * @summary Types of marker\n * @memberOf PSV.plugins.MarkersPlugin\n * @enum {string}\n * @constant\n * @private\n */\nconst MARKER_TYPES = {\n image : 'image',\n html : 'html',\n polygonPx : 'polygonPx',\n polygonRad : 'polygonRad',\n polylinePx : 'polylinePx',\n polylineRad: 'polylineRad',\n square : 'square',\n rect : 'rect',\n circle : 'circle',\n ellipse : 'ellipse',\n path : 'path',\n};\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Properties\n * @summary Marker properties, see {@link http://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options}\n */\n\n/**\n * @summary Object representing a marker\n * @memberOf PSV.plugins.MarkersPlugin\n */\nexport class Marker {\n\n /**\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {PSV.Viewer} psv\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(properties, psv) {\n if (!properties.id) {\n throw new PSVError('missing marker id');\n }\n\n if (properties.image && (!properties.width || !properties.height)) {\n throw new PSVError('missing marker width/height');\n }\n\n if (properties.image || properties.html) {\n if ((!('x' in properties) || !('y' in properties)) && (!('latitude' in properties) || !('longitude' in properties))) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n }\n\n /**\n * @member {PSV.Viewer}\n * @readonly\n * @protected\n */\n this.psv = psv;\n\n /**\n * @member {string}\n * @readonly\n */\n this.id = properties.id;\n\n /**\n * @member {string}\n * @readonly\n */\n this.type = Marker.getType(properties, false);\n\n /**\n * @member {boolean}\n * @protected\n */\n this.visible = true;\n\n /**\n * @member {HTMLElement|SVGElement}\n * @readonly\n */\n this.$el = null;\n\n /**\n * @summary Original configuration of the marker\n * @member {PSV.plugins.MarkersPlugin.Properties}\n * @readonly\n */\n this.config = {};\n\n /**\n * @summary User data associated to the marker\n * @member {any}\n */\n this.data = undefined;\n\n /**\n * @summary Tooltip instance for this marker\n * @member {PSV.components.Tooltip}\n */\n this.tooltip = null;\n\n /**\n * @summary Computed properties\n * @member {Object}\n * @protected\n * @property {boolean} inViewport\n * @property {boolean} dynamicSize\n * @property {PSV.Point} anchor\n * @property {PSV.Position} position - position in spherical coordinates\n * @property {PSV.Point} position2D - position in viewer coordinates\n * @property {external:THREE.Vector3[]} positions3D - positions in 3D space\n * @property {number} width\n * @property {number} height\n * @property {*} def\n */\n this.props = {\n inViewport : false,\n dynamicSize: false,\n anchor : null,\n position : null,\n position2D : null,\n positions3D: null,\n width : null,\n height : null,\n def : null,\n };\n\n // create element\n if (this.isNormal()) {\n this.$el = document.createElement('div');\n }\n else if (this.isPolygon()) {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, 'polygon');\n }\n else if (this.isPolyline()) {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, 'polyline');\n }\n else {\n this.$el = document.createElementNS(MarkersPlugin.SVG_NS, this.type);\n }\n\n this.$el.id = `psv-marker-${this.id}`;\n this.$el[MarkersPlugin.MARKER_DATA] = this;\n\n this.update(properties);\n }\n\n /**\n * @summary Destroys the marker\n */\n destroy() {\n delete this.$el[MarkersPlugin.MARKER_DATA];\n delete this.$el;\n delete this.config;\n delete this.props;\n delete this.psv;\n }\n\n /**\n * @summary Checks if it is a normal marker (image or html)\n * @returns {boolean}\n */\n isNormal() {\n return this.type === MARKER_TYPES.image\n || this.type === MARKER_TYPES.html;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline marker\n * @returns {boolean}\n */\n isPoly() {\n return this.isPolygon()\n || this.isPolyline();\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using pixel coordinates\n * @returns {boolean}\n */\n isPolyPx() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polylinePx;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using radian coordinates\n * @returns {boolean}\n */\n isPolyRad() {\n return this.type === MARKER_TYPES.polygonRad\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is a polygon marker\n * @returns {boolean}\n */\n isPolygon() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polygonRad;\n }\n\n /**\n * @summary Checks if it is a polyline marker\n * @returns {boolean}\n */\n isPolyline() {\n return this.type === MARKER_TYPES.polylinePx\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is an SVG marker\n * @returns {boolean}\n */\n isSvg() {\n return this.type === MARKER_TYPES.square\n || this.type === MARKER_TYPES.rect\n || this.type === MARKER_TYPES.circle\n || this.type === MARKER_TYPES.ellipse\n || this.type === MARKER_TYPES.path;\n }\n\n /**\n * @summary Computes marker scale from zoom level\n * @param {number} zoomLevel\n * @returns {number}\n */\n getScale(zoomLevel) {\n if (Array.isArray(this.config.scale)) {\n return this.config.scale[0] + (this.config.scale[1] - this.config.scale[0]) * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n else if (typeof this.config.scale === 'function') {\n return this.config.scale(zoomLevel);\n }\n else if (typeof this.config.scale === 'number') {\n return this.config.scale * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n else {\n return 1;\n }\n }\n\n /**\n * @summary Returns the markers list content for the marker, it can be either :\n * - the `listContent`\n * - the `tooltip.content`\n * - the `html`\n * - the `id`\n * @returns {*}\n */\n getListContent() {\n if (this.config.listContent) {\n return this.config.listContent;\n }\n else if (this.config.tooltip) {\n return this.config.tooltip.content;\n }\n else if (this.config.html) {\n return this.config.html;\n }\n else {\n return this.id;\n }\n }\n\n /**\n * @summary Display the tooltip of this marker\n * @param {{clientX: number, clientY: number}} [mousePosition]\n */\n showTooltip(mousePosition) {\n if (this.visible && this.config.tooltip && this.props.position2D) {\n const config = {\n content : this.config.tooltip.content,\n position: this.config.tooltip.position,\n data : this,\n };\n\n if (this.isPoly()) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n config.box = { // separate the tooltip from the cursor\n width : this.psv.tooltip.size.arrow * 2,\n height: this.psv.tooltip.size.arrow * 2,\n };\n\n if (mousePosition) {\n config.top = mousePosition.clientY - boundingRect.top - this.psv.tooltip.size.arrow / 2;\n config.left = mousePosition.clientX - boundingRect.left - this.psv.tooltip.size.arrow;\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n }\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n config.box = {\n width : this.props.width,\n height: this.props.height,\n };\n }\n\n if (this.tooltip) {\n this.tooltip.move(config);\n }\n else {\n this.tooltip = this.psv.tooltip.create(config);\n }\n }\n }\n\n /**\n * @summary Hides the tooltip of this marker\n */\n hideTooltip() {\n if (this.tooltip) {\n this.tooltip.hide();\n this.tooltip = null;\n }\n }\n\n /**\n * @summary Updates the marker with new properties\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @throws {PSV.PSVError} when trying to change the marker's type\n */\n update(properties) {\n const newType = Marker.getType(properties, true);\n\n if (newType !== undefined && newType !== this.type) {\n throw new PSVError('cannot change marker type');\n }\n\n utils.deepmerge(this.config, properties);\n this.data = this.config.data;\n\n this.visible = properties.visible !== false;\n\n // reset CSS class\n if (this.isNormal()) {\n this.$el.setAttribute('class', 'psv-marker psv-marker--normal');\n }\n else {\n this.$el.setAttribute('class', 'psv-marker psv-marker--svg');\n }\n\n // add CSS classes\n if (this.config.className) {\n utils.addClasses(this.$el, this.config.className);\n }\n if (this.config.tooltip) {\n utils.addClasses(this.$el, 'psv-marker--has-tooltip');\n if (typeof this.config.tooltip === 'string') {\n this.config.tooltip = { content: this.config.tooltip };\n }\n }\n if (this.config.content) {\n utils.addClasses(this.$el, 'psv-marler--has-content');\n }\n\n // apply style\n if (this.config.style) {\n utils.deepmerge(this.$el.style, this.config.style);\n }\n\n // parse anchor\n this.props.anchor = utils.parsePosition(this.config.anchor);\n\n if (this.isNormal()) {\n this.__updateNormal();\n }\n else if (this.isPoly()) {\n this.__updatePoly();\n }\n else {\n this.__updateSvg();\n }\n }\n\n /**\n * @summary Updates a normal marker\n * @private\n */\n __updateNormal() {\n if (this.config.width && this.config.height) {\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n this.$el.style.width = this.config.width + 'px';\n this.$el.style.height = this.config.height + 'px';\n }\n else {\n this.props.dynamicSize = true;\n }\n\n if (this.config.image) {\n this.props.def = this.config.image;\n this.$el.style.backgroundImage = `url(${this.config.image})`;\n }\n else if (this.config.html) {\n this.props.def = this.config.html;\n this.$el.innerHTML = this.config.html;\n }\n\n // set anchor\n this.$el.style.transformOrigin = `${this.props.anchor.x * 100}% ${this.props.anchor.y * 100}%`;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates an SVG marker\n * @private\n */\n __updateSvg() {\n this.props.dynamicSize = true;\n\n // set content\n switch (this.type) {\n case MARKER_TYPES.square:\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.square,\n height: this.config.square,\n };\n break;\n\n case MARKER_TYPES.rect:\n if (Array.isArray(this.config.rect)) {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect[0],\n height: this.config.rect[1],\n };\n }\n else {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect.width,\n height: this.config.rect.height,\n };\n }\n break;\n\n case MARKER_TYPES.circle:\n this.props.def = {\n cx: this.config.circle,\n cy: this.config.circle,\n r : this.config.circle,\n };\n break;\n\n case MARKER_TYPES.ellipse:\n if (Array.isArray(this.config.ellipse)) {\n this.props.def = {\n cx: this.config.ellipse[0],\n cy: this.config.ellipse[1],\n rx: this.config.ellipse[0],\n ry: this.config.ellipse[1],\n };\n }\n else {\n this.props.def = {\n cx: this.config.ellipse.rx,\n cy: this.config.ellipse.ry,\n rx: this.config.ellipse.rx,\n ry: this.config.ellipse.ry,\n };\n }\n break;\n\n case MARKER_TYPES.path:\n this.props.def = {\n d: this.config.path,\n };\n break;\n\n // no default\n }\n\n utils.each(this.props.def, (value, prop) => {\n this.$el.setAttributeNS(null, prop, value);\n });\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n }\n else {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates a polygon marker\n * @private\n */\n __updatePoly() {\n this.props.dynamicSize = true;\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n\n if (this.isPolyline() && !this.config.svgStyle.fill) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n }\n }\n else if (this.isPolygon()) {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n else if (this.isPolyline()) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n this.$el.setAttributeNS(null, 'stroke', 'rgb(0,0,0)');\n }\n\n // fold arrays: [1,2,3,4] => [[1,2],[3,4]]\n const actualPoly = this.config.polygonPx || this.config.polygonRad || this.config.polylinePx || this.config.polylineRad;\n if (!Array.isArray(actualPoly[0])) {\n for (let i = 0; i < actualPoly.length; i++) {\n actualPoly.splice(i, 2, [actualPoly[i], actualPoly[i + 1]]);\n }\n }\n\n // convert texture coordinates to spherical coordinates\n if (this.isPolyPx()) {\n this.props.def = actualPoly.map((coord) => {\n const sphericalCoords = this.psv.dataHelper.textureCoordsToSphericalCoords({ x: coord[0], y: coord[1] });\n return [sphericalCoords.longitude, sphericalCoords.latitude];\n });\n }\n // clean angles\n else {\n this.props.def = actualPoly.map((coord) => {\n return [utils.parseAngle(coord[0]), utils.parseAngle(coord[1], true)];\n });\n }\n\n const centroid = this.isPolygon()\n ? getPolygonCenter(this.props.def)\n : getPolylineCenter(this.props.def);\n\n this.props.position = {\n longitude: centroid[0],\n latitude : centroid[1],\n };\n\n // compute x/y/z positions\n this.props.positions3D = this.props.def.map((coord) => {\n return this.psv.dataHelper.sphericalCoordsToVector3({ longitude: coord[0], latitude: coord[1] });\n });\n }\n\n /**\n * @summary Determines the type of a marker by the available properties\n * @param {Marker.Properties} properties\n * @param {boolean} [allowNone=false]\n * @returns {string}\n * @throws {PSV.PSVError} when the marker's type cannot be found\n */\n static getType(properties, allowNone = false) {\n const found = [];\n\n utils.each(MARKER_TYPES, (type) => {\n if (type in properties) {\n found.push(type);\n }\n });\n\n if (found.length === 0 && !allowNone) {\n throw new PSVError(`missing marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n else if (found.length > 1) {\n throw new PSVError(`multiple marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n\n return found[0];\n }\n\n}\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport pin from './pin.svg';\n\n/**\n * @summary Navigation bar markers button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersButton extends AbstractButton {\n\n static id = 'markers';\n static icon = pin;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin(MarkersPlugin.id);\n\n if (this.plugin) {\n this.plugin.on(MarkersPlugin.EVENTS.SHOW_MARKERS, this);\n this.plugin.on(MarkersPlugin.EVENTS.HIDE_MARKERS, this);\n\n this.toggleActive(true);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(MarkersPlugin.EVENTS.SHOW_MARKERS, this);\n this.plugin.off(MarkersPlugin.EVENTS.HIDE_MARKERS, this);\n }\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case MarkersPlugin.EVENTS.SHOW_MARKERS: this.toggleActive(true); break;\n case MarkersPlugin.EVENTS.HIDE_MARKERS: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers\n */\n onClick() {\n if (this.plugin.prop.visible) {\n this.plugin.hide();\n }\n else {\n this.plugin.show();\n }\n }\n\n}\n","import { AbstractButton, CONSTANTS } from 'photo-sphere-viewer';\nimport MarkersPlugin from './index';\nimport pinList from './pin-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersListButton extends AbstractButton {\n\n static id = 'markersList';\n static icon = pinList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-list-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin(MarkersPlugin.id);\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === MarkersPlugin.ID_PANEL_MARKERS_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers list\n */\n onClick() {\n this.plugin.toggleMarkersList();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\nimport { Marker } from './Marker';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\nimport icon from './pin-list.svg';\nimport './style.scss';\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Options\n * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event.\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers]\n */\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.SelectMarkerData\n * @summary Data of the `select-marker` event\n * @property {boolean} dblclick - if the selection originated from a double click, the simple click is always fired before the double click\n * @property {boolean} rightclick - if the selection originated from a right click\n */\n\n\n// add markers buttons\nDEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf('caption'), 0, MarkersButton.id, MarkersListButton.id);\nDEFAULTS.lang[MarkersButton.id] = 'Markers';\nDEFAULTS.lang[MarkersListButton.id] = 'Markers list';\nregisterButton(MarkersButton);\nregisterButton(MarkersListButton);\n\n\n/**\n * @summary Displays various markers on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class MarkersPlugin extends AbstractPlugin {\n\n static id = 'markers';\n\n /**\n * @summary Available events\n * @enum {string}\n * @constant\n */\n static EVENTS = {\n GOTO_MARKER_DONE : 'goto-marker-done',\n LEAVE_MARKER : 'leave-marker',\n OVER_MARKER : 'over-marker',\n RENDER_MARKERS_LIST: 'render-markers-list',\n SELECT_MARKER : 'select-marker',\n SELECT_MARKER_LIST : 'select-marker-list',\n UNSELECT_MARKER : 'unselect-marker',\n HIDE_MARKERS : 'hide-markers',\n SHOW_MARKERS : 'show-markers',\n };\n\n /**\n * @summary Namespace for SVG creation\n * @type {string}\n * @constant\n */\n static SVG_NS = 'http://www.w3.org/2000/svg';\n\n /**\n * @summary Property name added to marker elements\n * @type {string}\n * @constant\n */\n static MARKER_DATA = 'psvMarker';\n\n /**\n * @summary Panel identifier for marker content\n * @type {string}\n * @constant\n */\n static ID_PANEL_MARKER = 'marker';\n\n /**\n * @summary Panel identifier for markers list\n * @type {string}\n * @constant\n */\n static ID_PANEL_MARKERS_LIST = 'markersList';\n\n /**\n * @summary Markers list template\n * @param {PSV.Marker[]} markers\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n */\n static MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => `\n
    \n

    ${icon} ${title}

    \n
      \n ${markers.map(marker => `\n
    • \n ${marker.type === 'image' ? `` : ''}\n ${marker.getListContent()}\n
    • \n `).join('')}\n
    \n
    \n`;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.MarkersPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = 'psv-markers';\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.psv.container.appendChild(this.container);\n\n /**\n * @summary All registered markers\n * @member {Object}\n */\n this.markers = {};\n\n /**\n * @type {Object}\n * @property {boolean} visible - Visibility of the component\n * @property {PSV.plugins.MarkersPlugin.Marker} currentMarker - Last selected marker\n * @property {PSV.plugins.MarkersPlugin.Marker} hoveringMarker - Marker under the cursor\n * @private\n */\n this.prop = {\n visible : true,\n currentMarker : null,\n hoveringMarker: null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin.Options}\n */\n this.config = {\n clickEventOnMarker: false,\n ...options,\n };\n\n /**\n * @member {SVGElement}\n * @readonly\n */\n this.svgContainer = document.createElementNS(MarkersPlugin.SVG_NS, 'svg');\n this.svgContainer.setAttribute('class', 'psv-markers-svg-container');\n this.container.appendChild(this.svgContainer);\n\n // Markers events via delegation\n this.container.addEventListener('mouseenter', this, true);\n this.container.addEventListener('mouseleave', this, true);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('contextmenu', this);\n\n // Viewer events\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n this.psv.on(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n if (options?.markers) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.setMarkers(options.markers);\n });\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.clearMarkers(false);\n\n this.container.removeEventListener('mouseenter', this);\n this.container.removeEventListener('mouseleave', this);\n this.container.removeEventListener('mousemove', this);\n this.container.removeEventListener('contextmenu', this);\n\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n this.psv.off(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n this.psv.container.removeChild(this.container);\n\n delete this.svgContainer;\n delete this.markers;\n delete this.container;\n delete this.prop;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mouseenter': this.__onMouseEnter(e); break;\n case 'mouseleave': this.__onMouseLeave(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'contextmenu': this.__onContextMenu(e); break;\n case CONSTANTS.EVENTS.CLICK: this.__onClick(e, e.args[0], false); break;\n case CONSTANTS.EVENTS.DOUBLE_CLICK: this.__onClick(e, e.args[0], true); break;\n case CONSTANTS.EVENTS.RENDER: this.renderMarkers(); break;\n case CONSTANTS.EVENTS.CONFIG_CHANGED:\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @fires PSV.plugins.MarkersPlugin.show-markers\n */\n show() {\n this.prop.visible = true;\n\n this.renderMarkers();\n\n /**\n * @event show-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are shown\n */\n this.trigger(MarkersPlugin.EVENTS.SHOW_MARKERS);\n }\n\n /**\n * @override\n * @fires PSV.plugins.MarkersPlugin.hide-markers\n */\n hide() {\n this.prop.visible = false;\n\n this.renderMarkers();\n\n /**\n * @event hide-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are hidden\n */\n this.trigger(MarkersPlugin.EVENTS.HIDE_MARKERS);\n }\n\n /**\n * @summary Toggles the visibility of all tooltips\n */\n toggleAllTooltips() {\n this.prop.showAllTooltips = !this.prop.showAllTooltips;\n this.renderMarkers();\n }\n\n /**\n * @summary Displays all tooltips\n */\n showAllTooltips() {\n this.prop.showAllTooltips = true;\n this.renderMarkers();\n }\n\n /**\n * @summary Hides all tooltips\n */\n hideAllTooltips() {\n this.prop.showAllTooltips = false;\n this.renderMarkers();\n }\n\n /**\n * @summary Return the total number of markers\n * @returns {number}\n */\n getNbMarkers() {\n return Object.keys(this.markers).length;\n }\n\n /**\n * @summary Adds a new marker to viewer\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker's id is missing or already exists\n */\n addMarker(properties, render = true) {\n if (this.markers[properties.id]) {\n throw new PSVError(`marker \"${properties.id}\" already exists`);\n }\n\n const marker = new Marker(properties, this.psv);\n\n if (marker.isNormal()) {\n this.container.appendChild(marker.$el);\n }\n else {\n this.svgContainer.appendChild(marker.$el);\n }\n\n this.markers[marker.id] = marker;\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n\n return marker;\n }\n\n /**\n * @summary Returns the internal marker object for a marker id\n * @param {string} markerId\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker cannot be found\n */\n getMarker(markerId) {\n const id = typeof markerId === 'object' ? markerId.id : markerId;\n\n if (!this.markers[id]) {\n throw new PSVError(`cannot find marker \"${id}\"`);\n }\n\n return this.markers[id];\n }\n\n /**\n * @summary Returns the last marker selected by the user\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n getCurrentMarker() {\n return this.prop.currentMarker;\n }\n\n /**\n * @summary Updates the existing marker with the same id\n * @description Every property can be changed but you can't change its type (Eg: `image` to `html`).\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n updateMarker(properties, render = true) {\n const marker = this.getMarker(properties.id);\n\n marker.update(properties);\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n\n return marker;\n }\n\n /**\n * @summary Removes a marker from the viewer\n * @param {*} markerOrId\n * @param {boolean} [render=true] - renders the marker immediately\n */\n removeMarker(markerOrId, render = true) {\n const marker = this.getMarker(markerOrId);\n\n if (marker.isNormal()) {\n this.container.removeChild(marker.$el);\n }\n else {\n this.svgContainer.removeChild(marker.$el);\n }\n\n if (this.prop.hoveringMarker === marker) {\n this.prop.hoveringMarker = null;\n }\n\n if (this.prop.currentMarker === marker) {\n this.prop.currentMarker = null;\n }\n\n marker.hideTooltip();\n\n marker.destroy();\n delete this.markers[marker.id];\n\n if (render) {\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Replaces all markers\n * @param {PSV.plugins.MarkersPlugin.Properties[]} markers\n * @param {boolean} [render=true] - renders the marker immediately\n */\n setMarkers(markers, render = true) {\n this.clearMarkers(false);\n\n utils.each(markers, marker => this.addMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Removes all markers\n * @param {boolean} [render=true] - renders the markers immediately\n */\n clearMarkers(render = true) {\n utils.each(this.markers, marker => this.removeMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n }\n }\n\n /**\n * @summary Rotate the view to face the marker\n * @param {string} markerId\n * @param {string|number} [speed] - rotates smoothy, see {@link PSV.Viewer#animate}\n * @fires PSV.plugins.MarkersPlugin.goto-marker-done\n * @return {PSV.Animation} A promise that will be resolved when the animation finishes\n */\n gotoMarker(markerId, speed) {\n const marker = this.getMarker(markerId);\n\n return this.psv.animate({\n ...marker.props.position,\n speed,\n })\n .then(() => {\n /**\n * @event goto-marker-done\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the animation to a marker is done\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.GOTO_MARKER_DONE, marker);\n });\n }\n\n /**\n * @summary Hides a marker\n * @param {string} markerId\n */\n hideMarker(markerId) {\n this.getMarker(markerId).visible = false;\n this.renderMarkers();\n }\n\n /**\n * @summary Shows a marker\n * @param {string} markerId\n */\n showMarker(markerId) {\n this.getMarker(markerId).visible = true;\n this.renderMarkers();\n }\n\n /**\n * @summary Toggles a marker\n * @param {string} markerId\n */\n toggleMarker(markerId) {\n this.getMarker(markerId).visible ^= true;\n this.renderMarkers();\n }\n\n /**\n * @summary Toggles the visibility of markers list\n */\n toggleMarkersList() {\n if (this.psv.panel.prop.contentId === MarkersPlugin.ID_PANEL_MARKERS_LIST) {\n this.hideMarkersList();\n }\n else {\n this.showMarkersList();\n }\n }\n\n /**\n * @summary Opens the panel with the content of the marker\n * @param {string} markerId\n */\n showMarkerPanel(markerId) {\n const marker = this.getMarker(markerId);\n\n if (marker?.config?.content) {\n this.psv.panel.show({\n id : MarkersPlugin.ID_PANEL_MARKER,\n content: marker.config.content,\n });\n }\n else {\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKER);\n }\n }\n\n /**\n * @summary Opens side panel with list of markers\n * @fires PSV.plugins.MarkersPlugin.filter:render-markers-list\n */\n showMarkersList() {\n let markers = [];\n utils.each(this.markers, (marker) => {\n if (marker.visible && !marker.config.hideList) {\n markers.push(marker);\n }\n });\n\n /**\n * @event filter:render-markers-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Used to alter the list of markers displayed on the side-panel\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @returns {PSV.plugins.MarkersPlugin.Marker[]}\n */\n markers = this.change(MarkersPlugin.EVENTS.RENDER_MARKERS_LIST, markers);\n\n this.psv.panel.show({\n id : MarkersPlugin.ID_PANEL_MARKERS_LIST,\n content : MarkersPlugin.MARKERS_LIST_TEMPLATE(\n markers,\n this.psv.config.lang.markers,\n utils.dasherize(MarkersPlugin.MARKER_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const markerId = li ? li.dataset[MarkersPlugin.MARKER_DATA] : undefined;\n\n if (markerId) {\n const marker = this.getMarker(markerId);\n\n /**\n * @event select-marker-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker is selected from the side panel\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.SELECT_MARKER_LIST, marker);\n\n this.gotoMarker(marker, 1000);\n this.hideMarkersList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of markers\n */\n hideMarkersList() {\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKERS_LIST);\n }\n\n /**\n * @summary Updates the visibility and the position of all markers\n */\n renderMarkers() {\n utils.each(this.markers, (marker) => {\n let isVisible = this.prop.visible && marker.visible;\n\n if (isVisible && marker.isPoly()) {\n const positions = this.__getPolyPositions(marker);\n isVisible = positions.length > (marker.isPolygon() ? 2 : 1);\n\n if (isVisible) {\n marker.props.position2D = this.__getMarkerPosition(marker);\n\n const points = positions.map(pos => pos.x + ',' + pos.y).join(' ');\n\n marker.$el.setAttributeNS(null, 'points', points);\n }\n }\n else if (isVisible) {\n if (marker.props.dynamicSize) {\n this.__updateMarkerSize(marker);\n }\n\n const scale = marker.getScale(this.psv.getZoomLevel());\n const position = this.__getMarkerPosition(marker, scale);\n isVisible = this.__isMarkerVisible(marker, position);\n\n if (isVisible) {\n marker.props.position2D = position;\n\n if (marker.isSvg()) {\n let transform = `translate(${position.x}, ${position.y})`;\n if (scale !== 1) {\n transform += ` scale(${scale}, ${scale})`;\n }\n\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n let transform = `translate3D(${position.x}px, ${position.y}px, 0px)`;\n if (scale !== 1) {\n transform += ` scale(${scale}, ${scale})`;\n }\n\n marker.$el.style.transform = transform;\n }\n }\n }\n\n marker.props.inViewport = isVisible;\n utils.toggleClass(marker.$el, 'psv-marker--visible', isVisible);\n\n if (marker.props.inViewport && (this.prop.showAllTooltips || (marker === this.prop.hoveringMarker && !marker.isPoly()))) {\n marker.showTooltip();\n }\n else if (!marker.props.inViewport || marker !== this.prop.hoveringMarker) {\n marker.hideTooltip();\n }\n });\n }\n\n /**\n * @summary Determines if a point marker is visible
    \n * It tests if the point is in the general direction of the camera, then check if it's in the viewport\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.Point} position\n * @returns {boolean}\n * @private\n */\n __isMarkerVisible(marker, position) {\n return marker.props.positions3D[0].dot(this.psv.prop.direction) > 0\n && position.x + marker.props.width >= 0\n && position.x - marker.props.width <= this.psv.prop.size.width\n && position.y + marker.props.height >= 0\n && position.y - marker.props.height <= this.psv.prop.size.height;\n }\n\n /**\n * @summary Computes the real size of a marker\n * @description This is done by removing all it's transformations (if any) and making it visible\n * before querying its bounding rect\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __updateMarkerSize(marker) {\n utils.addClasses(marker.$el, 'psv-marker--transparent');\n\n let transform;\n if (marker.isSvg()) {\n transform = marker.$el.getAttributeNS(null, 'transform');\n marker.$el.removeAttributeNS(null, 'transform');\n }\n else {\n transform = marker.$el.style.transform;\n marker.$el.style.transform = '';\n }\n\n const rect = marker.$el.getBoundingClientRect();\n marker.props.width = rect.width;\n marker.props.height = rect.height;\n\n utils.removeClasses(marker.$el, 'psv-marker--transparent');\n\n if (transform) {\n if (marker.isSvg()) {\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n marker.$el.style.transform = transform;\n }\n }\n\n // the size is no longer dynamic once known\n marker.props.dynamicSize = false;\n }\n\n /**\n * @summary Computes viewer coordinates of a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {number} [scale=1]\n * @returns {PSV.Point}\n * @private\n */\n __getMarkerPosition(marker, scale = 1) {\n if (marker.isPoly()) {\n return this.psv.dataHelper.vector3ToViewerCoords(this.psv.dataHelper.sphericalCoordsToVector3(marker.props.position));\n }\n else {\n const position = this.psv.dataHelper.vector3ToViewerCoords(marker.props.positions3D[0]);\n\n position.x -= marker.props.width * marker.props.anchor.x * scale;\n position.y -= marker.props.height * marker.props.anchor.y * scale;\n\n return position;\n }\n }\n\n /**\n * @summary Computes viewer coordinates of each point of a polygon/polyline
    \n * It handles points behind the camera by creating intermediary points suitable for the projector\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point[]}\n * @private\n */\n __getPolyPositions(marker) {\n const nbVectors = marker.props.positions3D.length;\n\n // compute if each vector is visible\n const positions3D = marker.props.positions3D.map((vector) => {\n return {\n vector : vector,\n visible: vector.dot(this.psv.prop.direction) > 0,\n };\n });\n\n // get pairs of visible/invisible vectors for each invisible vector connected to a visible vector\n const toBeComputed = [];\n positions3D.forEach((pos, i) => {\n if (!pos.visible) {\n const neighbours = [\n i === 0 ? positions3D[nbVectors - 1] : positions3D[i - 1],\n i === nbVectors - 1 ? positions3D[0] : positions3D[i + 1],\n ];\n\n neighbours.forEach((neighbour) => {\n if (neighbour.visible) {\n toBeComputed.push({\n visible : neighbour,\n invisible: pos,\n index : i,\n });\n }\n });\n }\n });\n\n // compute intermediary vector for each pair (the loop is reversed for splice to insert at the right place)\n toBeComputed.reverse().forEach((pair) => {\n positions3D.splice(pair.index, 0, {\n vector : this.__getPolyIntermediaryPoint(pair.visible.vector, pair.invisible.vector),\n visible: true,\n });\n });\n\n // translate vectors to screen pos\n return positions3D\n .filter(pos => pos.visible)\n .map(pos => this.psv.dataHelper.vector3ToViewerCoords(pos.vector));\n }\n\n /**\n * Given one point in the same direction of the camera and one point behind the camera,\n * computes an intermediary point on the great circle delimiting the half sphere visible by the camera.\n * The point is shifted by .01 rad because the projector cannot handle points exactly on this circle.\n * TODO : does not work with fisheye view (must not use the great circle)\n * {@link http://math.stackexchange.com/a/1730410/327208}\n * @param P1 {external:THREE.Vector3}\n * @param P2 {external:THREE.Vector3}\n * @returns {external:THREE.Vector3}\n * @private\n */\n __getPolyIntermediaryPoint(P1, P2) {\n const C = this.psv.prop.direction.clone().normalize();\n const N = new THREE.Vector3().crossVectors(P1, P2).normalize();\n const V = new THREE.Vector3().crossVectors(N, P1).normalize();\n const X = P1.clone().multiplyScalar(-C.dot(V));\n const Y = V.clone().multiplyScalar(C.dot(P1));\n const H = new THREE.Vector3().addVectors(X, Y).normalize();\n const a = new THREE.Vector3().crossVectors(H, C);\n return H.applyAxisAngle(a, 0.01).multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n }\n\n /**\n * @summary Returns the marker associated to an event target\n * @param {EventTarget} target\n * @param {boolean} [closest=false]\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @private\n */\n __getTargetMarker(target, closest = false) {\n const target2 = closest ? utils.getClosest(target, '.psv-marker') : target;\n return target2 ? target2[MarkersPlugin.MARKER_DATA] : undefined;\n }\n\n /**\n * @summary Checks if an event target is in the tooltip\n * @param {EventTarget} target\n * @param {PSV.components.Tooltip} tooltip\n * @returns {boolean}\n * @private\n */\n __targetOnTooltip(target, tooltip) {\n return target && tooltip ? utils.hasParent(target, tooltip.container) : false;\n }\n\n /**\n * @summary Handles mouse enter events, show the tooltip for non polygon markers\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseEnter(e) {\n const marker = this.__getTargetMarker(e.target);\n\n if (marker && !marker.isPoly()) {\n this.prop.hoveringMarker = marker;\n\n /**\n * @event over-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor hover a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.OVER_MARKER, marker);\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n }\n\n /**\n * @summary Handles mouse leave events, hide the tooltip\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @private\n */\n __onMouseLeave(e) {\n const marker = this.__getTargetMarker(e.target);\n\n // do not hide if we enter the tooltip itself while hovering a polygon\n if (marker && !(marker.isPoly() && this.__targetOnTooltip(e.relatedTarget, marker.tooltip))) {\n /**\n * @event leave-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor away from a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.LEAVE_MARKER, marker);\n\n this.prop.hoveringMarker = null;\n\n if (!this.prop.showAllTooltips) {\n marker.hideTooltip();\n }\n }\n }\n\n /**\n * @summary Handles mouse move events, refreshUi the tooltip for polygon markers\n * @param {MouseEvent} e\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseMove(e) {\n let marker;\n const targetMarker = this.__getTargetMarker(e.target);\n\n if (targetMarker?.isPoly()) {\n marker = targetMarker;\n }\n // do not hide if we enter the tooltip itself while hovering a polygon\n else if (this.prop.hoveringMarker && this.__targetOnTooltip(e.target, this.prop.hoveringMarker.tooltip)) {\n marker = this.prop.hoveringMarker;\n }\n\n if (marker) {\n if (!this.prop.hoveringMarker) {\n this.trigger(MarkersPlugin.EVENTS.OVER_MARKER, marker);\n\n this.prop.hoveringMarker = marker;\n }\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n else if (this.prop.hoveringMarker?.isPoly()) {\n this.trigger(MarkersPlugin.EVENTS.LEAVE_MARKER, this.prop.hoveringMarker);\n\n if (!this.prop.showAllTooltips) {\n this.prop.hoveringMarker.hideTooltip();\n }\n\n this.prop.hoveringMarker = null;\n }\n }\n\n /**\n * @summary Handles context menu events\n * @param {MouseWheelEvent} evt\n * @private\n */\n __onContextMenu(evt) {\n if (!utils.getClosest(evt.target, '.psv-marker')) {\n return true;\n }\n\n evt.preventDefault();\n return false;\n }\n\n /**\n * @summary Handles mouse click events, select the marker and open the panel if necessary\n * @param {Event} e\n * @param {Object} data\n * @param {boolean} dblclick\n * @fires PSV.plugins.MarkersPlugin.select-marker\n * @fires PSV.plugins.MarkersPlugin.unselect-marker\n * @private\n */\n __onClick(e, data, dblclick) {\n const marker = this.__getTargetMarker(data.target, true);\n\n if (marker) {\n this.prop.currentMarker = marker;\n\n /**\n * @event select-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler\n * with {@link PSV.plugins.MarkersPlugin.getCurrentMarker}\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.plugins.MarkersPlugin.SelectMarkerData} data\n */\n this.trigger(MarkersPlugin.EVENTS.SELECT_MARKER, marker, {\n dblclick : dblclick,\n rightclick: data.rightclick,\n });\n\n if (this.config.clickEventOnMarker) {\n // add the marker to event data\n data.marker = marker;\n }\n else {\n e.stopPropagation();\n }\n\n // the marker could have been deleted in an event handler\n if (this.markers[marker.id]) {\n this.showMarkerPanel(marker.id);\n }\n }\n else if (this.prop.currentMarker) {\n /**\n * @event unselect-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker was selected and the user clicks elsewhere\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n this.trigger(MarkersPlugin.EVENTS.UNSELECT_MARKER, this.prop.currentMarker);\n\n this.psv.panel.hide(MarkersPlugin.ID_PANEL_MARKER);\n\n this.prop.currentMarker = null;\n }\n }\n\n /**\n * @summary Updates the visiblity of the panel and the buttons\n * @private\n */\n __refreshUi() {\n const nbMarkers = this.getNbMarkers();\n const markersButton = this.psv.navbar.getButton(MarkersButton.id, false);\n const markersListButton = this.psv.navbar.getButton(MarkersListButton.id, false);\n\n if (nbMarkers === 0) {\n markersButton?.hide();\n markersListButton?.hide();\n\n if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKERS_LIST)) {\n this.psv.panel.hide();\n }\n else if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKER)) {\n this.psv.panel.hide();\n }\n }\n else {\n markersButton?.show();\n markersListButton?.show();\n\n if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKERS_LIST)) {\n this.showMarkersList();\n }\n else if (this.psv.panel.isVisible(MarkersPlugin.ID_PANEL_MARKER)) {\n this.prop.currentMarker ? this.showMarkerPanel(this.prop.currentMarker) : this.psv.panel.hide();\n }\n }\n }\n\n}\n"],"names":["greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","utils","greatArcDistance","CONSTANTS","SPHERE_RADIUS","a","Math","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","sum","reduce","intermediary","point","length","getPolylineCenter","polyline","lengths","i","l","push","consumed","round","MARKER_TYPES","image","html","polygonPx","polygonRad","polylinePx","polylineRad","square","rect","circle","ellipse","path","Marker","properties","psv","id","PSVError","width","height","type","getType","visible","$el","config","data","undefined","tooltip","props","inViewport","dynamicSize","anchor","position","position2D","positions3D","def","isNormal","document","createElement","isPolygon","createElementNS","MarkersPlugin","SVG_NS","isPolyline","MARKER_DATA","update","destroy","isPoly","isPolyPx","isPolyRad","isSvg","getScale","zoomLevel","Array","isArray","scale","EASINGS","inQuad","getListContent","listContent","content","showTooltip","mousePosition","boundingRect","container","getBoundingClientRect","box","size","arrow","top","clientY","left","clientX","move","create","hideTooltip","hide","newType","deepmerge","setAttribute","className","addClasses","style","parsePosition","__updateNormal","__updatePoly","__updateSvg","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","d","each","value","prop","setAttributeNS","svgStyle","dasherize","fill","actualPoly","splice","map","coord","sphericalCoords","textureCoordsToSphericalCoords","longitude","latitude","parseAngle","centroid","allowNone","found","Object","keys","join","MarkersButton","navbar","plugin","getPlugin","on","EVENTS","SHOW_MARKERS","HIDE_MARKERS","toggleActive","off","isSupported","handleEvent","e","onClick","show","AbstractButton","icon","pin","MarkersListButton","OPEN_PANEL","CLOSE_PANEL","args","ID_PANEL_MARKERS_LIST","toggleMarkersList","pinList","DEFAULTS","indexOf","lang","registerButton","options","cursor","mousemove","appendChild","markers","currentMarker","hoveringMarker","clickEventOnMarker","svgContainer","addEventListener","CLICK","DOUBLE_CLICK","RENDER","CONFIG_CHANGED","once","READY","setMarkers","clearMarkers","removeEventListener","removeChild","__onMouseEnter","__onMouseLeave","__onMouseMove","__onContextMenu","__onClick","renderMarkers","trigger","toggleAllTooltips","showAllTooltips","hideAllTooltips","getNbMarkers","addMarker","render","marker","__refreshUi","getMarker","markerId","getCurrentMarker","updateMarker","removeMarker","markerOrId","gotoMarker","speed","animate","then","GOTO_MARKER_DONE","hideMarker","showMarker","toggleMarker","panel","contentId","hideMarkersList","showMarkersList","showMarkerPanel","ID_PANEL_MARKER","hideList","change","RENDER_MARKERS_LIST","MARKERS_LIST_TEMPLATE","noMargin","clickHandler","li","target","getClosest","dataset","SELECT_MARKER_LIST","isVisible","positions","__getPolyPositions","__getMarkerPosition","points","pos","__updateMarkerSize","getZoomLevel","__isMarkerVisible","transform","toggleClass","dot","direction","getAttributeNS","removeAttributeNS","removeClasses","vector3ToViewerCoords","nbVectors","vector","toBeComputed","forEach","neighbours","neighbour","invisible","index","reverse","pair","__getPolyIntermediaryPoint","filter","P1","P2","C","clone","normalize","N","THREE","crossVectors","V","X","multiplyScalar","Y","H","addVectors","applyAxisAngle","__getTargetMarker","closest","target2","__targetOnTooltip","hasParent","OVER_MARKER","relatedTarget","LEAVE_MARKER","targetMarker","evt","preventDefault","dblclick","SELECT_MARKER","rightclick","stopPropagation","UNSELECT_MARKER","nbMarkers","markersButton","getButton","markersListButton","AbstractPlugin","title","dataKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EACO,SAASA,yBAAT,CAAmCC,EAAnC,EAAuCC,EAAvC,EAA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;EATGrF,cA0BZC,SAAS;EA1BGD,cAiCZG,cAAc;EAjCFH,cAwCZkK,kBAAkB;EAxCNlK,cA+CZqG,wBAAwB;;EA/CZrG,cAwDZsK,wBAAwB,UAACtD,OAAD,EAAU+H,KAAV,EAAiBC,OAAjB;EAAA,8GAEIjJ,IAFJ,SAEYgJ,KAFZ,yDAI3B/H,OAAO,CAAC9C,GAAR,CAAY,UAAA2E,MAAM;EAAA,+BACTmG,OADS,WACGnG,MAAM,CAAC9J,MAAP,CAAcR,EADjB,kDAEhBsK,MAAM,CAAClK,IAAP,KAAgB,OAAhB,6DAA+EkK,MAAM,CAAC9J,MAAP,CAActB,KAA7F,mBAAiH,EAFjG,2DAGwBoL,MAAM,CAAC5H,cAAP,EAHxB;EAAA,GAAlB,EAKC6D,IALD,CAKM,EALN,CAJ2B;EAAA;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/resolution.js b/dist/plugins/resolution.js index 4b1883efa..b3d797754 100644 --- a/dist/plugins/resolution.js +++ b/dist/plugins/resolution.js @@ -1,17 +1,15 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer'), require('photo-sphere-viewer/dist/plugins/settings')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'photo-sphere-viewer/dist/plugins/settings'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.ResolutionPlugin = factory(global.PhotoSphereViewer, global.PhotoSphereViewer.SettingsPlugin))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.ResolutionPlugin = factory(global.PhotoSphereViewer, global.PhotoSphereViewer.SettingsPlugin))); }(this, (function (photoSphereViewer, SettingsPlugin) { 'use strict'; - SettingsPlugin = SettingsPlugin && Object.prototype.hasOwnProperty.call(SettingsPlugin, 'default') ? SettingsPlugin['default'] : SettingsPlugin; - function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; @@ -114,7 +112,7 @@ type: 'options', label: _this.psv.config.lang.resolution, current: function current() { - return _this.prop.resolution ? _this.resolutionsById[_this.prop.resolution].label : ''; + return _this.prop.resolution; }, options: function options() { return _this.__getSettingsOptions(); @@ -149,7 +147,7 @@ _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, _assertThisInitialized(_this)); - if (options == null ? void 0 : options.resolutions) { + if (options != null && options.resolutions) { _this.setResolutions(options.resolutions); } @@ -252,13 +250,9 @@ ; _proto.__getSettingsOptions = function __getSettingsOptions() { - var _this4 = this; - return this.resolutions.map(function (resolution) { return { - type: 'button', id: resolution.id, - active: resolution.id === _this4.prop.resolution, label: resolution.label }; }); diff --git a/dist/plugins/resolution.js.map b/dist/plugins/resolution.js.map index d4c26e426..caf0e1af9 100644 --- a/dist/plugins/resolution.js.map +++ b/dist/plugins/resolution.js.map @@ -1 +1 @@ -{"version":3,"file":"resolution.js","sources":["../../src/plugins/resolution/utils.js","../../src/plugins/resolution/index.js"],"sourcesContent":["/**\n * @summary Returns deep equality between objects\n * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9}\n * @param obj1\n * @param obj2\n * @return {boolean}\n * @private\n */\nexport function deepEqual(obj1, obj2) {\n if (obj1 === obj2) {\n return true;\n }\n else if (isObject(obj1) && isObject(obj2)) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop of Object.keys(obj1)) {\n if (!deepEqual(obj1[prop], obj2[prop])) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object' && obj != null;\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError } from 'photo-sphere-viewer';\nimport SettingsPlugin from 'photo-sphere-viewer/dist/plugins/settings';\nimport { deepEqual } from './utils';\n\n\nDEFAULTS.lang.resolution = 'Quality';\n\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution\n * @property {string} id\n * @property {string} label\n * @property {string|string[]|PSV.Cubemap} panorama\n */\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Options\n * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions\n */\n\n/**\n * @summary Adds a setting to choose between multiple resolutions of the panorama.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class ResolutionPlugin extends AbstractPlugin {\n\n static id = 'resolution';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.ResolutionPlugin\n * @constant\n */\n static EVENTS = {\n /**\n * @event resolution-changed\n * @memberof PSV.plugins.ResolutionPlugin\n * @summary Triggered when the resolution is changed\n * @param {string} resolutionId\n */\n RESOLUTION_CHANGED: 'resolution-changed',\n };\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.ResolutionPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @readonly\n * @private\n */\n this.settings = SettingsPlugin ? psv.getPlugin(SettingsPlugin) : null;\n\n if (!this.settings) {\n throw new PSVError('Resolution plugin requires the Settings plugin');\n }\n\n this.settings.addSetting({\n id : ResolutionPlugin.id,\n type : 'options',\n label : this.psv.config.lang.resolution,\n current: () => (this.prop.resolution ? this.resolutionsById[this.prop.resolution].label : ''),\n options: () => this.__getSettingsOptions(),\n apply : resolution => this.setResolution(resolution),\n });\n\n /**\n * @summary Available resolutions\n * @member {PSV.plugins.ResolutionPlugin.Resolution[]}\n */\n this.resolutions = [];\n\n /**\n * @summary Available resolutions\n * @member {Object.}\n * @private\n */\n this.resolutionsById = {};\n\n /**\n * @type {Object}\n * @property {string} resolution - Current resolution\n * @private\n */\n this.prop = {\n resolution: null,\n };\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n if (options?.resolutions) {\n this.setResolutions(options.resolutions);\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n this.settings.removeSetting(SettingsPlugin.id);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) {\n this.__refreshResolution();\n }\n }\n\n /**\n * @summary Changes the available resolutions\n * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions\n */\n setResolutions(resolutions) {\n this.resolutions = resolutions;\n this.resolutionsById = {};\n\n resolutions.forEach((resolution) => {\n if (!resolution.id) {\n throw new PSVError('Missing resolution id');\n }\n this.resolutionsById[resolution.id] = resolution;\n });\n\n this.__refreshResolution();\n }\n\n /**\n * @summary Changes the current resolution\n * @param {string} id\n */\n setResolution(id) {\n if (!this.resolutionsById[id]) {\n throw new PSVError(`Resolution ${id} unknown`);\n }\n\n return this.psv.setPanorama(this.resolutionsById[id].panorama, { transition: false, showLoader: false });\n }\n\n /**\n * @summary Returns the current resolution\n * @return {string}\n */\n getResolution() {\n return this.prop.resolution;\n }\n\n /**\n * @summary Updates current resolution on panorama load\n * @private\n */\n __refreshResolution() {\n const resolution = this.resolutions.find(r => deepEqual(this.psv.config.panorama, r.panorama));\n if (this.prop.resolution !== resolution?.id) {\n this.prop.resolution = resolution?.id;\n this.trigger(ResolutionPlugin.EVENTS.RESOLUTION_CHANGED, this.prop.resolution);\n }\n }\n\n /**\n * @summary Returns options for Settings plugin\n * @return {PSV.plugins.SettingsPlugin.Option[]}\n * @private\n */\n __getSettingsOptions() {\n return this.resolutions\n .map(resolution => ({\n type : 'button',\n id : resolution.id,\n active: resolution.id === this.prop.resolution,\n label : resolution.label,\n }));\n }\n\n}\n"],"names":["deepEqual","obj1","obj2","isObject","Object","keys","length","prop","obj","DEFAULTS","lang","resolution","ResolutionPlugin","psv","options","settings","SettingsPlugin","getPlugin","PSVError","addSetting","id","type","label","config","current","resolutionsById","__getSettingsOptions","apply","setResolution","resolutions","on","CONSTANTS","EVENTS","PANORAMA_LOADED","setResolutions","destroy","off","removeSetting","handleEvent","e","__refreshResolution","forEach","setPanorama","panorama","transition","showLoader","getResolution","find","r","trigger","RESOLUTION_CHANGED","map","active","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;EAQO,SAASA,SAAT,CAAmBC,IAAnB,EAAyBC,IAAzB,EAA+B;EACpC,MAAID,IAAI,KAAKC,IAAb,EAAmB;EACjB,WAAO,IAAP;EACD,GAFD,MAGK,IAAIC,QAAQ,CAACF,IAAD,CAAR,IAAkBE,QAAQ,CAACD,IAAD,CAA9B,EAAsC;EACzC,QAAIE,MAAM,CAACC,IAAP,CAAYJ,IAAZ,EAAkBK,MAAlB,KAA6BF,MAAM,CAACC,IAAP,CAAYH,IAAZ,EAAkBI,MAAnD,EAA2D;EACzD,aAAO,KAAP;EACD;;EACD,oCAAmBF,MAAM,CAACC,IAAP,CAAYJ,IAAZ,CAAnB,kCAAsC;EAAjC,UAAMM,IAAI,mBAAV;;EACH,UAAI,CAACP,SAAS,CAACC,IAAI,CAACM,IAAD,CAAL,EAAaL,IAAI,CAACK,IAAD,CAAjB,CAAd,EAAwC;EACtC,eAAO,KAAP;EACD;EACF;;EACD,WAAO,IAAP;EACD,GAVI,MAWA;EACH,WAAO,KAAP;EACD;EACF;;EAED,SAASJ,QAAT,CAAkBK,GAAlB,EAAuB;EACrB,SAAO,OAAOA,GAAP,KAAe,QAAf,IAA2BA,GAAG,IAAI,IAAzC;EACD;;ACzBDC,4BAAQ,CAACC,IAAT,CAAcC,UAAd,GAA2B,SAA3B;EAGA;;;;;;;EAOA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+BAAsB;EAAA;;EACpB,QAAM7B,UAAU,GAAG,KAAKkB,WAAL,CAAiBkB,IAAjB,CAAsB,UAAAC,CAAC;EAAA,aAAIhD,SAAS,CAAC,MAAI,CAACa,GAAL,CAASU,MAAT,CAAgBoB,QAAjB,EAA2BK,CAAC,CAACL,QAA7B,CAAb;EAAA,KAAvB,CAAnB;;EACA,QAAI,KAAKpC,IAAL,CAAUI,UAAV,MAAyBA,UAAzB,oBAAyBA,UAAU,CAAES,EAArC,CAAJ,EAA6C;EAC3C,WAAKb,IAAL,CAAUI,UAAV,GAAuBA,UAAvB,oBAAuBA,UAAU,CAAES,EAAnC;EACA,WAAK6B,OAAL,CAAarC,gBAAgB,CAACoB,MAAjB,CAAwBkB,kBAArC,EAAyD,KAAK3C,IAAL,CAAUI,UAAnE;EACD;EACF;EAED;;;;;;;WAKAe,uBAAA,gCAAuB;EAAA;;EACrB,WAAO,KAAKG,WAAL,CACJsB,GADI,CACA,UAAAxC,UAAU;EAAA,aAAK;EAClBU,QAAAA,IAAI,EAAI,QADU;EAElBD,QAAAA,EAAE,EAAMT,UAAU,CAACS,EAFD;EAGlBgC,QAAAA,MAAM,EAAEzC,UAAU,CAACS,EAAX,KAAkB,MAAI,CAACb,IAAL,CAAUI,UAHlB;EAIlBW,QAAAA,KAAK,EAAGX,UAAU,CAACW;EAJD,OAAL;EAAA,KADV,CAAP;EAOD;;;IAjK2C+B;;EAAzBzC,iBAEZQ,KAAK;EAFOR,iBAUZoB,SAAS;EACd;;;;;;EAMAkB,EAAAA,kBAAkB,EAAE;EAPN;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"resolution.js","sources":["../../src/plugins/resolution/utils.js","../../src/plugins/resolution/index.js"],"sourcesContent":["/**\n * @summary Returns deep equality between objects\n * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9}\n * @param obj1\n * @param obj2\n * @return {boolean}\n * @private\n */\nexport function deepEqual(obj1, obj2) {\n if (obj1 === obj2) {\n return true;\n }\n else if (isObject(obj1) && isObject(obj2)) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop of Object.keys(obj1)) {\n if (!deepEqual(obj1[prop], obj2[prop])) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object' && obj != null;\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError } from 'photo-sphere-viewer';\nimport SettingsPlugin from 'photo-sphere-viewer/dist/plugins/settings';\nimport { deepEqual } from './utils';\n\n\nDEFAULTS.lang.resolution = 'Quality';\n\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution\n * @property {string} id\n * @property {string} label\n * @property {string|string[]|PSV.Cubemap} panorama\n */\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Options\n * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions\n */\n\n/**\n * @summary Adds a setting to choose between multiple resolutions of the panorama.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class ResolutionPlugin extends AbstractPlugin {\n\n static id = 'resolution';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.ResolutionPlugin\n * @constant\n */\n static EVENTS = {\n /**\n * @event resolution-changed\n * @memberof PSV.plugins.ResolutionPlugin\n * @summary Triggered when the resolution is changed\n * @param {string} resolutionId\n */\n RESOLUTION_CHANGED: 'resolution-changed',\n };\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.ResolutionPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @readonly\n * @private\n */\n this.settings = SettingsPlugin ? psv.getPlugin(SettingsPlugin) : null;\n\n if (!this.settings) {\n throw new PSVError('Resolution plugin requires the Settings plugin');\n }\n\n this.settings.addSetting({\n id : ResolutionPlugin.id,\n type : 'options',\n label : this.psv.config.lang.resolution,\n current: () => this.prop.resolution,\n options: () => this.__getSettingsOptions(),\n apply : resolution => this.setResolution(resolution),\n });\n\n /**\n * @summary Available resolutions\n * @member {PSV.plugins.ResolutionPlugin.Resolution[]}\n */\n this.resolutions = [];\n\n /**\n * @summary Available resolutions\n * @member {Object.}\n * @private\n */\n this.resolutionsById = {};\n\n /**\n * @type {Object}\n * @property {string} resolution - Current resolution\n * @private\n */\n this.prop = {\n resolution: null,\n };\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n if (options?.resolutions) {\n this.setResolutions(options.resolutions);\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n this.settings.removeSetting(SettingsPlugin.id);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) {\n this.__refreshResolution();\n }\n }\n\n /**\n * @summary Changes the available resolutions\n * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions\n */\n setResolutions(resolutions) {\n this.resolutions = resolutions;\n this.resolutionsById = {};\n\n resolutions.forEach((resolution) => {\n if (!resolution.id) {\n throw new PSVError('Missing resolution id');\n }\n this.resolutionsById[resolution.id] = resolution;\n });\n\n this.__refreshResolution();\n }\n\n /**\n * @summary Changes the current resolution\n * @param {string} id\n */\n setResolution(id) {\n if (!this.resolutionsById[id]) {\n throw new PSVError(`Resolution ${id} unknown`);\n }\n\n return this.psv.setPanorama(this.resolutionsById[id].panorama, { transition: false, showLoader: false });\n }\n\n /**\n * @summary Returns the current resolution\n * @return {string}\n */\n getResolution() {\n return this.prop.resolution;\n }\n\n /**\n * @summary Updates current resolution on panorama load\n * @private\n */\n __refreshResolution() {\n const resolution = this.resolutions.find(r => deepEqual(this.psv.config.panorama, r.panorama));\n if (this.prop.resolution !== resolution?.id) {\n this.prop.resolution = resolution?.id;\n this.trigger(ResolutionPlugin.EVENTS.RESOLUTION_CHANGED, this.prop.resolution);\n }\n }\n\n /**\n * @summary Returns options for Settings plugin\n * @return {PSV.plugins.SettingsPlugin.Option[]}\n * @private\n */\n __getSettingsOptions() {\n return this.resolutions\n .map(resolution => ({\n id : resolution.id,\n label: resolution.label,\n }));\n }\n\n}\n"],"names":["deepEqual","obj1","obj2","isObject","Object","keys","length","prop","obj","DEFAULTS","lang","resolution","ResolutionPlugin","psv","options","settings","SettingsPlugin","getPlugin","PSVError","addSetting","id","type","label","config","current","__getSettingsOptions","apply","setResolution","resolutions","resolutionsById","on","CONSTANTS","EVENTS","PANORAMA_LOADED","setResolutions","destroy","off","removeSetting","handleEvent","e","__refreshResolution","forEach","setPanorama","panorama","transition","showLoader","getResolution","find","r","trigger","RESOLUTION_CHANGED","map","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACO,SAASA,SAAT,CAAmBC,IAAnB,EAAyBC,IAAzB,EAA+B;EACpC,MAAID,IAAI,KAAKC,IAAb,EAAmB;EACjB,WAAO,IAAP;EACD,GAFD,MAGK,IAAIC,QAAQ,CAACF,IAAD,CAAR,IAAkBE,QAAQ,CAACD,IAAD,CAA9B,EAAsC;EACzC,QAAIE,MAAM,CAACC,IAAP,CAAYJ,IAAZ,EAAkBK,MAAlB,KAA6BF,MAAM,CAACC,IAAP,CAAYH,IAAZ,EAAkBI,MAAnD,EAA2D;EACzD,aAAO,KAAP;EACD;;EACD,oCAAmBF,MAAM,CAACC,IAAP,CAAYJ,IAAZ,CAAnB,kCAAsC;EAAjC,UAAMM,IAAI,mBAAV;;EACH,UAAI,CAACP,SAAS,CAACC,IAAI,CAACM,IAAD,CAAL,EAAaL,IAAI,CAACK,IAAD,CAAjB,CAAd,EAAwC;EACtC,eAAO,KAAP;EACD;EACF;;EACD,WAAO,IAAP;EACD,GAVI,MAWA;EACH,WAAO,KAAP;EACD;EACF;;EAED,SAASJ,QAAT,CAAkBK,GAA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AqBT,EAArB,EAAyBuB,QAA9C,EAAwD;EAAEC,MAAAA,UAAU,EAAE,KAAd;EAAqBC,MAAAA,UAAU,EAAE;EAAjC,KAAxD,CAAP;EACD;EAED;EACF;EACA;EACA;;;WACEC,gBAAA,yBAAgB;EACd,WAAO,KAAKvC,IAAL,CAAUI,UAAjB;EACD;EAED;EACF;EACA;EACA;;;WACE6B,sBAAA,+BAAsB;EAAA;;EACpB,QAAM7B,UAAU,GAAG,KAAKiB,WAAL,CAAiBmB,IAAjB,CAAsB,UAAAC,CAAC;EAAA,aAAIhD,SAAS,CAAC,MAAI,CAACa,GAAL,CAASU,MAAT,CAAgBoB,QAAjB,EAA2BK,CAAC,CAACL,QAA7B,CAAb;EAAA,KAAvB,CAAnB;;EACA,QAAI,KAAKpC,IAAL,CAAUI,UAAV,MAAyBA,UAAzB,oBAAyBA,UAAU,CAAES,EAArC,CAAJ,EAA6C;EAC3C,WAAKb,IAAL,CAAUI,UAAV,GAAuBA,UAAvB,oBAAuBA,UAAU,CAAES,EAAnC;EACA,WAAK6B,OAAL,CAAarC,gBAAgB,CAACoB,MAAjB,CAAwBkB,kBAArC,EAAyD,KAAK3C,IAAL,CAAUI,UAAnE;EACD;EACF;EAED;EACF;EACA;EACA;EACA;;;WACEc,uBAAA,gCAAuB;EACrB,WAAO,KAAKG,WAAL,CACJuB,GADI,CACA,UAAAxC,UAAU;EAAA,aAAK;EAClBS,QAAAA,EAAE,EAAKT,UAAU,CAACS,EADA;EAElBE,QAAAA,KAAK,EAAEX,UAAU,CAACW;EAFA,OAAL;EAAA,KADV,CAAP;EAKD;;;IA/J2C8B;;EAAzBxC,iBAEZQ,KAAK;EAFOR,iBAUZoB,SAAS;EACd;EACJ;EACA;EACA;EACA;EACA;EACIkB,EAAAA,kBAAkB,EAAE;EAPN;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/settings.css b/dist/plugins/settings.css index 83caee82d..5594cbdde 100644 --- a/dist/plugins/settings.css +++ b/dist/plugins/settings.css @@ -1,50 +1,9 @@ /*! - * Photo Sphere Viewer 4.0.7 + * Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine - * @copyright 2015-2020 Damien "Mistic" Sorel + * @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ -.psv-settings-title { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font: 24px sans-serif; - margin: 24px 0; -} - -.psv-settings-title svg { - width: 24px; - height: 24px; - margin: 0 12px; -} - -.psv-settings-list { - list-style: none; - margin: 0; - padding: 0; - overflow: hidden; -} - -.psv-settings-item { - clear: both; - min-height: 20px; - padding: 0.5em 1em; - cursor: pointer; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.psv-settings-item:hover { - background: rgba(255, 255, 255, 0.1); -} - .psv-settings-item-label { -webkit-box-flex: 1; -ms-flex: 1; diff --git a/dist/plugins/settings.css.map b/dist/plugins/settings.css.map index fe1eb4f97..af2b17e70 100644 --- a/dist/plugins/settings.css.map +++ b/dist/plugins/settings.css.map @@ -1 +1 @@ -{"version":3,"sources":["","style.scss%23sass","style.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,oBAAA;EAAA,oBAAA;EAAA,aAAA;EACA,yBAAA;MAAA,sBAAA;UAAA,mBAAA;EACA,qBAAA;EACA,cAAA;ACCF;;ADAE;EACE,WAAA;EACA,YAAA;ECGJ,cAAA;AACA;;ADDA;EACE,gBAAA;EACA,SAAA;ECIF,UAAA;EDFE,gBAAA;ACIF;;ADFA;EACE,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,oBAAA;EAAA,oBAAA;EAAA,aAAA;EACA,yBAAA;MAAA,sBAAA;UAAA,mBAAA;ACKF;;ADJE;EACE,oCAAA;ACOJ;;ADNE;EACE,mBAAA;MAAA,WAAA;UAAA,OAAA;EACA,iBAAA;ACSJ;;ADRE;EACE,mBAAA;MAAA,cAAA;UAAA,UAAA;ACWJ;;ADVE;EACE,mBAAA;MAAA,cAAA;UAAA,UAAA;EACA,WAAA;EACA,UAAA;ACaJ;;ADZI;EACE,UAAA;EACA,WAAA;ACeN;;ADdI;EACE,iBAAA;ACiBN;;ADhBI;EACE,gBAAA;ACmBN;;ADlBE;EACE,qCAAA;EACA,kBAAA;ACqBJ;;ADpBI;EACE,6BAAA;UAAA,qBAAA;ACuBN","file":"settings.css","sourcesContent":[null,".psv-settings-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 0; }\n .psv-settings-title svg {\n width: 24px;\n height: 24px;\n margin: 0 12px; }\n\n.psv-settings-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n\n.psv-settings-item {\n clear: both;\n min-height: 20px;\n padding: .5em 1em;\n cursor: pointer;\n display: flex;\n align-items: center; }\n .psv-settings-item:hover {\n background: rgba(255, 255, 255, 0.1); }\n .psv-settings-item-label {\n flex: 1;\n font-weight: bold; }\n .psv-settings-item-value {\n flex: none; }\n .psv-settings-item-icon {\n flex: none;\n height: 1em;\n width: 1em; }\n .psv-settings-item-icon svg {\n width: 1em;\n height: 1em; }\n .psv-settings-item-icon:first-child {\n margin-right: 1em; }\n .psv-settings-item-icon:last-child {\n margin-left: 1em; }\n .psv-settings-item--header {\n border-bottom: 1px solid currentColor;\n margin-bottom: 1em; }\n .psv-settings-item--header svg {\n transform: scaleX(-1); }\n",".psv-settings-title {\n display: flex;\n align-items: center;\n font: 24px sans-serif;\n margin: 24px 0; }\n .psv-settings-title svg {\n width: 24px;\n height: 24px;\n margin: 0 12px; }\n\n.psv-settings-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\n\n.psv-settings-item {\n clear: both;\n min-height: 20px;\n padding: .5em 1em;\n cursor: pointer;\n display: flex;\n align-items: center; }\n .psv-settings-item:hover {\n background: rgba(255, 255, 255, 0.1); }\n .psv-settings-item-label {\n flex: 1;\n font-weight: bold; }\n .psv-settings-item-value {\n flex: none; }\n .psv-settings-item-icon {\n flex: none;\n height: 1em;\n width: 1em; }\n .psv-settings-item-icon svg {\n width: 1em;\n height: 1em; }\n .psv-settings-item-icon:first-child {\n margin-right: 1em; }\n .psv-settings-item-icon:last-child {\n margin-left: 1em; }\n .psv-settings-item--header {\n border-bottom: 1px solid currentColor;\n margin-bottom: 1em; }\n .psv-settings-item--header svg {\n transform: scaleX(-1); }\n"]} \ No newline at end of file +{"version":3,"sources":["","style.scss%23sass","style.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,mBAAA;MAAA,WAAA;UAAA,OAAA;EACA,iBAAA;ACCF;;ADCA;EACE,mBAAA;MAAA,cAAA;UAAA,UAAA;ACEF;;ADAA;EACE,mBAAA;MAAA,cAAA;UAAA,UAAA;EACA,WAAA;EACA,UAAA;ACGF;;ADFE;EACE,UAAA;EACA,WAAA;ACKJ;;ADJE;EACE,iBAAA;ACOJ;;ADNE;EACE,gBAAA;ACSJ;;ADPA;EACE,qCAAA;EACA,kBAAA;ACUF;;ADTE;EACE,6BAAA;UAAA,qBAAA;ACYJ","file":"settings.css","sourcesContent":[null,".psv-settings-item-label {\n flex: 1;\n font-weight: bold; }\n\n.psv-settings-item-value {\n flex: none; }\n\n.psv-settings-item-icon {\n flex: none;\n height: 1em;\n width: 1em; }\n .psv-settings-item-icon svg {\n width: 1em;\n height: 1em; }\n .psv-settings-item-icon:first-child {\n margin-right: 1em; }\n .psv-settings-item-icon:last-child {\n margin-left: 1em; }\n\n.psv-settings-item--header {\n border-bottom: 1px solid currentColor;\n margin-bottom: 1em; }\n .psv-settings-item--header svg {\n transform: scaleX(-1); }\n",".psv-settings-item-label {\n flex: 1;\n font-weight: bold; }\n\n.psv-settings-item-value {\n flex: none; }\n\n.psv-settings-item-icon {\n flex: none;\n height: 1em;\n width: 1em; }\n .psv-settings-item-icon svg {\n width: 1em;\n height: 1em; }\n .psv-settings-item-icon:first-child {\n margin-right: 1em; }\n .psv-settings-item-icon:last-child {\n margin-left: 1em; }\n\n.psv-settings-item--header {\n border-bottom: 1px solid currentColor;\n margin-bottom: 1em; }\n .psv-settings-item--header svg {\n transform: scaleX(-1); }\n"]} \ No newline at end of file diff --git a/dist/plugins/settings.js b/dist/plugins/settings.js index 2ab7ddccf..8b7099cd9 100644 --- a/dist/plugins/settings.js +++ b/dist/plugins/settings.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.SettingsPlugin = factory(global.PhotoSphereViewer))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.SettingsPlugin = factory(global.PhotoSphereViewer))); }(this, (function (photoSphereViewer) { 'use strict'; function _inheritsLoose(subClass, superClass) { @@ -24,7 +24,7 @@ return self; } - var check = "\n"; + var check = "\n"; var chevron = "\n"; @@ -141,7 +141,7 @@ * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting * @summary Description of a 'options' setting * @property {'options'} type - type of the setting - * @property {function} current - function which returns the current value (human readable) + * @property {function} current - function which returns the current option id * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option} * @property {function} apply - function called with the id of the selected option */ @@ -159,7 +159,6 @@ * @summary Option of an 'option' setting * @property {string} id - identifier of the option * @property {string} label - label of the option - * @property {boolean} active - state of the option */ /** @@ -188,6 +187,7 @@ * @param {PSV.plugins.SettingsPlugin.Setting[]} settings * @param {string} title * @param {string} dataKey + * @param {function} optionsCurrent * @returns {string} */ @@ -200,6 +200,7 @@ * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting * @param {string} title * @param {string} dataKey + * @param {function} optionActive * @returns {string} */ @@ -309,7 +310,14 @@ this.psv.panel.show({ id: SettingsPlugin.ID_PANEL, - content: SettingsPlugin.SETTINGS_TEMPLATE(this.settings, this.psv.config.lang[SettingsButton.id], photoSphereViewer.utils.dasherize(SettingsPlugin.SETTING_DATA)), + content: SettingsPlugin.SETTINGS_TEMPLATE(this.settings, this.psv.config.lang[SettingsButton.id], photoSphereViewer.utils.dasherize(SettingsPlugin.SETTING_DATA), function (setting) { + // retrocompatibility with "current" returning a label + var current = setting.current(); + var option = setting.options().find(function (opt) { + return opt.id === current; + }); + return (option == null ? void 0 : option.label) || current; + }), noMargin: true, clickHandler: function clickHandler(e) { var li = e.target ? photoSphereViewer.utils.getClosest(e.target, 'li') : undefined; @@ -348,9 +356,13 @@ _proto.__showOptions = function __showOptions(setting) { var _this3 = this; + var current = setting.current(); this.psv.panel.show({ id: SettingsPlugin.ID_PANEL, - content: SettingsPlugin.SETTING_OPTIONS_TEMPLATE(setting, this.psv.config.lang[SettingsButton.id], photoSphereViewer.utils.dasherize(SettingsPlugin.SETTING_DATA)), + content: SettingsPlugin.SETTING_OPTIONS_TEMPLATE(setting, this.psv.config.lang[SettingsButton.id], photoSphereViewer.utils.dasherize(SettingsPlugin.SETTING_DATA), function (option) { + // retrocompatibility with options having an "active" flag + return 'active' in option ? option.active : option.id === current; + }), noMargin: true, clickHandler: function clickHandler(e) { var li = e.target ? photoSphereViewer.utils.getClosest(e.target, 'li') : undefined; @@ -374,25 +386,25 @@ SettingsPlugin.ID_PANEL = 'settings'; SettingsPlugin.SETTING_DATA = 'settingId'; - SettingsPlugin.SETTINGS_TEMPLATE = function (settings, title, dataKey) { - return "\n

    " + icon + " " + title + "

    \n
      \n " + settings.map(function (s) { - return "\n
    • \n " + SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s) + "\n
    • \n "; - }).join('') + "\n
    "; + SettingsPlugin.SETTINGS_TEMPLATE = function (settings, title, dataKey, optionsCurrent) { + return "\n
    \n

    " + icon + " " + title + "

    \n
      \n " + settings.map(function (s) { + return "\n
    • \n " + SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s, optionsCurrent) + "\n
    • \n "; + }).join('') + "\n
    \n
    \n"; }; SettingsPlugin.SETTINGS_TEMPLATE_ = { - options: function options(setting) { - return "\n " + setting.label + " \n " + setting.current() + " \n " + chevron + "\n "; + options: function options(setting, optionsCurrent) { + return "\n " + setting.label + " \n " + optionsCurrent(setting) + " \n " + chevron + "\n "; }, toggle: function toggle(setting) { return "\n " + setting.label + "\n " + (setting.active() ? switchOn : switchOff) + "\n "; } }; - SettingsPlugin.SETTING_OPTIONS_TEMPLATE = function (setting, title, dataKey) { - return "\n

    " + icon + " " + title + "

    \n
      \n
    • \n " + chevron + "\n " + setting.label + "\n
    • \n " + setting.options().map(function (s) { - return "\n
    • \n " + (s.active ? check : '') + "\n " + s.label + "\n
    • \n "; - }).join('') + "\n
    "; + SettingsPlugin.SETTING_OPTIONS_TEMPLATE = function (setting, title, dataKey, optionActive) { + return "\n
    \n

    " + icon + " " + title + "

    \n
      \n
    • \n " + chevron + "\n " + setting.label + "\n
    • \n " + setting.options().map(function (s) { + return "\n
    • \n " + (optionActive(s) ? check : '') + "\n " + s.label + "\n
    • \n "; + }).join('') + "\n
    \n"; }; return SettingsPlugin; diff --git a/dist/plugins/settings.js.map b/dist/plugins/settings.js.map index 42252053d..28cc4c7e9 100644 --- a/dist/plugins/settings.js.map +++ b/dist/plugins/settings.js.map @@ -1 +1 @@ -{"version":3,"file":"settings.js","sources":["../../src/plugins/settings/SettingsButton.js","../../src/plugins/settings/index.js"],"sourcesContent":["import { AbstractButton, CONSTANTS } from 'photo-sphere-viewer';\nimport SettingsPlugin from './index';\nimport icon from './settings.svg';\n\n/**\n * @summary Navigation bar settings button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class SettingsButton extends AbstractButton {\n\n static id = 'settings';\n static icon = icon;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-settings-button', true);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin(SettingsPlugin.id);\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === SettingsPlugin.ID_PANEL); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles settings\n */\n onClick() {\n this.plugin.toggleSettings();\n }\n\n}\n","import { AbstractPlugin, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport check from './check.svg';\nimport chevron from './chevron.svg';\nimport icon from './settings.svg';\nimport { SettingsButton } from './SettingsButton';\nimport './style.scss';\nimport switchOff from './switch-off.svg';\nimport switchOn from './switch-on.svg';\n\n\n// add settings button\nDEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf('fullscreen'), 0, SettingsButton.id);\nDEFAULTS.lang[SettingsButton.id] = 'Settings';\nregisterButton(SettingsButton);\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Setting\n * @summary Description of a setting\n * @property {string} id - identifier of the setting\n * @property {string} label - label of the setting\n * @property {'options' | 'toggle'} type - type of the setting\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting\n * @summary Description of a 'options' setting\n * @property {'options'} type - type of the setting\n * @property {function} current - function which returns the current value (human readable)\n * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option}\n * @property {function} apply - function called with the id of the selected option\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting\n * @summary Description of a 'toggle' setting\n * @property {'toggle'} type - type of the setting\n * @property {function} active - function which return whereas the setting is active or not\n * @property {function} toggle - function called when the setting is toggled\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Option\n * @summary Option of an 'option' setting\n * @property {string} id - identifier of the option\n * @property {string} label - label of the option\n * @property {boolean} active - state of the option\n */\n\n/**\n * @summary Adds a button to access various settings.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class SettingsPlugin extends AbstractPlugin {\n\n static id = 'settings';\n\n /**\n * @summary Panel identifier for settings content\n * @type {string}\n * @constant\n */\n static ID_PANEL = 'settings';\n\n /**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n */\n static SETTING_DATA = 'settingId';\n\n /**\n * @summary Settings list template\n * @param {PSV.plugins.SettingsPlugin.Setting[]} settings\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n */\n static SETTINGS_TEMPLATE = (settings, title, dataKey) => `\n

    ${icon} ${title}

    \n
      \n ${settings.map(s => `\n
    • \n ${SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s)}\n
    • \n `).join('')}\n
    `;\n\n /**\n * @summary Setting item template, by type\n */\n static SETTINGS_TEMPLATE_ = {\n options: setting => `\n ${setting.label} \n ${setting.current()} \n ${chevron}\n `,\n toggle : setting => `\n ${setting.label}\n ${setting.active() ? switchOn : switchOff}\n `,\n };\n\n /**\n * @summary Settings options template\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n */\n static SETTING_OPTIONS_TEMPLATE = (setting, title, dataKey) => `\n

    ${icon} ${title}

    \n
      \n
    • \n ${chevron}\n ${setting.label}\n
    • \n ${setting.options().map(s => `\n
    • \n ${s.active ? check : ''}\n ${s.label}\n
    • \n `).join('')}\n
    `;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Setting[]}\n * @private\n */\n this.settings = [];\n }\n\n /**\n * @package\n */\n destroy() {\n super.destroy();\n }\n\n /**\n * @summary Registers a new setting\n * @param {PSV.plugins.SettingsPlugin.Setting} setting\n */\n addSetting(setting) {\n if (!setting.id) {\n throw new PSVError('Missing setting id');\n }\n if (!setting.type) {\n throw new PSVError('Missing setting type');\n }\n if (!SettingsPlugin.SETTINGS_TEMPLATE_[setting.type]) {\n throw new PSVError('Unsupported setting type');\n }\n\n this.settings.push(setting);\n\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.showSettings();\n }\n }\n\n /**\n * @summary Removes a setting\n * @param {string} id\n */\n removeSetting(id) {\n let idx = -1;\n // FIXME use findIndex, one day, when IE11 is totally dead\n this.settings.some((setting, i) => {\n if (setting.id === id) {\n idx = i;\n return true;\n }\n return false;\n });\n if (idx !== -1) {\n this.settings.splice(idx, 1);\n\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.showSettings();\n }\n }\n }\n\n /**\n * @summary Toggles the settings panel\n */\n toggleSettings() {\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.hideSettings();\n }\n else {\n this.showSettings();\n }\n }\n\n /**\n * @summary Hides the settings panel\n */\n hideSettings() {\n this.psv.panel.hide(SettingsPlugin.ID_PANEL);\n }\n\n /**\n * @summary Shows the settings panel\n */\n showSettings() {\n this.psv.panel.show({\n id : SettingsPlugin.ID_PANEL,\n content : SettingsPlugin.SETTINGS_TEMPLATE(\n this.settings,\n this.psv.config.lang[SettingsButton.id],\n utils.dasherize(SettingsPlugin.SETTING_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const settingId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined;\n const setting = this.settings.find(s => s.id === settingId);\n\n if (setting) {\n switch (setting.type) {\n case 'toggle':\n setting.toggle();\n this.showSettings();\n break;\n\n case 'options':\n this.__showOptions(setting);\n break;\n\n default:\n // noop\n }\n }\n },\n });\n }\n\n /**\n * @summary Shows setting options panel\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @private\n */\n __showOptions(setting) {\n this.psv.panel.show({\n id : SettingsPlugin.ID_PANEL,\n content : SettingsPlugin.SETTING_OPTIONS_TEMPLATE(\n setting,\n this.psv.config.lang[SettingsButton.id],\n utils.dasherize(SettingsPlugin.SETTING_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const optionId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined;\n\n if (optionId === '__back') {\n this.showSettings();\n }\n else {\n setting.apply(optionId);\n this.hideSettings();\n }\n },\n });\n }\n\n}\n"],"names":["SettingsButton","navbar","plugin","psv","getPlugin","SettingsPlugin","id","on","CONSTANTS","EVENTS","OPEN_PANEL","CLOSE_PANEL","destroy","off","isSupported","handleEvent","e","type","toggleActive","args","ID_PANEL","onClick","toggleSettings","AbstractButton","icon","DEFAULTS","splice","indexOf","lang","registerButton","settings","addSetting","setting","PSVError","SETTINGS_TEMPLATE_","push","panel","prop","contentId","showSettings","removeSetting","idx","some","i","hideSettings","hide","show","content","SETTINGS_TEMPLATE","config","utils","dasherize","SETTING_DATA","noMargin","clickHandler","li","target","getClosest","undefined","settingId","dataset","find","s","toggle","__showOptions","SETTING_OPTIONS_TEMPLATE","optionId","apply","AbstractPlugin","title","dataKey","map","join","options","label","current","chevron","active","switchOn","switchOff","check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;;;;;;MAKaA,cAAb;EAAA;;EAKE;;;EAGA,0BAAYC,MAAZ,EAAoB;EAAA;;EAClB,uCAAMA,MAAN,EAAc,6CAAd,EAA6D,IAA7D;EAEA;;;;;;EAKA,UAAKC,MAAL,GAAc,MAAKC,GAAL,CAASC,SAAT,CAAmBC,cAAc,CAACC,EAAlC,CAAd;;EAEA,QAAI,MAAKJ,MAAT,EAAiB;EACf,YAAKC,GAAL,CAASI,EAAT,CAAYC,2BAAS,CAACC,MAAV,CAAiBC,UAA7B;;EACA,YAAKP,GAAL,CAASI,EAAT,CAAYC,2BAAS,CAACC,MAAV,CAAiBE,WAA7B;EACD;;EAbiB;EAcnB;EAED;;;;;EAxBF;;EAAA,SA2BEC,OA3BF,GA2BE,mBAAU;EACR,SAAKT,GAAL,CAASU,GAAT,CAAaL,2BAAS,CAACC,MAAV,CAAiBC,UAA9B,EAA0C,IAA1C;EACA,SAAKP,GAAL,CAASU,GAAT,CAAaL,2BAAS,CAACC,MAAV,CAAiBE,WAA9B,EAA2C,IAA3C;EAEA,WAAO,KAAKT,MAAZ;;EAEA,8BAAMU,OAAN;EACD;EAED;;;EApCF;;EAAA,SAuCEE,WAvCF,GAuCE,uBAAc;EACZ,WAAO,CAAC,CAAC,KAAKZ,MAAd;EACD;EAED;;;;;EA3CF;;EAAA,SAgDEa,WAhDF,GAgDE,qBAAYC,CAAZ,EAAe;EACb;EACA,YAAQA,CAAC,CAACC,IAAV;EACE;EACA,WAAKT,2BAAS,CAACC,MAAV,CAAiBC,UAAtB;EAAmC,aAAKQ,YAAL,CAAkBF,CAAC,CAACG,IAAF,CAAO,CAAP,MAAcd,cAAc,CAACe,QAA/C;EAA0D;;EAC7F,WAAKZ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AM,EAAG,gBAAA/B,OAAO;EAAA,gEAC0BA,OAAO,CAAC0C,KADlC,gEAE0B1C,OAAO,CAAC6C,MAAR,KAAmBC,QAAnB,GAA8BC,SAFxD;EAAA;EANU;;EAtCT1E,eAyDZ4D,2BAA2B,UAACjC,OAAD,EAAUqC,KAAV,EAAiBC,OAAjB;EAAA,iDACH9C,IADG,SACK6C,KADL,kHAG6BC,OAH7B,iEAIOM,OAJP,6DAKQ5C,OAAO,CAAC0C,KALhB,4BAOhC1C,OAAO,CAACyC,OAAR,GAAkBF,GAAlB,CAAsB,UAAAT,CAAC;EAAA,2DACcQ,OADd,WAC0BR,CAAC,CAACxD,EAD5B,2DAEkBwD,CAAC,CAACe,MAAF,GAAWG,KAAX,GAAmB,EAFrC,gEAGmBlB,CAAC,CAACY,KAHrB;EAAA,GAAvB,EAKCF,IALD,CAKM,EALN,CAPgC;EAAA;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"settings.js","sources":["../../src/plugins/settings/SettingsButton.js","../../src/plugins/settings/index.js"],"sourcesContent":["import { AbstractButton, CONSTANTS } from 'photo-sphere-viewer';\nimport SettingsPlugin from './index';\nimport icon from './settings.svg';\n\n/**\n * @summary Navigation bar settings button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class SettingsButton extends AbstractButton {\n\n static id = 'settings';\n static icon = icon;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-settings-button', true);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin(SettingsPlugin.id);\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === SettingsPlugin.ID_PANEL); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles settings\n */\n onClick() {\n this.plugin.toggleSettings();\n }\n\n}\n","import { AbstractPlugin, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport check from './check.svg';\nimport chevron from './chevron.svg';\nimport icon from './settings.svg';\nimport { SettingsButton } from './SettingsButton';\nimport './style.scss';\nimport switchOff from './switch-off.svg';\nimport switchOn from './switch-on.svg';\n\n\n// add settings button\nDEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf('fullscreen'), 0, SettingsButton.id);\nDEFAULTS.lang[SettingsButton.id] = 'Settings';\nregisterButton(SettingsButton);\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Setting\n * @summary Description of a setting\n * @property {string} id - identifier of the setting\n * @property {string} label - label of the setting\n * @property {'options' | 'toggle'} type - type of the setting\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting\n * @summary Description of a 'options' setting\n * @property {'options'} type - type of the setting\n * @property {function} current - function which returns the current option id\n * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option}\n * @property {function} apply - function called with the id of the selected option\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting\n * @summary Description of a 'toggle' setting\n * @property {'toggle'} type - type of the setting\n * @property {function} active - function which return whereas the setting is active or not\n * @property {function} toggle - function called when the setting is toggled\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Option\n * @summary Option of an 'option' setting\n * @property {string} id - identifier of the option\n * @property {string} label - label of the option\n */\n\n/**\n * @summary Adds a button to access various settings.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class SettingsPlugin extends AbstractPlugin {\n\n static id = 'settings';\n\n /**\n * @summary Panel identifier for settings content\n * @type {string}\n * @constant\n */\n static ID_PANEL = 'settings';\n\n /**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n */\n static SETTING_DATA = 'settingId';\n\n /**\n * @summary Settings list template\n * @param {PSV.plugins.SettingsPlugin.Setting[]} settings\n * @param {string} title\n * @param {string} dataKey\n * @param {function} optionsCurrent\n * @returns {string}\n */\n static SETTINGS_TEMPLATE = (settings, title, dataKey, optionsCurrent) => `\n
    \n

    ${icon} ${title}

    \n
      \n ${settings.map(s => `\n
    • \n ${SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s, optionsCurrent)}\n
    • \n `).join('')}\n
    \n
    \n`;\n\n /**\n * @summary Setting item template, by type\n */\n static SETTINGS_TEMPLATE_ = {\n options: (setting, optionsCurrent) => `\n ${setting.label} \n ${optionsCurrent(setting)} \n ${chevron}\n `,\n toggle : setting => `\n ${setting.label}\n ${setting.active() ? switchOn : switchOff}\n `,\n };\n\n /**\n * @summary Settings options template\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {string} title\n * @param {string} dataKey\n * @param {function} optionActive\n * @returns {string}\n */\n static SETTING_OPTIONS_TEMPLATE = (setting, title, dataKey, optionActive) => `\n
    \n

    ${icon} ${title}

    \n
      \n
    • \n ${chevron}\n ${setting.label}\n
    • \n ${setting.options().map(s => `\n
    • \n ${optionActive(s) ? check : ''}\n ${s.label}\n
    • \n `).join('')}\n
    \n`;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Setting[]}\n * @private\n */\n this.settings = [];\n }\n\n /**\n * @package\n */\n destroy() {\n super.destroy();\n }\n\n /**\n * @summary Registers a new setting\n * @param {PSV.plugins.SettingsPlugin.Setting} setting\n */\n addSetting(setting) {\n if (!setting.id) {\n throw new PSVError('Missing setting id');\n }\n if (!setting.type) {\n throw new PSVError('Missing setting type');\n }\n if (!SettingsPlugin.SETTINGS_TEMPLATE_[setting.type]) {\n throw new PSVError('Unsupported setting type');\n }\n\n this.settings.push(setting);\n\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.showSettings();\n }\n }\n\n /**\n * @summary Removes a setting\n * @param {string} id\n */\n removeSetting(id) {\n let idx = -1;\n // FIXME use findIndex, one day, when IE11 is totally dead\n this.settings.some((setting, i) => {\n if (setting.id === id) {\n idx = i;\n return true;\n }\n return false;\n });\n if (idx !== -1) {\n this.settings.splice(idx, 1);\n\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.showSettings();\n }\n }\n }\n\n /**\n * @summary Toggles the settings panel\n */\n toggleSettings() {\n if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) {\n this.hideSettings();\n }\n else {\n this.showSettings();\n }\n }\n\n /**\n * @summary Hides the settings panel\n */\n hideSettings() {\n this.psv.panel.hide(SettingsPlugin.ID_PANEL);\n }\n\n /**\n * @summary Shows the settings panel\n */\n showSettings() {\n this.psv.panel.show({\n id : SettingsPlugin.ID_PANEL,\n content : SettingsPlugin.SETTINGS_TEMPLATE(\n this.settings,\n this.psv.config.lang[SettingsButton.id],\n utils.dasherize(SettingsPlugin.SETTING_DATA),\n (setting) => { // retrocompatibility with \"current\" returning a label\n const current = setting.current();\n const option = setting.options().find(opt => opt.id === current);\n return option?.label || current;\n }\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const settingId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined;\n const setting = this.settings.find(s => s.id === settingId);\n\n if (setting) {\n switch (setting.type) {\n case 'toggle':\n setting.toggle();\n this.showSettings();\n break;\n\n case 'options':\n this.__showOptions(setting);\n break;\n\n default:\n // noop\n }\n }\n },\n });\n }\n\n /**\n * @summary Shows setting options panel\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @private\n */\n __showOptions(setting) {\n const current = setting.current();\n\n this.psv.panel.show({\n id : SettingsPlugin.ID_PANEL,\n content : SettingsPlugin.SETTING_OPTIONS_TEMPLATE(\n setting,\n this.psv.config.lang[SettingsButton.id],\n utils.dasherize(SettingsPlugin.SETTING_DATA),\n (option) => { // retrocompatibility with options having an \"active\" flag\n return 'active' in option ? option.active : option.id === current;\n }\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const optionId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined;\n\n if (optionId === '__back') {\n this.showSettings();\n }\n else {\n setting.apply(optionId);\n this.hideSettings();\n }\n },\n });\n }\n\n}\n"],"names":["SettingsButton","navbar","plugin","psv","getPlugin","SettingsPlugin","id","on","CONSTANTS","EVENTS","OPEN_PANEL","CLOSE_PANEL","destroy","off","isSupported","handleEvent","e","type","toggleActive","args","ID_PANEL","onClick","toggleSettings","AbstractButton","icon","DEFAULTS","splice","indexOf","lang","registerButton","settings","addSetting","setting","PSVError","SETTINGS_TEMPLATE_","push","panel","prop","contentId","showSettings","removeSetting","idx","some","i","hideSettings","hide","show","content","SETTINGS_TEMPLATE","config","utils","dasherize","SETTING_DATA","current","option","options","find","opt","label","noMargin","clickHandler","li","target","getClosest","undefined","settingId","dataset","s","toggle","__showOptions","SETTING_OPTIONS_TEMPLATE","active","optionId","apply","AbstractPlugin","title","dataKey","optionsCurrent","map","join","chevron","switchOn","switchOff","optionActive","check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;EACA;EACA;EACA;EACA;;MACaA,cAAb;EAAA;;EAKE;EACF;EACA;EACE,0BAAYC,MAAZ,EAAoB;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AA;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/stereo.js b/dist/plugins/stereo.js index 1d8fa27bc..a5970b527 100644 --- a/dist/plugins/stereo.js +++ b/dist/plugins/stereo.js @@ -1,17 +1,15 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer'), require('photo-sphere-viewer/dist/plugins/gyroscope'), require('three')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'photo-sphere-viewer/dist/plugins/gyroscope', 'three'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.StereoPlugin = factory(global.PhotoSphereViewer, global.PhotoSphereViewer.GyroscopePlugin, global.THREE))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.StereoPlugin = factory(global.PhotoSphereViewer, global.PhotoSphereViewer.GyroscopePlugin, global.THREE))); }(this, (function (photoSphereViewer, GyroscopePlugin, three) { 'use strict'; - GyroscopePlugin = GyroscopePlugin && Object.prototype.hasOwnProperty.call(GyroscopePlugin, 'default') ? GyroscopePlugin['default'] : GyroscopePlugin; - function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; @@ -59,9 +57,9 @@ }; }; - var mobileRotateIcon = ""; + var mobileRotateIcon = "\n"; - var stereo = "\n"; + var stereo = "\n"; /** * @summary Navigation bar stereo button class @@ -439,7 +437,7 @@ } }; - if ((_window$screen = window.screen) == null ? void 0 : _window$screen.orientation) { + if ((_window$screen = window.screen) != null && _window$screen.orientation) { window.screen.orientation.lock('landscape').then(null, function () { return displayRotateMessage(); }); @@ -459,7 +457,7 @@ _proto.__unlockOrientation = function __unlockOrientation() { var _window$screen2; - if ((_window$screen2 = window.screen) == null ? void 0 : _window$screen2.orientation) { + if ((_window$screen2 = window.screen) != null && _window$screen2.orientation) { window.screen.orientation.unlock(); } else { this.psv.overlay.hide(StereoPlugin.ID_OVERLAY_PLEASE_ROTATE); diff --git a/dist/plugins/stereo.js.map b/dist/plugins/stereo.js.map index 255b32b88..1a2d5f84f 100644 --- a/dist/plugins/stereo.js.map +++ b/dist/plugins/stereo.js.map @@ -1 +1 @@ -{"version":3,"file":"stereo.js","sources":["../../three-examples/effects/StereoEffect.js","../../src/plugins/stereo/StereoButton.js","../../src/plugins/stereo/index.js"],"sourcesContent":["import {\n\tStereoCamera,\n\tVector2\n} from \"../../../build/three.module.js\";\n\nvar StereoEffect = function ( renderer ) {\n\n\tvar _stereo = new StereoCamera();\n\t_stereo.aspect = 0.5;\n\tvar size = new Vector2();\n\n\tthis.setEyeSeparation = function ( eyeSep ) {\n\n\t\t_stereo.eyeSep = eyeSep;\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === null ) camera.updateMatrixWorld();\n\n\t\t_stereo.update( camera );\n\n\t\trenderer.getSize( size );\n\n\t\tif ( renderer.autoClear ) renderer.clear();\n\t\trenderer.setScissorTest( true );\n\n\t\trenderer.setScissor( 0, 0, size.width / 2, size.height );\n\t\trenderer.setViewport( 0, 0, size.width / 2, size.height );\n\t\trenderer.render( scene, _stereo.cameraL );\n\n\t\trenderer.setScissor( size.width / 2, 0, size.width / 2, size.height );\n\t\trenderer.setViewport( size.width / 2, 0, size.width / 2, size.height );\n\t\trenderer.render( scene, _stereo.cameraR );\n\n\t\trenderer.setScissorTest( false );\n\n\t};\n\n};\n\nexport { StereoEffect };\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport StereoPlugin from './index';\nimport stereo from './stereo.svg';\n\n/**\n * @summary Navigation bar stereo button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class StereoButton extends AbstractButton {\n\n static id = 'stereo';\n static icon = stereo;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-stereo-button', true);\n\n /**\n * @type {PSV.plugins.StereoPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin(StereoPlugin.id);\n\n if (this.plugin) {\n this.plugin.on(StereoPlugin.EVENTS.STEREO_UPDATED, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(StereoPlugin.EVENTS.STEREO_UPDATED, this);\n }\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !this.plugin ? false : { initial: false, promise: this.plugin.prop.isSupported };\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === StereoPlugin.EVENTS.STEREO_UPDATED) {\n this.toggleActive(e.args[0]);\n }\n }\n\n /**\n * @override\n * @description Toggles stereo control\n */\n onClick() {\n this.plugin.toggle();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope';\nimport { StereoEffect } from 'three/examples/jsm/effects/StereoEffect';\nimport mobileRotateIcon from './mobile-rotate.svg';\nimport { StereoButton } from './StereoButton';\n\n\n/**\n * @typedef {Object} external:THREE.StereoEffect\n * @summary {@link https://github.com/mrdoob/three.js/blob/dev/examples/jsm/effects/StereoEffect.js}\n */\n\n/**\n * @external NoSleep\n * @description {@link https://github.com/richtr/NoSleep.js}\n */\n\n\n// add stereo button\nDEFAULTS.navbar.splice(-1, 0, StereoButton.id);\nDEFAULTS.lang[StereoButton.id] = 'Stereo view';\nregisterButton(StereoButton);\n\n// other lang strings\nDEFAULTS.lang.stereoNotification = 'Click anywhere to exit stereo view.';\nDEFAULTS.lang.pleaseRotate = ['Please rotate your device', '(or tap to continue)'];\n\n\n/**\n * @summary Adds stereo view on mobile devices\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class StereoPlugin extends AbstractPlugin {\n\n static id = 'stereo';\n\n /**\n * @summary Identifier of the overlay \"please rotate your screen\"\n * @type {string}\n * @constant\n */\n static ID_OVERLAY_PLEASE_ROTATE = 'pleaseRotate';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.StereoPlugin\n * @constant\n */\n static EVENTS = {\n STEREO_UPDATED: 'stereo-updated',\n };\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @type {PSV.plugins.GyroscopePlugin}\n * @readonly\n * @private\n */\n this.gyroscope = GyroscopePlugin ? psv.getPlugin(GyroscopePlugin) : null;\n\n if (!this.gyroscope) {\n throw new PSVError('Stereo plugin requires the Gyroscope plugin');\n }\n\n /**\n * @member {Object}\n * @protected\n * @property {Promise} isSupported - indicates of the gyroscope API is available\n * @property {external:THREE.WebGLRenderer} renderer - original renderer\n * @property {external:NoSleep} noSleep\n * @property {WakeLockSentinel} wakeLock\n */\n this.prop = {\n isSupported: this.gyroscope.prop.isSupported,\n renderer : null,\n noSleep : null,\n wakeLock : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = this.psv.getPlugin('markers');\n\n this.psv.on(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n\n this.stop();\n\n if (this.prop.noSleep) {\n delete this.prop.noSleep;\n }\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.STOP_ALL:\n case CONSTANTS.EVENTS.CLICK:\n this.stop();\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Checks if the stereo view is enabled\n * @returns {boolean}\n */\n isEnabled() {\n return !!this.prop.renderer;\n }\n\n /**\n * @summary Enables the stereo view\n * @description\n * - enables NoSleep.js\n * - enables full screen\n * - starts gyroscope controle\n * - hides markers, navbar and panel\n * - instanciate {@link external:THREE.StereoEffect}\n * @returns {Promise}\n * @fires PSV.plugins.StereoPlugin.stereo-updated\n * @throws {PSV.PSVError} if the gyroscope API is not available/granted\n */\n start() {\n // Need to be in the main event queue\n this.psv.enterFullscreen();\n this.__startNoSleep();\n this.__lockOrientation();\n\n return this.gyroscope.start().then(() => {\n // switch renderer\n this.prop.renderer = this.psv.renderer.renderer;\n this.psv.renderer.renderer = new StereoEffect(this.psv.renderer.renderer);\n\n this.psv.needsUpdate();\n\n if (this.markers) {\n this.markers.hide();\n }\n this.psv.navbar.hide();\n this.psv.panel.hide();\n\n /**\n * @event stereo-updated\n * @memberof PSV.plugins.StereoPlugin\n * @summary Triggered when the stereo view is enabled/disabled\n * @param {boolean} enabled\n */\n this.trigger(StereoPlugin.EVENTS.STEREO_UPDATED, true);\n\n this.psv.notification.show({\n content: this.psv.config.lang.stereoNotification,\n timeout: 3000,\n });\n }, () => {\n this.__unlockOrientation();\n this.__stopNoSleep();\n this.psv.exitFullscreen();\n });\n }\n\n /**\n * @summary Disables the stereo view\n * @fires PSV.plugins.StereoPlugin.stereo-updated\n */\n stop() {\n if (this.isEnabled()) {\n this.psv.renderer.renderer = this.prop.renderer;\n this.prop.renderer = null;\n\n this.psv.needsUpdate();\n\n if (this.markers) {\n this.markers.show();\n }\n this.psv.navbar.show();\n\n this.__unlockOrientation();\n this.__stopNoSleep();\n this.psv.exitFullscreen();\n this.gyroscope.stop();\n\n this.trigger(StereoPlugin.EVENTS.STEREO_UPDATED, false);\n }\n }\n\n /**\n * @summary Enables or disables the stereo view\n */\n toggle() {\n if (this.isEnabled()) {\n this.stop();\n }\n else {\n this.start();\n }\n }\n\n /**\n * @summary Enables WakeLock or NoSleep.js\n * @private\n */\n __startNoSleep() {\n if ('wakeLock' in navigator) {\n navigator.wakeLock.request('screen')\n .then((wakeLock) => {\n this.prop.wakeLock = wakeLock;\n })\n .catch(() => utils.logWarn('Cannot acquire WakeLock'));\n }\n else if ('NoSleep' in window) {\n if (!this.prop.noSleep) {\n this.prop.noSleep = new window.NoSleep();\n }\n this.prop.noSleep.enable();\n }\n else {\n utils.logWarn('NoSleep is not available');\n }\n }\n\n /**\n * @summary Disables WakeLock or NoSleep.js\n * @private\n */\n __stopNoSleep() {\n if (this.prop.wakeLock) {\n this.prop.wakeLock.release();\n this.prop.wakeLock = null;\n }\n else if (this.prop.noSleep) {\n this.prop.noSleep.disable();\n }\n }\n\n /**\n * @summary Tries to lock the device in landscape or display a message\n * @private\n */\n __lockOrientation() {\n let displayRotateMessageTimeout;\n\n const displayRotateMessage = () => {\n if (this.isEnabled() && window.innerHeight > window.innerWidth) {\n this.psv.overlay.show({\n id : StereoPlugin.ID_OVERLAY_PLEASE_ROTATE,\n image : mobileRotateIcon,\n text : this.psv.config.lang.pleaseRotate[0],\n subtext: this.psv.config.lang.pleaseRotate[1],\n });\n }\n\n if (displayRotateMessageTimeout) {\n clearTimeout(displayRotateMessageTimeout);\n displayRotateMessageTimeout = null;\n }\n };\n\n if (window.screen?.orientation) {\n window.screen.orientation.lock('landscape').then(null, () => displayRotateMessage());\n displayRotateMessageTimeout = setTimeout(() => displayRotateMessage(), 500);\n }\n else {\n displayRotateMessage();\n }\n }\n\n /**\n * @summary Unlock the device orientation\n * @private\n */\n __unlockOrientation() {\n if (window.screen?.orientation) {\n window.screen.orientation.unlock();\n }\n else {\n this.psv.overlay.hide(StereoPlugin.ID_OVERLAY_PLEASE_ROTATE);\n }\n }\n\n}\n"],"names":["StereoEffect","renderer","_stereo","StereoCamera","aspect","size","Vector2","setEyeSeparation","eyeSep","setSize","width","height","render","scene","camera","updateMatrixWorld","parent","update","getSize","autoClear","clear","setScissorTest","setScissor","setViewport","cameraL","cameraR","StereoButton","navbar","plugin","psv","getPlugin","StereoPlugin","id","on","EVENTS","STEREO_UPDATED","destroy","off","isSupported","initial","promise","prop","handleEvent","e","type","toggleActive","args","onClick","toggle","AbstractButton","icon","stereo","DEFAULTS","splice","lang","registerButton","stereoNotification","pleaseRotate","gyroscope","GyroscopePlugin","PSVError","noSleep","wakeLock","markers","CONSTANTS","STOP_ALL","CLICK","stop","isEnabled","start","enterFullscreen","__startNoSleep","__lockOrientation","then","needsUpdate","hide","panel","trigger","notification","show","content","config","timeout","__unlockOrientation","__stopNoSleep","exitFullscreen","navigator","request","catch","utils","logWarn","window","NoSleep","enable","release","disable","displayRotateMessageTimeout","displayRotateMessage","innerHeight","innerWidth","overlay","ID_OVERLAY_PLEASE_ROTATE","image","mobileRotateIcon","text","subtext","clearTimeout","screen","orientation","lock","setTimeout","unlock","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,IAAIA,YAAY,GAAG,SAAfA,YAAe,CAAWC,QAAX,EAAsB;EAExC,MAAIC,OAAO,GAAG,IAAIC,kBAAJ,EAAd;;EACAD,EAAAA,OAAO,CAACE,MAAR,GAAiB,GAAjB;EACA,MAAIC,IAAI,GAAG,IAAIC,aAAJ,EAAX;;EAEA,OAAKC,gBAAL,GAAwB,UAAWC,MAAX,EAAoB;EAE3CN,IAAAA,OAAO,CAACM,MAAR,GAAiBA,MAAjB;EAEA,GAJD;;EAMA,OAAKC,OAAL,GAAe,UAAWC,KAAX,EAAkBC,MAAlB,EAA2B;EAEzCV,IAAAA,QAAQ,CAACQ,OAAT,CAAkBC,KAAlB,EAAyBC,MAAzB;EAEA,GAJD;;EAMA,OAAKC,MAAL,GAAc,UAAWC,KAAX,EAAkBC,MAAlB,EAA2B;EAExCD,IAAAA,KAAK,CAACE,iBAAN;EAEA,QAAK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HW;EAIpBgD,UAAAA,OAAO,EAAE,MAAI,CAAC5E,GAAL,CAASoD,MAAT,CAAgB3B,IAAhB,CAAqBG,YAArB,CAAkC,CAAlC;EAJW,SAAtB;EAMD;;EAED,UAAIuC,2BAAJ,EAAiC;EAC/BU,QAAAA,YAAY,CAACV,2BAAD,CAAZ;EACAA,QAAAA,2BAA2B,GAAG,IAA9B;EACD;EACF,KAdD;;EAgBA,0BAAIL,MAAM,CAACgB,MAAX,qBAAI,eAAeC,WAAnB,EAAgC;EAC9BjB,MAAAA,MAAM,CAACgB,MAAP,CAAcC,WAAd,CAA0BC,IAA1B,CAA+B,WAA/B,EAA4CpC,IAA5C,CAAiD,IAAjD,EAAuD;EAAA,eAAMwB,oBAAoB,EAA1B;EAAA,OAAvD;EACAD,MAAAA,2BAA2B,GAAGc,UAAU,CAAC;EAAA,eAAMb,oBAAoB,EAA1B;EAAA,OAAD,EAA+B,GAA/B,CAAxC;EACD,KAHD,MAIK;EACHA,MAAAA,oBAAoB;EACrB;EACF;EAED;;;;;;WAIAd,sBAAA,+BAAsB;EAAA;;EACpB,2BAAIQ,MAAM,CAACgB,MAAX,qBAAI,gBAAeC,WAAnB,EAAgC;EAC9BjB,MAAAA,MAAM,CAACgB,MAAP,CAAcC,WAAd,CAA0BG,MAA1B;EACD,KAFD,MAGK;EACH,WAAKlF,GAAL,CAASuE,OAAT,CAAiBzB,IAAjB,CAAsB5C,YAAY,CAACsE,wBAAnC;EACD;EACF;;;IA5QuCW;;EAArBjF,aAEZC,KAAK;EAFOD,aASZsE,2BAA2B;EATftE,aAiBZG,SAAS;EACdC,EAAAA,cAAc,EAAE;EADF;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"stereo.js","sources":["../../three-examples/effects/StereoEffect.js","../../src/plugins/stereo/StereoButton.js","../../src/plugins/stereo/index.js"],"sourcesContent":["import {\n\tStereoCamera,\n\tVector2\n} from '../../../build/three.module.js';\n\nvar StereoEffect = function ( renderer ) {\n\n\tvar _stereo = new StereoCamera();\n\t_stereo.aspect = 0.5;\n\tvar size = new Vector2();\n\n\tthis.setEyeSeparation = function ( eyeSep ) {\n\n\t\t_stereo.eyeSep = eyeSep;\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === null ) camera.updateMatrixWorld();\n\n\t\t_stereo.update( camera );\n\n\t\trenderer.getSize( size );\n\n\t\tif ( renderer.autoClear ) renderer.clear();\n\t\trenderer.setScissorTest( true );\n\n\t\trenderer.setScissor( 0, 0, size.width / 2, size.height );\n\t\trenderer.setViewport( 0, 0, size.width / 2, size.height );\n\t\trenderer.render( scene, _stereo.cameraL );\n\n\t\trenderer.setScissor( size.width / 2, 0, size.width / 2, size.height );\n\t\trenderer.setViewport( size.width / 2, 0, size.width / 2, size.height );\n\t\trenderer.render( scene, _stereo.cameraR );\n\n\t\trenderer.setScissorTest( false );\n\n\t};\n\n};\n\nexport { StereoEffect };\n","import { AbstractButton } from 'photo-sphere-viewer';\nimport StereoPlugin from './index';\nimport stereo from './stereo.svg';\n\n/**\n * @summary Navigation bar stereo button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class StereoButton extends AbstractButton {\n\n static id = 'stereo';\n static icon = stereo;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-stereo-button', true);\n\n /**\n * @type {PSV.plugins.StereoPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin(StereoPlugin.id);\n\n if (this.plugin) {\n this.plugin.on(StereoPlugin.EVENTS.STEREO_UPDATED, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(StereoPlugin.EVENTS.STEREO_UPDATED, this);\n }\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !this.plugin ? false : { initial: false, promise: this.plugin.prop.isSupported };\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === StereoPlugin.EVENTS.STEREO_UPDATED) {\n this.toggleActive(e.args[0]);\n }\n }\n\n /**\n * @override\n * @description Toggles stereo control\n */\n onClick() {\n this.plugin.toggle();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer';\nimport GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope';\nimport { StereoEffect } from 'three/examples/jsm/effects/StereoEffect';\nimport mobileRotateIcon from './mobile-rotate.svg';\nimport { StereoButton } from './StereoButton';\n\n\n/**\n * @typedef {Object} external:THREE.StereoEffect\n * @summary {@link https://github.com/mrdoob/three.js/blob/dev/examples/jsm/effects/StereoEffect.js}\n */\n\n/**\n * @external NoSleep\n * @description {@link https://github.com/richtr/NoSleep.js}\n */\n\n\n// add stereo button\nDEFAULTS.navbar.splice(-1, 0, StereoButton.id);\nDEFAULTS.lang[StereoButton.id] = 'Stereo view';\nregisterButton(StereoButton);\n\n// other lang strings\nDEFAULTS.lang.stereoNotification = 'Click anywhere to exit stereo view.';\nDEFAULTS.lang.pleaseRotate = ['Please rotate your device', '(or tap to continue)'];\n\n\n/**\n * @summary Adds stereo view on mobile devices\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class StereoPlugin extends AbstractPlugin {\n\n static id = 'stereo';\n\n /**\n * @summary Identifier of the overlay \"please rotate your screen\"\n * @type {string}\n * @constant\n */\n static ID_OVERLAY_PLEASE_ROTATE = 'pleaseRotate';\n\n /**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.StereoPlugin\n * @constant\n */\n static EVENTS = {\n STEREO_UPDATED: 'stereo-updated',\n };\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @type {PSV.plugins.GyroscopePlugin}\n * @readonly\n * @private\n */\n this.gyroscope = GyroscopePlugin ? psv.getPlugin(GyroscopePlugin) : null;\n\n if (!this.gyroscope) {\n throw new PSVError('Stereo plugin requires the Gyroscope plugin');\n }\n\n /**\n * @member {Object}\n * @protected\n * @property {Promise} isSupported - indicates of the gyroscope API is available\n * @property {external:THREE.WebGLRenderer} renderer - original renderer\n * @property {external:NoSleep} noSleep\n * @property {WakeLockSentinel} wakeLock\n */\n this.prop = {\n isSupported: this.gyroscope.prop.isSupported,\n renderer : null,\n noSleep : null,\n wakeLock : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = this.psv.getPlugin('markers');\n\n this.psv.on(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.STOP_ALL, this);\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n\n this.stop();\n\n if (this.prop.noSleep) {\n delete this.prop.noSleep;\n }\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.STOP_ALL:\n case CONSTANTS.EVENTS.CLICK:\n this.stop();\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Checks if the stereo view is enabled\n * @returns {boolean}\n */\n isEnabled() {\n return !!this.prop.renderer;\n }\n\n /**\n * @summary Enables the stereo view\n * @description\n * - enables NoSleep.js\n * - enables full screen\n * - starts gyroscope controle\n * - hides markers, navbar and panel\n * - instanciate {@link external:THREE.StereoEffect}\n * @returns {Promise}\n * @fires PSV.plugins.StereoPlugin.stereo-updated\n * @throws {PSV.PSVError} if the gyroscope API is not available/granted\n */\n start() {\n // Need to be in the main event queue\n this.psv.enterFullscreen();\n this.__startNoSleep();\n this.__lockOrientation();\n\n return this.gyroscope.start().then(() => {\n // switch renderer\n this.prop.renderer = this.psv.renderer.renderer;\n this.psv.renderer.renderer = new StereoEffect(this.psv.renderer.renderer);\n\n this.psv.needsUpdate();\n\n if (this.markers) {\n this.markers.hide();\n }\n this.psv.navbar.hide();\n this.psv.panel.hide();\n\n /**\n * @event stereo-updated\n * @memberof PSV.plugins.StereoPlugin\n * @summary Triggered when the stereo view is enabled/disabled\n * @param {boolean} enabled\n */\n this.trigger(StereoPlugin.EVENTS.STEREO_UPDATED, true);\n\n this.psv.notification.show({\n content: this.psv.config.lang.stereoNotification,\n timeout: 3000,\n });\n }, () => {\n this.__unlockOrientation();\n this.__stopNoSleep();\n this.psv.exitFullscreen();\n });\n }\n\n /**\n * @summary Disables the stereo view\n * @fires PSV.plugins.StereoPlugin.stereo-updated\n */\n stop() {\n if (this.isEnabled()) {\n this.psv.renderer.renderer = this.prop.renderer;\n this.prop.renderer = null;\n\n this.psv.needsUpdate();\n\n if (this.markers) {\n this.markers.show();\n }\n this.psv.navbar.show();\n\n this.__unlockOrientation();\n this.__stopNoSleep();\n this.psv.exitFullscreen();\n this.gyroscope.stop();\n\n this.trigger(StereoPlugin.EVENTS.STEREO_UPDATED, false);\n }\n }\n\n /**\n * @summary Enables or disables the stereo view\n */\n toggle() {\n if (this.isEnabled()) {\n this.stop();\n }\n else {\n this.start();\n }\n }\n\n /**\n * @summary Enables WakeLock or NoSleep.js\n * @private\n */\n __startNoSleep() {\n if ('wakeLock' in navigator) {\n navigator.wakeLock.request('screen')\n .then((wakeLock) => {\n this.prop.wakeLock = wakeLock;\n })\n .catch(() => utils.logWarn('Cannot acquire WakeLock'));\n }\n else if ('NoSleep' in window) {\n if (!this.prop.noSleep) {\n this.prop.noSleep = new window.NoSleep();\n }\n this.prop.noSleep.enable();\n }\n else {\n utils.logWarn('NoSleep is not available');\n }\n }\n\n /**\n * @summary Disables WakeLock or NoSleep.js\n * @private\n */\n __stopNoSleep() {\n if (this.prop.wakeLock) {\n this.prop.wakeLock.release();\n this.prop.wakeLock = null;\n }\n else if (this.prop.noSleep) {\n this.prop.noSleep.disable();\n }\n }\n\n /**\n * @summary Tries to lock the device in landscape or display a message\n * @private\n */\n __lockOrientation() {\n let displayRotateMessageTimeout;\n\n const displayRotateMessage = () => {\n if (this.isEnabled() && window.innerHeight > window.innerWidth) {\n this.psv.overlay.show({\n id : StereoPlugin.ID_OVERLAY_PLEASE_ROTATE,\n image : mobileRotateIcon,\n text : this.psv.config.lang.pleaseRotate[0],\n subtext: this.psv.config.lang.pleaseRotate[1],\n });\n }\n\n if (displayRotateMessageTimeout) {\n clearTimeout(displayRotateMessageTimeout);\n displayRotateMessageTimeout = null;\n }\n };\n\n if (window.screen?.orientation) {\n window.screen.orientation.lock('landscape').then(null, () => displayRotateMessage());\n displayRotateMessageTimeout = setTimeout(() => displayRotateMessage(), 500);\n }\n else {\n displayRotateMessage();\n }\n }\n\n /**\n * @summary Unlock the device orientation\n * @private\n */\n __unlockOrientation() {\n if (window.screen?.orientation) {\n window.screen.orientation.unlock();\n }\n else {\n this.psv.overlay.hide(StereoPlugin.ID_OVERLAY_PLEASE_ROTATE);\n }\n }\n\n}\n"],"names":["StereoEffect","renderer","_stereo","StereoCamera","aspect","size","Vector2","setEyeSeparation","eyeSep","setSize","width","height","render","scene","camera","updateMatrixWorld","parent","update","getSize","autoClear","clear","setScissorTest","setScissor","setViewport","cameraL","cameraR","StereoButton","navbar","plugin","psv","getPlugin","StereoPlugin","id","on","EVENTS","STEREO_UPDATED","destroy","off","isSupported","initial","promise","prop","handleEvent","e","type","toggleActive","args","onClick","toggle","AbstractButton","icon","stereo","DEFAULTS","splice","lang","registerButton","stereoNotification","pleaseRotate","gyroscope","GyroscopePlugin","PSVError","noSleep","wakeLock","markers","CONSTANTS","STOP_ALL","CLICK","stop","isEnabled","start","enterFullscreen","__startNoSleep","__lockOrientation","then","needsUpdate","hide","panel","trigger","notification","show","content","config","timeout","__unlockOrientation","__stopNoSleep","exitFullscreen","navigator","request","catch","utils","logWarn","window","NoSleep","enable","release","disable","displayRotateMessageTimeout","displayRotateMessage","innerHeight","innerWidth","overlay","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AAG,IAA9B;EACD;EACF,KAdD;;EAgBA,0BAAIL,MAAM,CAACgB,MAAX,aAAI,eAAeC,WAAnB,EAAgC;EAC9BjB,MAAAA,MAAM,CAACgB,MAAP,CAAcC,WAAd,CAA0BC,IAA1B,CAA+B,WAA/B,EAA4CpC,IAA5C,CAAiD,IAAjD,EAAuD;EAAA,eAAMwB,oBAAoB,EAA1B;EAAA,OAAvD;EACAD,MAAAA,2BAA2B,GAAGc,UAAU,CAAC;EAAA,eAAMb,oBAAoB,EAA1B;EAAA,OAAD,EAA+B,GAA/B,CAAxC;EACD,KAHD,MAIK;EACHA,MAAAA,oBAAoB;EACrB;EACF;EAED;EACF;EACA;EACA;;;WACEd,sBAAA,+BAAsB;EAAA;;EACpB,2BAAIQ,MAAM,CAACgB,MAAX,aAAI,gBAAeC,WAAnB,EAAgC;EAC9BjB,MAAAA,MAAM,CAACgB,MAAP,CAAcC,WAAd,CAA0BG,MAA1B;EACD,KAFD,MAGK;EACH,WAAKlF,GAAL,CAASuE,OAAT,CAAiBzB,IAAjB,CAAsB5C,YAAY,CAACsE,wBAAnC;EACD;EACF;;;IA5QuCW;;EAArBjF,aAEZC,KAAK;EAFOD,aASZsE,2BAA2B;EATftE,aAiBZG,SAAS;EACdC,EAAAA,cAAc,EAAE;EADF;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/visible-range.js b/dist/plugins/visible-range.js index 4c305ac94..596ecdbe5 100644 --- a/dist/plugins/visible-range.js +++ b/dist/plugins/visible-range.js @@ -1,13 +1,13 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('photo-sphere-viewer'), require('three')) : typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'three'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.VisibleRangePlugin = factory(global.PhotoSphereViewer, global.THREE))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.VisibleRangePlugin = factory(global.PhotoSphereViewer, global.THREE))); }(this, (function (photoSphereViewer, THREE) { 'use strict'; function _inheritsLoose(subClass, superClass) { @@ -28,6 +28,7 @@ * @typedef {Object} PSV.plugins.VisibleRangePlugin.Options * @property {double[]|string[]} [latitudeRange] - latitude range as two angles * @property {double[]|string[]} [longitudeRange] - longitude range as two angles + * @property {boolean} [usePanoData] - use panoData as visible range, you can also manually call `setRangesFromPanoData` */ /** @@ -54,15 +55,20 @@ _this.config = { latitudeRange: null, - longitudeRange: null + longitudeRange: null, + usePanoData: false }; if (options) { + _this.config.usePanoData = !!options.usePanoData; + _this.setLatitudeRange(options.latitudeRange); _this.setLongitudeRange(options.longitudeRange); } + _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, _assertThisInitialized(_this)); + _this.psv.on(photoSphereViewer.CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, _assertThisInitialized(_this)); _this.psv.on(photoSphereViewer.CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, _assertThisInitialized(_this)); @@ -77,6 +83,7 @@ var _proto = VisibleRangePlugin.prototype; _proto.destroy = function destroy() { + this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, this); this.psv.off(photoSphereViewer.CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this); this.psv.off(photoSphereViewer.CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this); @@ -106,6 +113,10 @@ } return _rangedPosition; + } else if (e.type === photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED) { + if (this.config.usePanoData) { + this.setRangesFromPanoData(); + } } } /** @@ -167,6 +178,55 @@ this.psv.rotate(this.psv.getPosition()); } } + /** + * @summary Changes the latitude and longitude ranges according the current panorama cropping data + */ + ; + + _proto.setRangesFromPanoData = function setRangesFromPanoData() { + this.setLatitudeRange(this.getPanoLatitudeRange()); + this.setLongitudeRange(this.getPanoLongitudeRange()); + } + /** + * @summary Gets the latitude range defined by the viewer's panoData + * @returns {double[]|null} + * @private + */ + ; + + _proto.getPanoLatitudeRange = function getPanoLatitudeRange() { + var p = this.psv.prop.panoData; + + if (p.croppedHeight === p.fullHeight && p.croppedY === 0) { + return null; + } else { + var latitude = function latitude(y) { + return Math.PI * (1 - y / p.fullHeight) - Math.PI / 2; + }; + + return [latitude(p.croppedY), latitude(p.croppedY + p.croppedHeight)]; + } + } + /** + * @summary Gets the longitude range defined by the viewer's panoData + * @returns {double[]|null} + * @private + */ + ; + + _proto.getPanoLongitudeRange = function getPanoLongitudeRange() { + var p = this.psv.prop.panoData; + + if (p.croppedWidth === p.fullWidth && p.croppedX === 0) { + return null; + } else { + var longitude = function longitude(x) { + return 2 * Math.PI * (x / p.fullWidth) - Math.PI; + }; + + return [longitude(p.croppedX), longitude(p.croppedX + p.croppedWidth)]; + } + } /** * @summary Apply "longitudeRange" and "latitudeRange" * @param {PSV.Position} position diff --git a/dist/plugins/visible-range.js.map b/dist/plugins/visible-range.js.map index c4661102c..f2898e14f 100644 --- a/dist/plugins/visible-range.js.map +++ b/dist/plugins/visible-range.js.map @@ -1 +1 @@ -{"version":3,"file":"visible-range.js","sources":["../../src/plugins/visible-range/index.js"],"sourcesContent":["import { AbstractPlugin, utils, CONSTANTS, Animation } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\n\n/**\n * @typedef {Object} PSV.plugins.VisibleRangePlugin.Options\n * @property {double[]|string[]} [latitudeRange] - latitude range as two angles\n * @property {double[]|string[]} [longitudeRange] - longitude range as two angles\n */\n\n/**\n * @summary Locks visible longitude and/or latitude\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class VisibleRangePlugin extends AbstractPlugin {\n\n static id = 'visible-range';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.VisibleRangePlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.plugins.VisibleRangePlugin.Options}\n * @private\n */\n this.config = {\n latitudeRange : null,\n longitudeRange: null,\n };\n\n if (options) {\n this.setLatitudeRange(options.latitudeRange);\n this.setLongitudeRange(options.longitudeRange);\n }\n\n this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this);\n this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this);\n this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this);\n\n super.destroy();\n }\n\n /**\n * @private\n */\n // eslint-disable-next-line consistent-return\n handleEvent(e) {\n if (e.type === CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION) {\n const { rangedPosition } = this.applyRanges(e.value);\n return rangedPosition;\n }\n else if (e.type === CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION) {\n const { rangedPosition, sidesReached } = this.applyRanges(e.value);\n\n if (utils.intersect(['left', 'right'], sidesReached).length > 0 && this.psv.isAutorotateEnabled()) {\n this.__reverseAutorotate();\n return e.value;\n }\n\n return rangedPosition;\n }\n }\n\n /**\n * @summary Changes the latitude range\n * @param {double[]|string[]} range - latitude range as two angles\n */\n setLatitudeRange(range) {\n // latitude range must have two values\n if (range && range.length !== 2) {\n utils.logWarn('latitude range must have exactly two elements');\n // eslint-disable-next-line no-param-reassign\n range = null;\n }\n // latitude range must be ordered\n else if (range && range[0] > range[1]) {\n utils.logWarn('latitude range values must be ordered');\n // eslint-disable-next-line no-param-reassign\n range = [range[1], range[0]];\n }\n // latitude range is between -PI/2 and PI/2\n if (range) {\n this.config.latitudeRange = range.map(angle => utils.parseAngle(angle, true));\n }\n else {\n this.config.latitudeRange = null;\n }\n\n if (this.psv.prop.ready) {\n this.psv.rotate(this.psv.getPosition());\n }\n }\n\n /**\n * @summary Changes the longitude range\n * @param {double[]|string[]} range - longitude range as two angles\n */\n setLongitudeRange(range) {\n // longitude range must have two values\n if (range && range.length !== 2) {\n utils.logWarn('longitude range must have exactly two elements');\n // eslint-disable-next-line no-param-reassign\n range = null;\n }\n // longitude range is between 0 and 2*PI\n if (range) {\n this.config.longitudeRange = range.map(angle => utils.parseAngle(angle));\n }\n else {\n this.config.longitudeRange = null;\n }\n\n if (this.psv.prop.ready) {\n this.psv.rotate(this.psv.getPosition());\n }\n }\n\n /**\n * @summary Apply \"longitudeRange\" and \"latitudeRange\"\n * @param {PSV.Position} position\n * @returns {{rangedPosition: PSV.Position, sidesReached: string[]}}\n * @private\n */\n applyRanges(position) {\n const rangedPosition = {\n longitude: position.longitude,\n latitude : position.latitude,\n };\n const sidesReached = [];\n\n let range;\n let offset;\n\n if (this.config.longitudeRange) {\n range = utils.clone(this.config.longitudeRange);\n offset = THREE.Math.degToRad(this.psv.prop.hFov) / 2;\n\n range[0] = utils.parseAngle(range[0] + offset);\n range[1] = utils.parseAngle(range[1] - offset);\n\n if (range[0] > range[1]) { // when the range cross longitude 0\n if (position.longitude > range[1] && position.longitude < range[0]) {\n if (position.longitude > (range[0] / 2 + range[1] / 2)) { // detect which side we are closer too\n rangedPosition.longitude = range[0];\n sidesReached.push('left');\n }\n else {\n rangedPosition.longitude = range[1];\n sidesReached.push('right');\n }\n }\n }\n else if (position.longitude < range[0]) {\n rangedPosition.longitude = range[0];\n sidesReached.push('left');\n }\n else if (position.longitude > range[1]) {\n rangedPosition.longitude = range[1];\n sidesReached.push('right');\n }\n }\n\n if (this.config.latitudeRange) {\n range = utils.clone(this.config.latitudeRange);\n offset = THREE.Math.degToRad(this.psv.prop.vFov) / 2;\n\n range[0] = utils.parseAngle(Math.min(range[0] + offset, range[1]), true);\n range[1] = utils.parseAngle(Math.max(range[1] - offset, range[0]), true);\n\n if (position.latitude < range[0]) {\n rangedPosition.latitude = range[0];\n sidesReached.push('bottom');\n }\n else if (position.latitude > range[1]) {\n rangedPosition.latitude = range[1];\n sidesReached.push('top');\n }\n }\n\n return { rangedPosition, sidesReached };\n }\n\n /**\n * @summary Reverses autorotate direction with smooth transition\n * @private\n */\n __reverseAutorotate() {\n const newSpeed = -this.psv.config.autorotateSpeed;\n const range = this.config.longitudeRange;\n this.config.longitudeRange = null;\n\n new Animation({\n properties: {\n speed: { start: this.psv.config.autorotateSpeed, end: 0 },\n },\n duration : 300,\n easing : 'inSine',\n onTick : (properties) => {\n this.psv.config.autorotateSpeed = properties.speed;\n },\n })\n .then(() => new Animation({\n properties: {\n speed: { start: 0, end: newSpeed },\n },\n duration : 300,\n easing : 'outSine',\n onTick : (properties) => {\n this.psv.config.autorotateSpeed = properties.speed;\n },\n }))\n .then(() => {\n this.config.longitudeRange = range;\n });\n }\n\n}\n"],"names":["VisibleRangePlugin","psv","options","config","latitudeRange","longitudeRange","setLatitudeRange","setLongitudeRange","on","CONSTANTS","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","destroy","off","handleEvent","e","type","applyRanges","value","rangedPosition","sidesReached","utils","intersect","length","isAutorotateEnabled","__reverseAutorotate","range","logWarn","map","angle","parseAngle","prop","ready","rotate","getPosition","position","longitude","latitude","offset","clone","THREE","degToRad","hFov","push","vFov","Math","min","max","newSpeed","autorotateSpeed","Animation","properties","speed","start","end","duration","easing","onTick","then","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;;;;;;EAMA;;;;;;MAKqBA;;;EAInB;;;;EAIA,8BAAYC,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA;;EACxB,uCAAMD,GAAN;EAEA;;;;;EAIA,UAAKE,MAAL,GAAc;EACZC,MAAAA,aAAa,EAAG,IADJ;EAEZC,MAAAA,cAAc,E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A;EAMZC,MAAAA,MAAM,EAAM,gBAACN,UAAD,EAAgB;EAC1B,QAAA,MAAI,CAACnD,GAAL,CAASE,MAAT,CAAgB+C,eAAhB,GAAkCE,UAAU,CAACC,KAA7C;EACD;EARW,KAAd,EAUGM,IAVH,CAUQ;EAAA,aAAM,IAAIR,2BAAJ,CAAc;EACxBC,QAAAA,UAAU,EAAE;EACVC,UAAAA,KAAK,EAAE;EAAEC,YAAAA,KAAK,EAAE,CAAT;EAAYC,YAAAA,GAAG,EAAEN;EAAjB;EADG,SADY;EAIxBO,QAAAA,QAAQ,EAAI,GAJY;EAKxBC,QAAAA,MAAM,EAAM,SALY;EAMxBC,QAAAA,MAAM,EAAM,gBAACN,UAAD,EAAgB;EAC1B,UAAA,MAAI,CAACnD,GAAL,CAASE,MAAT,CAAgB+C,eAAhB,GAAkCE,UAAU,CAACC,KAA7C;EACD;EARuB,OAAd,CAAN;EAAA,KAVR,EAoBGM,IApBH,CAoBQ,YAAM;EACV,MAAA,MAAI,CAACxD,MAAL,CAAYE,cAAZ,GAA6BsB,KAA7B;EACD,KAtBH;EAuBD;;;IAnN6CiC;;EAA3B5D,mBAEZ6D,KAAK;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"visible-range.js","sources":["../../src/plugins/visible-range/index.js"],"sourcesContent":["import { AbstractPlugin, utils, CONSTANTS, Animation } from 'photo-sphere-viewer';\nimport * as THREE from 'three';\n\n/**\n * @typedef {Object} PSV.plugins.VisibleRangePlugin.Options\n * @property {double[]|string[]} [latitudeRange] - latitude range as two angles\n * @property {double[]|string[]} [longitudeRange] - longitude range as two angles\n * @property {boolean} [usePanoData] - use panoData as visible range, you can also manually call `setRangesFromPanoData`\n */\n\n/**\n * @summary Locks visible longitude and/or latitude\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport default class VisibleRangePlugin extends AbstractPlugin {\n\n static id = 'visible-range';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.VisibleRangePlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.plugins.VisibleRangePlugin.Options}\n * @private\n */\n this.config = {\n latitudeRange : null,\n longitudeRange: null,\n usePanoData: false,\n };\n\n if (options) {\n this.config.usePanoData = !!options.usePanoData;\n this.setLatitudeRange(options.latitudeRange);\n this.setLongitudeRange(options.longitudeRange);\n }\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this);\n this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this);\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this);\n this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this);\n\n super.destroy();\n }\n\n /**\n * @private\n */\n // eslint-disable-next-line consistent-return\n handleEvent(e) {\n if (e.type === CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION) {\n const { rangedPosition } = this.applyRanges(e.value);\n return rangedPosition;\n }\n else if (e.type === CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION) {\n const { rangedPosition, sidesReached } = this.applyRanges(e.value);\n\n if (utils.intersect(['left', 'right'], sidesReached).length > 0 && this.psv.isAutorotateEnabled()) {\n this.__reverseAutorotate();\n return e.value;\n }\n\n return rangedPosition;\n }\n else if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) {\n if (this.config.usePanoData) {\n this.setRangesFromPanoData();\n }\n }\n }\n\n /**\n * @summary Changes the latitude range\n * @param {double[]|string[]} range - latitude range as two angles\n */\n setLatitudeRange(range) {\n // latitude range must have two values\n if (range && range.length !== 2) {\n utils.logWarn('latitude range must have exactly two elements');\n // eslint-disable-next-line no-param-reassign\n range = null;\n }\n // latitude range must be ordered\n else if (range && range[0] > range[1]) {\n utils.logWarn('latitude range values must be ordered');\n // eslint-disable-next-line no-param-reassign\n range = [range[1], range[0]];\n }\n // latitude range is between -PI/2 and PI/2\n if (range) {\n this.config.latitudeRange = range.map(angle => utils.parseAngle(angle, true));\n }\n else {\n this.config.latitudeRange = null;\n }\n\n if (this.psv.prop.ready) {\n this.psv.rotate(this.psv.getPosition());\n }\n }\n\n /**\n * @summary Changes the longitude range\n * @param {double[]|string[]} range - longitude range as two angles\n */\n setLongitudeRange(range) {\n // longitude range must have two values\n if (range && range.length !== 2) {\n utils.logWarn('longitude range must have exactly two elements');\n // eslint-disable-next-line no-param-reassign\n range = null;\n }\n // longitude range is between 0 and 2*PI\n if (range) {\n this.config.longitudeRange = range.map(angle => utils.parseAngle(angle));\n }\n else {\n this.config.longitudeRange = null;\n }\n\n if (this.psv.prop.ready) {\n this.psv.rotate(this.psv.getPosition());\n }\n }\n\n /**\n * @summary Changes the latitude and longitude ranges according the current panorama cropping data\n */\n setRangesFromPanoData() {\n this.setLatitudeRange(this.getPanoLatitudeRange());\n this.setLongitudeRange(this.getPanoLongitudeRange());\n }\n\n /**\n * @summary Gets the latitude range defined by the viewer's panoData\n * @returns {double[]|null}\n * @private\n */\n getPanoLatitudeRange() {\n const p = this.psv.prop.panoData;\n if (p.croppedHeight === p.fullHeight && p.croppedY === 0) {\n return null;\n }\n else {\n const latitude = y => Math.PI * (1 - y / p.fullHeight) - (Math.PI / 2);\n return [latitude(p.croppedY), latitude(p.croppedY + p.croppedHeight)];\n }\n }\n\n /**\n * @summary Gets the longitude range defined by the viewer's panoData\n * @returns {double[]|null}\n * @private\n */\n getPanoLongitudeRange() {\n const p = this.psv.prop.panoData;\n if (p.croppedWidth === p.fullWidth && p.croppedX === 0) {\n return null;\n }\n else {\n const longitude = x => 2 * Math.PI * (x / p.fullWidth) - Math.PI;\n return [longitude(p.croppedX), longitude(p.croppedX + p.croppedWidth)];\n }\n }\n\n /**\n * @summary Apply \"longitudeRange\" and \"latitudeRange\"\n * @param {PSV.Position} position\n * @returns {{rangedPosition: PSV.Position, sidesReached: string[]}}\n * @private\n */\n applyRanges(position) {\n const rangedPosition = {\n longitude: position.longitude,\n latitude : position.latitude,\n };\n const sidesReached = [];\n\n let range;\n let offset;\n\n if (this.config.longitudeRange) {\n range = utils.clone(this.config.longitudeRange);\n offset = THREE.Math.degToRad(this.psv.prop.hFov) / 2;\n\n range[0] = utils.parseAngle(range[0] + offset);\n range[1] = utils.parseAngle(range[1] - offset);\n\n if (range[0] > range[1]) { // when the range cross longitude 0\n if (position.longitude > range[1] && position.longitude < range[0]) {\n if (position.longitude > (range[0] / 2 + range[1] / 2)) { // detect which side we are closer too\n rangedPosition.longitude = range[0];\n sidesReached.push('left');\n }\n else {\n rangedPosition.longitude = range[1];\n sidesReached.push('right');\n }\n }\n }\n else if (position.longitude < range[0]) {\n rangedPosition.longitude = range[0];\n sidesReached.push('left');\n }\n else if (position.longitude > range[1]) {\n rangedPosition.longitude = range[1];\n sidesReached.push('right');\n }\n }\n\n if (this.config.latitudeRange) {\n range = utils.clone(this.config.latitudeRange);\n offset = THREE.Math.degToRad(this.psv.prop.vFov) / 2;\n\n range[0] = utils.parseAngle(Math.min(range[0] + offset, range[1]), true);\n range[1] = utils.parseAngle(Math.max(range[1] - offset, range[0]), true);\n\n if (position.latitude < range[0]) {\n rangedPosition.latitude = range[0];\n sidesReached.push('bottom');\n }\n else if (position.latitude > range[1]) {\n rangedPosition.latitude = range[1];\n sidesReached.push('top');\n }\n }\n\n return { rangedPosition, sidesReached };\n }\n\n /**\n * @summary Reverses autorotate direction with smooth transition\n * @private\n */\n __reverseAutorotate() {\n const newSpeed = -this.psv.config.autorotateSpeed;\n const range = this.config.longitudeRange;\n this.config.longitudeRange = null;\n\n new Animation({\n properties: {\n speed: { start: this.psv.config.autorotateSpeed, end: 0 },\n },\n duration : 300,\n easing : 'inSine',\n onTick : (properties) => {\n this.psv.config.autorotateSpeed = properties.speed;\n },\n })\n .then(() => new Animation({\n properties: {\n speed: { start: 0, end: newSpeed },\n },\n duration : 300,\n easing : 'outSine',\n onTick : (properties) => {\n this.psv.config.autorotateSpeed = properties.speed;\n },\n }))\n .then(() => {\n this.config.longitudeRange = range;\n });\n }\n\n}\n"],"names":["VisibleRangePlugin","psv","options","config","latitudeRange","longitudeRange","usePanoData","setLatitudeRange","setLongitudeRange","on","CONSTANTS","EVENTS","PANORAMA_LOADED","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","destroy","off","handleEvent","e","type","applyRanges","value","rangedPosition","sidesReached","utils","intersect","length","isAutorotateEnabled","__reverseAutorotate","setRangesFromPanoData","range","logWarn","map","angle","parseAngle","prop","ready","rotate","getPosition","getPanoLatitudeRange","getPanoLongitudeRange","p","panoData","croppedHeight","fullHeight","croppedY","latitude","y","Math","PI","croppedWidth","fullWidth","croppedX","longitude","x","position","offset","clone","THREE","degToRad","hFov","push","vFov","min","max","newSpeed","autorotateSpeed","Animation","properties","speed","start","end","duration","easing","onTick","then","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;MACqBA;;;EAInB;EACF;EACA;EACA;EACE,8BAAYC,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA;;EACxB,uCAAMD,GAAN;EAEA;EACJ;EACA;EACA;;EACI,UAAKE,MAAL,GAAc;EACZC,MAAAA,aAAa,EAAG,IADJ;EAEZC,MAAAA,cAAc,EAAE,IAFJ;EAGZC,MAAAA,WAAW,EAAE;EAHD,KAAd;;EAMA,QAAIJ,OAAJ,EAAa;EACX,YAAKC,MAAL,CAAYG,WAAZ,GAA0B,CAAC,CAACJ,OAAO,CAACI,WAApC;;EACA,YAAKC,gBAAL,CAAsBL,OAAO,CAACE,aAA9B;;EACA,YAAKI,iBAAL,CAAuBN,OAAO,CAACG,cAA/B;EACD;;EAED,UAAKJ,GAAL,CAASQ,EAAT,CAAYC,2BAAS,CAACC,MAAV,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AZ,GAA6B,IAA7B;EAEA,QAAI+D,2BAAJ,CAAc;EACZC,MAAAA,UAAU,EAAE;EACVC,QAAAA,KAAK,EAAE;EAAEC,UAAAA,KAAK,EAAE,KAAKtE,GAAL,CAASE,MAAT,CAAgBgE,eAAzB;EAA0CK,UAAAA,GAAG,EAAE;EAA/C;EADG,OADA;EAIZC,MAAAA,QAAQ,EAAI,GAJA;EAKZC,MAAAA,MAAM,EAAM,QALA;EAMZC,MAAAA,MAAM,EAAM,gBAACN,UAAD,EAAgB;EAC1B,QAAA,MAAI,CAACpE,GAAL,CAASE,MAAT,CAAgBgE,eAAhB,GAAkCE,UAAU,CAACC,KAA7C;EACD;EARW,KAAd,EAUGM,IAVH,CAUQ;EAAA,aAAM,IAAIR,2BAAJ,CAAc;EACxBC,QAAAA,UAAU,EAAE;EACVC,UAAAA,KAAK,EAAE;EAAEC,YAAAA,KAAK,EAAE,CAAT;EAAYC,YAAAA,GAAG,EAAEN;EAAjB;EADG,SADY;EAIxBO,QAAAA,QAAQ,EAAI,GAJY;EAKxBC,QAAAA,MAAM,EAAM,SALY;EAMxBC,QAAAA,MAAM,EAAM,gBAACN,UAAD,EAAgB;EAC1B,UAAA,MAAI,CAACpE,GAAL,CAASE,MAAT,CAAgBgE,eAAhB,GAAkCE,UAAU,CAACC,KAA7C;EACD;EARuB,OAAd,CAAN;EAAA,KAVR,EAoBGM,IApBH,CAoBQ,YAAM;EACV,MAAA,MAAI,CAACzE,MAAL,CAAYE,cAAZ,GAA6B0B,KAA7B;EACD,KAtBH;EAuBD;;;IApQ6C8C;;EAA3B7E,mBAEZ8E,KAAK;;;;;;;;"} \ No newline at end of file diff --git a/dist/viewer-compat.js b/dist/viewer-compat.js index e00fc4d54..ebd1cff83 100644 --- a/dist/viewer-compat.js +++ b/dist/viewer-compat.js @@ -1,20 +1,15 @@ /*! -* Photo Sphere Viewer 4.0.7 +* Photo Sphere Viewer 4.1.0 * @copyright 2014-2015 Jérémy Heleine -* @copyright 2015-2020 Damien "Mistic" Sorel +* @copyright 2015-2021 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three'), require('photo-sphere-viewer'), require('photo-sphere-viewer/dist/plugins/gyroscope'), require('photo-sphere-viewer/dist/plugins/stereo'), require('photo-sphere-viewer/dist/plugins/markers'), require('photo-sphere-viewer/dist/plugins/visible-range')) : typeof define === 'function' && define.amd ? define(['three', 'photo-sphere-viewer', 'photo-sphere-viewer/dist/plugins/gyroscope', 'photo-sphere-viewer/dist/plugins/stereo', 'photo-sphere-viewer/dist/plugins/markers', 'photo-sphere-viewer/dist/plugins/visible-range'], factory) : - (global = global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.ViewerCompat = factory(global.THREE, global.PhotoSphereViewer, global.PhotoSphereViewer.GyroscopePlugin, global.PhotoSphereViewer.StereoPlugin, global.PhotoSphereViewer.MarkersPlugin, global.PhotoSphereViewer.VisibleRangePlugin))); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.ViewerCompat = factory(global.THREE, global.PhotoSphereViewer, global.PhotoSphereViewer.GyroscopePlugin, global.PhotoSphereViewer.StereoPlugin, global.PhotoSphereViewer.MarkersPlugin, global.PhotoSphereViewer.VisibleRangePlugin))); }(this, (function (THREE, photoSphereViewer, GyroscopePlugin, StereoPlugin, MarkersPlugin, VisibleRangePlugin) { 'use strict'; - GyroscopePlugin = GyroscopePlugin && Object.prototype.hasOwnProperty.call(GyroscopePlugin, 'default') ? GyroscopePlugin['default'] : GyroscopePlugin; - StereoPlugin = StereoPlugin && Object.prototype.hasOwnProperty.call(StereoPlugin, 'default') ? StereoPlugin['default'] : StereoPlugin; - MarkersPlugin = MarkersPlugin && Object.prototype.hasOwnProperty.call(MarkersPlugin, 'default') ? MarkersPlugin['default'] : MarkersPlugin; - VisibleRangePlugin = VisibleRangePlugin && Object.prototype.hasOwnProperty.call(VisibleRangePlugin, 'default') ? VisibleRangePlugin['default'] : VisibleRangePlugin; - function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; diff --git a/dist/viewer-compat.js.map b/dist/viewer-compat.js.map index 244a7663e..ac73fba0e 100644 --- a/dist/viewer-compat.js.map +++ b/dist/viewer-compat.js.map @@ -1 +1 @@ -{"version":3,"file":"viewer-compat.js","sources":["../src/ViewerCompat.js"],"sourcesContent":["import * as THREE from 'three';\nimport { DEFAULTS, utils, Viewer } from 'photo-sphere-viewer';\nimport GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope';\nimport StereoPlugin from 'photo-sphere-viewer/dist/plugins/stereo';\nimport MarkersPlugin from 'photo-sphere-viewer/dist/plugins/markers';\nimport VisibleRangePlugin from 'photo-sphere-viewer/dist/plugins/visible-range';\n\n/**\n * @private\n */\nfunction snakeCaseToCamelCase(options) {\n if (typeof options === 'object') {\n utils.each(options, (value, key) => {\n if (typeof key === 'string' && key.indexOf('_') !== -1) {\n const camelKey = key.replace(/(_\\w)/g, matches => matches[1].toUpperCase());\n options[camelKey] = snakeCaseToCamelCase(value);\n delete options[key];\n }\n });\n }\n\n return options;\n}\n\n/**\n * @private\n */\nconst RENAMED_OPTIONS = {\n animSpeed : 'autorotateSpeed',\n animLat : 'autorotateLat',\n usexmpdata : 'useXmpData',\n mousemoveHover : 'captureCursor',\n zoomSpeed : 'zoomButtonIncrement',\n mousewheelFactor: 'mousewheelSpeed',\n};\n\n/**\n * @summary Compatibility wrapper for version 3\n * @memberOf PSV\n * @deprecated\n */\nexport default class ViewerCompat extends Viewer {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n snakeCaseToCamelCase(options);\n\n utils.each(RENAMED_OPTIONS, (newName, oldName) => {\n if (oldName in options) {\n options[newName] = options[oldName];\n delete options[oldName];\n }\n });\n\n if ('defaultFov' in options) {\n const minFov = options.minFov !== undefined ? options.minFov : DEFAULTS.minFov;\n const maxFov = options.maxFov !== undefined ? options.maxFov : DEFAULTS.maxFov;\n const defaultFov = utils.bound(options.defaultFov, minFov, maxFov);\n options.defaultZoomLvl = (defaultFov - minFov) / (maxFov - minFov) * 100;\n delete options.defaultFov;\n }\n\n if (!('timeAnim' in options)) {\n options.autorotateDelay = 2000;\n }\n else if (options.timeAnim === false) {\n options.autorotateDelay = null;\n }\n else if (typeof options.timeAnim === 'number') {\n options.autorotateDelay = options.timeAnim;\n }\n delete options.timeAnim;\n\n delete options.transition;\n\n if ('panoramaRoll' in options) {\n options.sphereCorrection = options.sphereCorrection || {};\n options.sphereCorrection.roll = options.panoramaRoll;\n delete options.panoramaRoll;\n }\n\n if (typeof options.navbar === 'string') {\n options.navbar = options.navbar.split(' ');\n }\n\n if (Array.isArray(options.navbar)) {\n const markersIdx = options.navbar.indexOf('markers');\n if (markersIdx !== -1) {\n options.navbar.splice(markersIdx, 1, 'markersList');\n }\n }\n\n const clickEventOnMarker = options.clickEventOnMarker;\n delete options.clickEventOnMarker;\n\n const markers = options.markers;\n delete options.markers;\n\n const longitudeRange = options.longitudeRange;\n delete options.longitudeRange;\n\n const latitudeRange = options.latitudeRange;\n delete options.latitudeRange;\n\n options.plugins = [];\n if (GyroscopePlugin) {\n options.plugins.push(GyroscopePlugin);\n }\n if (StereoPlugin) {\n options.plugins.push(StereoPlugin);\n }\n if (MarkersPlugin) {\n options.plugins.push([MarkersPlugin, { clickEventOnMarker, markers }]);\n }\n if (VisibleRangePlugin) {\n options.plugins.push([VisibleRangePlugin, { longitudeRange, latitudeRange }]);\n }\n\n super(options);\n\n this.gyroscope = this.getPlugin(GyroscopePlugin);\n this.stereo = this.getPlugin(StereoPlugin);\n this.markers = this.getPlugin(MarkersPlugin);\n }\n\n // GENERAL\n\n render() {\n this.renderer.render();\n }\n\n setPanorama(panorama, options = {}, transition = false) {\n snakeCaseToCamelCase(options);\n options.transition = transition;\n return super.setPanorama(panorama, options);\n }\n\n preloadPanorama(panorama) {\n return this.textureLoader.preloadPanorama(panorama);\n }\n\n clearPanoramaCache(panorama) {\n if (panorama) {\n THREE.Cache.remove(panorama);\n }\n else {\n THREE.Cache.clear();\n }\n }\n\n // GYROSCOPE / STEREO\n\n isGyroscopeEnabled() {\n return this.gyroscope && this.gyroscope.isEnabled();\n }\n\n startGyroscopeControl() {\n return this.gyroscope && this.gyroscope.start();\n }\n\n stopGyroscopeControl() {\n this.gyroscope && this.gyroscope.stop();\n }\n\n toggleGyroscopeControl() {\n this.gyroscope && this.gyroscope.toggle();\n }\n\n isStereoEnabled() {\n return this.stereo && this.stereo.isEnabled();\n }\n\n startStereoView() {\n return this.stereo && this.stereo.start();\n }\n\n stopStereoView() {\n this.stereo && this.stereo.stop();\n }\n\n toggleStereoView() {\n this.stereo && this.stereo.toggle();\n }\n\n // MARKERS\n\n addMarker(marker, render) {\n return this.markers && this.markers.addMarker(snakeCaseToCamelCase(marker), render);\n }\n\n getMarker(markerId) {\n return this.markers && this.markers.getMarker(markerId);\n }\n\n updateMarker(marker, render) {\n return this.markers && this.markers.updateMarker(snakeCaseToCamelCase(marker), render);\n }\n\n removeMarker(marker, render) {\n this.markers && this.markers.removeMarker(marker, render);\n }\n\n gotoMarker(markerOrId, duration) {\n this.markers && this.markers.gotoMarker(markerOrId, duration);\n }\n\n hideMarker(markerId) {\n this.markers && this.markers.hideMarker(markerId);\n }\n\n showMarker(markerId) {\n this.markers && this.markers.showMarker(markerId);\n }\n\n clearMarkers(render) {\n this.markers && this.markers.clearMarkers(render);\n }\n\n getCurrentMarker() {\n return this.markers && this.markers.getCurrentMarker();\n }\n\n // NAVBAR\n\n showNavbar() {\n this.navbar.show();\n }\n\n hideNavbar() {\n this.navbar.hide();\n }\n\n toggleNavbar() {\n this.navbar.toggle();\n }\n\n getNavbarButton(id, silent) {\n return this.navbar.getButton(id, silent);\n }\n\n setCaption(html) {\n return this.navbar.setCaption(html);\n }\n\n // NOTIFICATION\n\n showNotification(config) {\n this.notification.show(config);\n }\n\n hideNotification() {\n this.notification.hide();\n }\n\n isNotificationVisible() {\n return this.notification.isVisible();\n }\n\n // OVERLAY\n\n showOverlay(config) {\n this.overlay.show(config);\n }\n\n hideOverlay() {\n this.overlay.hide();\n }\n\n isOverlayVisible() {\n return this.overlay.isVisible();\n }\n\n // PANEL\n\n showPanel(config) {\n this.panel.show(config);\n }\n\n hidePanel() {\n this.panel.hide();\n }\n\n // TOOLTIP\n\n showTooltip(config) {\n this.prop.mainTooltip = this.tooltip.create(config);\n }\n\n hideTooltip() {\n if (this.prop.mainTooltip) {\n this.prop.mainTooltip.hide();\n this.prop.mainTooltip = null;\n }\n }\n\n isTooltipVisible() {\n return !!this.prop.mainTooltip;\n }\n\n}\n"],"names":["snakeCaseToCamelCase","options","utils","each","value","key","indexOf","camelKey","replace","matches","toUpperCase","RENAMED_OPTIONS","animSpeed","animLat","usexmpdata","mousemoveHover","zoomSpeed","mousewheelFactor","ViewerCompat","newName","oldName","minFov","undefined","DEFAULTS","maxFov","defaultFov","bound","defaultZoomLvl","autorotateDelay","timeAnim","transition","sphereCorrection","roll","panoramaRoll","navbar","split","Array","isArray","markersIdx","splice","clickEventOnMarker","markers","longitudeRange","latitudeRange","plugins","GyroscopePlugin","push","StereoPlugin","MarkersPlugin","VisibleRangePlugin","gyroscope","getPlugin","stereo","render","renderer","setPanorama","panorama","preloadPanorama","textureLoader","clearPanoramaCache","THREE","remove","clear","isGyroscopeEnabled","isEnabled","startGyroscopeControl","start","stopGyroscopeControl","stop","toggleGyroscopeControl","toggle","isStereoEnabled","startStereoView","stopStereoView","toggleStereoView","addMarker","marker","getMarker","markerId","updateMarker","removeMarker","gotoMarker","markerOrId","duration","hideMarker","showMarker","clearMarkers","getCurrentMarker","showNavbar","show","hideNavbar","hide","toggleNavbar","getNavbarButton","id","silent","getButton","setCaption","html","showNotification","config","notification","hideNotification","isNotificationVisible","isVisible","showOverlay","overlay","hideOverlay","isOverlayVisible","showPanel","panel","hidePanel","showTooltip","prop","mainTooltip","tooltip","create","hideTooltip","isTooltipVisible","Viewer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAOA;;;;EAGA,SAASA,oBAAT,CAA8BC,OAA9B,EAAuC;EACrC,MAAI,OAAOA,OAAP,KAAmB,QAAvB,EAAiC;EAC/BC,IAAAA,uBAAK,CAACC,IAAN,CAAWF,OAAX,EAAoB,UAACG,KAAD,EAAQC,GAAR,EAAgB;EAClC,UAAI,OAAOA,GAAP,KAAe,QAAf,IAA2BA,GAAG,CAACC,OAAJ,CAAY,GAAZ,MAAqB,CAAC,CAArD,EAAwD;EACtD,YAAMC,QAAQ,GAAGF,GAAG,CAACG,OAAJ,CAAY,QAAZ,EAAsB,UAAAC,OAAO;EAAA,iBAAIA,OAAO,CAAC,CAAD,CAAP,CAAWC,WAAX,EAAJ;EAAA,SAA7B,CAAjB;EACAT,QAAAA,OAAO,CAACM,QAAD,CAAP,GAAoBP,oBAAoB,CAACI,KAAD,CAAxC;EACA,eAAOH,OAAO,CAACI,GAAD,CAAd;EACD;EACF,KAND;EAOD;;EAED,SAAOJ,OAAP;EACD;EAED;;;;;EAGA,IAAMU,eAAe,GAAG;EACtBC,EAAAA,SAAS,EAAS,iBADI;EAEtBC,EAAAA,OAAO,EAAW,eAFI;EAGtBC,EAAAA,UAAU,EAAQ,YAHI;EAItBC,EAAAA,cAAc,EAAI,eAJI;EAKtBC,EAAAA,SAAS,EAAS,qBALI;EAMtBC,EAAAA,gBAAgB,EAAE;EANI,CAAxB;EASA;;;;;;MAKqBC;;;EAEnB;;;;;EAKA,wBAAYjB,OAAZ,EAAqB;EAAA;;EACnBD,IAAAA,oBAAoB,CAACC,OAAD,CAApB;EAEAC,IAAAA,uBAAK,CAACC,IAAN,CAAWQ,eAAX,EAA4B,UAACQ,OAAD,EAAUC,OAAV,EAAsB;EAChD,UAAIA,OAAO,IAAInB,OA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AjB,EAAyB;EACvB,SAAKC,YAAL,CAAkBZ,IAAlB,CAAuBW,MAAvB;EACD;;WAEDE,mBAAA,4BAAmB;EACjB,SAAKD,YAAL,CAAkBV,IAAlB;EACD;;WAEDY,wBAAA,iCAAwB;EACtB,WAAO,KAAKF,YAAL,CAAkBG,SAAlB,EAAP;EACD;;;WAIDC,cAAA,qBAAYL,MAAZ,EAAoB;EAClB,SAAKM,OAAL,CAAajB,IAAb,CAAkBW,MAAlB;EACD;;WAEDO,cAAA,uBAAc;EACZ,SAAKD,OAAL,CAAaf,IAAb;EACD;;WAEDiB,mBAAA,4BAAmB;EACjB,WAAO,KAAKF,OAAL,CAAaF,SAAb,EAAP;EACD;;;WAIDK,YAAA,mBAAUT,MAAV,EAAkB;EAChB,SAAKU,KAAL,CAAWrB,IAAX,CAAgBW,MAAhB;EACD;;WAEDW,YAAA,qBAAY;EACV,SAAKD,KAAL,CAAWnB,IAAX;EACD;;;WAIDqB,cAAA,qBAAYZ,MAAZ,EAAoB;EAClB,SAAKa,IAAL,CAAUC,WAAV,GAAwB,KAAKC,OAAL,CAAaC,MAAb,CAAoBhB,MAApB,CAAxB;EACD;;WAEDiB,cAAA,uBAAc;EACZ,QAAI,KAAKJ,IAAL,CAAUC,WAAd,EAA2B;EACzB,WAAKD,IAAL,CAAUC,WAAV,CAAsBvB,IAAtB;EACA,WAAKsB,IAAL,CAAUC,WAAV,GAAwB,IAAxB;EACD;EACF;;WAEDI,mBAAA,4BAAmB;EACjB,WAAO,CAAC,CAAC,KAAKL,IAAL,CAAUC,WAAnB;EACD;;;IApQuCK;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"viewer-compat.js","sources":["../src/ViewerCompat.js"],"sourcesContent":["import * as THREE from 'three';\nimport { DEFAULTS, utils, Viewer } from 'photo-sphere-viewer';\nimport GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope';\nimport StereoPlugin from 'photo-sphere-viewer/dist/plugins/stereo';\nimport MarkersPlugin from 'photo-sphere-viewer/dist/plugins/markers';\nimport VisibleRangePlugin from 'photo-sphere-viewer/dist/plugins/visible-range';\n\n/**\n * @private\n */\nfunction snakeCaseToCamelCase(options) {\n if (typeof options === 'object') {\n utils.each(options, (value, key) => {\n if (typeof key === 'string' && key.indexOf('_') !== -1) {\n const camelKey = key.replace(/(_\\w)/g, matches => matches[1].toUpperCase());\n options[camelKey] = snakeCaseToCamelCase(value);\n delete options[key];\n }\n });\n }\n\n return options;\n}\n\n/**\n * @private\n */\nconst RENAMED_OPTIONS = {\n animSpeed : 'autorotateSpeed',\n animLat : 'autorotateLat',\n usexmpdata : 'useXmpData',\n mousemoveHover : 'captureCursor',\n zoomSpeed : 'zoomButtonIncrement',\n mousewheelFactor: 'mousewheelSpeed',\n};\n\n/**\n * @summary Compatibility wrapper for version 3\n * @memberOf PSV\n * @deprecated\n */\nexport default class ViewerCompat extends Viewer {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n snakeCaseToCamelCase(options);\n\n utils.each(RENAMED_OPTIONS, (newName, oldName) => {\n if (oldName in options) {\n options[newName] = options[oldName];\n delete options[oldName];\n }\n });\n\n if ('defaultFov' in options) {\n const minFov = options.minFov !== undefined ? options.minFov : DEFAULTS.minFov;\n const maxFov = options.maxFov !== undefined ? options.maxFov : DEFAULTS.maxFov;\n const defaultFov = utils.bound(options.defaultFov, minFov, maxFov);\n options.defaultZoomLvl = (defaultFov - minFov) / (maxFov - minFov) * 100;\n delete options.defaultFov;\n }\n\n if (!('timeAnim' in options)) {\n options.autorotateDelay = 2000;\n }\n else if (options.timeAnim === false) {\n options.autorotateDelay = null;\n }\n else if (typeof options.timeAnim === 'number') {\n options.autorotateDelay = options.timeAnim;\n }\n delete options.timeAnim;\n\n delete options.transition;\n\n if ('panoramaRoll' in options) {\n options.sphereCorrection = options.sphereCorrection || {};\n options.sphereCorrection.roll = options.panoramaRoll;\n delete options.panoramaRoll;\n }\n\n if (typeof options.navbar === 'string') {\n options.navbar = options.navbar.split(' ');\n }\n\n if (Array.isArray(options.navbar)) {\n const markersIdx = options.navbar.indexOf('markers');\n if (markersIdx !== -1) {\n options.navbar.splice(markersIdx, 1, 'markersList');\n }\n }\n\n const clickEventOnMarker = options.clickEventOnMarker;\n delete options.clickEventOnMarker;\n\n const markers = options.markers;\n delete options.markers;\n\n const longitudeRange = options.longitudeRange;\n delete options.longitudeRange;\n\n const latitudeRange = options.latitudeRange;\n delete options.latitudeRange;\n\n options.plugins = [];\n if (GyroscopePlugin) {\n options.plugins.push(GyroscopePlugin);\n }\n if (StereoPlugin) {\n options.plugins.push(StereoPlugin);\n }\n if (MarkersPlugin) {\n options.plugins.push([MarkersPlugin, { clickEventOnMarker, markers }]);\n }\n if (VisibleRangePlugin) {\n options.plugins.push([VisibleRangePlugin, { longitudeRange, latitudeRange }]);\n }\n\n super(options);\n\n this.gyroscope = this.getPlugin(GyroscopePlugin);\n this.stereo = this.getPlugin(StereoPlugin);\n this.markers = this.getPlugin(MarkersPlugin);\n }\n\n // GENERAL\n\n render() {\n this.renderer.render();\n }\n\n setPanorama(panorama, options = {}, transition = false) {\n snakeCaseToCamelCase(options);\n options.transition = transition;\n return super.setPanorama(panorama, options);\n }\n\n preloadPanorama(panorama) {\n return this.textureLoader.preloadPanorama(panorama);\n }\n\n clearPanoramaCache(panorama) {\n if (panorama) {\n THREE.Cache.remove(panorama);\n }\n else {\n THREE.Cache.clear();\n }\n }\n\n // GYROSCOPE / STEREO\n\n isGyroscopeEnabled() {\n return this.gyroscope && this.gyroscope.isEnabled();\n }\n\n startGyroscopeControl() {\n return this.gyroscope && this.gyroscope.start();\n }\n\n stopGyroscopeControl() {\n this.gyroscope && this.gyroscope.stop();\n }\n\n toggleGyroscopeControl() {\n this.gyroscope && this.gyroscope.toggle();\n }\n\n isStereoEnabled() {\n return this.stereo && this.stereo.isEnabled();\n }\n\n startStereoView() {\n return this.stereo && this.stereo.start();\n }\n\n stopStereoView() {\n this.stereo && this.stereo.stop();\n }\n\n toggleStereoView() {\n this.stereo && this.stereo.toggle();\n }\n\n // MARKERS\n\n addMarker(marker, render) {\n return this.markers && this.markers.addMarker(snakeCaseToCamelCase(marker), render);\n }\n\n getMarker(markerId) {\n return this.markers && this.markers.getMarker(markerId);\n }\n\n updateMarker(marker, render) {\n return this.markers && this.markers.updateMarker(snakeCaseToCamelCase(marker), render);\n }\n\n removeMarker(marker, render) {\n this.markers && this.markers.removeMarker(marker, render);\n }\n\n gotoMarker(markerOrId, duration) {\n this.markers && this.markers.gotoMarker(markerOrId, duration);\n }\n\n hideMarker(markerId) {\n this.markers && this.markers.hideMarker(markerId);\n }\n\n showMarker(markerId) {\n this.markers && this.markers.showMarker(markerId);\n }\n\n clearMarkers(render) {\n this.markers && this.markers.clearMarkers(render);\n }\n\n getCurrentMarker() {\n return this.markers && this.markers.getCurrentMarker();\n }\n\n // NAVBAR\n\n showNavbar() {\n this.navbar.show();\n }\n\n hideNavbar() {\n this.navbar.hide();\n }\n\n toggleNavbar() {\n this.navbar.toggle();\n }\n\n getNavbarButton(id, silent) {\n return this.navbar.getButton(id, silent);\n }\n\n setCaption(html) {\n return this.navbar.setCaption(html);\n }\n\n // NOTIFICATION\n\n showNotification(config) {\n this.notification.show(config);\n }\n\n hideNotification() {\n this.notification.hide();\n }\n\n isNotificationVisible() {\n return this.notification.isVisible();\n }\n\n // OVERLAY\n\n showOverlay(config) {\n this.overlay.show(config);\n }\n\n hideOverlay() {\n this.overlay.hide();\n }\n\n isOverlayVisible() {\n return this.overlay.isVisible();\n }\n\n // PANEL\n\n showPanel(config) {\n this.panel.show(config);\n }\n\n hidePanel() {\n this.panel.hide();\n }\n\n // TOOLTIP\n\n showTooltip(config) {\n this.prop.mainTooltip = this.tooltip.create(config);\n }\n\n hideTooltip() {\n if (this.prop.mainTooltip) {\n this.prop.mainTooltip.hide();\n this.prop.mainTooltip = null;\n }\n }\n\n isTooltipVisible() {\n return !!this.prop.mainTooltip;\n }\n\n}\n"],"names":["snakeCaseToCamelCase","options","utils","each","value","key","indexOf","camelKey","replace","matches","toUpperCase","RENAMED_OPTIONS","animSpeed","animLat","usexmpdata","mousemoveHover","zoomSpeed","mousewheelFactor","ViewerCompat","newName","oldName","minFov","undefined","DEFAULTS","maxFov","defaultFov","bound","defaultZoomLvl","autorotateDelay","timeAnim","transition","sphereCorrection","roll","panoramaRoll","navbar","split","Array","isArray","markersIdx","splice","clickEventOnMarker","markers","longitudeRange","latitudeRange","plugins","GyroscopePlugin","push","StereoPlugin","MarkersPlugin","VisibleRangePlugin","gyroscope","getPlugin","stereo","render","renderer","setPanorama","panorama","preloadPanorama","textureLoader","clearPanoramaCache","THREE","remove","clear","isGyroscopeEnabled","isEnabled","startGyroscopeControl","start","stopGyroscopeControl","stop","toggleGyroscopeControl","toggle","isStereoEnabled","startStereoView","stopStereoView","toggleStereoView","addMarker","marker","getMarker","markerId","updateMarker","removeMarker","gotoMarker","markerOrId","duration","hideMarker","showMarker","clearMarkers","getCurrentMarker","showNavbar","show","hideNavbar","hide","toggleNavbar","getNavbarButton","id","silent","getButton","setCaption","html","showNotification","config","notification","hideNotification","isNotificationVisible","isVisible","showOverlay","overlay","hideOverlay","isOverlayVisible","showPanel","panel","hidePanel","showTooltip","prop","mainTooltip","tooltip","create","hideTooltip","isTooltipVisible","Viewer"],"mappings":";;;;;;;;;;;;;;;;;;EAOA;EACA;EACA;;EACA,SAASA,oBAAT,CAA8BC,OAA9B,EAAuC;EACrC,MAAI,OAAOA,OAAP,KAAmB,QAAvB,EAAiC;EAC/BC,IAAAA,uBAAK,CAACC,IAAN,CAAWF,OAAX,EAAoB,UAACG,KAAD,EAAQC,GAAR,EAAgB;EAClC,UAAI,OAAOA,GAAP,KAAe,QAAf,IAA2BA,GAAG,CAACC,OAAJ,CAAY,GAAZ,MAAqB,CAAC,CAArD,EAAwD;EACtD,YAAMC,QAAQ,GAAGF,GAAG,CAACG,OAAJ,CAAY,QAAZ,EAAsB,U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AKU,KAAL,CAAWrB,IAAX,CAAgBW,MAAhB;EACD;;WAEDW,YAAA,qBAAY;EACV,SAAKD,KAAL,CAAWnB,IAAX;EACD;;;WAIDqB,cAAA,qBAAYZ,MAAZ,EAAoB;EAClB,SAAKa,IAAL,CAAUC,WAAV,GAAwB,KAAKC,OAAL,CAAaC,MAAb,CAAoBhB,MAApB,CAAxB;EACD;;WAEDiB,cAAA,uBAAc;EACZ,QAAI,KAAKJ,IAAL,CAAUC,WAAd,EAA2B;EACzB,WAAKD,IAAL,CAAUC,WAAV,CAAsBvB,IAAtB;EACA,WAAKsB,IAAL,CAAUC,WAAV,GAAwB,IAAxB;EACD;EACF;;WAEDI,mBAAA,4BAAmB;EACjB,WAAO,CAAC,CAAC,KAAKL,IAAL,CAAUC,WAAnB;EACD;;;IApQuCK;;;;;;;;"} \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 59a84c843..c40c86839 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -22,6 +22,7 @@ module.exports = { nav : [ { text: 'Guide', link: '/guide/' }, { text: 'Plugins', link: '/plugins/' }, + { text: 'Demos', link: '/demos/' }, { text: 'API', link: 'https://photo-sphere-viewer.js.org/api/' }, { text: 'Changelog', link: '/changelog' }, ], @@ -69,6 +70,17 @@ module.exports = { ], }, ], + '/demos/': [ + { + title: 'Demos', + sidebarDepth: 3, + collapsable : false, + children : [ + '', + 'intro', + ], + }, + ], }, }, plugins : [ diff --git a/docs/README.md b/docs/README.md index 4064e96a7..ab167c0f3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,7 +20,7 @@ features: footer: Licensed under MIT License, documentation under CC BY 3.0 --- - + ::: tip Thanks to Jéremy Heleine I forked the original Photo Sphere Viewer [by Jérémy Heleine](http://jeremyheleine.me) to provide a better code architecture and a bunch of new features. diff --git a/docs/demos/README.md b/docs/demos/README.md new file mode 100644 index 000000000..f1626bbfc --- /dev/null +++ b/docs/demos/README.md @@ -0,0 +1,9 @@ +# User demos + +This sections contains various examples of Photo Sphere Viewer created my users or myself when providing support. + +### Want your demo here ? + +Create a JSFiddle by forking [PSV Home Demo](https://jsfiddle.net/mistic100/5r684etx/) and submit a Pull Request to add it to the documentation, if it is interesting enough it will be added. + +Alternatively open an issue withe your JSFiddle link and a short description and I will add it. diff --git a/docs/demos/intro.md b/docs/demos/intro.md new file mode 100644 index 000000000..12d8f53a4 --- /dev/null +++ b/docs/demos/intro.md @@ -0,0 +1,5 @@ +# Intro animation + +This a simple intro animation using the `Animation` helper. + + diff --git a/docs/guide/config.md b/docs/guide/config.md index f6c605ac2..807278640 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -148,7 +148,8 @@ lang: { download : 'Download', fullscreen: 'Fullscreen', menu : 'Menu', - twoFingers: ['Use two fingers to navigate'], + twoFingers: 'Use two fingers to navigate', + ctrlZoom : 'Use ctrl + scroll to zoom the image', loadError : 'The panorama can\'t be loaded', } ``` @@ -176,7 +177,13 @@ Enables zoom with the mouse wheel. - type: `boolean` - default: `true` -Enables panorama rotation with the mouse cursor. +Enables panorama rotation with the mouse cursor or with a finger swipe on touch screens. + +#### `mousewheelCtrlKey` +- type: `boolean` +- default: `false` + +Requires to use the ctrl key to zoom the panorama. The allows to scroll the page without interfering with the viewer. If enabled, an overlay asking the user to use ctrl + scroll is displayed when ctrl key is not pressed. #### `captureCursor` - type: `boolean` diff --git a/docs/guide/cubemap.md b/docs/guide/cubemap.md index 6d0b9a890..93856de1a 100644 --- a/docs/guide/cubemap.md +++ b/docs/guide/cubemap.md @@ -6,4 +6,4 @@ Photo Sphere Viewer supports cubemaps as six distinct image files. The files can All features of Photo Sphere Viewer are fully supported when using cubemaps but the `fisheye` option gives funky results. - + diff --git a/docs/guide/migration-v3.md b/docs/guide/migration-v3.md index 0c9f9b5c0..3ce9a16c4 100644 --- a/docs/guide/migration-v3.md +++ b/docs/guide/migration-v3.md @@ -81,8 +81,8 @@ Bellow is the mapping of the most common methods, please check the + ## Configuration diff --git a/docs/plugins/plugin-gyroscope.md b/docs/plugins/plugin-gyroscope.md index 6c2739c59..b076f6234 100644 --- a/docs/plugins/plugin-gyroscope.md +++ b/docs/plugins/plugin-gyroscope.md @@ -22,6 +22,12 @@ const viewer = new PhotoSphereViewer.Viewer({ ## Configuration +#### `touchmove` +- type: `boolean` +- default: `true` + +Allows to pan horizontally the camera when the gyroscope is enabled (requires global `mousemove=true`). + #### `absolutePosition` - type: `boolean` - default: `false` diff --git a/docs/plugins/plugin-markers.md b/docs/plugins/plugin-markers.md index b515a6a6f..f9c3a6377 100644 --- a/docs/plugins/plugin-markers.md +++ b/docs/plugins/plugin-markers.md @@ -52,7 +52,94 @@ markersPlugin.on('select-marker', (e, marker) => { The following example contains all types of markers. Click anywhere on the panorama to add a red marker, right-click to change it's color and double-click to remove it. - + + + +## Markers definition + +One of these options is required. + +#### `image` +- type : `string` + +Path to the image representing the marker. Requires `width` and `height` to be defined. + +#### `html` +- type : `string` + +HTML content of the marker. It is recommended to define `width` and `height`. + +#### `rect` +- type : `integer[2] | {width: integer, height: integer}` + +Size of the rectangle. + +```js +rect: [10, 5] + +rect: {width: 10, height: 5} +``` + +#### `circle` +- type: `integer` + +Radius of the circle. + +#### `ellipse` +- type : `integer[2] | {cx: integer, cy: integer}` + +Radiuses of the ellipse. + +```js +ellipse: [10, 5] + +ellipse: {cx: 10, cy: 5} +``` + +#### `path` +- type : `string` + +Definition of the path (0,0 will be placed at the defined x/y or longitude/latitude). + +```js +path: 'M 0 0 L 60 60 L 60 0 L 0 60 L 0 0' +``` + +#### `polygonRad` +- type : `double[2][]` + +Same as above but coordinates are in longitude and latitude. + +```js +polygonRad: [[0.2, 0.4], [0.9, 1.1], [1.5, 0.7]] +``` + +#### `polygonPx` +- type : `integer[2][]` + +Array of points defining the polygon in pixel coordinates on the panorama image. + +```js +polygonPx: [[100, 200], [150, 300], [300, 200]] +``` + +::: warning +Texture coordinates are not applicable to cubemaps. +::: + +#### `polylineRad` +- type : `double[2][]` + +Same as `polygonRad` but generates a polyline. + +#### `polylinePx` +- type : `integer[2][]` + +Same as `polygonPx` but generates a polyline. + +::: warning +Texture coordinates are not applicable to cubemaps. +::: ## Markers options @@ -68,6 +155,10 @@ Unique identifier of the marker. Position of the marker in **texture coordinates** (pixels) or **spherical coordinates** (radians). _(This option is ignored for polygons and polylines)_ +::: warning +Texture coordinates are not applicable to cubemaps. +::: + #### `width` & `height` - type : `integer` @@ -155,86 +246,6 @@ HTML content that will be displayed on the side panel when the marker is clicked Any custom data you want to attach to the marker. -## Markers definition - -One of these options is required. - -#### `image` -- type : `string` - -Path to the image representing the marker. Requires `width` and `height` to be defined. - -#### `html` -- type : `string` - -HTML content of the marker. It is recommended to define `width` and `height`. - -#### `rect` -- type : `integer[2] | {width: integer, height: integer}` - -Size of the rectangle. - -```js -rect: [10, 5] - -rect: {width: 10, height: 5} -``` - -#### `circle` -- type: `integer` - -Radius of the circle. - -#### `ellipse` -- type : `integer[2] | {cx: integer, cy: integer}` - -Radiuses of the ellipse. - -```js -ellipse: [10, 5] - -ellipse: {cx: 10, cy: 5} -``` - -#### `path` -- type : `string` - -Definition of the path (0,0 will be placed at the defined x/y or longitude/latitude). - -```js -path: 'M 0 0 L 60 60 L 60 0 L 0 60 L 0 0' -``` - -#### `polygonPx` -- type : `integer[2][]` - -Array of points defining the polygon in pixel coordinates on the panorama image. - -```js -polygonPx: [[100, 200], [150, 300], [300, 200]] -``` - - -#### `polygonRad` -- type : `double[2][]` - -Same as above but coordinates are in longitude and latitude. - -```js -polygonRad: [[0.2, 0.4], [0.9, 1.1], [1.5, 0.7]] -``` - -#### `polylinePx` -- type : `integer[2][]` - -Same as `polygonPx` but generates a polyline. - -#### `polylineRad` -- type : `double[2][]` - -Same as `polygonRad` but generates a polyline. - - ## Configuration #### `lang` diff --git a/docs/plugins/plugin-resolution.md b/docs/plugins/plugin-resolution.md index f6d785faa..599097ac9 100644 --- a/docs/plugins/plugin-resolution.md +++ b/docs/plugins/plugin-resolution.md @@ -41,7 +41,7 @@ const viewer = new PhotoSphereViewer.Viewer({ The following example provides two resolutions for the panorama, "small" is loaded by default. - + ## Configuration diff --git a/docs/plugins/plugin-settings.md b/docs/plugins/plugin-settings.md index 53acc4961..e0853dbd2 100644 --- a/docs/plugins/plugin-settings.md +++ b/docs/plugins/plugin-settings.md @@ -26,12 +26,12 @@ const viewer = new PhotoSphereViewer.Viewer({ The following example manually adds two settings. - + ## Adding a setting -Registering a new setting is done by calling the `registerSetting` on the plugin. There are currently two types of setting. +Registering a new setting is done by calling the `addSetting` on the plugin. There are currently two types of setting. ### Toggle setting @@ -56,12 +56,12 @@ settings.addSetting({ id : 'custom-options-setting', label : 'Options setting', type : 'options', - current: () => currentOption, // prefer a human readable label options: () => ([ - { id: 'option-a', label: 'Option A', active: currentOption === 'option-a' }, - { id: 'option-b', label: 'Option B', active: currentOption === 'option-b' }, + { id: 'option-a', label: 'Option A' }, + { id: 'option-b', label: 'Option B' }, ]), - toggle : (option) => currentOption = option, + current: () => currentOption, + apply : (option) => currentOption = option, }); ``` diff --git a/docs/plugins/plugin-visible-range.md b/docs/plugins/plugin-visible-range.md index f6c78395b..eabe85d3c 100644 --- a/docs/plugins/plugin-visible-range.md +++ b/docs/plugins/plugin-visible-range.md @@ -29,12 +29,13 @@ visibleRangePlugin.setLongitudeRange(['0deg', '180deg']); visibleRangePlugin.setLatitudeRange(null); ``` +Alternatively, if `usePanoData` is set to `true`, the visible range is limited to the [cropped panorama data](../guide/cropped-panorama.md#provide-cropping-data) provided to the viewer. ## Example In this example only the front portion of the sphere is visible. - + ## Configuration @@ -51,9 +52,19 @@ Visible longitude as two angles. Visible latitude as two angles. +#### `usePanoData` +- type: `boolean` +- default: `false` + +Use cropped panorama data as visible range immediately after load. + ## Methods #### `setLatitudeRange(range)` | `setLongitudeRange(range)` Change or remove the ranges. + +#### `setRangesFromPanoData()` + +Use cropped panorama data as visible range. diff --git a/docs/plugins/writing-a-plugin.md b/docs/plugins/writing-a-plugin.md index a440ccf4b..eb26a7b69 100644 --- a/docs/plugins/writing-a-plugin.md +++ b/docs/plugins/writing-a-plugin.md @@ -181,6 +181,10 @@ import customIcon from './icons/custom.svg'; static icon = customIcon; ``` +::: tip Icon color +To be correctly displayed in the navbar, the icon must use `fill="currentColor"` and/or `stroke="currentColor"`. +::: + ## Viewer settings A plugin can expose one or more settings to the viewer by using the [Settings plugin](./plugin-settings.md). diff --git a/example/equirectangular.html b/example/equirectangular.html index 907952d8f..4e03a0a0d 100644 --- a/example/equirectangular.html +++ b/example/equirectangular.html @@ -56,9 +56,10 @@ panorama : panos[0].url, caption : panos[0].desc, loadingImg : 'assets/photosphere-logo.gif', - // fisheye : true, - // touchmoveTwoFingers: true, - // captureCursor : true, + fisheye : false, + touchmoveTwoFingers: false, + mousewheelCtrlKey : false, + captureCursor : false, navbar : [ 'autorotate', 'zoom', 'download', { @@ -94,7 +95,10 @@ 'caption', 'gyroscope', 'stereo', 'fullscreen', ], plugins : [ - PhotoSphereViewer.GyroscopePlugin, + [PhotoSphereViewer.GyroscopePlugin, { + touchmove : true, + absolutePosition: false, + }], PhotoSphereViewer.StereoPlugin, ] }); diff --git a/example/plugin-visible-range.html b/example/plugin-visible-range.html index 784f7edd0..345d8b4cd 100644 --- a/example/plugin-visible-range.html +++ b/example/plugin-visible-range.html @@ -47,9 +47,17 @@ const viewer = new PhotoSphereViewer.Viewer({ container : 'photosphere', - panorama : 'sphere.jpg', + panorama : 'sphere_cropped.jpg', caption : 'Parc national du Mercantour © Damien Sorel', loadingImg: 'assets/photosphere-logo.gif', + panoData : { + fullWidth: 6000, + fullHeight: 3000, + croppedX: 700, + croppedY: 700, + croppedWidth: 4000, + croppedHeight: 1260, + }, navbar : [ 'autorotate', { @@ -68,6 +76,13 @@ visibleRange.setLatitudeRange(ranges.latitudeRange); }, }, + { + content : 'Set range from panoData', + className: 'custom-button', + onClick : function () { + visibleRange.setRangesFromPanoData(); + }, + }, 'caption', 'fullscreen', ], diff --git a/example/sphere_cropped.jpg b/example/sphere_cropped.jpg new file mode 100644 index 000000000..50d851d71 Binary files /dev/null and b/example/sphere_cropped.jpg differ diff --git a/package.json b/package.json index 2c320cf0e..7f3eb45f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photo-sphere-viewer", - "version": "4.0.7", + "version": "4.1.0", "description": "A JavaScript library to display Photo Sphere panoramas", "homepage": "https://photo-sphere-viewer.js.org", "main": "dist/photo-sphere-viewer.js", @@ -31,7 +31,7 @@ "url": "git://github.com/mistic100/Photo-Sphere-Viewer.git" }, "dependencies": { - "three": "^0.120.1", + "three": "^0.124.0", "uevent": "~2.0.0" }, "devDependencies": { @@ -43,6 +43,7 @@ "@csstools/postcss-sass": "^4.0.0", "@pixi/jsdoc-template": "^2.5.1", "@rollup/plugin-alias": "^3.0.1", + "@rollup/plugin-babel": "^5.2.2", "@rollup/plugin-inject": "^4.0.1", "@rollup/plugin-replace": "^2.3.1", "@vuepress/plugin-active-header-links": "^1.2.0", @@ -62,13 +63,12 @@ "mocha": "^8.0.1", "ngrok": "^3.2.7", "node-sass": "^4.13.0", - "nosleep.js": "^0.11.0", + "nosleep.js": "^0.12.0", "npm-run-all": "^4.1.3", "postcss-banner": "^3.0.0", "promise-polyfill": "^8.1.3", "raw-loader": "^4.0.0", - "rollup": "^2.0.2", - "rollup-plugin-babel": "^4.3.3", + "rollup": "^2.36.2", "rollup-plugin-local-resolve": "^1.0.7", "rollup-plugin-postcss": "^3.1.0", "rollup-plugin-string": "^3.0.0", @@ -87,7 +87,7 @@ "doc:clean": "rm -rf public/*", "doc:vuepress": "vuepress build docs", "doc:jsdoc": "jsdoc --configure .jsdoc.json --destination public/api src", - "doc:assets": "cpx \"example/assets/*\" public/assets && cpx example/sphere.jpg public/assets && cpx example/sphere_small.jpg public/assets && cpx \"example/cubemap/*\" public/assets/cubemap", + "doc:assets": "cpx \"example/assets/*\" public/assets && cpx example/sphere.jpg public/assets && cpx example/sphere_small.jpg public/assets && cpx example/sphere_cropped.jpg public/assets && cpx \"example/cubemap/*\" public/assets/cubemap", "test": "npm-run-all --parallel test:*", "test:mocha": "mocha --require @babel/register --recursive \"src/**/*.spec.js\"", "test:eslint": "eslint src --ignore-path .gitignore --ignore-pattern \"*.spec.js\"", diff --git a/rollup.config.js b/rollup.config.js index 0748e644e..0190094e4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,9 +1,9 @@ import alias from '@rollup/plugin-alias'; +import babel from '@rollup/plugin-babel'; import inject from '@rollup/plugin-inject'; import replace from '@rollup/plugin-replace'; import fs from 'fs'; import path from 'path'; -import babel from 'rollup-plugin-babel'; import localResolve from 'rollup-plugin-local-resolve'; import postcss from 'rollup-plugin-postcss' import { string } from 'rollup-plugin-string'; @@ -35,6 +35,7 @@ const baseConfig = { output : { format : 'umd', sourcemap: true, + interop : false, banner : banner, globals : { 'three' : 'THREE', @@ -50,7 +51,8 @@ const baseConfig = { plugins : () => [ localResolve(), babel({ - exclude: 'node_modules/**', + exclude : 'node_modules/**', + babelHelpers: 'bundled', }), postcss({ extract : true, @@ -110,7 +112,7 @@ const secondaryConfig = { // configuration to embed the examples files in PSV source delimiters : ['', ''], [`from 'three/examples/jsm`] : `from '../../../three-examples`, - [`from "../../../build/three.module.js"`]: `from "three"`, + [`from '../../../build/three.module.js'`]: `from "three"`, }), ], }; diff --git a/src/Viewer.js b/src/Viewer.js index 5f3ae7773..7f3343f45 100644 --- a/src/Viewer.js +++ b/src/Viewer.js @@ -16,7 +16,6 @@ import { EventsHandler } from './services/EventsHandler'; import { Renderer } from './services/Renderer'; import { TextureLoader } from './services/TextureLoader'; import { TooltipRenderer } from './services/TooltipRenderer'; -import './styles/viewer.scss'; import { bound, each, diff --git a/src/buttons/AbstractZoomButton.js b/src/buttons/AbstractZoomButton.js index 83eae5961..45c18c8d0 100644 --- a/src/buttons/AbstractZoomButton.js +++ b/src/buttons/AbstractZoomButton.js @@ -14,7 +14,7 @@ export class AbstractZoomButton extends AbstractButton { * @param {number} value */ constructor(navbar, value) { - super(navbar, 'psv-button--hover-scale psv-zoom-button', true); + super(navbar, 'psv-button--hover-scale psv-zoom-button'); /** * @override diff --git a/src/buttons/AutorotateButton.js b/src/buttons/AutorotateButton.js index 760550d25..b0d44da7b 100644 --- a/src/buttons/AutorotateButton.js +++ b/src/buttons/AutorotateButton.js @@ -3,8 +3,6 @@ import playActive from '../icons/play-active.svg'; import play from '../icons/play.svg'; import { AbstractButton } from './AbstractButton'; -import '../styles/buttons/autorotate.scss'; - /** * @summary Navigation bar autorotate button class * @extends PSV.buttons.AbstractButton diff --git a/src/buttons/MenuButton.js b/src/buttons/MenuButton.js index 059e67332..a6b2908f2 100644 --- a/src/buttons/MenuButton.js +++ b/src/buttons/MenuButton.js @@ -1,7 +1,6 @@ -import { BUTTON_DATA, EVENTS, IDS } from '../data/constants'; +import { EVENTS, IDS } from '../data/constants'; import menuIcon from '../icons/menu.svg'; -import menuTemplate from '../templates/menu'; -import { getClosest } from '../utils'; +import { dasherize, getClosest } from '../utils'; import { AbstractButton } from './AbstractButton'; /** @@ -14,6 +13,34 @@ export class MenuButton extends AbstractButton { static id = 'menu'; static icon = menuIcon; + /** + * @summary Property name added to buttons list + * @type {string} + * @constant + */ + static BUTTON_DATA = 'psvButton'; + + /** + * @summary Menu template + * @param {AbstractButton[]} buttons + * @param {PSV.Viewer} psv + * @param {string} dataKey + * @returns {string} + */ + static MENU_TEMPLATE = (buttons, psv, dataKey) => ` +
    +

    ${menuIcon} ${psv.config.lang.menu}

    +
      + ${buttons.map(button => ` +
    • + ${button.container.innerHTML} + ${button.container.title} +
    • + `).join('')} +
    +
    +`; + /** * @param {PSV.components.Navbar} navbar */ @@ -87,11 +114,11 @@ export class MenuButton extends AbstractButton { __showMenu() { this.psv.panel.show({ id : IDS.MENU, - content : menuTemplate(this.parent.collapsed, this.psv), + content : MenuButton.MENU_TEMPLATE(this.parent.collapsed, this.psv, dasherize(MenuButton.BUTTON_DATA)), noMargin : true, clickHandler: (e) => { const li = e.target ? getClosest(e.target, 'li') : undefined; - const buttonId = li ? li.dataset[BUTTON_DATA] : undefined; + const buttonId = li ? li.dataset[MenuButton.BUTTON_DATA] : undefined; if (buttonId) { this.parent.getButton(buttonId).onClick(); diff --git a/src/buttons/ZoomRangeButton.js b/src/buttons/ZoomRangeButton.js index 9263532c6..a9fc36cd0 100644 --- a/src/buttons/ZoomRangeButton.js +++ b/src/buttons/ZoomRangeButton.js @@ -3,8 +3,6 @@ import { SYSTEM } from '../data/system'; import { getStyle } from '../utils'; import { AbstractButton } from './AbstractButton'; -import '../styles/buttons/zoom-range.scss'; - /** * @summary Navigation bar zoom button class * @extends PSV.buttons.AbstractButton diff --git a/src/components/Loader.js b/src/components/Loader.js index 9e7d889f9..be592015c 100644 --- a/src/components/Loader.js +++ b/src/components/Loader.js @@ -2,8 +2,6 @@ import { SYSTEM } from '../data/system'; import { getStyle } from '../utils'; import { AbstractComponent } from './AbstractComponent'; -import '../styles/loader.scss'; - /** * @summary Loader class * @extends PSV.components.AbstractComponent diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 7441739c7..2fcd89b27 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -8,7 +8,6 @@ import { ZoomOutButton } from '../buttons/ZoomOutButton'; import { ZoomRangeButton } from '../buttons/ZoomRangeButton'; import { DEFAULTS } from '../data/config'; import { PSVError } from '../PSVError'; -import '../styles/navbar.scss'; import { clone, logWarn } from '../utils'; import { AbstractComponent } from './AbstractComponent'; import { NavbarCaption } from './NavbarCaption'; diff --git a/src/components/Notification.js b/src/components/Notification.js index 7bec07c00..fea669a13 100644 --- a/src/components/Notification.js +++ b/src/components/Notification.js @@ -1,8 +1,6 @@ import { EVENTS } from '../data/constants'; import { AbstractComponent } from './AbstractComponent'; -import '../styles/notification.scss'; - /** * @summary Notification class * @extends PSV.components.AbstractComponent diff --git a/src/components/Overlay.js b/src/components/Overlay.js index ecab984d8..649267d6c 100644 --- a/src/components/Overlay.js +++ b/src/components/Overlay.js @@ -2,8 +2,6 @@ import { EVENTS } from '../data/constants'; import { AbstractComponent } from './AbstractComponent'; import { PSVError } from '../PSVError'; -import '../styles/overlay.scss'; - /** * @summary Overlay class * @extends PSV.components.AbstractComponent diff --git a/src/components/Panel.js b/src/components/Panel.js index f6c493c68..7f83df160 100644 --- a/src/components/Panel.js +++ b/src/components/Panel.js @@ -1,8 +1,6 @@ import { EVENTS } from '../data/constants'; import { SYSTEM } from '../data/system'; import { PSVError } from '../PSVError'; - -import '../styles/panel.scss'; import { toggleClass } from '../utils'; import { AbstractComponent } from './AbstractComponent'; diff --git a/src/components/Tooltip.js b/src/components/Tooltip.js index 98296c223..51aecc8fc 100644 --- a/src/components/Tooltip.js +++ b/src/components/Tooltip.js @@ -3,8 +3,6 @@ import { PSVError } from '../PSVError'; import { addClasses, parsePosition } from '../utils'; import { AbstractComponent } from './AbstractComponent'; -import '../styles/tooltip.scss'; - const LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' }; const TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' }; const STATE = { NONE: 0, SHOWING: 1, HIDING: 2, READY: 3 }; diff --git a/src/data/config.js b/src/data/config.js index 2662ff581..b9961b7bd 100644 --- a/src/data/config.js +++ b/src/data/config.js @@ -36,6 +36,7 @@ export const DEFAULTS = { mousewheelSpeed : 1, mousemove : true, captureCursor : false, + mousewheelCtrlKey : false, touchmoveTwoFingers: false, useXmpData : true, panoData : null, @@ -57,7 +58,8 @@ export const DEFAULTS = { download : 'Download', fullscreen: 'Fullscreen', menu : 'Menu', - twoFingers: ['Use two fingers to navigate'], + twoFingers: 'Use two fingers to navigate', + ctrlZoom : 'Use ctrl + scroll to zoom the image', loadError : 'The panorama can\'t be loaded', }, keyboard : { @@ -120,6 +122,10 @@ export const CONFIG_PARSERS = { return bound(maxFov, 1, 179); }, lang : (lang) => { + if (Array.isArray(lang.twoFingers)) { + logWarn('lang.twoFingers must not be an array'); + lang.twoFingers = lang.twoFingers[0]; + } return { ...DEFAULTS.lang, ...lang, diff --git a/src/data/constants.js b/src/data/constants.js index 6c97b59ba..5711f5ec1 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -34,6 +34,14 @@ export const LONGTOUCH_DELAY = 500; */ export const TWOFINGERSOVERLAY_DELAY = 100; +/** + * @summary Duration in milliseconds of the "ctrl zoom" overlay + * @memberOf PSV.constants + * @type {number} + * @constant + */ +export const CTRLZOOM_TIMEOUT = 2000; + /** * @summary Time size of the mouse position history used to compute inertia * @memberOf PSV.constants @@ -82,14 +90,6 @@ export const CUBE_MAP = [0, 2, 4, 5, 3, 1]; */ export const CUBE_HASHMAP = ['left', 'right', 'top', 'bottom', 'back', 'front']; -/** - * @summary Property name added to buttons list - * @memberOf PSV.constants - * @type {string} - * @constant - */ -export const BUTTON_DATA = 'psvButton'; - /** * @summary Property name added to viewer element * @memberOf PSV.constants @@ -306,6 +306,7 @@ export const CHANGE_EVENTS = { export const IDS = { MENU : 'menu', TWO_FINGERS: 'twoFingers', + CTRL_ZOOM : 'ctrlZoom', ERROR : 'error', }; diff --git a/src/icons/download.svg b/src/icons/download.svg index dcb29b02e..0057759f3 100644 --- a/src/icons/download.svg +++ b/src/icons/download.svg @@ -1 +1 @@ - + diff --git a/src/icons/error.svg b/src/icons/error.svg index 23199067d..f55ac87e1 100644 --- a/src/icons/error.svg +++ b/src/icons/error.svg @@ -1 +1 @@ - + diff --git a/src/icons/fullscreen-in.svg b/src/icons/fullscreen-in.svg index f13152bcc..93b5ec36a 100644 --- a/src/icons/fullscreen-in.svg +++ b/src/icons/fullscreen-in.svg @@ -1 +1 @@ - + diff --git a/src/icons/fullscreen-out.svg b/src/icons/fullscreen-out.svg index 34ce6951b..be3c31812 100644 --- a/src/icons/fullscreen-out.svg +++ b/src/icons/fullscreen-out.svg @@ -1 +1 @@ - + diff --git a/src/icons/gesture.svg b/src/icons/gesture.svg index 0d008b030..7eabcd412 100644 --- a/src/icons/gesture.svg +++ b/src/icons/gesture.svg @@ -1 +1 @@ - + diff --git a/src/icons/info.svg b/src/icons/info.svg index a8c99afec..834f29b9a 100644 --- a/src/icons/info.svg +++ b/src/icons/info.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/icons/menu.svg b/src/icons/menu.svg index 06fc51e92..58b028c40 100644 --- a/src/icons/menu.svg +++ b/src/icons/menu.svg @@ -1 +1 @@ - + diff --git a/src/icons/mousewheel.svg b/src/icons/mousewheel.svg new file mode 100644 index 000000000..95ea06f25 --- /dev/null +++ b/src/icons/mousewheel.svg @@ -0,0 +1 @@ + diff --git a/src/icons/play-active.svg b/src/icons/play-active.svg index d72b26b60..3b83aa24c 100644 --- a/src/icons/play-active.svg +++ b/src/icons/play-active.svg @@ -1 +1 @@ - + diff --git a/src/icons/play.svg b/src/icons/play.svg index f1a020d81..9ae0f5613 100644 --- a/src/icons/play.svg +++ b/src/icons/play.svg @@ -1 +1 @@ - + diff --git a/src/icons/zoom-in.svg b/src/icons/zoom-in.svg index 765af1410..1b51d04ac 100644 --- a/src/icons/zoom-in.svg +++ b/src/icons/zoom-in.svg @@ -1 +1 @@ - + diff --git a/src/icons/zoom-out.svg b/src/icons/zoom-out.svg index 0c5d16a75..fbae171a5 100644 --- a/src/icons/zoom-out.svg +++ b/src/icons/zoom-out.svg @@ -1 +1 @@ - + diff --git a/src/index.js b/src/index.js index 77eae140f..8d698269b 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ import './data/constants'; // for jsdoc import { SYSTEM } from './data/system'; import { AbstractPlugin } from './plugins/AbstractPlugin'; import { PSVError } from './PSVError'; +import './styles/index.scss'; import * as utils from './utils'; import { Viewer } from './Viewer'; diff --git a/src/plugins/gyroscope/compass.svg b/src/plugins/gyroscope/compass.svg index ca09b4952..2a86ba894 100644 --- a/src/plugins/gyroscope/compass.svg +++ b/src/plugins/gyroscope/compass.svg @@ -1 +1 @@ - + diff --git a/src/plugins/gyroscope/index.js b/src/plugins/gyroscope/index.js index bf5470070..9bc01ebc7 100644 --- a/src/plugins/gyroscope/index.js +++ b/src/plugins/gyroscope/index.js @@ -10,6 +10,7 @@ import { GyroscopeButton } from './GyroscopeButton'; /** * @typedef {Object} PSV.plugins.GyroscopePlugin.Options + * @property {boolean} [touchmove=true] - allows to pan horizontally when the gyroscope is enabled (requires global `mousemove=true`) * @property {boolean} [absolutePosition=false] - when true the view will ignore the current direction when enabling gyroscope control */ @@ -66,6 +67,7 @@ export default class GyroscopePlugin extends AbstractPlugin { * @private */ this.config = { + touchmove : true, absolutePosition: false, ...options, }; @@ -253,7 +255,9 @@ export default class GyroscopePlugin extends AbstractPlugin { if (this.isEnabled()) { e.preventDefault(); - this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude; + if (this.config.touchmove) { + this.prop.alphaOffset -= e.args[0].longitude - this.psv.prop.position.longitude; + } } } @@ -269,7 +273,6 @@ export default class GyroscopePlugin extends AbstractPlugin { else if ('DeviceOrientationEvent' in window) { return new Promise((resolve) => { const listener = (e) => { - /* eslint-disable-next-line no-restricted-globals */ resolve(e && e.alpha !== null && !isNaN(e.alpha)); window.removeEventListener('deviceorientation', listener); diff --git a/src/plugins/markers/index.js b/src/plugins/markers/index.js index 81f17d423..aa504e0ea 100644 --- a/src/plugins/markers/index.js +++ b/src/plugins/markers/index.js @@ -90,13 +90,13 @@ export default class MarkersPlugin extends AbstractPlugin { * @returns {string} */ static MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => ` -
    -

    ${icon} ${title}

    -
      +
      +

      ${icon} ${title}

      +
        ${markers.map(marker => ` -
      • - ${marker.type === 'image' ? `` : ''} -

        ${marker.getListContent()}

        +
      • + ${marker.type === 'image' ? `` : ''} + ${marker.getListContent()}
      • `).join('')}
      diff --git a/src/plugins/markers/pin.svg b/src/plugins/markers/pin.svg index 83d5af417..2df050910 100644 --- a/src/plugins/markers/pin.svg +++ b/src/plugins/markers/pin.svg @@ -1 +1 @@ - + diff --git a/src/plugins/markers/style.scss b/src/plugins/markers/style.scss index a45cffe50..98c0f155a 100644 --- a/src/plugins/markers/style.scss +++ b/src/plugins/markers/style.scss @@ -43,78 +43,3 @@ cursor: pointer; } } - -.psv-markers-list { - list-style: none; - margin: 0; - padding: 0; - overflow: hidden; - - &-title { - display: flex; - align-items: center; - font: $psv-panel-title-font; - margin: $psv-panel-title-margin 0; - - svg { - width: $psv-panel-title-icon-size; - height: $psv-panel-title-icon-size; - margin: 0 $psv-panel-title-icon-size / 2; - } - } - - &-item { - clear: both; - min-height: $psv-markers-list-image-size; - padding: $psv-markers-list-padding; - cursor: pointer; - transform: translateX(0); - transition: transform .3s ease-in-out; - - // pseudo-element used to fill the gap of the hover translation - &::before { - content: ''; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: $psv-markers-list-hover-translation; - margin-left: -$psv-markers-list-hover-translation; - } - - &:nth-child(odd), - &:nth-child(odd)::before { - background: $psv-markers-list-odd-background; - } - - &:nth-child(even), - &:nth-child(even)::before { - background: $psv-markers-list-even-background; - } - } - - &-image { - float: left; - width: $psv-markers-list-image-size; - } - - .psv-button-svg { - * { - fill: currentColor; - } - } - - &-name { - margin: 0; - padding: 0; - } - - &-image + &-name { - padding-left: calc(#{$psv-markers-list-image-size} + #{nth($psv-markers-list-padding, 1)}); - } -} - -.psv-container:not(.psv--is-touch) .psv-markers-list-item:hover { - transform: translateX($psv-markers-list-hover-translation); - transition: transform .1s ease-in-out; -} diff --git a/src/plugins/resolution/index.js b/src/plugins/resolution/index.js index 9e217a49d..af59c8ed2 100644 --- a/src/plugins/resolution/index.js +++ b/src/plugins/resolution/index.js @@ -65,7 +65,7 @@ export default class ResolutionPlugin extends AbstractPlugin { id : ResolutionPlugin.id, type : 'options', label : this.psv.config.lang.resolution, - current: () => (this.prop.resolution ? this.resolutionsById[this.prop.resolution].label : ''), + current: () => this.prop.resolution, options: () => this.__getSettingsOptions(), apply : resolution => this.setResolution(resolution), }); @@ -179,10 +179,8 @@ export default class ResolutionPlugin extends AbstractPlugin { __getSettingsOptions() { return this.resolutions .map(resolution => ({ - type : 'button', - id : resolution.id, - active: resolution.id === this.prop.resolution, - label : resolution.label, + id : resolution.id, + label: resolution.label, })); } diff --git a/src/plugins/settings/check.svg b/src/plugins/settings/check.svg index 8bd6c10a1..a838e9eba 100644 --- a/src/plugins/settings/check.svg +++ b/src/plugins/settings/check.svg @@ -1 +1 @@ - + diff --git a/src/plugins/settings/index.js b/src/plugins/settings/index.js index 3d2a80be0..09b8fca96 100644 --- a/src/plugins/settings/index.js +++ b/src/plugins/settings/index.js @@ -25,7 +25,7 @@ registerButton(SettingsButton); * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting * @summary Description of a 'options' setting * @property {'options'} type - type of the setting - * @property {function} current - function which returns the current value (human readable) + * @property {function} current - function which returns the current option id * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option} * @property {function} apply - function called with the id of the selected option */ @@ -43,7 +43,6 @@ registerButton(SettingsButton); * @summary Option of an 'option' setting * @property {string} id - identifier of the option * @property {string} label - label of the option - * @property {boolean} active - state of the option */ /** @@ -74,25 +73,29 @@ export default class SettingsPlugin extends AbstractPlugin { * @param {PSV.plugins.SettingsPlugin.Setting[]} settings * @param {string} title * @param {string} dataKey + * @param {function} optionsCurrent * @returns {string} */ - static SETTINGS_TEMPLATE = (settings, title, dataKey) => ` -

      ${icon} ${title}

      -
        - ${settings.map(s => ` -
      • - ${SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s)} -
      • - `).join('')} -
      `; + static SETTINGS_TEMPLATE = (settings, title, dataKey, optionsCurrent) => ` +
      +

      ${icon} ${title}

      +
        + ${settings.map(s => ` +
      • + ${SettingsPlugin.SETTINGS_TEMPLATE_[s.type](s, optionsCurrent)} +
      • + `).join('')} +
      +
      +`; /** * @summary Setting item template, by type */ static SETTINGS_TEMPLATE_ = { - options: setting => ` + options: (setting, optionsCurrent) => ` ${setting.label} - ${setting.current()} + ${optionsCurrent(setting)} ${chevron} `, toggle : setting => ` @@ -106,22 +109,25 @@ export default class SettingsPlugin extends AbstractPlugin { * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting * @param {string} title * @param {string} dataKey + * @param {function} optionActive * @returns {string} */ - static SETTING_OPTIONS_TEMPLATE = (setting, title, dataKey) => ` -

      ${icon} ${title}

      -
        -
      • - ${chevron} - ${setting.label} -
      • - ${setting.options().map(s => ` -
      • - ${s.active ? check : ''} - ${s.label} + static SETTING_OPTIONS_TEMPLATE = (setting, title, dataKey, optionActive) => ` +
        +

        ${icon} ${title}

        +
          +
        • + ${chevron} + ${setting.label}
        • - `).join('')} -
        `; + ${setting.options().map(s => ` +
      • + ${optionActive(s) ? check : ''} + ${s.label} +
      • + `).join('')} +
      +`; /** * @param {PSV.Viewer} psv @@ -216,7 +222,12 @@ export default class SettingsPlugin extends AbstractPlugin { content : SettingsPlugin.SETTINGS_TEMPLATE( this.settings, this.psv.config.lang[SettingsButton.id], - utils.dasherize(SettingsPlugin.SETTING_DATA) + utils.dasherize(SettingsPlugin.SETTING_DATA), + (setting) => { // retrocompatibility with "current" returning a label + const current = setting.current(); + const option = setting.options().find(opt => opt.id === current); + return option?.label || current; + } ), noMargin : true, clickHandler: (e) => { @@ -249,12 +260,17 @@ export default class SettingsPlugin extends AbstractPlugin { * @private */ __showOptions(setting) { + const current = setting.current(); + this.psv.panel.show({ id : SettingsPlugin.ID_PANEL, content : SettingsPlugin.SETTING_OPTIONS_TEMPLATE( setting, this.psv.config.lang[SettingsButton.id], - utils.dasherize(SettingsPlugin.SETTING_DATA) + utils.dasherize(SettingsPlugin.SETTING_DATA), + (option) => { // retrocompatibility with options having an "active" flag + return 'active' in option ? option.active : option.id === current; + } ), noMargin : true, clickHandler: (e) => { diff --git a/src/plugins/settings/style.scss b/src/plugins/settings/style.scss index dc5a0703c..d8f85d66c 100644 --- a/src/plugins/settings/style.scss +++ b/src/plugins/settings/style.scss @@ -1,73 +1,40 @@ @import '../../styles/vars'; -.psv-settings { - &-title { - display: flex; - align-items: center; - font: $psv-panel-title-font; - margin: $psv-panel-title-margin 0; - - svg { - width: $psv-panel-title-icon-size; - height: $psv-panel-title-icon-size; - margin: 0 $psv-panel-title-icon-size / 2; - } +.psv-settings-item { + &-label { + flex: 1; + font-weight: bold; } - &-list { - list-style: none; - margin: 0; - padding: 0; - overflow: hidden; + &-value { + flex: none; } - &-item { - clear: both; - min-height: 20px; - padding: .5em 1em; - cursor: pointer; - display: flex; - align-items: center; + &-icon { + flex: none; + height: 1em; + width: 1em; - &:hover { - background: rgba(255, 255, 255, .1); + svg { + width: 1em; + height: 1em; } - &-label { - flex: 1; - font-weight: bold; + &:first-child { + margin-right: 1em; } - &-value { - flex: none; - } - - &-icon { - flex: none; - height: 1em; - width: 1em; - - svg { - width: 1em; - height: 1em; - } - - &:first-child { - margin-right: 1em; - } - - &:last-child { - margin-left: 1em; - } + &:last-child { + margin-left: 1em; } + } - &--header { - border-bottom: 1px solid currentColor; - margin-bottom: 1em; + &--header { + border-bottom: 1px solid currentColor; + margin-bottom: 1em; - svg { - transform: scaleX(-1); - } + svg { + transform: scaleX(-1); } } } diff --git a/src/plugins/stereo/mobile-rotate.svg b/src/plugins/stereo/mobile-rotate.svg index df7618f5f..b73b40a3f 100644 --- a/src/plugins/stereo/mobile-rotate.svg +++ b/src/plugins/stereo/mobile-rotate.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/plugins/stereo/stereo.svg b/src/plugins/stereo/stereo.svg index 760b1fa1a..c7fd1ebd2 100644 --- a/src/plugins/stereo/stereo.svg +++ b/src/plugins/stereo/stereo.svg @@ -1 +1 @@ - + diff --git a/src/plugins/visible-range/index.js b/src/plugins/visible-range/index.js index 3bfc7210c..1926082f2 100644 --- a/src/plugins/visible-range/index.js +++ b/src/plugins/visible-range/index.js @@ -5,6 +5,7 @@ import * as THREE from 'three'; * @typedef {Object} PSV.plugins.VisibleRangePlugin.Options * @property {double[]|string[]} [latitudeRange] - latitude range as two angles * @property {double[]|string[]} [longitudeRange] - longitude range as two angles + * @property {boolean} [usePanoData] - use panoData as visible range, you can also manually call `setRangesFromPanoData` */ /** @@ -30,13 +31,16 @@ export default class VisibleRangePlugin extends AbstractPlugin { this.config = { latitudeRange : null, longitudeRange: null, + usePanoData: false, }; if (options) { + this.config.usePanoData = !!options.usePanoData; this.setLatitudeRange(options.latitudeRange); this.setLongitudeRange(options.longitudeRange); } + this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this); this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this); this.psv.on(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this); } @@ -45,6 +49,7 @@ export default class VisibleRangePlugin extends AbstractPlugin { * @package */ destroy() { + this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this); this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ANIMATE_POSITION, this); this.psv.off(CONSTANTS.CHANGE_EVENTS.GET_ROTATE_POSITION, this); @@ -70,6 +75,11 @@ export default class VisibleRangePlugin extends AbstractPlugin { return rangedPosition; } + else if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) { + if (this.config.usePanoData) { + this.setRangesFromPanoData(); + } + } } /** @@ -126,6 +136,46 @@ export default class VisibleRangePlugin extends AbstractPlugin { } } + /** + * @summary Changes the latitude and longitude ranges according the current panorama cropping data + */ + setRangesFromPanoData() { + this.setLatitudeRange(this.getPanoLatitudeRange()); + this.setLongitudeRange(this.getPanoLongitudeRange()); + } + + /** + * @summary Gets the latitude range defined by the viewer's panoData + * @returns {double[]|null} + * @private + */ + getPanoLatitudeRange() { + const p = this.psv.prop.panoData; + if (p.croppedHeight === p.fullHeight && p.croppedY === 0) { + return null; + } + else { + const latitude = y => Math.PI * (1 - y / p.fullHeight) - (Math.PI / 2); + return [latitude(p.croppedY), latitude(p.croppedY + p.croppedHeight)]; + } + } + + /** + * @summary Gets the longitude range defined by the viewer's panoData + * @returns {double[]|null} + * @private + */ + getPanoLongitudeRange() { + const p = this.psv.prop.panoData; + if (p.croppedWidth === p.fullWidth && p.croppedX === 0) { + return null; + } + else { + const longitude = x => 2 * Math.PI * (x / p.fullWidth) - Math.PI; + return [longitude(p.croppedX), longitude(p.croppedX + p.croppedWidth)]; + } + } + /** * @summary Apply "longitudeRange" and "latitudeRange" * @param {PSV.Position} position diff --git a/src/services/EventsHandler.js b/src/services/EventsHandler.js index e27bbce84..d0c51d201 100644 --- a/src/services/EventsHandler.js +++ b/src/services/EventsHandler.js @@ -1,6 +1,7 @@ import { Animation } from '../Animation'; import { ACTIONS, + CTRLZOOM_TIMEOUT, DBLCLICK_DELAY, EVENTS, IDS, @@ -11,6 +12,7 @@ import { } from '../data/constants'; import { SYSTEM } from '../data/system'; import gestureIcon from '../icons/gesture.svg'; +import mousewheelIcon from '../icons/mousewheel.svg'; import { clone, distance, getClosest, getEventKey, isFullscreenEnabled, normalizeWheel, throttle } from '../utils'; import { AbstractService } from './AbstractService'; @@ -38,24 +40,29 @@ export class EventsHandler extends AbstractService { * @property {number} mouseY - current y position of the cursor * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y] * @property {number} pinchDist - distance between fingers when zooming + * @property {boolean} ctrlKeyDown - when the Ctrl key is pressed * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks * @property {number} dblclickTimeout - timeout id for double click + * @property {number} twofingersTimeout - timeout id for "two fingers" overlay + * @property {number} ctrlZoomTimeout - timeout id for "ctrol zoom" overlay * @protected */ this.state = { - keyboardEnabled : false, - moving : false, - zooming : false, - startMouseX : 0, - startMouseY : 0, - mouseX : 0, - mouseY : 0, - mouseHistory : [], - pinchDist : 0, - dblclickData : null, - dblclickTimeout : null, - longtouchTimeout: null, + keyboardEnabled : false, + moving : false, + zooming : false, + startMouseX : 0, + startMouseY : 0, + mouseX : 0, + mouseY : 0, + mouseHistory : [], + pinchDist : 0, + ctrlKeyDown : false, + dblclickData : null, + dblclickTimeout : null, + longtouchTimeout : null, twofingersTimeout: null, + ctrlZoomTimeout : null, }; /** @@ -73,6 +80,7 @@ export class EventsHandler extends AbstractService { init() { window.addEventListener('resize', this); window.addEventListener('keydown', this); + window.addEventListener('keyup', this); this.psv.container.addEventListener('mouseenter', this); this.psv.container.addEventListener('mousedown', this); this.psv.container.addEventListener('mouseleave', this); @@ -94,6 +102,7 @@ export class EventsHandler extends AbstractService { destroy() { window.removeEventListener('resize', this); window.removeEventListener('keydown', this); + window.removeEventListener('keyup', this); this.psv.container.removeEventListener('mouseenter', this); this.psv.container.removeEventListener('mousedown', this); this.psv.container.removeEventListener('mouseleave', this); @@ -111,6 +120,7 @@ export class EventsHandler extends AbstractService { clearTimeout(this.state.dblclickTimeout); clearTimeout(this.state.longtouchTimeout); clearTimeout(this.state.twofingersTimeout); + clearTimeout(this.state.ctrlZoomTimeout); delete this.state; @@ -128,6 +138,7 @@ export class EventsHandler extends AbstractService { // @formatter:off case 'resize': this.__onResize(); break; case 'keydown': this.__onKeyDown(evt); break; + case 'keyup': this.__onKeyUp(); break; case 'mouseup': this.__onMouseUp(evt); break; case 'touchend': this.__onTouchEnd(evt); break; case SYSTEM.fullscreenEvent: this.__fullscreenToggled(); break; @@ -174,6 +185,17 @@ export class EventsHandler extends AbstractService { * @private */ __onKeyDown(evt) { + const key = getEventKey(evt); + + if (this.config.mousewheelCtrlKey) { + this.state.ctrlKeyDown = key === 'Control'; + + if (this.state.ctrlKeyDown) { + clearTimeout(this.state.ctrlZoomTimeout); + this.psv.overlay.hide(IDS.CTRL_ZOOM); + } + } + if (!this.state.keyboardEnabled) { return; } @@ -182,11 +204,8 @@ export class EventsHandler extends AbstractService { let dLat = 0; let dZoom = 0; - const key = getEventKey(evt); - const action = this.config.keyboard[key]; - /* eslint-disable */ - switch (action) { + switch (this.config.keyboard[key]) { // @formatter:off case ACTIONS.ROTATE_LAT_UP : dLat = 0.01; break; case ACTIONS.ROTATE_LAT_DOWN : dLat = -0.01; break; @@ -210,6 +229,14 @@ export class EventsHandler extends AbstractService { } } + /** + * @summary Handles keyboard events + * @private + */ + __onKeyUp() { + this.state.ctrlKeyDown = false; + } + /** * @summary Handles mouse down events * @param {MouseEvent} evt @@ -353,7 +380,7 @@ export class EventsHandler extends AbstractService { this.psv.overlay.show({ id: IDS.TWO_FINGERS, image: gestureIcon, - text: this.config.lang.twoFingers[0], + text: this.config.lang.twoFingers, }); }, TWOFINGERSOVERLAY_DELAY); } @@ -396,7 +423,7 @@ export class EventsHandler extends AbstractService { /** * @summary Handles mouse wheel events - * @param {MouseWheelEvent} evt + * @param {WheelEvent} evt * @private */ __onMouseWheel(evt) { @@ -404,6 +431,19 @@ export class EventsHandler extends AbstractService { return; } + if (this.config.mousewheelCtrlKey && !this.state.ctrlKeyDown) { + this.psv.overlay.show({ + id: IDS.CTRL_ZOOM, + image: mousewheelIcon, + text: this.config.lang.ctrlZoom, + }); + + clearTimeout(this.state.ctrlZoomTimeout); + this.state.ctrlZoomTimeout = setTimeout(() => this.psv.overlay.hide(IDS.CTRL_ZOOM), CTRLZOOM_TIMEOUT); + + return; + } + evt.preventDefault(); evt.stopPropagation(); diff --git a/src/services/Renderer.js b/src/services/Renderer.js index 68a0620ac..4673f4799 100644 --- a/src/services/Renderer.js +++ b/src/services/Renderer.js @@ -430,7 +430,7 @@ export class Renderer extends AbstractService { } } - if (item.dispose) { + if (item.dispose && !(item instanceof THREE.Scene)) { item.dispose(); } diff --git a/src/styles/_vars.scss b/src/styles/_vars.scss index 8a2b04153..e748be0d9 100644 --- a/src/styles/_vars.scss +++ b/src/styles/_vars.scss @@ -75,14 +75,10 @@ $psv-panel-title-font: 24px sans-serif !default; $psv-panel-title-icon-size: 24px !default; $psv-panel-title-margin: 24px !default; - -//*** MARKERS *** -$psv-markers-list-image-size: 20px !default; -$psv-markers-list-padding: .5em 1em !default; -$psv-markers-list-hover-translation: 10px !default; - -$psv-markers-list-odd-background: rgba(255, 255, 255, .1) !default; -$psv-markers-list-even-background: transparent !default; +$psv-panel-menu-item-height: 20px !default; +$psv-panel-menu-item-padding: .5em 1em !default; +$psv-panel-menu-odd-background: rgba(255, 255, 255, .1) !default; +$psv-panel-menu-even-background: transparent !default; //*** NOTIFICATION *** @@ -96,6 +92,7 @@ $psv-notification-text-color: $psv-tooltip-text-color !default; //*** OVERLAY *** +$psv-overlay-color: black !default; $psv-overlay-opacity: .8 !default; $psv-overlay-font-family: sans-serif !default; $psv-overlay-text-size: 30px !default; diff --git a/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 000000000..5a11847d2 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,9 @@ +@import 'viewer'; +@import 'loader'; +@import 'navbar'; +@import 'buttons/autorotate'; +@import 'buttons/zoom-range'; +@import 'notification'; +@import 'overlay'; +@import 'panel'; +@import 'tooltip'; diff --git a/src/styles/navbar.scss b/src/styles/navbar.scss index 9ee837871..58b8a16e8 100644 --- a/src/styles/navbar.scss +++ b/src/styles/navbar.scss @@ -68,10 +68,6 @@ width: 100%; transform: scale(1); transition: transform $psv-buttons-hover-scale-delay ease; - - * { - fill: currentColor; - } } } diff --git a/src/styles/overlay.scss b/src/styles/overlay.scss index 06ff7c93c..287a99663 100644 --- a/src/styles/overlay.scss +++ b/src/styles/overlay.scss @@ -12,6 +12,7 @@ bottom: 0; right: 0; background: $psv-main-background; + color: $psv-overlay-color; opacity: $psv-overlay-opacity; &-image { diff --git a/src/styles/panel.scss b/src/styles/panel.scss index 9d2bb3788..8ace6e41b 100644 --- a/src/styles/panel.scss +++ b/src/styles/panel.scss @@ -144,3 +144,72 @@ } } } + +.psv-panel-menu { + &-title { + display: flex; + align-items: center; + font: $psv-panel-title-font; + margin: $psv-panel-title-margin $psv-panel-title-margin / 2; + + svg { + width: $psv-panel-title-icon-size; + height: $psv-panel-title-icon-size; + margin-right: $psv-panel-title-margin / 2; + } + } + + &-list { + list-style: none; + margin: 0; + padding: 0; + overflow: hidden; + } + + &-item { + min-height: $psv-panel-menu-item-height; + padding: $psv-panel-menu-item-padding; + cursor: pointer; + display: flex; + align-items: center; + justify-content: flex-start; + transition: background .1s ease-in-out; + + &-icon { + flex: none; + height: $psv-panel-menu-item-height; + width: $psv-panel-menu-item-height; + margin-right: #{nth($psv-panel-menu-item-padding, 1)}; + + img { + max-width: 100%; + max-height: 100%; + } + + svg { + width: 100%; + height: 100%; + } + } + } + + &--stripped &-item { + &:hover { + background: rgba(255, 255, 255, .2); + } + + &:nth-child(odd), + &:nth-child(odd)::before { + background: $psv-panel-menu-odd-background; + } + + &:nth-child(even), + &:nth-child(even)::before { + background: $psv-panel-menu-even-background; + } + } +} + +.psv-container:not(.psv--is-touch) .psv-panel-menu-item:hover { + background: rgba(255, 255, 255, .2); +} diff --git a/src/templates/menu.js b/src/templates/menu.js deleted file mode 100644 index 88c4f1dd5..000000000 --- a/src/templates/menu.js +++ /dev/null @@ -1,24 +0,0 @@ -import { BUTTON_DATA } from '../data/constants'; -import { dasherize } from '../utils'; - -const HTML_BUTTON_DATA = 'data-' + dasherize(BUTTON_DATA); - -/** - * @summary Menu template - * @param {AbstractButton[]} buttons - * @param {PSV.Viewer} psv - * @returns {string} - */ -export default (buttons, psv) => ` -
      -

      ${psv.config.lang.menu}

      -
        - ${buttons.map(button => ` -
      • - ${button.container.innerHTML} -

        ${button.container.title}

        -
      • - `).join('')} -
      -
      -`; diff --git a/src/utils/browser.js b/src/utils/browser.js index 2ccd6bb97..8391d879a 100644 --- a/src/utils/browser.js +++ b/src/utils/browser.js @@ -114,6 +114,7 @@ export function getClosest(el, selector) { */ const KEYMAP = { 13 : 'Enter', + 17 : 'Control', 27 : 'Escape', 32 : ' ', 33 : 'PageUp', @@ -209,7 +210,7 @@ export function getStyle(elt, prop) { * @description From Facebook's Fixed Data Table * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js} * @copyright Facebook - * @param {MouseWheelEvent} event + * @param {WheelEvent} event * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}} */ export function normalizeWheel(event) { diff --git a/src/utils/psv.js b/src/utils/psv.js index bfb252f34..e12f18671 100644 --- a/src/utils/psv.js +++ b/src/utils/psv.js @@ -196,7 +196,7 @@ export function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) { parsed = value; } } - else if (typeof angle === 'number' && !Number.isNaN(angle)) { + else if (typeof angle === 'number' && !isNaN(angle)) { parsed = angle; } else {