@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 5.36 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import a from"./ImageViewerViewModel.js";import n from"./NavigationUI.js";import{loadSequentialNavigationUIComponents as s,SequentialNavigationUI as l}from"./SequentialNavigationUI.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as g}from"../../support/decorators/vmEvent.js";import{tsx as c}from"../../support/jsxFactory.js";const h="esri-image-viewer";let u=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),s()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get _navigationUI(){return c(n,{cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold,currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes,preserveAngle:this.navigationViewModel?.preserveAngle??"none"})}get _sequentialNavigationUI(){return c(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return c("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h),loading:this.viewModel.updating},this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:Number}),t()],u.prototype,"brightness",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"contrast",null),e([t()],u.prototype,"currentNode",null),e([t({type:Object})],u.prototype,"customParameters",null),e([t({readOnly:!0})],u.prototype,"error",null),e([t()],u.prototype,"imageSize",null),e([t({readOnly:!0})],u.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],u.prototype,"imageRenderer",null),e([t()],u.prototype,"imageRotation",null),e([t()],u.prototype,"imageSource",null),e([t({type:Boolean})],u.prototype,"navigationEnabled",void 0),e([t()],u.prototype,"navigationNodes",null),e([t()],u.prototype,"navigationMode",null),e([t()],u.prototype,"navigationViewModel",null),e([t({type:Number})],u.prototype,"sharpness",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t()],u.prototype,"uiStrings",void 0),e([g(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t()],u.prototype,"_navigationUI",null),e([t()],u.prototype,"_sequentialNavigationUI",null),u=e([i("esri.widgets.OrientedImageryViewer.components.ImageViewer")],u);const m=u;export{m as default};