diff --git a/.eslintrc.json b/.eslintrc.json index 29ea7141e..27fe6fc6f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -91,12 +91,18 @@ "exceptAfterSingleLine": true } ], + "no-restricted-syntax": [ + "error", + "ForInStatement", + "LabeledStatement", + "WithStatement" + ], "import/no-unresolved": [ "error", { "ignore": [ "^photo-sphere-viewer$", - "^photo-sphere-viewer\/plugins\/([a-z-]+)$" + "^photo-sphere-viewer\/dist\/plugins\/([a-z-]+)$" ] } ] diff --git a/dist/photo-sphere-viewer.css b/dist/photo-sphere-viewer.css index e3f8aa29d..587f85f8b 100644 --- a/dist/photo-sphere-viewer.css +++ b/dist/photo-sphere-viewer.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -96,7 +96,7 @@ transform: scale(1.2); } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -132,7 +132,7 @@ display: block; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -143,7 +143,7 @@ padding: 7.5px; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -190,7 +190,7 @@ transform: scale(1.3); } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -246,7 +246,7 @@ font: 14px sans-serif; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -254,7 +254,7 @@ .psv-notification { position: absolute; z-index: 100; - bottom: 40px; + bottom: 0; display: -webkit-box; display: -ms-flexbox; display: flex; @@ -288,7 +288,7 @@ bottom: 80px; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -342,7 +342,7 @@ text-align: center; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -486,7 +486,7 @@ display: block; } /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/photo-sphere-viewer.css.map b/dist/photo-sphere-viewer.css.map index 04e033fe0..64894eea4 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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EACE,iDAAA;UAAA,yCAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACmBJ;;ADlBI;EACE,yCAAA;ACqBN;;ADpBE;EACE,oDAAA;UAAA,4CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACuBJ;;ADtBI;EACE,0CAAA;ACyBN;;ADxBE;EACE,mDAAA;UAAA,2CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;AC2BJ;;AD1BI;EACE,0CAAA;AC6BN;;AD5BE;EACE,qDAAA;UAAA,6CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;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: 40px;\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: 40px;\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":["","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,YAAA;ACiBJ;;ADhBE;EACE,WAAA;EACA,2BAAA;UAAA,mBAAA;EACA,gDAAA;EAAA,wCAAA;EAAA,gCAAA;EAAA,8DAAA;ACmBJ;;ADlBI;EACE,kBAAA;ACqBN;;ADnBA;EACE,6BAAA;UAAA,qBAAA;ACsBF;AF7EA;;;;;GAAA;AGAA;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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A,0CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACWJ;;ADVI;EACE,wCAAA;ACaN;;ADZE;EACE,kDAAA;UAAA,0CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACeJ;;ADdI;EACE,uCAAA;ACiBN;;ADhBE;EACE,iDAAA;UAAA,yCAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACmBJ;;ADlBI;EACE,yCAAA;ACqBN;;ADpBE;EACE,oDAAA;UAAA,4CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;ACuBJ;;ADtBI;EACE,0CAAA;ACyBN;;ADxBE;EACE,mDAAA;UAAA,2CAAA;EACA,0CAAA;UAAA,kCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;AC2BJ;;AD1BI;EACE,0CAAA;AC6BN;;AD5BE;EACE,qDAAA;UAAA,6CAAA;EACA,yCAAA;UAAA,iCAAA;EACA,uDAAA;EAAA,+CAAA;EAAA,uCAAA;EAAA,0DAAA;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 diff --git a/dist/photo-sphere-viewer.js b/dist/photo-sphere-viewer.js index 95f6680a9..3dc33ade9 100644 --- a/dist/photo-sphere-viewer.js +++ b/dist/photo-sphere-viewer.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -1288,8 +1288,9 @@ /** * @callback OnTick + * @summary Function called for each animation frame with computed properties * @memberOf PSV.Animation - * @param {Object[]} properties - current values + * @param {Object.} properties - current values * @param {float} progress - 0 to 1 */ @@ -1312,7 +1313,7 @@ var Animation = /*#__PURE__*/function () { /** * @param {Object} options - * @param {Object[]} options.properties + * @param {Object.} options.properties * @param {number} options.properties[].start * @param {number} options.properties[].end * @param {number} options.duration @@ -4284,6 +4285,12 @@ this.prop.contentId = config.id; this.prop.visible = true; + + if (this.prop.clickHandler) { + this.content.removeEventListener('click', this.prop.clickHandler); + this.prop.clickHandler = null; + } + this.content.innerHTML = config.content; this.content.scrollTop = 0; this.container.classList.add('psv-panel--open'); @@ -5965,7 +5972,7 @@ /** * @summary Loads the panorama texture(s) * @param {string|string[]|PSV.Cubemap} panorama - * @param {PSV.PanoData | function} [newPanoData] + * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData] * @returns {Promise.} * @throws {PSV.PSVError} when the image cannot be loaded * @package @@ -6109,7 +6116,7 @@ /** * @summary Loads the sphere texture * @param {string} panorama - * @param {PSV.PanoData | function} [newPanoData] + * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData] * @returns {Promise.} * @throws {PSV.PSVError} when the image cannot be loaded * @private @@ -7084,7 +7091,7 @@ ; _proto.getPlugin = function getPlugin(pluginId) { - return this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId]; + return pluginId ? this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId] : null; } /** * @summary Returns the current position of the camera @@ -7193,7 +7200,7 @@ this.textureLoader.abortLoading(); } - if (!this.prop.isReady) { + if (!this.prop.ready) { if (!('longitude' in options) && !this.prop.isCubemap) { options.longitude = this.config.defaultLong; } diff --git a/dist/photo-sphere-viewer.js.map b/dist/photo-sphere-viewer.js.map index 11bd449f8..67b7cc741 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 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 * @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 }\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) {\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) {\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 if (this.prop.mousedown) {\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}\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 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 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 };\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\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 if (this.prop.longtouchTimeout) {\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 if (this.config.touchmoveTwoFingers) {\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n }\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 this.psv.overlay.show({\n id : IDS.TWO_FINGERS,\n image: gestureIcon,\n text : this.config.lang.twoFingers[0],\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 }\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 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 combines 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 | function} [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 | function} [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 this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId];\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.isReady) {\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","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","__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","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","isReady","showLoader","hideError","done","showError","error","setOptions","setOption","option","last","elapsed","errorIcon","isDefaultPrevented","change","animate","animProperties","tOffset","newZoomLvl","dim","enterFullscreen"],"mappings":";;;;;;;;;;;;EAAA;;;;EAIA;;;;;;EAMO,IAAMA,cAAc,GAAG,CAAvB;EAEP;;;;;;;EAMO,IAAMC,cAAc,GAAG,GAAvB;EAEP;;;;;;;EAMO,IAAMC,eAAe,GAAG,GAAxB;EAEP;;;;;;;EAMO,IAAMC,cAAc,GAAG,GAAvB;EAEP;;;;;;;EAMO,IAAMC,aAAa,GAAG,GAAtB;EAEP;;;;;;;EAMO,IAAMC,eAAe,GAAG,EAAxB;EAEP;;;;;;;EAMO,IAAMC,aAAa,GAAG,CAAtB;EAEP;;;;;;;EAMO,IAAMC,QAAQ,GAAG,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,CAAhB,CAAjB;EAEP;;;;;;;EAMO,IAAMC,YAAY,GAAG,CAAC,MAAD,EAA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L,SAj2BF,GAi2BE,qBAAY;EACV,SAAK3J,cAAL;EACA,SAAKC,aAAL;EAEA,SAAKrH,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/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 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 }\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) {\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) {\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 if (this.prop.mousedown) {\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}\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 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 };\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\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 if (this.prop.longtouchTimeout) {\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 if (this.config.touchmoveTwoFingers) {\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n }\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 this.psv.overlay.show({\n id : IDS.TWO_FINGERS,\n image: gestureIcon,\n text : this.config.lang.twoFingers[0],\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 }\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 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 combines 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","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","__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","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","last","elapsed","errorIcon","isDefaultPrevented","change","animate","animProperties","tOffset","newZoomLvl","dim","enterFullscreen"],"mappings":";;;;;;;;;;;;EAAA;;;;EAIA;;;;;;EAMO,IAAMA,cAAc,GAAG,CAAvB;EAEP;;;;;;;EAMO,IAAMC,cAAc,GAAG,GAAvB;EAEP;;;;;;;EAMO,IAAMC,eAAe,GAAG,GAAxB;EAEP;;;;;;;EAMO,IAAMC,cAAc,GAAG,GAAvB;EAEP;;;;;;;EAMO,IAAMC,aAAa,GAAG,GAAtB;EAEP;;;;;;;EAMO,IAAMC,eAAe,GAAG,EAAxB;EAEP;;;;;;;EAMO,IAAMC,aAAa,GAAG,CAAtB;EAEP;;;;;;;EAMO,IAAMC,QAAQ,GAAG,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,CAAhB,CAAjB;EAEP;;;;;;;EAMO,IAAMC,YAAY,GAAG,CAAC,MAAD,EAAS,OAAT,EAAkB,KAAlB,EAAyB,QAAzB,EAAmC,MAAnC,EAA2C,OAA3C,CAArB;EAEP;;;;;;;EAMO,IAAMC,WAAW,GAAG,WAApB;EAEP;;;;;;;EAMO,IAAMC,W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AAsB;EACpB,SAAKsJ,aAAL,CAAmB3K,eAAnB;EACD;EAED;;;;EA71BF;;EAAA,SAi2BEiL,SAj2BF,GAi2BE,qBAAY;EACV,SAAK3J,cAAL;EACA,SAAKC,aAAL;EAEA,SAAKrH,OAAL,CAAariB,MAAM,CAACqB,QAApB;EACD,GAt2BH;;EAAA;EAAA,EAA4B+f,mBAA5B;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/autorotate-keypoints.js b/dist/plugins/autorotate-keypoints.js index d6a395211..052cc7369 100644 --- a/dist/plugins/autorotate-keypoints.js +++ b/dist/plugins/autorotate-keypoints.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/gyroscope.js b/dist/plugins/gyroscope.js index f196d3b19..7ffafa9ea 100644 --- a/dist/plugins/gyroscope.js +++ b/dist/plugins/gyroscope.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/markers.css b/dist/plugins/markers.css index 8fea78927..6372909c9 100644 --- a/dist/plugins/markers.css +++ b/dist/plugins/markers.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.0.4 + * Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -50,13 +50,6 @@ cursor: pointer; } -.psv-markers-list-title { - font: 24px sans-serif; - margin: 1em 0; - text-align: center; - text-shadow: 2px 1px #000; -} - .psv-markers-list { list-style: none; margin: 0; @@ -64,6 +57,23 @@ 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; diff --git a/dist/plugins/markers.css.map b/dist/plugins/markers.css.map index ca1637a7f..713812a79 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,qBAAA;EACA,aAAA;EACA,kBAAA;EACA,yBAAA;ACaF;;ADXA;EACE,gBAAA;EACA,SAAA;EACA,UAAA;EACA,gBAAA;ACcF;;ADbE;EACE,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,gCAAA;UAAA,wBAAA;EACA,sDAAA;EAAA,8CAAA;EAAA,sCAAA;EAAA,0EAAA;ACgBJ;;ADfI;EACE,WAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;EACA,YAAA;ECkBN,WAAA;EDhBM,kBAAA;ACkBN;;ADjBI;EACE,oCAAA;ACoBN;;ADnBI;EACE,uBAAA;ACsBN;;ADrBE;EACE,WAAA;EACA,WAAA;ACwBJ;;ADvBE;EACE,kBAAA;AC0BJ;;ADzBE;EACE,SAAA;EACA,UAAA;AC4BJ;;AD3BE;EACE,gCAAA;AC8BJ;;AD5BA;EACE,mCAAA;UAAA,2BAAA;EACA,sDAAA;EAAA,8CAAA;EAAA,sCAAA;EAAA,0EAAA;AC+BF","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-title {\n font: 24px sans-serif;\n margin: 1em 0;\n text-align: center;\n text-shadow: 2px 1px #000; }\n\n.psv-markers-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\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-title {\n font: 24px sans-serif;\n margin: 1em 0;\n text-align: center;\n text-shadow: 2px 1px #000; }\n\n.psv-markers-list {\n list-style: none;\n margin: 0;\n padding: 0;\n overflow: hidden; }\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;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 diff --git a/dist/plugins/markers.js b/dist/plugins/markers.js index c667813a6..5d3eadf2a 100644 --- a/dist/plugins/markers.js +++ b/dist/plugins/markers.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -809,7 +809,7 @@ MarkersButton.id = 'markers'; MarkersButton.icon = pin; - var pinList = "\n"; + var icon = "\n"; /** * @summary Navigation bar markers list button class @@ -900,7 +900,7 @@ return MarkersListButton; }(photoSphereViewer.AbstractButton); MarkersListButton.id = 'markersList'; - MarkersListButton.icon = pinList; + MarkersListButton.icon = icon; /** * @typedef {Object} PSV.plugins.MarkersPlugin.Options @@ -1974,7 +1974,7 @@ MarkersPlugin.ID_PANEL_MARKERS_LIST = 'markersList'; MarkersPlugin.MARKERS_LIST_TEMPLATE = function (markers, title, dataKey) { - return "\n
\n

" + title + "

\n
    \n " + markers.map(function (marker) { + 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 32a66ea7d..dd1584921 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 './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

    ${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,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C5H,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;;;;;;;;;;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,CAA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,aAA/B,CAA1B,GAA0E,KAAK3I,GAAL,CAASuL,KAAT,CAAe1H,IAAf,EAA1E;EACD;EACF;EACF;;;IAp8BwC2M;;EAAtB9O,cAEZzB,KAAK;EAFOyB,cASZoF,SAAS;EACdqE,EAAAA,gBAAgB,EAAK,kBADP;EAEdwE,EAAAA,YAAY,EAAS,cAFP;EAGdF,EAAAA,WAAW,EAAU,aAHP;EAId1D,EAAAA,mBAAmB,EAAE,qBAJP;EAKdiE,EAAAA,aAAa,EAAQ,eALP;EAMdzD,EAAAA,kBAAkB,EAAG,oBANP;EAOd4D,EAAAA,eAAe,EAAM,iBAPP;EAQdnJ,EAAAA,YAAY,EAAS,cARP;EASdD,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 diff --git a/dist/plugins/resolution.js b/dist/plugins/resolution.js new file mode 100644 index 000000000..d85ae0c65 --- /dev/null +++ b/dist/plugins/resolution.js @@ -0,0 +1,284 @@ +/*! +* Photo Sphere Viewer 4.0.5 +* @copyright 2014-2015 Jérémy Heleine +* @copyright 2015-2020 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))); +}(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; + subClass.__proto__ = superClass; + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + /** + * @summary Returns deep equality between objects + * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9} + * @param obj1 + * @param obj2 + * @return {boolean} + * @private + */ + function deepEqual(obj1, obj2) { + if (obj1 === obj2) { + return true; + } else if (isObject(obj1) && isObject(obj2)) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) { + return false; + } + + for (var _i = 0, _Object$keys = Object.keys(obj1); _i < _Object$keys.length; _i++) { + var prop = _Object$keys[_i]; + + if (!deepEqual(obj1[prop], obj2[prop])) { + return false; + } + } + + return true; + } else { + return false; + } + } + + function isObject(obj) { + return typeof obj === 'object' && obj != null; + } + + photoSphereViewer.DEFAULTS.lang.resolution = 'Quality'; + /** + * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution + * @property {string} id + * @property {string} label + * @property {string|string[]|PSV.Cubemap} panorama + */ + + /** + * @typedef {Object} PSV.plugins.ResolutionPlugin.Options + * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions + */ + + /** + * @summary Adds a setting to choose between multiple resolutions of the panorama. + * @extends PSV.plugins.AbstractPlugin + * @memberof PSV.plugins + */ + + var ResolutionPlugin = /*#__PURE__*/function (_AbstractPlugin) { + _inheritsLoose(ResolutionPlugin, _AbstractPlugin); + + /** + * @summary Available events + * @enum {string} + * @memberof PSV.plugins.ResolutionPlugin + * @constant + */ + + /** + * @param {PSV.Viewer} psv + * @param {PSV.plugins.ResolutionPlugin.Options} options + */ + function ResolutionPlugin(psv, options) { + var _this; + + _this = _AbstractPlugin.call(this, psv) || this; + /** + * @type {PSV.plugins.SettingsPlugin} + * @readonly + * @private + */ + + _this.settings = SettingsPlugin ? psv.getPlugin(SettingsPlugin) : null; + + if (!_this.settings) { + throw new photoSphereViewer.PSVError('Resolution plugin requires the Settings plugin'); + } + + _this.settings.addSetting({ + id: ResolutionPlugin.id, + type: 'options', + label: _this.psv.config.lang.resolution, + current: function current() { + return _this.prop.resolution ? _this.resolutionsById[_this.prop.resolution].label : ''; + }, + options: function options() { + return _this.__getSettingsOptions(); + }, + apply: function apply(resolution) { + return _this.setResolution(resolution); + } + }); + /** + * @summary Available resolutions + * @member {PSV.plugins.ResolutionPlugin.Resolution[]} + */ + + + _this.resolutions = []; + /** + * @summary Available resolutions + * @member {Object.} + * @private + */ + + _this.resolutionsById = {}; + /** + * @type {Object} + * @property {string} resolution - Current resolution + * @private + */ + + _this.prop = { + resolution: null + }; + + _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, _assertThisInitialized(_this)); + + if (options == null ? void 0 : options.resolutions) { + _this.setResolutions(options.resolutions); + } + + return _this; + } + /** + * @package + */ + + + var _proto = ResolutionPlugin.prototype; + + _proto.destroy = function destroy() { + this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, this); + this.settings.removeSetting(SettingsPlugin.id); + + _AbstractPlugin.prototype.destroy.call(this); + } + /** + * @summary Handles events + * @param {Event} e + * @private + */ + ; + + _proto.handleEvent = function handleEvent(e) { + if (e.type === photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED) { + this.__refreshResolution(); + } + } + /** + * @summary Changes the available resolutions + * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions + */ + ; + + _proto.setResolutions = function setResolutions(resolutions) { + var _this2 = this; + + this.resolutions = resolutions; + this.resolutionsById = {}; + resolutions.forEach(function (resolution) { + if (!resolution.id) { + throw new photoSphereViewer.PSVError('Missing resolution id'); + } + + _this2.resolutionsById[resolution.id] = resolution; + }); + + this.__refreshResolution(); + } + /** + * @summary Changes the current resolution + * @param {string} id + */ + ; + + _proto.setResolution = function setResolution(id) { + if (!this.resolutionsById[id]) { + throw new photoSphereViewer.PSVError("Resolution " + id + " unknown"); + } + + return this.psv.setPanorama(this.resolutionsById[id].panorama, { + transition: false, + showLoader: false + }); + } + /** + * @summary Returns the current resolution + * @return {string} + */ + ; + + _proto.getResolution = function getResolution() { + return this.prop.resolution; + } + /** + * @summary Updates current resolution on panorama load + * @private + */ + ; + + _proto.__refreshResolution = function __refreshResolution() { + var _this3 = this; + + var resolution = this.resolutions.find(function (r) { + return deepEqual(_this3.psv.config.panorama, r.panorama); + }); + + if (this.prop.resolution !== (resolution == null ? void 0 : resolution.id)) { + this.prop.resolution = resolution == null ? void 0 : resolution.id; + this.trigger(ResolutionPlugin.EVENTS.RESOLUTION_CHANGED, this.prop.resolution); + } + } + /** + * @summary Returns options for Settings plugin + * @return {PSV.plugins.SettingsPlugin.Option[]} + * @private + */ + ; + + _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 + }; + }); + }; + + return ResolutionPlugin; + }(photoSphereViewer.AbstractPlugin); + + ResolutionPlugin.id = 'resolution'; + ResolutionPlugin.EVENTS = { + /** + * @event resolution-changed + * @memberof PSV.plugins.ResolutionPlugin + * @summary Triggered when the resolution is changed + * @param {string} resolutionId + */ + RESOLUTION_CHANGED: 'resolution-changed' + }; + + return ResolutionPlugin; + +}))); +//# sourceMappingURL=resolution.js.map diff --git a/dist/plugins/resolution.js.map b/dist/plugins/resolution.js.map new file mode 100644 index 000000000..d4c26e426 --- /dev/null +++ b/dist/plugins/resolution.js.map @@ -0,0 +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,IA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,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 diff --git a/dist/plugins/settings.css b/dist/plugins/settings.css new file mode 100644 index 000000000..a1222bc1f --- /dev/null +++ b/dist/plugins/settings.css @@ -0,0 +1,91 @@ +/*! + * Photo Sphere Viewer 4.0.5 + * @copyright 2014-2015 Jérémy Heleine + * @copyright 2015-2020 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; + flex: 1; + font-weight: bold; +} + +.psv-settings-item-value { + -webkit-box-flex: 0; + -ms-flex: none; + flex: none; +} + +.psv-settings-item-icon { + -webkit-box-flex: 0; + -ms-flex: none; + flex: none; + height: 1em; + width: 1em; +} + +.psv-settings-item-icon svg { + width: 1em; + height: 1em; +} + +.psv-settings-item-icon:first-child { + margin-right: 1em; +} + +.psv-settings-item-icon:last-child { + margin-left: 1em; +} + +.psv-settings-item--header { + border-bottom: 1px solid currentColor; + margin-bottom: 1em; +} + +.psv-settings-item--header svg { + -webkit-transform: scaleX(-1); + transform: scaleX(-1); +} +/*# sourceMappingURL=settings.css.map */ \ No newline at end of file diff --git a/dist/plugins/settings.css.map b/dist/plugins/settings.css.map new file mode 100644 index 000000000..fe1eb4f97 --- /dev/null +++ b/dist/plugins/settings.css.map @@ -0,0 +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 diff --git a/dist/plugins/settings.js b/dist/plugins/settings.js new file mode 100644 index 000000000..25e351aa2 --- /dev/null +++ b/dist/plugins/settings.js @@ -0,0 +1,401 @@ +/*! +* Photo Sphere Viewer 4.0.5 +* @copyright 2014-2015 Jérémy Heleine +* @copyright 2015-2020 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))); +}(this, (function (photoSphereViewer) { 'use strict'; + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + var check = "\n"; + + var chevron = "\n"; + + var icon = "\n"; + + /** + * @summary Navigation bar settings button class + * @extends PSV.buttons.AbstractButton + * @memberof PSV.buttons + */ + + var SettingsButton = /*#__PURE__*/function (_AbstractButton) { + _inheritsLoose(SettingsButton, _AbstractButton); + + /** + * @param {PSV.components.Navbar} navbar + */ + function SettingsButton(navbar) { + var _this; + + _this = _AbstractButton.call(this, navbar, 'psv-button--hover-scale psv-settings-button', true) || this; + /** + * @type {PSV.plugins.SettingsPlugin} + * @private + * @readonly + */ + + _this.plugin = _this.psv.getPlugin(SettingsPlugin.id); + + if (_this.plugin) { + _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL, _assertThisInitialized(_this)); + + _this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL, _assertThisInitialized(_this)); + } + + return _this; + } + /** + * @override + */ + + + var _proto = SettingsButton.prototype; + + _proto.destroy = function destroy() { + this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL, this); + this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL, this); + delete this.plugin; + + _AbstractButton.prototype.destroy.call(this); + } + /** + * @override + */ + ; + + _proto.isSupported = function isSupported() { + return !!this.plugin; + } + /** + * @summary Handles events + * @param {Event} e + * @private + */ + ; + + _proto.handleEvent = function handleEvent(e) { + /* eslint-disable */ + switch (e.type) { + // @formatter:off + case photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL: + this.toggleActive(e.args[0] === SettingsPlugin.ID_PANEL); + break; + + case photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL: + this.toggleActive(false); + break; + // @formatter:on + } + /* eslint-enable */ + + } + /** + * @override + * @description Toggles settings + */ + ; + + _proto.onClick = function onClick() { + this.plugin.toggleSettings(); + }; + + return SettingsButton; + }(photoSphereViewer.AbstractButton); + SettingsButton.id = 'settings'; + SettingsButton.icon = icon; + + var switchOff = "\n"; + + var switchOn = "\n"; + + photoSphereViewer.DEFAULTS.navbar.splice(photoSphereViewer.DEFAULTS.navbar.indexOf('fullscreen'), 0, SettingsButton.id); + photoSphereViewer.DEFAULTS.lang[SettingsButton.id] = 'Settings'; + photoSphereViewer.registerButton(SettingsButton); + /** + * @typedef {Object} PSV.plugins.SettingsPlugin.Setting + * @summary Description of a setting + * @property {string} id - identifier of the setting + * @property {string} label - label of the setting + * @property {'options' | 'toggle'} type - type of the setting + */ + + /** + * @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} 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 + */ + + /** + * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting + * @summary Description of a 'toggle' setting + * @property {'toggle'} type - type of the setting + * @property {function} active - function which return whereas the setting is active or not + * @property {function} toggle - function called when the setting is toggled + */ + + /** + * @typedef {Object} PSV.plugins.SettingsPlugin.Option + * @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 + */ + + /** + * @summary Adds a button to access various settings. + * @extends PSV.plugins.AbstractPlugin + * @memberof PSV.plugins + */ + + var SettingsPlugin = /*#__PURE__*/function (_AbstractPlugin) { + _inheritsLoose(SettingsPlugin, _AbstractPlugin); + + /** + * @summary Panel identifier for settings content + * @type {string} + * @constant + */ + + /** + * @summary Property name added to settings items + * @type {string} + * @constant + */ + + /** + * @summary Settings list template + * @param {PSV.plugins.SettingsPlugin.Setting[]} settings + * @param {string} title + * @param {string} dataKey + * @returns {string} + */ + + /** + * @summary Setting item template, by type + */ + + /** + * @summary Settings options template + * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting + * @param {string} title + * @param {string} dataKey + * @returns {string} + */ + + /** + * @param {PSV.Viewer} psv + */ + function SettingsPlugin(psv) { + var _this; + + _this = _AbstractPlugin.call(this, psv) || this; + /** + * @type {PSV.plugins.SettingsPlugin.Setting[]} + * @private + */ + + _this.settings = []; + return _this; + } + /** + * @package + */ + + + var _proto = SettingsPlugin.prototype; + + _proto.destroy = function destroy() { + _AbstractPlugin.prototype.destroy.call(this); + } + /** + * @summary Registers a new setting + * @param {PSV.plugins.SettingsPlugin.Setting} setting + */ + ; + + _proto.addSetting = function addSetting(setting) { + if (!setting.id) { + throw new photoSphereViewer.PSVError('Missing setting id'); + } + + if (!setting.type) { + throw new photoSphereViewer.PSVError('Missing setting type'); + } + + if (!SettingsPlugin.SETTINGS_TEMPLATE_[setting.type]) { + throw new photoSphereViewer.PSVError('Unsupported setting type'); + } + + this.settings.push(setting); + + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.showSettings(); + } + } + /** + * @summary Removes a setting + * @param {string} id + */ + ; + + _proto.removeSetting = function removeSetting(id) { + var idx = -1; // FIXME use findIndex, one day, when IE11 is totally dead + + this.settings.some(function (setting, i) { + if (setting.id === id) { + idx = i; + return true; + } + + return false; + }); + + if (idx !== -1) { + this.settings.splice(idx, 1); + + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.showSettings(); + } + } + } + /** + * @summary Toggles the settings panel + */ + ; + + _proto.toggleSettings = function toggleSettings() { + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.hideSettings(); + } else { + this.showSettings(); + } + } + /** + * @summary Hides the settings panel + */ + ; + + _proto.hideSettings = function hideSettings() { + this.psv.panel.hide(SettingsPlugin.ID_PANEL); + } + /** + * @summary Shows the settings panel + */ + ; + + _proto.showSettings = function showSettings() { + var _this2 = this; + + 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)), + noMargin: true, + clickHandler: function clickHandler(e) { + var li = e.target ? photoSphereViewer.utils.getClosest(e.target, 'li') : undefined; + var settingId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined; + + var setting = _this2.settings.find(function (s) { + return s.id === settingId; + }); + + if (setting) { + switch (setting.type) { + case 'toggle': + setting.toggle(); + + _this2.showSettings(); + + break; + + case 'options': + _this2.__showOptions(setting); + + break; + + } + } + } + }); + } + /** + * @summary Shows setting options panel + * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting + * @private + */ + ; + + _proto.__showOptions = function __showOptions(setting) { + var _this3 = this; + + 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)), + noMargin: true, + clickHandler: function clickHandler(e) { + var li = e.target ? photoSphereViewer.utils.getClosest(e.target, 'li') : undefined; + var optionId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined; + + if (optionId === '__back') { + _this3.showSettings(); + } else { + setting.apply(optionId); + + _this3.hideSettings(); + } + } + }); + }; + + return SettingsPlugin; + }(photoSphereViewer.AbstractPlugin); + + SettingsPlugin.id = 'settings'; + 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_ = { + options: function options(setting) { + return "\n " + setting.label + " \n " + setting.current() + " \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
    "; + }; + + return SettingsPlugin; + +}))); +//# sourceMappingURL=settings.js.map diff --git a/dist/plugins/settings.js.map b/dist/plugins/settings.js.map new file mode 100644 index 000000000..42252053d --- /dev/null +++ b/dist/plugins/settings.js.map @@ -0,0 +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,0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9C,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 diff --git a/dist/plugins/stereo.js b/dist/plugins/stereo.js index a5115b9d8..39c289274 100644 --- a/dist/plugins/stereo.js +++ b/dist/plugins/stereo.js @@ -1,12 +1,12 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 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/plugins/gyroscope'), require('three')) : - typeof define === 'function' && define.amd ? define(['photo-sphere-viewer', 'photo-sphere-viewer/plugins/gyroscope', 'three'], 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))); }(this, (function (photoSphereViewer, GyroscopePlugin, THREE) { 'use strict'; @@ -209,7 +209,7 @@ _this.gyroscope = GyroscopePlugin ? psv.getPlugin(GyroscopePlugin) : null; if (!_this.gyroscope) { - throw new photoSphereViewer.PSVError('Stereo plugin requires the gyroscope plugin'); + throw new photoSphereViewer.PSVError('Stereo plugin requires the Gyroscope plugin'); } /** * @member {Object} diff --git a/dist/plugins/stereo.js.map b/dist/plugins/stereo.js.map index 73c2998ba..bf18238e5 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":["/**\n * @author alteredq / http://alteredqualia.com/\n * @authod mrdoob / http://mrdoob.com/\n * @authod arodic / http://aleksandarrodic.com/\n * @authod fonserbc / http://fonserbc.github.io/\n*/\n\nTHREE.StereoEffect = function ( renderer ) {\n\n\tvar _stereo = new THREE.StereoCamera();\n\t_stereo.aspect = 0.5;\n\tvar size = new THREE.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","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/plugins/gyroscope';\nimport * as THREE from 'three';\nimport 'three/examples/js/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/js/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 */\n this.prop = {\n isSupported: this.gyroscope.prop.isSupported,\n renderer : null,\n noSleep : 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 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 THREE.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 NoSleep.js\n * TODO WakeLock API when available https://web.dev/wakelock\n * @private\n */\n __startNoSleep() {\n if (!('NoSleep' in window)) {\n utils.logWarn('NoSleep is not available');\n return;\n }\n\n if (!this.prop.noSleep) {\n this.prop.noSleep = new window.NoSleep();\n }\n\n this.prop.noSleep.enable();\n }\n\n /**\n * @summary Disables NoSleep.js\n * @private\n */\n __stopNoSleep() {\n 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":["THREE","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","markers","CONSTANTS","STOP_ALL","CLICK","stop","isEnabled","start","enterFullscreen","__startNoSleep","__lockOrientation","then","needsUpdate","hide","panel","trigger","notification","show","content","config","timeout","__unlockOrientation","__stopNoSleep","exitFullscreen","window","utils","logWarn","NoSleep","enable","disable","displayRotateMessageTimeout","displayRotateMessage","innerHeight","innerWidth","overlay","ID_OVERLAY_PLEASE_ROTATE","image","mobileRotateIcon","text","subtext","clearTimeout","screen","orientation","lock","setTimeout","unlock","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;AAOAA,gBAAK,CAACC,YAAN,GAAqB,UAAWC,QAAX,EAAsB;EAE1C,MAAIC,OAAO,GAAG,IAAIH,cAAK,CAACI,YAAV,EAAd;;EACAD,EAAAA,OAAO,CAACE,MAAR,GAAiB,GAAjB;EACA,MAAIC,IAAI,GAAG,IAAIN,cAAK,CAACO,OAAV,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,QAAKD,MAAM,CAACE,MAAP,KAAkB,IAAvB,EAA8BF,MAAM,CAACC,iBAAP;;EAE9Bb,IAAAA,OAAO,CAACe,MAAR,CAAgBH,MAAhB;;EAEAb,IAAAA,QAAQ,CAACiB,OAAT,CAAkBb,IAAlB;EAEA,QAAKJ,QAAQ,CAACkB,SAAd,EAA0BlB,QAAQ,CAACmB,KAAT;EAC1BnB,IAAAA,QAAQ,CAACoB,cAAT,CAAyB,IAAzB;EAEAp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AAY,CAACiE,wBAAnC;EACD;EACF;;;IA7PuCW;;EAArB5E,aAEZC,KAAK;EAFOD,aASZiE,2BAA2B;EATfjE,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":["/**\n * @author alteredq / http://alteredqualia.com/\n * @authod mrdoob / http://mrdoob.com/\n * @authod arodic / http://aleksandarrodic.com/\n * @authod fonserbc / http://fonserbc.github.io/\n*/\n\nTHREE.StereoEffect = function ( renderer ) {\n\n\tvar _stereo = new THREE.StereoCamera();\n\t_stereo.aspect = 0.5;\n\tvar size = new THREE.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","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 * as THREE from 'three';\nimport 'three/examples/js/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/js/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 */\n this.prop = {\n isSupported: this.gyroscope.prop.isSupported,\n renderer : null,\n noSleep : 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 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 THREE.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 NoSleep.js\n * TODO WakeLock API when available https://web.dev/wakelock\n * @private\n */\n __startNoSleep() {\n if (!('NoSleep' in window)) {\n utils.logWarn('NoSleep is not available');\n return;\n }\n\n if (!this.prop.noSleep) {\n this.prop.noSleep = new window.NoSleep();\n }\n\n this.prop.noSleep.enable();\n }\n\n /**\n * @summary Disables NoSleep.js\n * @private\n */\n __stopNoSleep() {\n 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":["THREE","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","markers","CONSTANTS","STOP_ALL","CLICK","stop","isEnabled","start","enterFullscreen","__startNoSleep","__lockOrientation","then","needsUpdate","hide","panel","trigger","notification","show","content","config","timeout","__unlockOrientation","__stopNoSleep","exitFullscreen","window","utils","logWarn","NoSleep","enable","disable","displayRotateMessageTimeout","displayRotateMessage","innerHeight","innerWidth","overlay","ID_OVERLAY_PLEASE_ROTATE","image","mobileRotateIcon","text","subtext","clearTimeout","screen","orientation","lock","setTimeout","unlock","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;AAOAA,gBAAK,CAACC,YAAN,GAAqB,UAAWC,QAAX,EAAsB;EAE1C,MAAIC,OAAO,GAAG,IAAIH,cAAK,CAACI,YAAV,EAAd;;EACAD,EAAAA,OAAO,CAACE,MAAR,GAAiB,GAAjB;EACA,MAAIC,IAAI,GAAG,IAAIN,cAAK,CAACO,OAAV,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,QAAKD,MAAM,CAACE,MAAP,KAAkB,IAAvB,EAA8BF,MAAM,CAACC,iBAAP;;EAE9Bb,IAAAA,OAAO,CAACe,MAAR,CAAgBH,MAAhB;;EAEAb,IAAAA,QAAQ,CAACiB,OAAT,CAAkBb,IAAlB;EAEA,QAAKJ,QAAQ,CAACkB,SAAd,EAA0BlB,QAAQ,CAACmB,KAAT;EAC1BnB,IAAAA,QAAQ,CAACoB,cAAT,CAAyB,IAAzB;EAEApB,IAAAA,QAAQ,CAACqB,UAAT,CAAqB,CAArB,EAAwB,CAAxB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C,KAAK;EAFOD,aASZiE,2BAA2B;EATfjE,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 cced36674..f863f693b 100644 --- a/dist/plugins/visible-range.js +++ b/dist/plugins/visible-range.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/viewer-compat.js b/dist/viewer-compat.js index 1ce9ea4b0..f0bd44e9f 100644 --- a/dist/viewer-compat.js +++ b/dist/viewer-compat.js @@ -1,12 +1,12 @@ /*! -* Photo Sphere Viewer 4.0.4 +* Photo Sphere Viewer 4.0.5 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2020 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/plugins/gyroscope'), require('photo-sphere-viewer/plugins/stereo'), require('photo-sphere-viewer/plugins/markers'), require('photo-sphere-viewer/plugins/visible-range')) : - typeof define === 'function' && define.amd ? define(['three', 'photo-sphere-viewer', 'photo-sphere-viewer/plugins/gyroscope', 'photo-sphere-viewer/plugins/stereo', 'photo-sphere-viewer/plugins/markers', 'photo-sphere-viewer/plugins/visible-range'], 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))); }(this, (function (THREE, photoSphereViewer, GyroscopePlugin, StereoPlugin, MarkersPlugin, VisibleRangePlugin) { 'use strict'; diff --git a/dist/viewer-compat.js.map b/dist/viewer-compat.js.map index 179cafe9c..244a7663e 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/plugins/gyroscope';\nimport StereoPlugin from 'photo-sphere-viewer/plugins/stereo';\nimport MarkersPlugin from 'photo-sphere-viewer/plugins/markers';\nimport VisibleRangePlugin from 'photo-sphere-viewer/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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"],"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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AKD,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 diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 60d10afdd..33b2eee6c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -62,6 +62,8 @@ module.exports = { 'plugin-autorotate-keypoints', 'plugin-gyroscope', 'plugin-markers', + 'plugin-resolution', + 'plugin-settings', 'plugin-stereo', 'plugin-visible-range', ], diff --git a/docs/plugins/plugin-resolution.md b/docs/plugins/plugin-resolution.md new file mode 100644 index 000000000..c9b6e8d1a --- /dev/null +++ b/docs/plugins/plugin-resolution.md @@ -0,0 +1,64 @@ +# ResolutionPlugin + + + +> Adds a button to choose between multiple resolutions of the panorama. **Requires the [Settings plugin](./plugin-settings.md).** + +This plugin is available in the core `photo-sphere-viewer` package in `dist/plugins/resolution.js`. + +[[toc]] + + +## Usage + +Once enabled the plugin will add a new setting the user can use to change the resolution of the panorama. + +```js +const viewer = new PhotoSphereViewer.Viewer({ + panorama: 'sphere_small.jpg', + plugins: [ + PhotoSphereViewer.SettingsPlugin, + [PhotoSphereViewer.ResolutionPlugin, { + resolutions: [ + { + id : 'small', + label : 'Small', + panorama: 'sphere_small.jpg', + }, + { + id : 'normal', + label : 'Normal', + panorama: 'sphere.jpg', + }, + ], + }], + ], +}); +``` + + +## Example + +The following example provides two resolutions for the panorama, "small" is loaded by default. + + + + +## Configuration + +#### `resolutions` +- type: `object[]` + +List of available resolutions. Each resolution consist of an object with the properties `id`, `label` and `panorama`. +Cubemaps are supported. + +#### `lang` +- type: `object` +- default: +```js +lang: { + resolution : 'Quality', +} +``` + +_Note: this option is not part of the plugin but is merged with the main [`lang`](../guide/config.md#lang) object._ diff --git a/docs/plugins/plugin-settings.md b/docs/plugins/plugin-settings.md new file mode 100644 index 000000000..5f5d26a7f --- /dev/null +++ b/docs/plugins/plugin-settings.md @@ -0,0 +1,80 @@ +# SettingsPlugin + + + +> This plugin does nothing on it's own but is required by other plugins. + +This plugin is available in the core `photo-sphere-viewer` package in `dist/plugins/settings.js` and `dist/plugins/settings.css`. + +[[toc]] + + +## Usage + +Once enabled the plugin will add a new "Settings" button which other plugins cas use to display various settings in the side panel. + +```js +const viewer = new PhotoSphereViewer.Viewer({ + plugins: [ + PhotoSphereViewer.SettingsPlugin, + ], +}); +``` + + +## Example + +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. + +### Toggle setting + +This a setting which has only two values : `true` and `false`. It is required to provide the `active(): boolean` and `toggle(): void` functions. + +```js +settings.addSetting({ + id : 'custom-toggle-setting', + label : 'Toggle setting', + type : 'toggle', + active: () => enabled, + toggle: () => enabled = !enabled, +}); +``` + +### Options setting + +This is a setting which has multiple available values (or options). It is required to provide the `current(): string`, `options(): Options[]` and `apply(option: string): void` functions. + +```js +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' }, + ]), + toggle : (option) => currentOption = option, +}); +``` + + +## Configuration + +#### `lang` +- type: `object` +- default: +```js +lang: { + settings : 'Settings', +} +``` + +_Note: this option is not part of the plugin but is merged with the main [`lang`](../guide/config.md#lang) object._ diff --git a/docs/plugins/plugin-stereo.md b/docs/plugins/plugin-stereo.md index c9e06852d..f3f1ee524 100644 --- a/docs/plugins/plugin-stereo.md +++ b/docs/plugins/plugin-stereo.md @@ -2,7 +2,7 @@ -> Adds stereo view on mobile devices. **Requires the Gyroscope plugin.** +> Adds stereo view on mobile devices. **Requires the [Gyroscope plugin](./plugin-gyroscope.md).** This plugin is available in the core `photo-sphere-viewer` package in `dist/plugins/stereo.js`. diff --git a/docs/plugins/writing-a-plugin.md b/docs/plugins/writing-a-plugin.md index 52aed9d39..a440ccf4b 100644 --- a/docs/plugins/writing-a-plugin.md +++ b/docs/plugins/writing-a-plugin.md @@ -181,6 +181,47 @@ import customIcon from './icons/custom.svg'; static icon = customIcon; ``` +## Viewer settings + +A plugin can expose one or more settings to the viewer by using the [Settings plugin](./plugin-settings.md). + +This is done by requiring the settings plugin and calling the `addSetting` method. Consult the [Settings plugin](./plugin-settings.md) page for more information. + +```js +import SettingsPlugin from 'photo-sphere-viewer/plugins/settings'; + +export default class PhotoSphereViewerCustomPlugin extends AbstractPlugin { + + constructor(psv) { + super(psv); + + /** + * @type {PSV.plugins.SettingsPlugin} + */ + this.settings = SettingsPlugin ? psv.getPlugin(SettingsPlugin) : null; + + if (this.settings) { + this.settings.addSetting({ + id : 'custom-setting', + type : 'toggle', + label : 'Custom setting', + active: () => this.isActive(), + toggle: () => this.toggle(), + }); + } + } + + destroy() { + if (this.settings) { + this.settings.removeSetting('custom-setting'); + delete this.settings; + } + + super.destroy(); + } + +} +``` ## Naming and publishing diff --git a/example/Bryce-Canyon-By-Jess-Beauchemin.jpg b/example/Bryce-Canyon-By-Jess-Beauchemin.jpg deleted file mode 100644 index e8d521e1d..000000000 Binary files a/example/Bryce-Canyon-By-Jess-Beauchemin.jpg and /dev/null differ diff --git a/example/Bryce-Canyon-National-Park-Mark-Doliner.jpg b/example/Bryce-Canyon-National-Park-Mark-Doliner.jpg deleted file mode 100644 index a20dc0e6e..000000000 Binary files a/example/Bryce-Canyon-National-Park-Mark-Doliner.jpg and /dev/null differ diff --git a/example/compat.html b/example/compat.html index c428681ad..c739465db 100644 --- a/example/compat.html +++ b/example/compat.html @@ -32,16 +32,14 @@ diff --git a/example/cubemap.html b/example/cubemap.html index d9d0e288f..0cdb2e119 100644 --- a/example/cubemap.html +++ b/example/cubemap.html @@ -45,14 +45,14 @@ var panos = [ { url : { - left : 'suntemple-cubemap/left.jpg', - front : 'suntemple-cubemap/front.jpg', - right : 'suntemple-cubemap/right.jpg', - back : 'suntemple-cubemap/back.jpg', - top : 'suntemple-cubemap/top.jpg', - bottom: 'suntemple-cubemap/bottom.jpg' + left : 'cubemap/px.jpg', + front : 'cubemap/nz.jpg', + right : 'cubemap/nx.jpg', + back : 'cubemap/pz.jpg', + top : 'cubemap/py.jpg', + bottom: 'cubemap/ny.jpg' }, - desc: 'Sun Temple (Unreal 4)' + desc: 'Parc national du Mercantour © Damien Sorel', }, { url : [ @@ -63,8 +63,8 @@ 'test-cubemap/5.png', 'test-cubemap/6.png' ], - desc: 'Test cubemap' - } + desc: 'Test cubemap', + }, ]; var PSV = new PhotoSphereViewer.Viewer({ @@ -85,7 +85,7 @@ i = 1 - i; markers.clearMarkers(); - PSV.setPanorama(panos[i].url, { zoom: 50 }) + PSV.setPanorama(panos[i].url, { longitude: 0, latitude: 0, zoom: 50 }) .then(function () { PSV.navbar.setCaption(panos[i].desc); }, function () {}); @@ -130,12 +130,28 @@ } a.push({ - id : 'statue', - tooltip : 'Angel', - svgStyle : { + id : 'polygon', + svgStyle : { fill: 'rgba(255, 0, 111, 0.26)', }, - polygonRad: [5.4196, 0.6801, 5.4644, 0.7610, 5.5004, 0.9194, 5.6522, 0.9363, 5.6923, 0.9757, 5.8132, 0.9662, 5.8625, 0.9315, 5.8905, 0.9991, 6.0215, 1.0558, 0.0822, 0.9023, 6.2390, 0.8732, 6.0377, 0.8648, 5.8348, 0.8780, 5.7862, 0.8678, 5.8175, 0.8614, 5.8431, 0.8128, 5.8354, 0.7028, 5.8620, 0.6204, 5.8815, 0.4776, 5.9339, 0.3234, 5.7591, 0.3510, 5.5885, 0.3273, 5.6381, 0.4327, 5.6353, 0.5043, 5.5959, 0.6228, 5.5877, 0.7108, 5.5952, 0.7519, 5.5775, 0.7502, 5.5021, 0.7012], + polylineRad: [ + [6.2208, 0.0906], + [0.0443, 0.1028], + [0.2322, 0.0849], + [0.4531, 0.0387], + [0.5022, -0.0056], + [0.4587, -0.0396], + [0.2520, -0.0453], + [0.0434, -0.0575], + [6.1302, -0.0623], + [6.0094, -0.0169], + [6.0471, 0.0320], + [6.2208, 0.0906], + ], + tooltip : { + content : 'This is a mountain', + position: 'right bottom', + }, }); return a; diff --git a/example/cubemap/nx.jpg b/example/cubemap/nx.jpg new file mode 100644 index 000000000..eac48f8d4 Binary files /dev/null and b/example/cubemap/nx.jpg differ diff --git a/example/cubemap/ny.jpg b/example/cubemap/ny.jpg new file mode 100644 index 000000000..8de23439d Binary files /dev/null and b/example/cubemap/ny.jpg differ diff --git a/example/cubemap/nz.jpg b/example/cubemap/nz.jpg new file mode 100644 index 000000000..8ebb3e423 Binary files /dev/null and b/example/cubemap/nz.jpg differ diff --git a/example/cubemap/px.jpg b/example/cubemap/px.jpg new file mode 100644 index 000000000..8e880ab66 Binary files /dev/null and b/example/cubemap/px.jpg differ diff --git a/example/cubemap/py.jpg b/example/cubemap/py.jpg new file mode 100644 index 000000000..479e65ce6 Binary files /dev/null and b/example/cubemap/py.jpg differ diff --git a/example/cubemap/pz.jpg b/example/cubemap/pz.jpg new file mode 100644 index 000000000..7ea0d3ed0 Binary files /dev/null and b/example/cubemap/pz.jpg differ diff --git a/example/equirectangular.html b/example/equirectangular.html index 48c08f198..907952d8f 100644 --- a/example/equirectangular.html +++ b/example/equirectangular.html @@ -42,36 +42,24 @@ + + + + + + + + + diff --git a/example/plugin-visible-range.html b/example/plugin-visible-range.html index 151f44044..784f7edd0 100644 --- a/example/plugin-visible-range.html +++ b/example/plugin-visible-range.html @@ -46,25 +46,24 @@ }; const viewer = new PhotoSphereViewer.Viewer({ - container : 'photosphere', - panorama : 'Bryce-Canyon-National-Park-Mark-Doliner.jpg', - caption : 'Bryce Canyon National Park © Mark Doliner', - loadingImg : 'assets/photosphere-logo.gif', - defaultZoomLvl: 50, - navbar: [ + container : 'photosphere', + panorama : 'sphere.jpg', + caption : 'Parc national du Mercantour © Damien Sorel', + loadingImg: 'assets/photosphere-logo.gif', + navbar : [ 'autorotate', { - content: 'Clear range', + content : 'Clear range', className: 'custom-button', - onClick: function() { + onClick : function () { visibleRange.setLongitudeRange(null); visibleRange.setLatitudeRange(null); }, }, { - content: 'Set range', + content : 'Set range', className: 'custom-button', - onClick: function() { + onClick : function () { visibleRange.setLongitudeRange(ranges.longitudeRange); visibleRange.setLatitudeRange(ranges.latitudeRange); }, @@ -72,7 +71,7 @@ 'caption', 'fullscreen', ], - plugins : [ + plugins : [ [PhotoSphereViewer.VisibleRangePlugin, ranges], ], }); diff --git a/example/sphere.jpg b/example/sphere.jpg new file mode 100644 index 000000000..db232847e Binary files /dev/null and b/example/sphere.jpg differ diff --git a/example/sphere_small.jpg b/example/sphere_small.jpg new file mode 100644 index 000000000..4b86fca31 Binary files /dev/null and b/example/sphere_small.jpg differ diff --git a/example/suntemple-cubemap/back.jpg b/example/suntemple-cubemap/back.jpg deleted file mode 100644 index 196174516..000000000 Binary files a/example/suntemple-cubemap/back.jpg and /dev/null differ diff --git a/example/suntemple-cubemap/bottom.jpg b/example/suntemple-cubemap/bottom.jpg deleted file mode 100644 index 2a6658106..000000000 Binary files a/example/suntemple-cubemap/bottom.jpg and /dev/null differ diff --git a/example/suntemple-cubemap/front.jpg b/example/suntemple-cubemap/front.jpg deleted file mode 100644 index 4b2ed66ae..000000000 Binary files a/example/suntemple-cubemap/front.jpg and /dev/null differ diff --git a/example/suntemple-cubemap/left.jpg b/example/suntemple-cubemap/left.jpg deleted file mode 100644 index 0f7a68c9f..000000000 Binary files a/example/suntemple-cubemap/left.jpg and /dev/null differ diff --git a/example/suntemple-cubemap/right.jpg b/example/suntemple-cubemap/right.jpg deleted file mode 100644 index c27d52536..000000000 Binary files a/example/suntemple-cubemap/right.jpg and /dev/null differ diff --git a/example/suntemple-cubemap/top.jpg b/example/suntemple-cubemap/top.jpg deleted file mode 100644 index 30b8bd0b2..000000000 Binary files a/example/suntemple-cubemap/top.jpg and /dev/null differ diff --git a/example/test-sphere.jpg b/example/test-sphere.jpg new file mode 100644 index 000000000..3cbc9ab07 Binary files /dev/null and b/example/test-sphere.jpg differ diff --git a/package.json b/package.json index fa4c2079b..b58e9b7f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photo-sphere-viewer", - "version": "4.0.4", + "version": "4.0.5", "description": "A JavaScript library to display Photo Sphere panoramas", "homepage": "https://photo-sphere-viewer.js.org", "main": "dist/photo-sphere-viewer.js", @@ -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/Bryce-Canyon-National-Park-Mark-Doliner.jpg public/assets && cpx \"example/suntemple-cubemap/*\" public/assets/suntemple-cubemap", + "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", "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 94ae113de..b60096e97 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -80,7 +80,7 @@ const secondaryConfig = { ...baseConfig.output.globals, 'photo-sphere-viewer': 'PhotoSphereViewer', ...plugins.reduce((globals, p) => { - globals[`photo-sphere-viewer/plugins/${p}`] = `PhotoSphereViewer.${camelize(p)}Plugin`; + globals[`photo-sphere-viewer/dist/plugins/${p}`] = `PhotoSphereViewer.${camelize(p)}Plugin`; return globals; }, {}), }, @@ -88,7 +88,7 @@ const secondaryConfig = { external: [ ...baseConfig.external, 'photo-sphere-viewer', - ...plugins.map(p => `photo-sphere-viewer/plugins/${p}`), + ...plugins.map(p => `photo-sphere-viewer/dist/plugins/${p}`), ], plugins: () => [ @@ -96,7 +96,7 @@ const secondaryConfig = { alias({ 'photo-sphere-viewer': './src', ...plugins.reduce((alias, p) => { - alias[`photo-sphere-viewer/plugins/${p}`] = `./src/plugins/${p}`; + alias[`photo-sphere-viewer/dist/plugins/${p}`] = `./src/plugins/${p}`; return alias; }, {}), }), diff --git a/src/Animation.js b/src/Animation.js index 6ba699eb2..4bca0398c 100644 --- a/src/Animation.js +++ b/src/Animation.js @@ -3,8 +3,9 @@ import { each } from './utils'; /** * @callback OnTick + * @summary Function called for each animation frame with computed properties * @memberOf PSV.Animation - * @param {Object[]} properties - current values + * @param {Object.} properties - current values * @param {float} progress - 0 to 1 */ @@ -27,7 +28,7 @@ export class Animation { /** * @param {Object} options - * @param {Object[]} options.properties + * @param {Object.} options.properties * @param {number} options.properties[].start * @param {number} options.properties[].end * @param {number} options.duration diff --git a/src/Viewer.js b/src/Viewer.js index 84857b56e..5f3ae7773 100644 --- a/src/Viewer.js +++ b/src/Viewer.js @@ -337,7 +337,7 @@ export class Viewer extends EventEmitter { * @returns {PSV.plugins.AbstractPlugin} */ getPlugin(pluginId) { - return this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId]; + return pluginId ? this.plugins[typeof pluginId === 'function' ? pluginId.id : pluginId] : null; } /** @@ -433,7 +433,7 @@ export class Viewer extends EventEmitter { this.textureLoader.abortLoading(); } - if (!this.prop.isReady) { + if (!this.prop.ready) { if (!('longitude' in options) && !this.prop.isCubemap) { options.longitude = this.config.defaultLong; } diff --git a/src/ViewerCompat.js b/src/ViewerCompat.js index 4cc4556f0..c580441b5 100644 --- a/src/ViewerCompat.js +++ b/src/ViewerCompat.js @@ -1,9 +1,9 @@ import * as THREE from 'three'; import { DEFAULTS, utils, Viewer } from 'photo-sphere-viewer'; -import GyroscopePlugin from 'photo-sphere-viewer/plugins/gyroscope'; -import StereoPlugin from 'photo-sphere-viewer/plugins/stereo'; -import MarkersPlugin from 'photo-sphere-viewer/plugins/markers'; -import VisibleRangePlugin from 'photo-sphere-viewer/plugins/visible-range'; +import GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope'; +import StereoPlugin from 'photo-sphere-viewer/dist/plugins/stereo'; +import MarkersPlugin from 'photo-sphere-viewer/dist/plugins/markers'; +import VisibleRangePlugin from 'photo-sphere-viewer/dist/plugins/visible-range'; /** * @private diff --git a/src/components/Panel.js b/src/components/Panel.js index 1e1a0a8b0..f6c493c68 100644 --- a/src/components/Panel.js +++ b/src/components/Panel.js @@ -144,6 +144,11 @@ export class Panel extends AbstractComponent { this.prop.contentId = config.id; this.prop.visible = true; + if (this.prop.clickHandler) { + this.content.removeEventListener('click', this.prop.clickHandler); + this.prop.clickHandler = null; + } + this.content.innerHTML = config.content; this.content.scrollTop = 0; this.container.classList.add('psv-panel--open'); diff --git a/src/index.js b/src/index.js index 7ca60407f..77eae140f 100644 --- a/src/index.js +++ b/src/index.js @@ -91,13 +91,21 @@ export { * @property {string} back */ +/** + * @callback PanoDataProvider + * @summary Function to compute panorama data once the image is loaded + * @memberOf PSV + * @param {Image} image - loaded image + * @returns {PSV.PanoData} computed panorama data + */ + /** * @typedef {PSV.AnimateOptions} PSV.PanoramaOptions * @summary Object defining panorama and animation options * @property {boolean|number} [transition=1500] - duration of the transition between all and new panorama * @property {boolean} [showLoader=true] - show the loader * @property {PSV.SphereCorrection} [sphereCorrection] - new sphere correction to apply to the panorama - * @property {PSV.PanoData | function} [panoData] - new panorama data used for this panorama + * @property {PSV.PanoData | PSV.PanoDataProvider} [panoData] - new panorama data used for this panorama */ /** diff --git a/src/plugins/markers/index.js b/src/plugins/markers/index.js index f51090dca..81f17d423 100644 --- a/src/plugins/markers/index.js +++ b/src/plugins/markers/index.js @@ -3,6 +3,7 @@ import * as THREE from 'three'; import { Marker } from './Marker'; import { MarkersButton } from './MarkersButton'; import { MarkersListButton } from './MarkersListButton'; +import icon from './pin-list.svg'; import './style.scss'; /** @@ -90,7 +91,7 @@ export default class MarkersPlugin extends AbstractPlugin { */ static MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => `
    -

    ${title}

    +

    ${icon} ${title}

      ${markers.map(marker => `
    • diff --git a/src/plugins/markers/pin-list.svg b/src/plugins/markers/pin-list.svg index 1db48b324..e66284133 100644 --- a/src/plugins/markers/pin-list.svg +++ b/src/plugins/markers/pin-list.svg @@ -1 +1 @@ - + diff --git a/src/plugins/markers/style.scss b/src/plugins/markers/style.scss index 2da0df1c7..a45cffe50 100644 --- a/src/plugins/markers/style.scss +++ b/src/plugins/markers/style.scss @@ -44,19 +44,25 @@ } } -.psv-markers-list-title { - font: $psv-markers-list-title-font; - margin: 1em 0; - text-align: center; - text-shadow: $psv-markers-list-title-shadow; -} - .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; diff --git a/src/plugins/resolution/index.js b/src/plugins/resolution/index.js new file mode 100644 index 000000000..9e217a49d --- /dev/null +++ b/src/plugins/resolution/index.js @@ -0,0 +1,189 @@ +import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError } from 'photo-sphere-viewer'; +import SettingsPlugin from 'photo-sphere-viewer/dist/plugins/settings'; +import { deepEqual } from './utils'; + + +DEFAULTS.lang.resolution = 'Quality'; + + +/** + * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution + * @property {string} id + * @property {string} label + * @property {string|string[]|PSV.Cubemap} panorama + */ + +/** + * @typedef {Object} PSV.plugins.ResolutionPlugin.Options + * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions + */ + +/** + * @summary Adds a setting to choose between multiple resolutions of the panorama. + * @extends PSV.plugins.AbstractPlugin + * @memberof PSV.plugins + */ +export default class ResolutionPlugin extends AbstractPlugin { + + static id = 'resolution'; + + /** + * @summary Available events + * @enum {string} + * @memberof PSV.plugins.ResolutionPlugin + * @constant + */ + static EVENTS = { + /** + * @event resolution-changed + * @memberof PSV.plugins.ResolutionPlugin + * @summary Triggered when the resolution is changed + * @param {string} resolutionId + */ + RESOLUTION_CHANGED: 'resolution-changed', + }; + + /** + * @param {PSV.Viewer} psv + * @param {PSV.plugins.ResolutionPlugin.Options} options + */ + constructor(psv, options) { + super(psv); + + /** + * @type {PSV.plugins.SettingsPlugin} + * @readonly + * @private + */ + this.settings = SettingsPlugin ? psv.getPlugin(SettingsPlugin) : null; + + if (!this.settings) { + throw new PSVError('Resolution plugin requires the Settings plugin'); + } + + this.settings.addSetting({ + id : ResolutionPlugin.id, + type : 'options', + label : this.psv.config.lang.resolution, + current: () => (this.prop.resolution ? this.resolutionsById[this.prop.resolution].label : ''), + options: () => this.__getSettingsOptions(), + apply : resolution => this.setResolution(resolution), + }); + + /** + * @summary Available resolutions + * @member {PSV.plugins.ResolutionPlugin.Resolution[]} + */ + this.resolutions = []; + + /** + * @summary Available resolutions + * @member {Object.} + * @private + */ + this.resolutionsById = {}; + + /** + * @type {Object} + * @property {string} resolution - Current resolution + * @private + */ + this.prop = { + resolution: null, + }; + + this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this); + + if (options?.resolutions) { + this.setResolutions(options.resolutions); + } + } + + /** + * @package + */ + destroy() { + this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this); + + this.settings.removeSetting(SettingsPlugin.id); + + super.destroy(); + } + + /** + * @summary Handles events + * @param {Event} e + * @private + */ + handleEvent(e) { + if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) { + this.__refreshResolution(); + } + } + + /** + * @summary Changes the available resolutions + * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions + */ + setResolutions(resolutions) { + this.resolutions = resolutions; + this.resolutionsById = {}; + + resolutions.forEach((resolution) => { + if (!resolution.id) { + throw new PSVError('Missing resolution id'); + } + this.resolutionsById[resolution.id] = resolution; + }); + + this.__refreshResolution(); + } + + /** + * @summary Changes the current resolution + * @param {string} id + */ + setResolution(id) { + if (!this.resolutionsById[id]) { + throw new PSVError(`Resolution ${id} unknown`); + } + + return this.psv.setPanorama(this.resolutionsById[id].panorama, { transition: false, showLoader: false }); + } + + /** + * @summary Returns the current resolution + * @return {string} + */ + getResolution() { + return this.prop.resolution; + } + + /** + * @summary Updates current resolution on panorama load + * @private + */ + __refreshResolution() { + const resolution = this.resolutions.find(r => deepEqual(this.psv.config.panorama, r.panorama)); + if (this.prop.resolution !== resolution?.id) { + this.prop.resolution = resolution?.id; + this.trigger(ResolutionPlugin.EVENTS.RESOLUTION_CHANGED, this.prop.resolution); + } + } + + /** + * @summary Returns options for Settings plugin + * @return {PSV.plugins.SettingsPlugin.Option[]} + * @private + */ + __getSettingsOptions() { + return this.resolutions + .map(resolution => ({ + type : 'button', + id : resolution.id, + active: resolution.id === this.prop.resolution, + label : resolution.label, + })); + } + +} diff --git a/src/plugins/resolution/utils.js b/src/plugins/resolution/utils.js new file mode 100644 index 000000000..01b1569a0 --- /dev/null +++ b/src/plugins/resolution/utils.js @@ -0,0 +1,31 @@ +/** + * @summary Returns deep equality between objects + * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9} + * @param obj1 + * @param obj2 + * @return {boolean} + * @private + */ +export function deepEqual(obj1, obj2) { + if (obj1 === obj2) { + return true; + } + else if (isObject(obj1) && isObject(obj2)) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) { + return false; + } + for (const prop of Object.keys(obj1)) { + if (!deepEqual(obj1[prop], obj2[prop])) { + return false; + } + } + return true; + } + else { + return false; + } +} + +function isObject(obj) { + return typeof obj === 'object' && obj != null; +} diff --git a/src/plugins/settings/SettingsButton.js b/src/plugins/settings/SettingsButton.js new file mode 100644 index 000000000..4ca9bc11d --- /dev/null +++ b/src/plugins/settings/SettingsButton.js @@ -0,0 +1,77 @@ +import { AbstractButton, CONSTANTS } from 'photo-sphere-viewer'; +import SettingsPlugin from './index'; +import icon from './settings.svg'; + +/** + * @summary Navigation bar settings button class + * @extends PSV.buttons.AbstractButton + * @memberof PSV.buttons + */ +export class SettingsButton extends AbstractButton { + + static id = 'settings'; + static icon = icon; + + /** + * @param {PSV.components.Navbar} navbar + */ + constructor(navbar) { + super(navbar, 'psv-button--hover-scale psv-settings-button', true); + + /** + * @type {PSV.plugins.SettingsPlugin} + * @private + * @readonly + */ + this.plugin = this.psv.getPlugin(SettingsPlugin.id); + + if (this.plugin) { + this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this); + this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this); + } + } + + /** + * @override + */ + destroy() { + this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this); + this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this); + + delete this.plugin; + + super.destroy(); + } + + /** + * @override + */ + isSupported() { + return !!this.plugin; + } + + /** + * @summary Handles events + * @param {Event} e + * @private + */ + handleEvent(e) { + /* eslint-disable */ + switch (e.type) { + // @formatter:off + case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === SettingsPlugin.ID_PANEL); break; + case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break; + // @formatter:on + } + /* eslint-enable */ + } + + /** + * @override + * @description Toggles settings + */ + onClick() { + this.plugin.toggleSettings(); + } + +} diff --git a/src/plugins/settings/check.svg b/src/plugins/settings/check.svg new file mode 100644 index 000000000..8bd6c10a1 --- /dev/null +++ b/src/plugins/settings/check.svg @@ -0,0 +1 @@ + diff --git a/src/plugins/settings/chevron.svg b/src/plugins/settings/chevron.svg new file mode 100644 index 000000000..7f7e84562 --- /dev/null +++ b/src/plugins/settings/chevron.svg @@ -0,0 +1 @@ + diff --git a/src/plugins/settings/index.js b/src/plugins/settings/index.js new file mode 100644 index 000000000..3d2a80be0 --- /dev/null +++ b/src/plugins/settings/index.js @@ -0,0 +1,275 @@ +import { AbstractPlugin, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer'; +import check from './check.svg'; +import chevron from './chevron.svg'; +import icon from './settings.svg'; +import { SettingsButton } from './SettingsButton'; +import './style.scss'; +import switchOff from './switch-off.svg'; +import switchOn from './switch-on.svg'; + + +// add settings button +DEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf('fullscreen'), 0, SettingsButton.id); +DEFAULTS.lang[SettingsButton.id] = 'Settings'; +registerButton(SettingsButton); + +/** + * @typedef {Object} PSV.plugins.SettingsPlugin.Setting + * @summary Description of a setting + * @property {string} id - identifier of the setting + * @property {string} label - label of the setting + * @property {'options' | 'toggle'} type - type of the setting + */ + +/** + * @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} 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 + */ + +/** + * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting + * @summary Description of a 'toggle' setting + * @property {'toggle'} type - type of the setting + * @property {function} active - function which return whereas the setting is active or not + * @property {function} toggle - function called when the setting is toggled + */ + +/** + * @typedef {Object} PSV.plugins.SettingsPlugin.Option + * @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 + */ + +/** + * @summary Adds a button to access various settings. + * @extends PSV.plugins.AbstractPlugin + * @memberof PSV.plugins + */ +export default class SettingsPlugin extends AbstractPlugin { + + static id = 'settings'; + + /** + * @summary Panel identifier for settings content + * @type {string} + * @constant + */ + static ID_PANEL = 'settings'; + + /** + * @summary Property name added to settings items + * @type {string} + * @constant + */ + static SETTING_DATA = 'settingId'; + + /** + * @summary Settings list template + * @param {PSV.plugins.SettingsPlugin.Setting[]} settings + * @param {string} title + * @param {string} dataKey + * @returns {string} + */ + static SETTINGS_TEMPLATE = (settings, title, dataKey) => ` +

      ${icon} ${title}

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

      ${icon} ${title}

      +
        +
      • + ${chevron} + ${setting.label} +
      • + ${setting.options().map(s => ` +
      • + ${s.active ? check : ''} + ${s.label} +
      • + `).join('')} +
      `; + + /** + * @param {PSV.Viewer} psv + */ + constructor(psv) { + super(psv); + + /** + * @type {PSV.plugins.SettingsPlugin.Setting[]} + * @private + */ + this.settings = []; + } + + /** + * @package + */ + destroy() { + super.destroy(); + } + + /** + * @summary Registers a new setting + * @param {PSV.plugins.SettingsPlugin.Setting} setting + */ + addSetting(setting) { + if (!setting.id) { + throw new PSVError('Missing setting id'); + } + if (!setting.type) { + throw new PSVError('Missing setting type'); + } + if (!SettingsPlugin.SETTINGS_TEMPLATE_[setting.type]) { + throw new PSVError('Unsupported setting type'); + } + + this.settings.push(setting); + + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.showSettings(); + } + } + + /** + * @summary Removes a setting + * @param {string} id + */ + removeSetting(id) { + let idx = -1; + // FIXME use findIndex, one day, when IE11 is totally dead + this.settings.some((setting, i) => { + if (setting.id === id) { + idx = i; + return true; + } + return false; + }); + if (idx !== -1) { + this.settings.splice(idx, 1); + + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.showSettings(); + } + } + } + + /** + * @summary Toggles the settings panel + */ + toggleSettings() { + if (this.psv.panel.prop.contentId === SettingsPlugin.ID_PANEL) { + this.hideSettings(); + } + else { + this.showSettings(); + } + } + + /** + * @summary Hides the settings panel + */ + hideSettings() { + this.psv.panel.hide(SettingsPlugin.ID_PANEL); + } + + /** + * @summary Shows the settings panel + */ + showSettings() { + this.psv.panel.show({ + id : SettingsPlugin.ID_PANEL, + content : SettingsPlugin.SETTINGS_TEMPLATE( + this.settings, + this.psv.config.lang[SettingsButton.id], + utils.dasherize(SettingsPlugin.SETTING_DATA) + ), + noMargin : true, + clickHandler: (e) => { + const li = e.target ? utils.getClosest(e.target, 'li') : undefined; + const settingId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined; + const setting = this.settings.find(s => s.id === settingId); + + if (setting) { + switch (setting.type) { + case 'toggle': + setting.toggle(); + this.showSettings(); + break; + + case 'options': + this.__showOptions(setting); + break; + + default: + // noop + } + } + }, + }); + } + + /** + * @summary Shows setting options panel + * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting + * @private + */ + __showOptions(setting) { + 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) + ), + noMargin : true, + clickHandler: (e) => { + const li = e.target ? utils.getClosest(e.target, 'li') : undefined; + const optionId = li ? li.dataset[SettingsPlugin.SETTING_DATA] : undefined; + + if (optionId === '__back') { + this.showSettings(); + } + else { + setting.apply(optionId); + this.hideSettings(); + } + }, + }); + } + +} diff --git a/src/plugins/settings/settings.svg b/src/plugins/settings/settings.svg new file mode 100644 index 000000000..e9ea68286 --- /dev/null +++ b/src/plugins/settings/settings.svg @@ -0,0 +1 @@ + diff --git a/src/plugins/settings/style.scss b/src/plugins/settings/style.scss new file mode 100644 index 000000000..dc5a0703c --- /dev/null +++ b/src/plugins/settings/style.scss @@ -0,0 +1,73 @@ +@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; + } + } + + &-list { + list-style: none; + margin: 0; + padding: 0; + overflow: hidden; + } + + &-item { + clear: both; + min-height: 20px; + padding: .5em 1em; + cursor: pointer; + display: flex; + align-items: center; + + &:hover { + background: rgba(255, 255, 255, .1); + } + + &-label { + flex: 1; + font-weight: bold; + } + + &-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; + } + } + + &--header { + border-bottom: 1px solid currentColor; + margin-bottom: 1em; + + svg { + transform: scaleX(-1); + } + } + } +} diff --git a/src/plugins/settings/switch-off.svg b/src/plugins/settings/switch-off.svg new file mode 100644 index 000000000..a562d398d --- /dev/null +++ b/src/plugins/settings/switch-off.svg @@ -0,0 +1 @@ + diff --git a/src/plugins/settings/switch-on.svg b/src/plugins/settings/switch-on.svg new file mode 100644 index 000000000..6adb6f0d3 --- /dev/null +++ b/src/plugins/settings/switch-on.svg @@ -0,0 +1 @@ + diff --git a/src/plugins/stereo/index.js b/src/plugins/stereo/index.js index abbab0689..b37055225 100644 --- a/src/plugins/stereo/index.js +++ b/src/plugins/stereo/index.js @@ -1,5 +1,5 @@ import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from 'photo-sphere-viewer'; -import GyroscopePlugin from 'photo-sphere-viewer/plugins/gyroscope'; +import GyroscopePlugin from 'photo-sphere-viewer/dist/plugins/gyroscope'; import * as THREE from 'three'; import 'three/examples/js/effects/StereoEffect'; import mobileRotateIcon from './mobile-rotate.svg'; @@ -67,7 +67,7 @@ export default class StereoPlugin extends AbstractPlugin { this.gyroscope = GyroscopePlugin ? psv.getPlugin(GyroscopePlugin) : null; if (!this.gyroscope) { - throw new PSVError('Stereo plugin requires the gyroscope plugin'); + throw new PSVError('Stereo plugin requires the Gyroscope plugin'); } /** diff --git a/src/services/TextureLoader.js b/src/services/TextureLoader.js index 4fc2bbaa2..9a849da3a 100644 --- a/src/services/TextureLoader.js +++ b/src/services/TextureLoader.js @@ -37,7 +37,7 @@ export class TextureLoader extends AbstractService { /** * @summary Loads the panorama texture(s) * @param {string|string[]|PSV.Cubemap} panorama - * @param {PSV.PanoData | function} [newPanoData] + * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData] * @returns {Promise.} * @throws {PSV.PSVError} when the image cannot be loaded * @package @@ -173,7 +173,7 @@ export class TextureLoader extends AbstractService { /** * @summary Loads the sphere texture * @param {string} panorama - * @param {PSV.PanoData | function} [newPanoData] + * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData] * @returns {Promise.} * @throws {PSV.PSVError} when the image cannot be loaded * @private diff --git a/src/styles/_vars.scss b/src/styles/_vars.scss index ee8598ffe..8a2b04153 100644 --- a/src/styles/_vars.scss +++ b/src/styles/_vars.scss @@ -71,6 +71,10 @@ $psv-panel-close-button-color: #fff !default; $psv-panel-font: 16px sans-serif !default; +$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; @@ -80,12 +84,9 @@ $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-markers-list-title-shadow: 2px 1px #000 !default; -$psv-markers-list-title-font: 24px sans-serif !default; - //*** NOTIFICATION *** -$psv-notification-bottom: (from: $psv-navbar-height, to: $psv-navbar-height * 2) !default; +$psv-notification-bottom: (from: 0, to: $psv-navbar-height * 2) !default; $psv-notification-animate-delay: 200ms !default; $psv-notification-background-color: $psv-tooltip-background-color !default; $psv-notification-radius: $psv-tooltip-radius !default;