@panoramax/web-viewer 3.2.3-develop-616b2950 → 3.2.3-develop-17199efb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +10 -13
- package/build/index.js +1 -1
- package/package.json +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -40,6 +40,9 @@ viewer-publish-develop-tag:
|
|
|
40
40
|
cache:
|
|
41
41
|
paths:
|
|
42
42
|
- node_modules
|
|
43
|
+
artifacts:
|
|
44
|
+
paths:
|
|
45
|
+
- build
|
|
43
46
|
variables:
|
|
44
47
|
CI: 1
|
|
45
48
|
script:
|
|
@@ -54,23 +57,17 @@ viewer-publish-develop-tag:
|
|
|
54
57
|
# Develop publishing on Gitlab Pages
|
|
55
58
|
pages:
|
|
56
59
|
stage: deploy
|
|
60
|
+
needs:
|
|
61
|
+
- viewer-publish-develop-tag
|
|
57
62
|
only:
|
|
58
63
|
- develop
|
|
59
|
-
image:
|
|
60
|
-
cache:
|
|
61
|
-
paths:
|
|
62
|
-
- node_modules
|
|
63
|
-
variables:
|
|
64
|
-
CI: 1
|
|
64
|
+
image: python:3-bookworm
|
|
65
65
|
script:
|
|
66
|
-
-
|
|
67
|
-
- npm run build
|
|
66
|
+
- cp -r build/ public/
|
|
68
67
|
- >
|
|
69
68
|
cp mkdocs.yml mkdocs_dev.yml && sed -i 's|^site_url.*|site_url: https://viewer.geovisio.fr/docs|' mkdocs_dev.yml
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
- mkdocs build -d build/docs -f mkdocs_dev.yml
|
|
69
|
+
- pip3 install mkdocs-material
|
|
70
|
+
- mkdocs build -d public/docs -f mkdocs_dev.yml
|
|
73
71
|
artifacts:
|
|
74
72
|
paths:
|
|
75
|
-
-
|
|
76
|
-
publish: build
|
|
73
|
+
- public
|
package/build/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(F,Da){"object"===typeof exports&&"object"===typeof module?module.exports=Da():"function"===typeof define&&define.amd?define("Panoramax",[],Da):"object"===typeof exports?exports.Panoramax=Da():F.Panoramax=Da()}(this,(()=>(()=>{var F={9039:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Basic});var cl=ll(4542),hl=ll(5254),dl=ll(4964),pl=ll(8340),fl=ll(5995),Al=ll(7343),bl=ll(8330);ll(3638);class Basic extends cl.WF{constructor(){let F=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.style=pl.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=null,this.sequence=null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${bl.rE} (616b295)\n\n\ud83c\udd98 Issues can be reported at ${bl.Jk.O}`),this._t=(0,dl.getTranslations)(this.lang),F||(this.loader=(0,fl.createWebComp)("pnx-loader",{_parent:this}),this._isInternetFast=null,(0,Al.isInternetFast)().then((F=>this._isInternetFast=F)),this.endpoint&&this._setupAPI(this.endpoint))}_setupAPI(F){if(this.loader=this.loader||(0,fl.createWebComp)("pnx-loader",{_parent:this}),this.endpoint)try{this.api=new hl.A(F,{users:this.users,fetch:this.fetchOptions,style:this.style}),this.api.onceReady().then((()=>{let F=this.api.getUnavailableFeatures(),Da=this.api.getAvailableFeatures();Da=0===F.length?"\u2705 All features available":"\u2705 Available features: "+Da.join(", "),F=0===F.length?"":"\ud83d\udeab Unavailable features: "+F.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${Da}\n ${F}\n`.trim())})).catch((F=>this.loader.dismiss(F,this._t.pnx.error_api)))}catch(ll){var Da;null!==(Da=this.loader)&&void 0!==Da&&Da.dismiss?this.loader.dismiss(ll,this._t.pnx.error_api):console.error(ll)}else console.warn("No endpoint is defined")}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((F=>setTimeout(F,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(F,Da,ll){if(super.attributeChangedCallback(F,Da,ll),"endpoint"===F&&(this.api&&this.api._endpoint===ll||this._setupAPI(ll)),["picture","sequence"].includes(F)){let cl,hl,dl,pl;"picture"===F?(cl=this.sequence,dl=this.sequence,hl=ll,pl=Da):(cl=ll,dl=Da,hl=this.picture,pl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:cl,picId:hl,prevSeqId:dl,prevPicId:pl}}))}}getClassName(){return"Basic"}select(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=Da,this.sequence=F}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return cl.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{type:Object,attribute:!1},users:{type:Array,reflect:!0},style:{type:Object},lang:{type:String},endpoint:{type:String}}},153:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CoverageMap});var cl=ll(9039),hl=ll(5642),dl=ll(8340),pl=ll(927);ll(7776);class CoverageMap extends cl.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>this._initMap())),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((F=>setTimeout(F,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}_initMap(){class MyMap extends hl.A{_getLayerStyleProperties(F){return"pictures_symbols"===F?{layout:{visibility:"none"}}:super._getLayerStyleProperties(F)}}this.map=new MyMap(this,this._mapContainer,{hash:!0}),this.map.addControl(new pl.NavigationControl({showCompass:!1})),this.map.waitForEnoughMapLoaded().then((()=>{this.map.reloadLayersStyles(),this.loader.dismiss()})),this.map.on("picture-click",(F=>this.select(F.seqId,F.picId))),this.map.on("sequence-click",(F=>this.select(F.seqId)))}_onSelect(F){if(F.detail.picId||F.detail.seqId){const Da=F.detail.picId?"pictures":"sequences",ll=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((F=>(0,dl.getUserLayerId)(F,Da))),filter:["==",["get","id"],F.detail.picId||F.detail.seqId]});ll.length>=0&&null!=ll[0]&&this.map._attachPreviewToPictures({features:ll},Da)}}}customElements.define("pnx-coverage-map",CoverageMap)},1752:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Editor});ll(7365);var cl=ll(9039),hl=ll(5642),dl=ll(9048),pl=(ll(7534),ll(6810),ll(508)),fl=ll(8340),Al=ll(1545),bl=(ll(4542),ll(5995));const kl="sequence-headings";class Editor extends cl.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}getClassName(){return"Editor"}onceReady(){var F,Da;return this.map&&this.psv&&null!==(F=(Da=this.map).loaded)&&void 0!==F&&F.call(Da)?Promise.resolve():new Promise((F=>setTimeout(F,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._psvContainer,this._mapContainer]}_initPSV(){try{this.psv=new dl.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(F){let Da=Al.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(F,Da)}}_initMap(){try{this.map=new hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,fl.linkMapAndPhoto)(this),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const F=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=Da=>(Da=void 0===this._lastRelHeading?Da:Da+this._lastRelHeading-this.psv.getPictureRelativeHeading(),F(Da))}catch(F){this.loader.dismiss(F,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...fl.VECTOR_STYLES.SEQUENCES.layout},paint:{...fl.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...fl.VECTOR_STYLES.PICTURES.layout},paint:{...fl.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.api.getSequenceItems(this.sequence).then((F=>{if(this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=F.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:F.features.map((F=>F.geometry.coordinates))}},...F.features.map((F=>(F.properties.id=F.id,F.properties.sequences=[this.sequence],F)))]}),this.picture){const Da=F.features.find((F=>F.id===this.picture));Da?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:Da.geometry.coordinates,zoom:18})):console.log("Picture with ID",Da,"was not found")}else{const Da=[...F.features[0].geometry.coordinates,...F.features[0].geometry.coordinates];for(let ll=1;ll<F.features.length;ll++){const cl=F.features[ll].geometry.coordinates;cl[0]<Da[0]&&(Da[0]=cl[0]),cl[1]<Da[1]&&(Da[1]=cl[1]),cl[0]>Da[2]&&(Da[2]=cl[0]),cl[1]>Da[3]&&(Da[3]=cl[1])}this.map.fitBounds(Da,{animate:!1})}})).catch((F=>this.loader.dismiss(F,this._t.pnx.error_api)))}_getNode(F){const Da=this._sequenceData.find((Da=>Da.properties.id===F)),ll=Da?(0,pl.apiFeatureToPSVNode)(Da,this._t,this._isInternetFast):null;return ll&&delete ll.links,ll}_addMapBackgroundWidget(){const F=(0,bl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(F)}previewSequenceHeadingChange(F){const Da=void 0!==this.map.getLayer(kl);if(this.map._picMarkerPreview.remove(),void 0===F)return delete this._lastRelHeading,Da&&this.map.setLayoutProperty(kl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=F,Da||this.map.addLayer({id:kl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ll=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(kl,"visibility","visible"),this.map.setLayoutProperty(kl,"icon-rotate",["+",["get","view:azimuth"],ll,F]);const cl=[["==",["geometry-type"],"Point"]];this.picture&&cl.push(["!=",["get","id"],this.picture]),this.map.setFilter(kl,["all",...cl]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{type:Object},background:{type:String},...cl.A.properties},customElements.define("pnx-editor",Editor)},8743:(F,Da,ll)=>{"use strict";ll.d(Da,{$:()=>wc,A:()=>Viewer});ll(9616);var cl=ll(1545),hl=ll(4451),dl=ll(8340),pl=ll(9039),fl=ll(9048),Al=ll(2771),bl=ll(5995),kl=ll(9683),Dl=ll(2e3),Wl=ll(9438),Ql=ll(2118);const wc=20,Sc=Math.PI/6,eu=100;class Viewer extends pl.A{constructor(){super(),this.map=!0,this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.widgets=this.getAttribute("widgets")||"true",this._prevSequence=null,this.grid=(0,bl.createWebComp)("pnx-cornered-grid"),this.mini=(0,bl.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!this.picture||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.psvContainer=document.createElement("div"),this.mapContainer=document.createElement("div"),this.popup=(0,bl.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new hl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()})))}connectedCallback(){super.connectedCallback(),this._moveChildToGrid(),this.onceAPIReady().then((async()=>{var F;this._initParams=new Ql.Ay(Ql.Ay.GetComponentProperties(Viewer,this),null===(F=this.urlHandler)||void 0===F?void 0:F.currentURLParams());const Da=this._initParams.getParentInit(),ll=this._initParams.getParentPostInit();if(this._initPSV(),Da.map?await this._initMap():(this.grid.removeChild(this.mini),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer)),"false"!==Da.widgets){var cl,hl;if(this.grid.appendChild((0,bl.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-share",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.map)this.grid.appendChild((0,bl.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:ll.geocoder})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(cl=this.map)||void 0===cl||null===(hl=cl._hasQualityScore)||void 0===hl?void 0:hl.call(cl))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}));this.legend=(0,bl.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:ll.focus}),this.grid.appendChild(this.legend),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))}(0,Ql.iz)(this,ll),this._handleKeyboardManagement(),ll.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}))}getClassName(){return"Viewer"}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(F,Da,ll){super.attributeChangedCallback(F,Da,ll),"picture"===F&&null===Da&&null!==ll&&this.mini.removeAttribute("collapsed"),"focus"===F&&this._setFocus(ll)}render(){return[this.loader,this.grid,this.popup,this.slot]}oncePSVReady(){let F;return new Promise((Da=>{F=setInterval((()=>{"object"===typeof this.psv&&(this.psv.container?(clearInterval(F),Da()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(F),Da()}),{once:!0}))}),250)}))}onceMapReady(){if(!this.map)return Promise.resolve();let F;return new Promise((Da=>{F=setInterval((()=>{var ll,cl;"object"===typeof this.map&&(null!==(ll=(cl=this.map).loaded)&&void 0!==ll&&ll.call(cl)?(clearInterval(F),Da()):this.map.once&&this.map.once("render",(()=>{clearInterval(F),Da()})))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>new Promise((F=>{this.psv.addEventListener("picture-loaded",F,{once:!0})}))))}_initPSV(){try{this.psv=new fl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...cl.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>(0,Ql.Vy)(this.psv,this._initParams.getPSVPostInit())))}catch(F){let Da=cl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(F,Da)}}async _initMap(){await new Promise((F=>{this.map=new Al.A(this,this.mapContainer,this._initParams.getMapInit()),this.map.once("users-changed",F)})),(0,Ql.mK)(this.map,this._initParams.getMapPostInit()),(0,dl.initMapKeyboardHandler)(this),(0,dl.linkMapAndPhoto)(this)}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{var F,Da;this.psv.startKeyboardControl(),null===(F=this.map)||void 0===F||null===(Da=F.keyboard)||void 0===Da||Da.disable()},keytonone=()=>{var F,Da;this.psv.stopKeyboardControl(),null===(F=this.map)||void 0===F||null===(Da=F.keyboard)||void 0===Da||Da.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(F=>{"map"===F.detail.focus?keytomap():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let F of this.grid.childNodes)"bg"!==F.getAttribute("slot")&&(F.addEventListener("focusin",(()=>keytonone())),F.addEventListener("focusout",(()=>keytofocused())))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3||this.map&&this.isMapWide()}_moveChildToGrid(){for(let ll=0;ll<this.childNodes.length;ll++){var F;let cl=this.childNodes[ll];var Da;if(null!==(F=cl.getAttribute)&&void 0!==F&&F.call(cl,"slot"))null!==(Da=cl.tagName)&&void 0!==Da&&Da.toLowerCase().startsWith("pnx-")&&(cl._parent=this,cl._t=this._t),this.grid.appendChild(cl)}}setPopup(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;F?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof Da?this.popup.innerHTML=Da:Array.isArray(Da)&&Da.forEach((F=>this.popup.appendChild(F)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,bl.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,bl.createWebComp)("pnx-report-form",{_parent:this})]),this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_showPictureMetadata(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,bl.createWebComp)("pnx-picture-metadata",{_parent:this})]),this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}moveCenter(){const F=this.psv.getPictureMetadata();F&&(this.map&&this.isMapWide()?this.map.flyTo({center:F.gps,zoom:20}):this._psvAnimate({speed:fl.LM,yaw:0,pitch:0,zoom:fl.cS}))}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(F){if(this.map&&this.isMapWide()){let Da;switch(F){case"up":Da=[0,-100];break;case"left":Da=[-100,0];break;case"down":Da=[0,eu];break;case"right":Da=[eu,0]}this.map.panBy(Da)}else{let Da=this.psv.getPosition();switch(F){case"up":Da.pitch+=Sc;break;case"left":Da.yaw-=Sc;break;case"down":Da.pitch-=Sc;break;case"right":Da.yaw+=Sc}this._psvAnimate({speed:fl.LM,...Da})}}_psvAnimate(F){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(F)}isMapWide(){if(!this.map)throw new Error("Map is not enabled");return this.mapContainer.parentNode==this.grid}_setFocus(F){var Da,ll,cl,hl;let dl=arguments.length>1&&void 0!==arguments[1]&&arguments[1],pl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===F&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(F))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=F,(pl||("map"!==F||!this.map||!this.isMapWide())&&("pic"!==F||this.map&&this.isMapWide()))&&("map"===F?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,bl.fa)(kl.pt),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,bl.fa)(Dl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(Da=this.map)||void 0===Da||null===(ll=Da.resize)||void 0===ll||ll.call(Da),this.psv.autoSize(),this.psv.forceRefresh(),null===(cl=this.legend)||void 0===cl||null===(hl=cl.setAttribute)||void 0===hl||hl.call(cl,"focus",this.focus),!dl)){const Da=new CustomEvent("focus-changed",{detail:{focus:F}});this.dispatchEvent(Da)}}_toggleFocus(){if(!this.map)throw new Error("Map is not enabled");this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var F;const Da=(0,Wl.qi)("#pnx-map-filters-menu"),ll=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-date-from"),cl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-date-end"),hl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-type-flat"),dl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-type-360"),pl=(0,Wl.qi)("#pnx-map-theme");let fl="";null===dl||void 0===dl||!dl.checked||null!==hl&&void 0!==hl&&hl.checked||(fl="equirectangular"),null!==dl&&void 0!==dl&&dl.checked||null===hl||void 0===hl||!hl.checked||(fl="flat");let Al=[];if(null!==(F=this.map)&&void 0!==F&&F._hasQualityScore()){const F=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-qualityscore");Al=((null===F||void 0===F?void 0:F.grade)||"").split(",").map((F=>parseInt(F))).filter((F=>!isNaN(F))),5==Al.length&&(Al=[])}const bl={minDate:null===ll||void 0===ll?void 0:ll.value,maxDate:null===cl||void 0===cl?void 0:cl.value,pic_type:fl,theme:null===pl||void 0===pl?void 0:pl.value,qualityscore:Al};this.map.setFilters(bl)}}Viewer.properties={map:{type:Object},psv:{type:Object},"url-parameters":{type:String},focus:{type:String,reflect:!0},geocoder:{type:String},widgets:{type:String},...pl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(F,Da,ll)=>{"use strict";ll.r(Da),ll.d(Da,{Basic:()=>cl.A,CoverageMap:()=>hl.A,Editor:()=>dl.A,Viewer:()=>pl.A});var cl=ll(9039),hl=ll(153),dl=ll(1752),pl=ll(8743)},9341:(F,Da,ll)=>{"use strict";ll.r(Da),ll.d(Da,{core:()=>cl,layout:()=>hl,menus:()=>dl,ui:()=>pl});var cl=ll(3921),hl=ll(456),dl=ll(8794),pl=ll(9472)},7422:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CorneredGrid});var cl=ll(4542);class CorneredGrid extends cl.WF{render(){return cl.qy`
|
|
12
|
+
!function(F,Da){"object"===typeof exports&&"object"===typeof module?module.exports=Da():"function"===typeof define&&define.amd?define("Panoramax",[],Da):"object"===typeof exports?exports.Panoramax=Da():F.Panoramax=Da()}(this,(()=>(()=>{var F={9039:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Basic});var cl=ll(4542),hl=ll(5254),dl=ll(4964),pl=ll(8340),fl=ll(5995),Al=ll(7343),bl=ll(8330);ll(3638);class Basic extends cl.WF{constructor(){let F=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.style=pl.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=null,this.sequence=null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${bl.rE} (17199ef)\n\n\ud83c\udd98 Issues can be reported at ${bl.Jk.O}`),this._t=(0,dl.getTranslations)(this.lang),F||(this.loader=(0,fl.createWebComp)("pnx-loader",{_parent:this}),this._isInternetFast=null,(0,Al.isInternetFast)().then((F=>this._isInternetFast=F)),this.endpoint&&this._setupAPI(this.endpoint))}_setupAPI(F){if(this.loader=this.loader||(0,fl.createWebComp)("pnx-loader",{_parent:this}),this.endpoint)try{this.api=new hl.A(F,{users:this.users,fetch:this.fetchOptions,style:this.style}),this.api.onceReady().then((()=>{let F=this.api.getUnavailableFeatures(),Da=this.api.getAvailableFeatures();Da=0===F.length?"\u2705 All features available":"\u2705 Available features: "+Da.join(", "),F=0===F.length?"":"\ud83d\udeab Unavailable features: "+F.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${Da}\n ${F}\n`.trim())})).catch((F=>this.loader.dismiss(F,this._t.pnx.error_api)))}catch(ll){var Da;null!==(Da=this.loader)&&void 0!==Da&&Da.dismiss?this.loader.dismiss(ll,this._t.pnx.error_api):console.error(ll)}else console.warn("No endpoint is defined")}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((F=>setTimeout(F,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(F,Da,ll){if(super.attributeChangedCallback(F,Da,ll),"endpoint"===F&&(this.api&&this.api._endpoint===ll||this._setupAPI(ll)),["picture","sequence"].includes(F)){let cl,hl,dl,pl;"picture"===F?(cl=this.sequence,dl=this.sequence,hl=ll,pl=Da):(cl=ll,dl=Da,hl=this.picture,pl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:cl,picId:hl,prevSeqId:dl,prevPicId:pl}}))}}getClassName(){return"Basic"}select(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=Da,this.sequence=F}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return cl.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{type:Object,attribute:!1},users:{type:Array,reflect:!0},style:{type:Object},lang:{type:String},endpoint:{type:String}}},153:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CoverageMap});var cl=ll(9039),hl=ll(5642),dl=ll(8340),pl=ll(927);ll(7776);class CoverageMap extends cl.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>this._initMap())),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((F=>setTimeout(F,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}_initMap(){class MyMap extends hl.A{_getLayerStyleProperties(F){return"pictures_symbols"===F?{layout:{visibility:"none"}}:super._getLayerStyleProperties(F)}}this.map=new MyMap(this,this._mapContainer,{hash:!0}),this.map.addControl(new pl.NavigationControl({showCompass:!1})),this.map.waitForEnoughMapLoaded().then((()=>{this.map.reloadLayersStyles(),this.loader.dismiss()})),this.map.on("picture-click",(F=>this.select(F.seqId,F.picId))),this.map.on("sequence-click",(F=>this.select(F.seqId)))}_onSelect(F){if(F.detail.picId||F.detail.seqId){const Da=F.detail.picId?"pictures":"sequences",ll=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((F=>(0,dl.getUserLayerId)(F,Da))),filter:["==",["get","id"],F.detail.picId||F.detail.seqId]});ll.length>=0&&null!=ll[0]&&this.map._attachPreviewToPictures({features:ll},Da)}}}customElements.define("pnx-coverage-map",CoverageMap)},1752:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Editor});ll(7365);var cl=ll(9039),hl=ll(5642),dl=ll(9048),pl=(ll(7534),ll(6810),ll(508)),fl=ll(8340),Al=ll(1545),bl=(ll(4542),ll(5995));const kl="sequence-headings";class Editor extends cl.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}getClassName(){return"Editor"}onceReady(){var F,Da;return this.map&&this.psv&&null!==(F=(Da=this.map).loaded)&&void 0!==F&&F.call(Da)?Promise.resolve():new Promise((F=>setTimeout(F,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._psvContainer,this._mapContainer]}_initPSV(){try{this.psv=new dl.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(F){let Da=Al.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(F,Da)}}_initMap(){try{this.map=new hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,fl.linkMapAndPhoto)(this),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const F=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=Da=>(Da=void 0===this._lastRelHeading?Da:Da+this._lastRelHeading-this.psv.getPictureRelativeHeading(),F(Da))}catch(F){this.loader.dismiss(F,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...fl.VECTOR_STYLES.SEQUENCES.layout},paint:{...fl.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...fl.VECTOR_STYLES.PICTURES.layout},paint:{...fl.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.api.getSequenceItems(this.sequence).then((F=>{if(this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=F.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:F.features.map((F=>F.geometry.coordinates))}},...F.features.map((F=>(F.properties.id=F.id,F.properties.sequences=[this.sequence],F)))]}),this.picture){const Da=F.features.find((F=>F.id===this.picture));Da?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:Da.geometry.coordinates,zoom:18})):console.log("Picture with ID",Da,"was not found")}else{const Da=[...F.features[0].geometry.coordinates,...F.features[0].geometry.coordinates];for(let ll=1;ll<F.features.length;ll++){const cl=F.features[ll].geometry.coordinates;cl[0]<Da[0]&&(Da[0]=cl[0]),cl[1]<Da[1]&&(Da[1]=cl[1]),cl[0]>Da[2]&&(Da[2]=cl[0]),cl[1]>Da[3]&&(Da[3]=cl[1])}this.map.fitBounds(Da,{animate:!1})}})).catch((F=>this.loader.dismiss(F,this._t.pnx.error_api)))}_getNode(F){const Da=this._sequenceData.find((Da=>Da.properties.id===F)),ll=Da?(0,pl.apiFeatureToPSVNode)(Da,this._t,this._isInternetFast):null;return ll&&delete ll.links,ll}_addMapBackgroundWidget(){const F=(0,bl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(F)}previewSequenceHeadingChange(F){const Da=void 0!==this.map.getLayer(kl);if(this.map._picMarkerPreview.remove(),void 0===F)return delete this._lastRelHeading,Da&&this.map.setLayoutProperty(kl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=F,Da||this.map.addLayer({id:kl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ll=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(kl,"visibility","visible"),this.map.setLayoutProperty(kl,"icon-rotate",["+",["get","view:azimuth"],ll,F]);const cl=[["==",["geometry-type"],"Point"]];this.picture&&cl.push(["!=",["get","id"],this.picture]),this.map.setFilter(kl,["all",...cl]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{type:Object},background:{type:String},...cl.A.properties},customElements.define("pnx-editor",Editor)},8743:(F,Da,ll)=>{"use strict";ll.d(Da,{$:()=>wc,A:()=>Viewer});ll(9616);var cl=ll(1545),hl=ll(4451),dl=ll(8340),pl=ll(9039),fl=ll(9048),Al=ll(2771),bl=ll(5995),kl=ll(9683),Dl=ll(2e3),Wl=ll(9438),Ql=ll(2118);const wc=20,Sc=Math.PI/6,eu=100;class Viewer extends pl.A{constructor(){super(),this.map=!0,this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.widgets=this.getAttribute("widgets")||"true",this._prevSequence=null,this.grid=(0,bl.createWebComp)("pnx-cornered-grid"),this.mini=(0,bl.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!this.picture||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.psvContainer=document.createElement("div"),this.mapContainer=document.createElement("div"),this.popup=(0,bl.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new hl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()})))}connectedCallback(){super.connectedCallback(),this._moveChildToGrid(),this.onceAPIReady().then((async()=>{var F;this._initParams=new Ql.Ay(Ql.Ay.GetComponentProperties(Viewer,this),null===(F=this.urlHandler)||void 0===F?void 0:F.currentURLParams());const Da=this._initParams.getParentInit(),ll=this._initParams.getParentPostInit();if(this._initPSV(),Da.map?await this._initMap():(this.grid.removeChild(this.mini),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer)),"false"!==Da.widgets){var cl,hl;if(this.grid.appendChild((0,bl.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-share",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.map)this.grid.appendChild((0,bl.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:ll.geocoder})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(cl=this.map)||void 0===cl||null===(hl=cl._hasQualityScore)||void 0===hl?void 0:hl.call(cl))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}));this.legend=(0,bl.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:ll.focus}),this.grid.appendChild(this.legend),this.grid.appendChild((0,bl.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))}(0,Ql.iz)(this,ll),this._handleKeyboardManagement(),ll.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}))}getClassName(){return"Viewer"}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(F,Da,ll){super.attributeChangedCallback(F,Da,ll),"picture"===F&&null===Da&&null!==ll&&this.mini.removeAttribute("collapsed"),"focus"===F&&this._setFocus(ll)}render(){return[this.loader,this.grid,this.popup,this.slot]}oncePSVReady(){let F;return new Promise((Da=>{F=setInterval((()=>{"object"===typeof this.psv&&(this.psv.container?(clearInterval(F),Da()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(F),Da()}),{once:!0}))}),250)}))}onceMapReady(){if(!this.map)return Promise.resolve();let F;return new Promise((Da=>{F=setInterval((()=>{var ll,cl;"object"===typeof this.map&&(null!==(ll=(cl=this.map).loaded)&&void 0!==ll&&ll.call(cl)?(clearInterval(F),Da()):this.map.once&&this.map.once("render",(()=>{clearInterval(F),Da()})))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>new Promise((F=>{this.psv.addEventListener("picture-loaded",F,{once:!0})}))))}_initPSV(){try{this.psv=new fl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...cl.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>(0,Ql.Vy)(this.psv,this._initParams.getPSVPostInit())))}catch(F){let Da=cl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(F,Da)}}async _initMap(){await new Promise((F=>{this.map=new Al.A(this,this.mapContainer,this._initParams.getMapInit()),this.map.once("users-changed",F)})),(0,Ql.mK)(this.map,this._initParams.getMapPostInit()),(0,dl.initMapKeyboardHandler)(this),(0,dl.linkMapAndPhoto)(this)}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{var F,Da;this.psv.startKeyboardControl(),null===(F=this.map)||void 0===F||null===(Da=F.keyboard)||void 0===Da||Da.disable()},keytonone=()=>{var F,Da;this.psv.stopKeyboardControl(),null===(F=this.map)||void 0===F||null===(Da=F.keyboard)||void 0===Da||Da.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(F=>{"map"===F.detail.focus?keytomap():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let F of this.grid.childNodes)"bg"!==F.getAttribute("slot")&&(F.addEventListener("focusin",(()=>keytonone())),F.addEventListener("focusout",(()=>keytofocused())))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3||this.map&&this.isMapWide()}_moveChildToGrid(){for(let ll=0;ll<this.childNodes.length;ll++){var F;let cl=this.childNodes[ll];var Da;if(null!==(F=cl.getAttribute)&&void 0!==F&&F.call(cl,"slot"))null!==(Da=cl.tagName)&&void 0!==Da&&Da.toLowerCase().startsWith("pnx-")&&(cl._parent=this,cl._t=this._t),this.grid.appendChild(cl)}}setPopup(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;F?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof Da?this.popup.innerHTML=Da:Array.isArray(Da)&&Da.forEach((F=>this.popup.appendChild(F)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,bl.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,bl.createWebComp)("pnx-report-form",{_parent:this})]),this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_showPictureMetadata(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,bl.createWebComp)("pnx-picture-metadata",{_parent:this})]),this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}moveCenter(){const F=this.psv.getPictureMetadata();F&&(this.map&&this.isMapWide()?this.map.flyTo({center:F.gps,zoom:20}):this._psvAnimate({speed:fl.LM,yaw:0,pitch:0,zoom:fl.cS}))}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(F){if(this.map&&this.isMapWide()){let Da;switch(F){case"up":Da=[0,-100];break;case"left":Da=[-100,0];break;case"down":Da=[0,eu];break;case"right":Da=[eu,0]}this.map.panBy(Da)}else{let Da=this.psv.getPosition();switch(F){case"up":Da.pitch+=Sc;break;case"left":Da.yaw-=Sc;break;case"down":Da.pitch-=Sc;break;case"right":Da.yaw+=Sc}this._psvAnimate({speed:fl.LM,...Da})}}_psvAnimate(F){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(F)}isMapWide(){if(!this.map)throw new Error("Map is not enabled");return this.mapContainer.parentNode==this.grid}_setFocus(F){var Da,ll,cl,hl;let dl=arguments.length>1&&void 0!==arguments[1]&&arguments[1],pl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===F&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(F))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=F,(pl||("map"!==F||!this.map||!this.isMapWide())&&("pic"!==F||this.map&&this.isMapWide()))&&("map"===F?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,bl.fa)(kl.pt),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,bl.fa)(Dl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(Da=this.map)||void 0===Da||null===(ll=Da.resize)||void 0===ll||ll.call(Da),this.psv.autoSize(),this.psv.forceRefresh(),null===(cl=this.legend)||void 0===cl||null===(hl=cl.setAttribute)||void 0===hl||hl.call(cl,"focus",this.focus),!dl)){const Da=new CustomEvent("focus-changed",{detail:{focus:F}});this.dispatchEvent(Da)}}_toggleFocus(){if(!this.map)throw new Error("Map is not enabled");this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var F;const Da=(0,Wl.qi)("#pnx-map-filters-menu"),ll=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-date-from"),cl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-date-end"),hl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-type-flat"),dl=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-type-360"),pl=(0,Wl.qi)("#pnx-map-theme");let fl="";null===dl||void 0===dl||!dl.checked||null!==hl&&void 0!==hl&&hl.checked||(fl="equirectangular"),null!==dl&&void 0!==dl&&dl.checked||null===hl||void 0===hl||!hl.checked||(fl="flat");let Al=[];if(null!==(F=this.map)&&void 0!==F&&F._hasQualityScore()){const F=null===Da||void 0===Da?void 0:Da.shadowRoot.getElementById("pnx-filter-qualityscore");Al=((null===F||void 0===F?void 0:F.grade)||"").split(",").map((F=>parseInt(F))).filter((F=>!isNaN(F))),5==Al.length&&(Al=[])}const bl={minDate:null===ll||void 0===ll?void 0:ll.value,maxDate:null===cl||void 0===cl?void 0:cl.value,pic_type:fl,theme:null===pl||void 0===pl?void 0:pl.value,qualityscore:Al};this.map.setFilters(bl)}}Viewer.properties={map:{type:Object},psv:{type:Object},"url-parameters":{type:String},focus:{type:String,reflect:!0},geocoder:{type:String},widgets:{type:String},...pl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(F,Da,ll)=>{"use strict";ll.r(Da),ll.d(Da,{Basic:()=>cl.A,CoverageMap:()=>hl.A,Editor:()=>dl.A,Viewer:()=>pl.A});var cl=ll(9039),hl=ll(153),dl=ll(1752),pl=ll(8743)},9341:(F,Da,ll)=>{"use strict";ll.r(Da),ll.d(Da,{core:()=>cl,layout:()=>hl,menus:()=>dl,ui:()=>pl});var cl=ll(3921),hl=ll(456),dl=ll(8794),pl=ll(9472)},7422:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CorneredGrid});var cl=ll(4542);class CorneredGrid extends cl.WF{render(){return cl.qy`
|
|
13
13
|
<div class="bg">
|
|
14
14
|
<slot name="bg"></slot>
|
|
15
15
|
</div>
|