@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 5.21 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as e}from"tslib";import i from"../Camera.js";import{property as t,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import a from"./PanoramicViewer/PanoramicVideoViewerViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import{tsx as s,messageBundle as c,vmEvent as d}from"./support/widget.js";const p="esri-panoramic-viewer";let u=class extends r{constructor(e){super(e),this.messagesCommon=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,i)=>{this.viewModel.addGraphic(e,i)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadVideo=e=>this.viewModel.loadVideo(e),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return l({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}get activeAudioIcon(){const{videoMuted:e}=this.viewModel;return e?"sound-off":"sound"}get activeVideoIcon(){const{videoPaused:e,videoLoaded:i}=this.viewModel;return i&&!1===e?"pause":"play"}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get horizonAngles(){return this.viewModel.horizonAngles}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get oiViewModel(){return this.viewModel.oiViewModel}set oiViewModel(e){this.viewModel.oiViewModel=e}get video(){return this.viewModel.video}get videoSource(){return this.viewModel.videoSource}set videoSource(e){this.viewModel.videoSource=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}_handleVideoSeek(e){const i=this.viewModel?.video;i&&(i.currentTime=e.target.value,i.play())}render(){const{control:e,reset:i}=this.messagesCommon,{mute:t,unmute:o}=this.messages;return s("calcite-panel",null,s("calcite-panel",{loading:this.viewModel.updating},s("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(n.widget,p)}),s("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:this.viewModel?.videoDuration,minLabel:"0",value:this.viewModel.currentTime??0,onCalciteSliderChange:this._handleVideoSeek}),s("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>this.viewModel.playPanoramicVideoHandler(),text:"Play",title:this.viewModel.videoPaused?e.play:e.pause})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:"refresh",onclick:()=>this.viewModel.rewindPanoramicVideoHandler(),text:"Rewind",title:i})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>this.viewModel.togglePanoramicAudio(),text:"Audio",title:this.viewModel.videoMuted?t:o})))))}static{this.vnodeSelector="calcite-panel"}};e([t()],u.prototype,"activeAudioIcon",null),e([t()],u.prototype,"activeVideoIcon",null),e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:i})],u.prototype,"camera",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"fov",null),e([t({readOnly:!0,type:Number})],u.prototype,"hfov",null),e([t()],u.prototype,"horizonAngles",null),e([t()],u.prototype,"icon",null),e([t({readOnly:!0})],u.prototype,"imageRenderer",null),e([t({readOnly:!0})],u.prototype,"imageSize",null),e([t()],u.prototype,"oiViewModel",null),e([t(),c("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],u.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([t()],u.prototype,"video",null),e([t()],u.prototype,"videoSource",null),e([t({type:Number})],u.prototype,"pitch",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t({readOnly:!0,type:Number})],u.prototype,"vfov",null),e([d(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t({type:Number})],u.prototype,"yaw",null),u=e([o("esri.widgets.PanoramicVideoViewer")],u);const h=u;export{h as default};