@arcgis/core 5.2.0-next.162 → 5.2.0-next.164
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/PopupTemplate.js +1 -1
- package/analysis/LineOfSightAnalysis.d.ts +1 -1
- package/analysis/LineOfSightAnalysisObserver.d.ts +5 -4
- package/analysis/LineOfSightAnalysisTarget.d.ts +4 -4
- package/analysis/Viewshed.d.ts +4 -4
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/092e311cb7aea92a6a26.js +1 -0
- package/assets/esri/core/workers/chunks/{8e19629899a5becf8e19.js → 150e7a7bd5df25693da7.js} +1 -1
- package/assets/esri/core/workers/chunks/1e1c45f75020d5e05dc3.js +1 -0
- package/assets/esri/core/workers/chunks/{8e4a7027d171fb60e51e.js → 1f7f4f821d422b46cae7.js} +1 -1
- package/assets/esri/core/workers/chunks/1fe24ffcd88280d84fbe.js +1 -0
- package/assets/esri/core/workers/chunks/226f862bbeb33fc7c597.js +1 -0
- package/assets/esri/core/workers/chunks/25a3bd8bede2d07d3a54.js +1 -0
- package/assets/esri/core/workers/chunks/2ad69cc496235702bbf2.js +1 -0
- package/assets/esri/core/workers/chunks/3f46acfda693c70abbdd.js +1 -0
- package/assets/esri/core/workers/chunks/434a8ba841a59e0deab9.js +1 -0
- package/assets/esri/core/workers/chunks/45fd2b456a6997584ca1.js +1 -0
- package/assets/esri/core/workers/chunks/{2e096537a3a5555a4a93.js → 4cb751dc8d00bdaeb04c.js} +1 -1
- package/assets/esri/core/workers/chunks/{85bba551057366cd00ae.js → 4db829a0238024736fe6.js} +1 -1
- package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +1 -0
- package/assets/esri/core/workers/chunks/542e5640ea1b80ef801a.js +1 -0
- package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +1 -0
- package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +1 -0
- package/assets/esri/core/workers/chunks/5dc604e3691f36f03959.js +1 -0
- package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +1 -0
- package/assets/esri/core/workers/chunks/{5f4feca26102088ea565.js → 60737732ce495bbdd0fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ce8b9b80da146a5bbf5.js → 60c79934799927114074.js} +1 -1
- package/assets/esri/core/workers/chunks/67f54efc817b241f8746.js +1 -0
- package/assets/esri/core/workers/chunks/{8aa80b892fde552577e8.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f528ac5c648ca6a98582.js → 711cfb84659cb4437679.js} +1 -1
- package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +29 -0
- package/assets/esri/core/workers/chunks/771dd92cb3e6a3427f66.js +1 -0
- package/assets/esri/core/workers/chunks/792d2b62356a1d953c88.js +1 -0
- package/assets/esri/core/workers/chunks/89c8b0f684c1f27d149e.js +1 -0
- package/assets/esri/core/workers/chunks/8ab57cb1bfd3dc8d3c2a.js +1 -0
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +1 -0
- package/assets/esri/core/workers/chunks/97b5f4302fb867c829f4.js +1 -0
- package/assets/esri/core/workers/chunks/9de5ad77bc37ec142218.js +1 -0
- package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +1 -0
- package/assets/esri/core/workers/chunks/aa4f3751f0d830113bed.js +1 -0
- package/assets/esri/core/workers/chunks/ad96132bc89671e595f3.js +1 -0
- package/assets/esri/core/workers/chunks/b1d989b72203113a06fe.js +1 -0
- package/assets/esri/core/workers/chunks/{fc73737b41e086f0ce0b.js → b59aaf30c7fe2c8d1aaa.js} +1 -1
- package/assets/esri/core/workers/chunks/b6d71a4ab788a09714f3.js +1 -0
- package/assets/esri/core/workers/chunks/b704f489d0f072a0bfcd.js +1 -0
- package/assets/esri/core/workers/chunks/b736046c6b4ede73ea46.js +1 -0
- package/assets/esri/core/workers/chunks/c070d2ddf290b4f92916.js +1 -0
- package/assets/esri/core/workers/chunks/{d6cd0039d6e9c40961e3.js → d1f98c5249c487eb96f1.js} +1 -1
- package/assets/esri/core/workers/chunks/d77c68e0fc3b259bf4f9.js +1 -0
- package/assets/esri/core/workers/chunks/e251921bc5367258c4d2.js +1 -0
- package/assets/esri/core/workers/chunks/ee08ae5b73439a1ff666.js +1 -0
- package/assets/esri/core/workers/chunks/{e0351753f6b4d1adf11e.js → fc0dbb588a4062615cb6.js} +1 -1
- package/assets/esri/core/workers/chunks/fcaf9450642fcef83286.js +1 -0
- package/assets/esri/core/workers/chunks/feb41abc03d677df6f73.js +1 -0
- package/chunks/GlobalIllumination.glsl.js +2 -17
- package/config.d.ts +11 -30
- package/config.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers.d.ts +17 -0
- package/geometry/support/clipRay.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +32 -14
- package/layers/GeoJSONLayer.d.ts +2 -107
- package/layers/MapImageLayer.d.ts +2 -1
- package/layers/SceneLayer.d.ts +40 -16
- package/layers/SubtypeGroupLayer.d.ts +63 -0
- package/layers/ViewshedLayer.d.ts +10 -4
- package/layers/WMSLayer.d.ts +2 -69
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/TemporalLayer.d.ts +70 -48
- package/layers/mixins/TiledImagery.d.ts +0 -11
- package/layers/support/LabelClass.d.ts +20 -2
- package/layers/support/Sublayer.d.ts +32 -2
- package/layers/support/TimeInformation.js +2 -0
- package/package.json +2 -2
- package/popup/content.d.ts +38 -1
- package/popup/content.js +1 -1
- package/rest/layerSources/DynamicWorkspaceLayer.d.ts +10 -6
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/timeUtils.js +2 -0
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +2 -2
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/support/timeUtils.d.ts +11 -0
- package/symbols/TextSymbol.d.ts +27 -2
- package/symbols/cim/CIMCursor.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +16 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +16 -1
- package/views/3d/environment/VirtualLighting.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +9 -4
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +2 -0
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/BasemapView.js +1 -1
- package/views/GroundView.d.ts +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -2
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/views/support/ScheduledQueueProcessor.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/webscene/Slide.d.ts +1 -2
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/DirectionalPad/VisibleElements.d.ts +5 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +61 -2
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +3 -2
- package/widgets/TimeSlider.d.ts +5 -4
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +3 -3
- package/widgets/UtilityNetworkValidateTopology.d.ts +1 -1
- package/assets/esri/core/workers/chunks/0bd5012da287469b17d5.js +0 -1
- package/assets/esri/core/workers/chunks/0cb50bc2b2125c5fedf2.js +0 -1
- package/assets/esri/core/workers/chunks/112befb3b5b406f29298.js +0 -1
- package/assets/esri/core/workers/chunks/167b057ad50e6aef54de.js +0 -1
- package/assets/esri/core/workers/chunks/2d13a22f7b2427927fdc.js +0 -1
- package/assets/esri/core/workers/chunks/2f04b8679c9f15390517.js +0 -1
- package/assets/esri/core/workers/chunks/42045cf46497828cd3c0.js +0 -1
- package/assets/esri/core/workers/chunks/42fd2a7b22b03dacc6a7.js +0 -1
- package/assets/esri/core/workers/chunks/43cf862577bf37344ff4.js +0 -1
- package/assets/esri/core/workers/chunks/4be559c53fe5ac0d0d2e.js +0 -1
- package/assets/esri/core/workers/chunks/4e350d6c76957f5beb70.js +0 -1
- package/assets/esri/core/workers/chunks/4fe34da1c5d63e66ce98.js +0 -1
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +0 -1
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +0 -1
- package/assets/esri/core/workers/chunks/6da7229433105a69eb3f.js +0 -1
- package/assets/esri/core/workers/chunks/74c866e0b66e61751861.js +0 -1
- package/assets/esri/core/workers/chunks/830ab9b8d000169da675.js +0 -1
- package/assets/esri/core/workers/chunks/849879c8aed16315194c.js +0 -1
- package/assets/esri/core/workers/chunks/8ff23ac0abeea0073b47.js +0 -1
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +0 -1
- package/assets/esri/core/workers/chunks/95dbbddac6581b9d671f.js +0 -1
- package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +0 -1
- package/assets/esri/core/workers/chunks/aa1ac7954e4f0fefe15b.js +0 -1
- package/assets/esri/core/workers/chunks/b5df193c93e9c19f9700.js +0 -1
- package/assets/esri/core/workers/chunks/befa32b9e7b3fbdd431e.js +0 -1
- package/assets/esri/core/workers/chunks/c2c1f51a4668055c2838.js +0 -1
- package/assets/esri/core/workers/chunks/d0f5bee9db1ad51ae687.js +0 -1
- package/assets/esri/core/workers/chunks/d7429b58c90e015263ad.js +0 -1
- package/assets/esri/core/workers/chunks/d95d63e8d51244d71afb.js +0 -1
- package/assets/esri/core/workers/chunks/dfc81e66196c402f39b4.js +0 -29
- package/assets/esri/core/workers/chunks/dfd2dc5cdc97ffba8926.js +0 -1
- package/assets/esri/core/workers/chunks/e01fc1c31bc023dd0e33.js +0 -1
- package/assets/esri/core/workers/chunks/e1b7806ab3e1967b15f0.js +0 -1
- package/assets/esri/core/workers/chunks/e1f5d00878f27e1d413e.js +0 -1
- package/assets/esri/core/workers/chunks/ffbcb816b611049a6276.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as n}from"../intl.js";import{prefersReducedMotion as r}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecateWidget as o,deprecatedProperty as s}from"../core/deprecate.js";import c from"../core/Logger.js";import{isAbortError as l}from"../core/promiseUtils.js";import{watch as u,initial as d,syncAndInitial as f,on as p,sync as m}from"../core/reactiveUtils.js";import{throttle as h}from"../core/throttle.js";import{property as g,subclass as ee}from"../core/accessorSupport/decorators.js";import{or as te}from"../layers/orientedImagery/transformations/utils.js";import ne from"./Expand.js";import re from"./PanoramicVideoViewer.js";import _ from"./PanoramicViewer.js";import v from"./Widget.js";import{getAllArcPath as y}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as b,defaultImageGeometryField as x,defaultOIObjectIDField as ie,segmentArcs as S,featureCircleRadius as ae,navigationToolDimensionLength as C,sectorsRadii as w}from"./OrientedImageryViewer/constants.js";import{css as T,navigation as oe,navigationToolRotationFrom as E,navigationToolRotationTo as D,root as O}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as k,loadImageForAttachment as A,getThumbnailPixelBlock as j,renderImageWithRotation as M}from"./OrientedImageryViewer/galleryUtils.js";import N from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import P from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as F,Alert as I}from"./OrientedImageryViewer/components/Alert.js";import L from"./OrientedImageryViewer/components/ImageLocationWidget.js";import R from"./OrientedImageryViewer/components/ImageViewer.js";import z from"./OrientedImageryViewer/components/NavigationUI.js";import B from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as V,SequentialNavigationUI as H}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as U,renderEnhancementSlider as W,VideoEnhancementTools as G}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as K}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as se}from"./support/componentsUtils.js";import{globalCss as q}from"./support/globalCss.js";import{iconByKind as ce}from"./support/iconUtils.js";import{vmEvent as J,messageBundle as Y,tsx as X}from"./support/widget.js";import{setFocus as Z}from"./support/widgetUtils.js";const Q={overlayed:`overlayed`};let $=class extends v{constructor(e,t){super(e,t),this.actionBarPosition=`top`,this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new N,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit=`meters`,this.pixelAreaMeasurementUnit=`square-meters`,this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new P,this._defaultSuperimposeZOffsetPercentage=100,this._panoramicSuperimposeRadiusOffsetPercentage=100,this._exploreImages3DMenuOpen=!1,this._exploreImages3DCollapsed=!1,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.displayNewMeasurementButton=!0,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=i(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set(`noImageInSequenceError`,!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{let t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{let t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(u(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${Q.overlayed}-${t.id}`)},this._highlight=e=>{let t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{let{target:t}=e,{dataset:{action:n}}=t,{_previousAction:r}=this,i=r?.dataset.action,a=i?.includes(`draw`)??!1,o=i===`select-feature`,s=i!==n;switch(n){case`draw-point`:case`draw-polygon`:case`draw-polyline`:{r&&te(o,a&&s)&&(r.active=!1),t.active=!t.active;let e=n.replace(`draw-`,``);this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case`save`:this.viewModel.saveDrawing();break;case`select-feature`:a&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case`delete-feature`:this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleExploreImages3DPanel=e=>{this._exploreImages3DCollapsed=e.target.collapsed},this._settingsToggle=null,this._toggleImageNavigation=async e=>{let t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t===e?null:e;let{activeViewer:n}=this.viewModel;if(!n)return;let{mode:r,preserveAngle:i}=this.viewModel;if(r==="default"){if(this.navigationMode===`directional`){let e=await this._loadNavigationSettings(),t=i===`heading`||i===`both`,n=i===`pitch`||i===`both`,{messages:r,messagesCommon:a}=this,o=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:r.configureNavigation,preserveHeading:r.preserveHeading,preserveHeadingDescription:r.preserveHeadingDescription,preservePitch:r.preservePitch,preservePitchDescription:r.preservePitchDescription,settings:a.settings,thresholdLabel:r.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:n});this._settingsToggle=new ne({content:o,expandIcon:`configure`}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:`top-left`})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}},this._toggleImageAttributes=h(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this._rootActionTitleToFocus=null,this._actionTitleToFocus=null,this._focusPendingAction=e=>{let t=this._actionTitleToFocus;if(!t)return;let n=[...e.querySelectorAll(`calcite-action`)].find(e=>e.getAttribute(`title`)===t);n&&(this._actionTitleToFocus=null,Z(n))},this.navigate=async e=>{let t=null;try{let{currentNode:n}=this.viewModel;if(!n)throw new K;t=await this.viewModel.navigate(n,e)}catch(e){l(e)||c.getLogger(this).error(`Error occurred while navigating`,e),[`NoImageInSequenceError`,`NoSequenceFoundError`].includes(e.name)&&this._set(`noImageInSequenceError`,!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{o(c.getLogger(this),`Oriented Imagery Viewer`,`arcgis-oriented-imagery-viewer`,{version:`5.0`})}}initialize(){this.addHandles([u(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},d),u(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),u(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),u(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),u(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this._disableExploreImages3D()):this._resetSuperimposeOffset()}),u(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},f),u(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);let n=e.feature&&e.feature!==t?.feature,r=!e.overlaysEnabled&&!!t?.overlaysEnabled,i=e.overlaysEnabled&&!t?.overlaysEnabled,a=this.viewModel.mode===`video`||this.viewModel.mode===`panoramic-video`;if(r&&a){this.viewModel.removeAllOverlayMapFeatures(),this.viewModel.mode===`video`&&this.viewModel.videoViewModel?.clearOverlayGraphics();return}(n||i)&&(n&&(this._resetSuperimposeOffset(),this.viewModel.removeAllOverlayMapFeatures()),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},d),p(()=>this.viewModel,`popup-open`,async e=>{await this.view?.openPopup(e)},m),p(()=>this.viewModel,`popup-close`,()=>{this.view?.closePopup()},m),this._toggleImageAttributes])}loadDependencies(){return Promise.all([U(),V(),se({"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`),block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),shell:()=>import(`@esri/calcite-components/dist/components/calcite-shell`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),slider:()=>import(`@esri/calcite-components/dist/components/calcite-slider`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),"shell-panel":()=>import(`@esri/calcite-components/dist/components/calcite-shell-panel`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`)}),F()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return s(c.getLogger(this),`activeLayer`,{replacement:`layer`}),this.layer}set activeLayer(e){s(c.getLogger(this),`activeLayer`,{replacement:`layer`}),this.layer=e}get activeVideoIcon(){let{videoElement:e,videoViewModel:t}=this.viewModel;return!e?.loaded||!t||t.videoPaused?`play`:`pause`}get activeAudioIcon(){let{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?`sound-off`:`sound`}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return this.viewModel.mode===`video`?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){this.viewModel.mode===`video`?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return`oriented-imagery-widget`}set icon(e){this._overrideIfSome(`icon`,e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){let{popupEnabled:e,state:t}=this.viewModel;return(t===`image-loaded`||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get selectedFeatureObjectId(){return this.currentBestFeature?.attributes?.objectId??null}get selectedPoint(){return this.viewModel.selectedPoint}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){let{mode:e,videoElement:t,panoramicVideoLoaded:n}=this.viewModel;return(e===`video`&&t?.loaded===!0||n)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}get _actionBarLayout(){return this.actionBarPosition===`start`||this.actionBarPosition===`end`?`vertical`:`horizontal`}_renderActionBar(){let{selectedGroup:e,superimposeViewEnabled:n}=this,r=this._actionBarLayout;if(n)return X(`calcite-action-bar`,{"data-testid":`action-bar--superimpose`,expandToggleDisabled:!0,layout:r,slot:`action-bar`},X(`calcite-action-group`,{overlayPositioning:`fixed`},this._superimposeViewToggle()));let i=t();return X(`calcite-action-bar`,{afterUpdate:this._focusPendingAction,"data-testid":`action-bar`,expandToggleDisabled:!0,layout:r,slot:`action-bar`},!e&&X(`calcite-action-group`,{key:`main`,overlayPositioning:`fixed`},this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(i),e===`overlays`&&X(`calcite-action-group`,{key:`overlays`,overlayPositioning:`fixed`},this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),e===`navigation`?this._directionToolsToggle():null,e===`navigation`&&X(`calcite-action-group`,{key:`context-navigation`,overlayPositioning:`fixed`},this._navigationToolToggle(),this._imageGalleryToggle()),e===`measurements`&&this._measurementToolToggle(),e===`utilities`&&X(`calcite-action-group`,{overlayPositioning:`fixed`},this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),e===`search`&&X(`calcite-action-group`,{key:`search`,overlayPositioning:`fixed`},this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?X(`calcite-action`,{bind:this,icon:e?`arrow-right`:`arrow-left`,key:`back-arrow`,text:this.messages.previous,title:this.messages.previous,onclick:()=>this._toggleGroupSelection(null)}):null}get _activeMeasurementHeading(){let{measureType:e,messages:t,triangularMeasurementActive:n}=this,{groundArea:r,heightAboveGround:i,groundDistance:a,triangulatedAreaHeading:o,triangulatedDistanceHeading:s}=t;if(n)return e===`area`?o:s;switch(e){case`area`:return r;case`height`:return i;default:return a}}_additionalFootprintToggle(){let{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:n}}=this;return n?X(`calcite-action`,{active:e,bind:this,class:T.addCoverage,disabled:t,icon:`trapezoid-area`,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints,onclick:this._toggleAdditionalCoverage}):null}_additionalPointSourcesToggle(){let{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:n}}=this;return n?X(`calcite-action`,{active:e,bind:this,class:T.addExpPoints,disabled:t,icon:`circle-area`,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations,onclick:this._toggleAdditionalCameraLocations}):null}get _measurementToggle(){let{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:n},triangularMeasurementActive:r,id:i}=this;if(e!==`image-loaded`||!t||r&&!n)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();let a=this._imageMeasurementToolsLoaderTask?.value;return a?X(`calcite-dialog`,{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:`bottom-start`,resizable:!0,scale:`s`,slot:`dialogs`,width:`s`,onCalciteDialogBeforeClose:this._clearMeasurements},X(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){let{viewModel:{state:e},triangularMeasurementActive:t}=this;return X(`calcite-panel`,{bind:this,class:t?T.viewerContainerMeasurement:T.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes(`loading`)&&!t},X(`calcite-shell`,null,this.visibleElements.menu?X(`calcite-shell-panel`,{collapsed:!0,displayMode:`dock`,slot:`panel-${this.actionBarPosition}`},this._renderActionBar()):null,X(`calcite-panel`,null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._exploreImages3DTools,this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){let{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:n}=this.visibleElements;return n?X(`calcite-action`,{active:e,bind:this,class:T.currentCoverage,disabled:t,icon:`trapezoid-area`,text:this.messages.currentFootprint,title:this.messages.currentFootprint,onclick:this._toggleCurrentCoverage}):null}_exploreImagesToggle(){let{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?X(`calcite-action`,{active:!this.disabled,bind:this,icon:`oriented-imagery-widget`,text:e,title:e,onclick:this._toggleExploreImages}):null}get _imageEnhancementTools(){let{enhancementToolActive:e,viewModel:{brightness:t,contrast:n,sharpness:r,state:i}}=this;return e&&i===`image-loaded`?X(`calcite-panel`,{bind:this,class:T.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},X(`div`,{class:T.imageEnhancementTools},W({title:this.messages.brightness,value:t,handleChange:this._handleBrightnessChange}),W({title:this.messages.contrast,value:n,handleChange:this._handleContrastChange}),W({title:this.messages.sharpness,value:r,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),X(`calcite-action`,{bind:this,icon:`reset`,slot:`header-actions-end`,text:this.messagesCommon.reset,title:this.messagesCommon.reset,onclick:this._resetImageTools})):null}get _videoEnhancementTools(){let{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:n},messages:{videoEnhancement:r,brightness:i,contrast:a},messagesCommon:{reset:o}}=this;return!e||n!==`video`||!t?null:X(G,{brightness:t.videoBrightness,contrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:r,brightness:i,contrast:a,reset:o},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState})}get _superimposeTools(){let{superimposeViewEnabled:e,view:t,viewModel:{state:n,mode:r},messages:{superimposeSettings:i,superimposeSliderTitle:a,superimposeSliderTooltip:o}}=this,s=r===`panoramic`;return!e||t?.type!==`3d`||n!==`image-loaded`?null:X(`calcite-panel`,{bind:this,class:this.classes(T.imageEnhancementWrapper,T.superimposeTools),heading:i,key:`superimpose-settings`},X(`div`,{class:T.imageEnhancementTools},W({title:a,tooltip:o,value:s?this._panoramicSuperimposeRadiusOffsetPercentage:this._defaultSuperimposeZOffsetPercentage,max:100,min:0,ticks:10,step:1,handleChange:this._handleSuperimposeZOffsetChange})),X(`calcite-action`,{bind:this,icon:`reset`,slot:`header-actions-end`,text:this.messagesCommon.reset,title:this.messagesCommon.reset,onclick:this._resetSuperimposeOffset}))}_imageEnhancementsToggle(){let{state:e,mode:t}=this.viewModel,{enhancementTool:n}=this.visibleElements;return!n||t===`video`?null:X(`calcite-action`,{active:this.enhancementToolActive,bind:this,disabled:t!=="default"||e!==`image-loaded`,icon:`sliders-horizontal`,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement,onclick:this._toggleEnhancementToolState})}_exploreImages3DToggle(){let{exploreImages3D:e}=this.messages,t=this.view?.type!==`3d`||!this.layer?.hasZ,n=this.verticalFilterEnabled||this.viewModel.frustumSearchEnabled;return this.visibleElements.exploreImages3D?X(`calcite-action`,{active:n,bind:this,disabled:t,icon:`3d-search`,text:e,title:e,onclick:this._toggleExploreImages3DMenu}):null}get _exploreImages3DTools(){let{frustumRange:e,search3DFilters:t,verticalRange:n}=this.messages,r=this.verticalFilterEnabled,i=this.viewModel.frustumSearchEnabled;return!this.visibleElements.exploreImages3D||!this._exploreImages3DMenuOpen?null:X(`calcite-panel`,{bind:this,class:T.submenu,closed:!this._exploreImages3DMenuOpen,collapsed:this._exploreImages3DCollapsed,collapseDirection:`up`,collapsible:!0,heading:t,key:`explore-images-3d-tools`,onCalcitePanelToggle:this._toggleExploreImages3DPanel},X(`calcite-list`,{label:t,scale:`s`},X(`calcite-list-item`,{bind:this,label:n},X(`calcite-switch`,{checked:r,scale:`s`,slot:`content-start`,onCalciteSwitchChange:e=>this._toggleExploreImages3DSelection(`3d`,e)})),X(`calcite-list-item`,{bind:this,label:e},X(`calcite-switch`,{checked:i,scale:`s`,slot:`content-start`,onCalciteSwitchChange:e=>this._toggleExploreImages3DSelection(`frustum`,e)}))))}_showSelectedImageToggle(){let{displayImages:e}=this.messages,t=this.viewModel.mode.includes(`video`);return this.visibleElements.showSelectedImage?X(`calcite-action`,{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:`show-oriented-imagery`,text:e,title:e,onclick:this._toggleShowSelectedImage}):null}_superimposeViewToggle(){let{superimposeView:e}=this.messages,{mode:t,accuracyParametersMissing:n}=this.viewModel,r=!this.superimposeViewEnabled&&(this.view?.type!==`3d`||t.includes(`video`)||n);return this.visibleElements.superimpose?X(`calcite-action`,{active:this.superimposeViewEnabled,bind:this,disabled:r,icon:`superimpose`,text:e,title:e,onclick:this._toggleSuperimposeView}):null}_videoEnhancementsToggle(){let{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:n}=this.visibleElements;return!n||e!==`video`?null:X(`calcite-action`,{active:this.enhancementToolActive,bind:this,disabled:e!==`video`,icon:`sliders-horizontal`,text:t,title:t,onclick:this._toggleEnhancementToolState})}get _imageGalleryPanel(){let{container:e,galleryOpened:t,imageGalleryEnabled:n}=this;return n&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){let{galleryOpened:e,invalidCameraHeading:t}=this;return X(`calcite-panel`,{bind:this,class:T.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},X(`div`,{class:T.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){let{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:n}}=this;return n?X(`calcite-action`,{active:this.galleryOpened,bind:this,disabled:!e||t,icon:`images`,text:this.messages.imageGallery,title:this.messages.imageGallery,onclick:this._toggleImageGallery}):null}get _imageOverlaysComponent(){let{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:n,dataCaptureEnabled:r,dataCaptureLayer:a,imageOverlaysOpened:o,showCameraLocations:s,showMapFeatures:c,view:l,layer:u}=this,d=r&&!this.viewModel.mode.includes(`video`);if(!u)return null;let f=u.imageGeometryField?.length?u.imageGeometryField:x,p=u.imageReferenceField?.length?u.imageReferenceField:ie;t||(this._imageOverlaysLoaderTask=i(async()=>(await import(`./OrientedImageryViewer/components/ImageOverlays.js`)).default));let m=this._imageOverlaysLoaderTask?.value;return m?X(m,{closed:!o,dataCaptureEnabled:d,dataCaptureLayer:a,imageGeometryField:f,imageReferenceField:p,messages:e,overlayedLayers:n,showCameraLocations:s,showMapFeatures:c,view:l,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){let{navigationMode:e,viewModel:t}=this,{mode:n,state:r}=t;if(!(!e||n!=="default"&&n!==`panoramic`||r!==`image-loaded`))return e===`directional`?n==="default"?X(z,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):X(B,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):X(H,{layout:`horizontal`,uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){let{imageOverlaysOpened:e}=this,t=this.classes({[T.imageOverlaysContainer]:!0,[q.hidden]:!e||!this._imageOverlaysEnabled});return X(`div`,{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){let{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:n}}=this;return n?X(`calcite-action`,{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:`layers`,text:this.messages.imageOverlays,title:this.messages.imageOverlays,onclick:this._toggleImageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){let{displayMessage:e,loadImageViewer:t,mode:n,clickAction:r,state:i}=this.viewModel,a=e!=null||n!=="default"||i.includes(`loading`);return X(R,{afterCreate:t,clickAction:r,visible:!a})}get _imageViewerTriangular(){let{messages:e,triangularMeasurementActive:t}=this,{displayMessage:n,storeImageMeasurementViewer:r,storePanoramicMeasurementViewer:i,mode:a,state:o,clickAction:s}=this.viewModel,c=n!=null||a===`none`||a===`video`,l=this.classes({[T.viewer]:!c,[T.viewerHidden]:c});return t?X(`calcite-panel`,{class:T.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:o.includes(`loading`)},X(`calcite-panel`,{bind:this,class:l},a==="default"?X(R,{afterCreate:r,clickAction:s,uiStrings:e}):X(_,{afterCreate:i,clickAction:s,uiStrings:e}))):null}_utilitiesGroupToggle(){let{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?X(`calcite-action`,{bind:this,icon:`tools`,key:`utilities-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`utilities`,e)}):null}_searchGroupToggle(){let{searchTools:e}=this.messages;return this.visibleElements.searchTools?X(`calcite-action`,{bind:this,icon:`search`,key:`search-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`search`,e)}):null}get _videoViewer(){let{mode:e,loadVideoViewer:t,videoViewModel:n}=this.viewModel,{control:r,reset:i}=this.messagesCommon,{mute:a,unmute:o}=this.messages,s=e!==`video`,c=this.classes({[T.viewer]:!s,[T.viewerHidden]:s}),l=`esri-image-viewer`,u=`${l}__slider-container`;return X(`calcite-panel`,{bind:this,class:c},X(`calcite-panel`,{afterCreate:t,class:this.classes(q.widget,l)}),X(`calcite-block`,{class:u,expanded:!0},X(`calcite-slider`,{bind:this,labelHandles:!0,labelTicks:!0,max:n?.videoDuration,minLabel:`0`,value:n?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),X(`calcite-action-bar`,{"data-testid":`action-bar--video-controls`,expandToggleDisabled:!0,layout:`horizontal`},X(`calcite-action-group`,{overlayPositioning:`fixed`},X(`calcite-action`,{bind:this,icon:this.activeVideoIcon,text:`Play`,title:n?.videoPaused?r.play:r.pause,onclick:()=>n?.playVideoHandler()})),X(`calcite-action-group`,{overlayPositioning:`fixed`},X(`calcite-action`,{bind:this,icon:`refresh`,text:`Rewind`,title:i,onclick:()=>n?.rewindVideoHandler()})),X(`calcite-action-group`,{overlayPositioning:`fixed`},X(`calcite-action`,{bind:this,icon:this.activeAudioIcon,text:`Audio`,title:n?.videoMuted?a:o,onclick:()=>n?.toggleAudio()}))))}get _locationToggle(){let{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:n,groundCoordinatesAccuracyLoading:r,triangulatedPoint:i},imageLocationToolActive:a,triangularMeasurementActive:o,messages:{groundLocation:s,triangulatedLocationHeading:c}}=this;if(e!==`image-loaded`||!t||!a)return;let l=t;if(o){if(!i)return;l=i}return X(`calcite-dialog`,{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?c:s,id:s,open:!0,placement:`bottom-start`,resizable:!0,scale:`s`,slot:`dialogs`,width:`s`,onCalciteDialogBeforeClose:this._clearImageLocation},X(L,{accuracy:n,accuracyLoading:r,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){let{mapImageConversionToolState:e,viewModel:{state:t,disabled:n},videoLoaded:r,invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this,o=!!(this.viewModel.mode===`video`&&r&&this.viewModel.videoViewModel?.videoPaused),s=this.viewModel.mode===`panoramic-video`&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused,c=t!==`image-loaded`&&!o&&!s||i||n;return a?X(`calcite-action`,{active:e,bind:this,disabled:c,icon:`image-pin`,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool,onclick:this._toggleMapImageConversionToolState}):null}_measurementToolToggle(){let{measureType:e,viewModel:t,accuracyParametersMissing:n,messages:r,triangularMeasurementActive:i}=this,{state:a}=t,{groundDistance:o,groundArea:s,heightAboveGround:c,groundLocation:l,triangulatedDistanceHeading:u,triangulatedAreaHeading:d,triangulatedLocationHeading:f}=r,p=a!==`image-loaded`||n,m=this._actionBarLayout;return X(`calcite-action-group`,{key:`measurement-tools`,layout:m,overlayPositioning:`fixed`,scale:`m`},X(`calcite-action`,{active:e===`distance`&&!i,bind:this,disabled:p,icon:`measure-line`,key:`distance-measurement`,text:o,title:o,onclick:e=>this._toggleMeasurementSketch(e,`distance`)}),X(`calcite-action`,{active:e===`area`&&!i,bind:this,disabled:p,icon:`measure-area`,key:`area-measurement`,text:s,title:s,onclick:e=>this._toggleMeasurementSketch(e,`area`)}),X(`calcite-action`,{active:e===`height`,bind:this,disabled:p,icon:`measure-building-height-top-base`,key:`height-measurement`,text:c,title:c,onclick:e=>this._toggleMeasurementSketch(e,`height`)}),X(`calcite-action`,{active:this.imageLocationToolActive?!i:!1,bind:this,disabled:p,icon:`pin-tear`,key:`surface-location`,text:l,title:l,onclick:this._toggleLocationTool}),X(`calcite-action`,{active:i?this.imageLocationToolActive:!1,bind:this,disabled:p,icon:`dual-image-location`,key:`triangular-location`,text:f,title:f,onclick:this._toggleTriangularLocation}),X(`calcite-action`,{active:i?this.measureType===`distance`:!1,bind:this,disabled:p,icon:`dual-image-distance`,key:`triangular-distance`,text:u,title:u,onclick:this._toggleTriangularDistanceMeasurements}),X(`calcite-action`,{active:i?this.measureType===`area`:!1,bind:this,disabled:p,icon:`dual-image-area`,key:`triangular-area`,text:d,title:d,onclick:this._toggleTriangularAreaMeasurements}))}get _messageBox(){let{messages:e,viewModel:{displayMessage:t,mode:r}}=this;if(!t||r===`video`)return null;let{key:i,map:a,type:o}=t,s=`${a?n(e[i],a):e[i]}`,c=o===`error`?`danger`:o===`warn`?`warning`:`info`;return X(`calcite-notice`,{appearance:`transparent`,class:T.notice,icon:ce[c],kind:c,open:!0},X(`div`,{slot:`message`},s))}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||=i(async()=>(await import(`./OrientedImageryViewer/components/NavigationSettings.js`)).default),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){let{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:n}=this.viewModel,r=t!==`image-loaded`||n;return this.visibleElements.measurementTools?X(`calcite-action`,{bind:this,disabled:r,icon:`measure-line`,key:`measurements-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`measurements`,e)}):null}_navigationGroupToggle(){let{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?X(`calcite-action`,{bind:this,icon:`absolute-direction`,key:`navigation-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`navigation`,e)}):null}_navigationToolToggle(){let{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:n}=this;return t?X(`calcite-action`,{active:this.navigationToolActive,bind:this,disabled:e!==`image-loaded`&&!n||this.invalidCameraHeading,icon:`explore`,text:this.messages.navigationTool,title:this.messages.navigationTool,onclick:this._toggleNavigationTool}):null}_directionToolsToggle(){let{messages:e,viewModel:t,visibleElements:n}=this,{directionalNavigation:r,sequentialNavigation:i}=n,{state:a}=t,{directionalNavigation:o,directionalNavigationDescription:s,sequentialNavigation:c,sequentialNavigationDescription:l}=e,u=this._actionBarLayout;return X(`calcite-action-group`,{key:`navigation-tools`,layout:u,overlayPositioning:`fixed`,scale:`m`},r?X(`calcite-action`,{active:this.navigationMode===`directional`,bind:this,disabled:a!==`image-loaded`||this.invalidCameraHeading,icon:`directional-navigation`,text:o,title:o+`
|
|
3
3
|
`+s,onclick:()=>void this._toggleImageNavigation(`directional`)}):null,i?X(`calcite-action`,{active:this.navigationMode===`sequential`,bind:this,disabled:a!==`image-loaded`||this.invalidCameraHeading||!this.canNavigateSequentially,icon:`sequential-navigation`,text:c,title:c+`
|
|
4
|
-
`+l,onclick:()=>void this._toggleImageNavigation(`sequential`)}):null)}_overlaysGroupToggle(){let{overlays:e}=this.messages;return this.visibleElements.overlays?X(`calcite-action`,{bind:this,icon:`oriented-imagery-overlays`,key:`overlays-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`overlays`,e)}):null}_openPopupAction(){let{showPopupsAction:e}=this.visibleElements;return e?X(`calcite-action`,{bind:this,disabled:!this.popupEnabled,icon:`popup`,text:this.messages.showPopups,title:this.messages.showPopups,onclick:this._toggleImageAttributes}):null}get _panoramicVideoViewer(){let{displayMessage:e,loadPanoramicVideoViewer:t,mode:n,clickAction:r,state:i,currentBestFeature:a}=this.viewModel,o=a?.attributes.imagePath,s=e!=null||n!==`panoramic-video`||i.includes(`loading`)||!o;return X(re,{afterCreate:t,clickAction:r,oiViewModel:this.viewModel,videoSource:o,visible:!s})}get _panoramicViewer(){let{displayMessage:e,loadPanoramicViewer:t,mode:n,clickAction:r,state:i}=this.viewModel,a=e!=null||n!==`panoramic`||i.includes(`loading`);return X(_,{afterCreate:t,clickAction:r,visible:!a})}get noImageInSequenceError(){return this._get(`noImageInSequenceError`)??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=t?!0:!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this._exploreImages3DMenuOpen=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){let t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){let t=e.currentTarget.value??0;if(this.viewModel.mode==="default"){this._defaultSuperimposeZOffsetPercentage=t,this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);return}this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){let n=e.target,r=n.getAttribute(`data-src`),i=n.getAttribute(`data-rotation`),a=n.getAttribute(`data-objectid`),o=i?parseFloat(i)%360:0,{layer:s,_galleryController:{signal:u}}=this;if(!r||!a)return;let d;try{d=k(r)?await A(s,a,{signal:u}):await j(r,{signal:u})}catch(e){l(e)||c.getLogger(`esri.widgets.OrientedImageryViewer`).error(`#lazyLoadImage()`,e)}finally{t.unobserve(n)}if(!d)return;M(d,n,o)}})}_loadImageFromGallery(e){let{target:t}=e;if(!t)return;let n=t.getAttribute(`data-objectid`);n&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(n)&&this.viewModel.selectBestFeature(n)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i(async()=>{let{default:e}=await import(`./OrientedImageryViewer/components/ImageMeasurementWidget.js`);return e})}_loadSketchResources(){this._sketchLoaderTask=i(async()=>(await import(`./OrientedImageryViewer/components/SketchTools.js`)).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,n){let{viewModel:{state:r}}=this;return r===`image-loaded`?X(I,{class:T.alert,icon:`exclamation-mark-triangle-f`,kind:`warning`,message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:n}):null}get _renderNavigation(){let{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:n,state:i}}=this;if(!this.container||!n)return null;let a,o,s,c,l;if(t){let{x:e,y:n,direction:r}=t,[i,u,d,f]=S[r];a=`M ${e} ${n} L ${i} ${u} A ${w[2]} ${w[2]} 0 0 1 ${d} ${f} Z`,o=e,c=n,s=S[r][4],l=S[r][5]}let u=e=>{let t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},d=e=>{let t=e.target.dataset;if(!t)return;let{featureIndexInSector:n,sector:r}=t;n&&r&&this.viewModel.handleFeatureClick({sector:r,featureIndexInSector:+n})},f=e=>{e.removeEventListener(`click`,d)},p=n.attributes.objectId,m=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:n,featureIndexInSector:r,sector:i})=>X(`circle`,{afterRemoved:f,class:this.classes(T.feature,{selected:p===n}),cx:e,cy:t,"data-feature-index-in-sector":r,"data-sector":i,key:`${T.feature}-${n}`,r:ae,onclick:d}))),h=e=>{e.removeEventListener(`click`,u)},g=this.classes({[T.navigationWrapper]:!0,[T.navigationWrapperVideo]:this.viewModel.mode.includes(`video`),[T.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&(i===`image-loaded`||this.videoLoaded)?X(`div`,{bind:this,class:g,key:this.messages.navigationTool},X(`svg`,{afterCreate:e=>this._storeNavigationToolReference(e),class:r()?oe:T.rotateWithAnimation,focusable:`false`,height:C,role:`img`,width:C,xmlns:`http://www.w3.org/2000/svg`},X(`defs`,null,X(`linearGradient`,{gradientUnits:`userSpaceOnUse`,id:`${this.id}-coverage-fill`,x1:o,x2:s,y1:c,y2:l},X(`stop`,{class:T.navigationPathOffset0,offset:0}),X(`stop`,{class:T.navigationPathOffset1,offset:1}))),X(`g`,null,X(`circle`,{class:this.classes(T.sector,T.outerSector),cx:w[3],cy:w[3],r:w[3],onclick:this._scaleNavigationTool}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[2]}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[1]}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[0]}),X(`path`,{class:T.pointer,d:`M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z`,key:`${T.pointer}-west`}),X(`path`,{class:this.classes(T.pointer,T.north),d:`M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z`,key:`${T.pointer}-north`}),X(`path`,{class:T.pointer,d:`M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z`,key:`${T.pointer}-east`}),X(`path`,{class:T.pointer,d:`M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z`,key:`${T.pointer}-south`}),X(`path`,{class:this.classes(T.sector,T.sectorSeparator),d:`M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076`,key:T.sectorSeparator}),y([w[2],w[1],w[0]],w[3],w[3]).map((t,n)=>X(`path`,{afterRemoved:h,class:this.classes(T.sector,e?.[n]?.length?T.sectorEnabled:T.sectorDisabled),d:t,"data-sector":`${n}`,key:`${T.sector}-${n}`,onclick:u})),X(`path`,{class:this.classes(T.sector,T.sectorCross),d:`M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53`,key:T.sectorCross}),m,n.attributes.cameraPitch>=5&&a?X(`path`,{class:T.selectedFeaturePath,d:a,fill:`url(#${this.id}-coverage-fill)`,key:T.selectedFeaturePath}):null))):null}_renderSketch(){let{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t||(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value))return null;let{geometryType:n}=e,r=n===`point`?`pin`:n===`polyline`?`line`:`polygon`,i=this._sketchLoaderTask.value;return X(`div`,{class:T.sketchTools},X(i,{icon:r,messages:this._imageSketchToolsMessages,type:n,onAction:this._onAction}))}get _renderThumbnails(){let{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?X(`div`,{class:T.carouselContent},t?.items.map(({url:t,objectId:n,rotation:r},i)=>X(`div`,{class:`${T.carouselItemWrapper}${e.attributes.objectId===n?`--selected`:``}`,key:`${T.carouselItemWrapper}-${i}`},X(`canvas`,{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${n}`,class:T.carouselItem,"data-objectid":`${n}`,"data-rotation":`${r}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){let e=!this.shouldShowSelectedImage;e&&this._disableExploreImages3D(),this.shouldShowSelectedImage=e,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if(this.viewModel.mode==="default"){this._defaultSuperimposeZOffsetPercentage=100,this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);return}this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_disableExploreImages3D(){this._exploreImages3DMenuOpen=!1,this._exploreImages3DCollapsed=!1,this.verticalFilterEnabled=!1,this.viewModel.setFrustumSearchEnabled(!1)}_setExploreImages3DSearchMode(e){let t=e===`3d`||e===`both`,n=e===`frustum`||e===`both`,r=this.verticalFilterEnabled===t&&this.viewModel.frustumSearchEnabled===n;this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=t,this.viewModel.setFrustumSearchEnabled(n),this._toggleDisabledViewer(!0),r&&this.scheduleRender()}_toggleExploreImages3DMenu(e){if(e.stopPropagation(),this._exploreImages3DMenuOpen){this._disableExploreImages3D();return}this.shouldShowSelectedImage=!1,this._exploreImages3DCollapsed=!1,!this.verticalFilterEnabled&&!this.viewModel.frustumSearchEnabled&&this._setExploreImages3DSearchMode(`3d`),this._exploreImages3DMenuOpen=!0}_toggleExploreImages3DSelection(e,{currentTarget:t}){this._setExploreImages3DSearchMode(this._getNextExploreImages3DSearchMode(e)),t.checked=e===`3d`?this.verticalFilterEnabled:this.viewModel.frustumSearchEnabled}_getNextExploreImages3DSearchMode(e){let t=this.verticalFilterEnabled,n=this.viewModel.frustumSearchEnabled,r=t&&n;return e===`3d`?r?`frustum`:n?`both`:`3d`:r?`3d`:t?`both`:`3d`}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();let t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this._disableExploreImages3D())}_toggleGroupSelection(e,t){let n=this._rootActionTitleToFocus;e&&(this._rootActionTitleToFocus=t?.currentTarget?.getAttribute(`title`)),e!==`search`&&(this._exploreImages3DMenuOpen=!1),this.selectedGroup=e,this._actionTitleToFocus=e?this.messages.previous:n}_toggleImageOverlays(e){e.stopPropagation();let t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();let t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=this.imageGalleryEnabled?!t:!1}_toggleLocationTool(e){let t=this.imageLocationToolActive,n=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=n||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();let n=this.measureType,r=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=n===t&&!r?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){let e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements(`area`)}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements(`distance`)}_toggleTriangularLocation(){let e=this.triangularMeasurementActive,t=this.navigationToolActive;if(!e){this._activateTriangulatedImageLocationWorkflow(e,t);return}if(this.measureType!==null){this._resetMeasureTypeAndActivateImageLocationTool();return}this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool()}_toggleTriangularMeasurements(e){let t=this.triangularMeasurementActive,n=this.viewModel.measureType,r=this.navigationToolActive;t?e===n?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!r):(this.imageLocationToolActive=!1,this.measureType=e,this.viewModel.displayNewMeasurementButton=!0):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=r?!0:!r,this.viewModel.displayNewMeasurementButton=!0)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){let{previousFeatureAngle:t,bestFeatureAngle:n}=this.viewModel,r=(n-t+540)%360-180;e.style.setProperty(E,`${t}deg`),e.style.setProperty(D,`${t+r}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,n){return e==="default"?this.viewModel.loadMediaSource(t,n):this.viewModel.loadPanoramicMediaSource(t,n)}async overlayMapFeatures(e,t){return this.removeHandles(`${Q.overlayed}-${e.id}`),this.addHandles(u(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${Q.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return X(`div`,{class:this.classes(q.widget,O)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([g({readOnly:!0})],$.prototype,`accuracyParametersMissing`,null),e([g()],$.prototype,`actionBarPosition`,void 0),e([g()],$.prototype,`activeLayer`,null),e([g()],$.prototype,`activeVideoIcon`,null),e([g()],$.prototype,`activeAudioIcon`,null),e([g()],$.prototype,`cameraHeadingThreshold`,null),e([g()],$.prototype,`cameraPitchThreshold`,null),e([g()],$.prototype,`canNavigateSequentially`,null),e([g()],$.prototype,`currentBestFeature`,null),e([g()],$.prototype,`currentCoverageVisible`,null),e([g()],$.prototype,`dataCaptureEnabled`,void 0),e([g()],$.prototype,`dataCaptureLayer`,null),e([g()],$.prototype,`depthImageNotSupported`,null),e([g()],$.prototype,`disabled`,null),e([g()],$.prototype,`enhancementToolActive`,null),e([g()],$.prototype,`features`,null),e([g()],$.prototype,`imagePointsInView`,null),e([g()],$.prototype,`galleryOpened`,void 0),e([g()],$.prototype,`icon`,null),e([g()],$.prototype,`imageEnhancementToolActive`,void 0),e([g()],$.prototype,`videoEnhancementToolActive`,void 0),e([g({readOnly:!0})],$.prototype,`imageGalleryEnabled`,null),e([g()],$.prototype,`imageLocationToolActive`,null),e([g()],$.prototype,`imageOverlaysOpened`,void 0),e([g({readOnly:!0})],$.prototype,`invalidCameraHeading`,null),e([g()],$.prototype,`isAdditionalCoverageVisible`,null),e([g()],$.prototype,`isAdditionalPointSourcesVisible`,null),e([g()],$.prototype,`mapImageConversionToolState`,null),e([g()],$.prototype,`measureType`,null),e([g()],$.prototype,`layer`,null),e([g()],$.prototype,`navigationToolActive`,void 0),e([g()],$.prototype,`navigationMode`,null),e([J(b()),g({type:N})],$.prototype,`viewModel`,void 0),e([g(),Y(`esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer`)],$.prototype,`messages`,void 0),e([g(),Y(`esri/core/t9n/Units`)],$.prototype,`measurementUnitMessages`,void 0),e([g(),Y(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([g(),Y(`esri/widgets/Sketch/t9n/Sketch`)],$.prototype,`messagesSketch`,void 0),e([g()],$.prototype,`pixelMeasurementUnit`,void 0),e([g()],$.prototype,`pixelAreaMeasurementUnit`,void 0),e([g({readOnly:!0})],$.prototype,`popupEnabled`,null),e([g()],$.prototype,`preloadMedia`,null),e([g()],$.prototype,`referencePoint`,null),e([g()],$.prototype,`selectedFeatureObjectId`,null),e([g()],$.prototype,`selectedPoint`,null),e([g()],$.prototype,`selectedGroup`,void 0),e([g()],$.prototype,`showCameraLocations`,void 0),e([g()],$.prototype,`showMapFeatures`,void 0),e([J([`create`,`delete`,`redo`,`undo`,`update`]),g({readOnly:!0})],$.prototype,`sketchViewModel`,null),e([g()],$.prototype,`triangularMeasurementActive`,null),e([g()],$.prototype,`videoLoaded`,null),e([g()],$.prototype,`view`,null),e([g({type:P,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([g()],$.prototype,`determineWorkflowForFeature`,null),e([g()],$.prototype,`shouldShowSelectedImage`,null),e([g()],$.prototype,`superimposeViewEnabled`,null),e([g()],$.prototype,`defaultSuperimposeCameraLockEnabled`,null),e([g()],$.prototype,`updateFootprint`,null),e([g()],$.prototype,`verticalFilterEnabled`,null),e([g()],$.prototype,`_defaultSuperimposeZOffsetPercentage`,void 0),e([g()],$.prototype,`_panoramicSuperimposeRadiusOffsetPercentage`,void 0),e([g()],$.prototype,`_exploreImages3DMenuOpen`,void 0),e([g()],$.prototype,`_exploreImages3DCollapsed`,void 0),e([g()],$.prototype,`_actionBarLayout`,null),e([g()],$.prototype,`_activeMeasurementHeading`,null),e([g()],$.prototype,`_imageOverlaysLoaderTask`,void 0),e([g()],$.prototype,`_imageMeasurementToolsLoaderTask`,void 0),e([g()],$.prototype,`_navigationSettingsLoaderTask`,void 0),e([g()],$.prototype,`_navigationTask`,void 0),e([g()],$.prototype,`_measurementToggle`,null),e([g()],$.prototype,`_renderRoot`,null),e([g()],$.prototype,`_imageEnhancementTools`,null),e([g()],$.prototype,`_videoEnhancementTools`,null),e([g()],$.prototype,`_superimposeTools`,null),e([g()],$.prototype,`_exploreImages3DTools`,null),e([g()],$.prototype,`_imageGalleryPanel`,null),e([g()],$.prototype,`_imageGalleryContext`,null),e([g()],$.prototype,`_imageOverlaysComponent`,null),e([g()],$.prototype,`_navigationUI`,null),e([g()],$.prototype,`_imageOverlayMessages`,null),e([g()],$.prototype,`_imageSketchToolsMessages`,null),e([g()],$.prototype,`_imageOverlaysEnabled`,null),e([g()],$.prototype,`_imageViewer`,null),e([g()],$.prototype,`_imageViewerTriangular`,null),e([g()],$.prototype,`_videoViewer`,null),e([g()],$.prototype,`_locationToggle`,null),e([g()],$.prototype,`_messageBox`,null),e([g()],$.prototype,`_navigationToolExpanded`,void 0),e([g()],$.prototype,`_navigationTool`,void 0),e([g()],$.prototype,`_panoramicVideoViewer`,null),e([g()],$.prototype,`_panoramicViewer`,null),e([g({readOnly:!0})],$.prototype,`noImageInSequenceError`,null),e([g()],$.prototype,`_renderNavigation`,null),e([g()],$.prototype,`_renderThumbnails`,null),e([g()],$.prototype,`_sketchLoaderTask`,void 0),$=e([ee(`esri.widgets.OrientedImageryViewer`)],$);const le=$;export{le as default};
|
|
4
|
+
`+l,onclick:()=>void this._toggleImageNavigation(`sequential`)}):null)}_overlaysGroupToggle(){let{overlays:e}=this.messages;return this.visibleElements.overlays?X(`calcite-action`,{bind:this,icon:`oriented-imagery-overlays`,key:`overlays-group-toggle`,text:e,title:e,onclick:e=>this._toggleGroupSelection(`overlays`,e)}):null}_openPopupAction(){let{showPopupsAction:e}=this.visibleElements;return e?X(`calcite-action`,{bind:this,disabled:!this.popupEnabled,icon:`popup`,text:this.messages.showPopups,title:this.messages.showPopups,onclick:this._toggleImageAttributes}):null}get _panoramicVideoViewer(){let{displayMessage:e,loadPanoramicVideoViewer:t,mode:n,clickAction:r,state:i,currentBestFeature:a}=this.viewModel,o=a?.attributes.imagePath,s=e!=null||n!==`panoramic-video`||i.includes(`loading`)||!o;return X(re,{afterCreate:t,clickAction:r,oiViewModel:this.viewModel,videoSource:o,visible:!s})}get _panoramicViewer(){let{displayMessage:e,loadPanoramicViewer:t,mode:n,clickAction:r,state:i}=this.viewModel,a=e!=null||n!==`panoramic`||i.includes(`loading`);return X(_,{afterCreate:t,clickAction:r,visible:!a})}get noImageInSequenceError(){return this._get(`noImageInSequenceError`)??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=t?!0:!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this._exploreImages3DMenuOpen=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){let t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){let t=e.currentTarget.value??0;if(this.viewModel.mode==="default"){this._defaultSuperimposeZOffsetPercentage=t,this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);return}this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){let n=e.target,r=n.getAttribute(`data-src`),i=n.getAttribute(`data-rotation`),a=n.getAttribute(`data-objectid`),o=i?parseFloat(i)%360:0,{layer:s,_galleryController:{signal:u}}=this;if(!r||!a)return;let d;try{d=k(r)?await A(s,a,{signal:u}):await j(r,{signal:u})}catch(e){l(e)||c.getLogger(`esri.widgets.OrientedImageryViewer`).error(`#lazyLoadImage()`,e)}finally{t.unobserve(n)}if(!d)return;M(d,n,o)}})}_loadImageFromGallery(e){let{target:t}=e;if(!t)return;let n=t.getAttribute(`data-objectid`);n&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(n)&&this.viewModel.selectBestFeature(n)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i(async()=>{let{default:e}=await import(`./OrientedImageryViewer/components/ImageMeasurementWidget.js`);return e})}_loadSketchResources(){this._sketchLoaderTask=i(async()=>(await import(`./OrientedImageryViewer/components/SketchTools.js`)).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,n){let{viewModel:{state:r}}=this;return r===`image-loaded`?X(I,{class:T.alert,icon:`exclamation-mark-triangle-f`,kind:`warning`,message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:n}):null}get _renderNavigation(){let{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:n,state:i}}=this;if(!this.container||!n)return null;let a,o,s,c,l;if(t){let{x:e,y:n,direction:r}=t,[i,u,d,f]=S[r];a=`M ${e} ${n} L ${i} ${u} A ${w[2]} ${w[2]} 0 0 1 ${d} ${f} Z`,o=e,c=n,s=S[r][4],l=S[r][5]}let u=e=>{let t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},d=e=>{let t=e.target.dataset;if(!t)return;let{featureIndexInSector:n,sector:r}=t;n&&r&&this.viewModel.handleFeatureClick({sector:r,featureIndexInSector:+n})},f=e=>{e.removeEventListener(`click`,d)},p=n.attributes.objectId,m=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:n,featureIndexInSector:r,sector:i})=>X(`circle`,{afterRemoved:f,class:this.classes(T.feature,{selected:p===n}),cx:e,cy:t,"data-feature-index-in-sector":r,"data-sector":i,key:`${T.feature}-${n}`,r:ae,onclick:d}))),h=e=>{e.removeEventListener(`click`,u)},g=this.classes({[T.navigationWrapper]:!0,[T.navigationWrapperVideo]:this.viewModel.mode.includes(`video`),[T.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&(i===`image-loaded`||this.videoLoaded)?X(`div`,{bind:this,class:g,key:this.messages.navigationTool},X(`svg`,{afterCreate:e=>this._storeNavigationToolReference(e),class:r()?oe:T.rotateWithAnimation,focusable:`false`,height:C,role:`img`,width:C,xmlns:`http://www.w3.org/2000/svg`},X(`defs`,null,X(`linearGradient`,{gradientUnits:`userSpaceOnUse`,id:`${this.id}-coverage-fill`,x1:o,x2:s,y1:c,y2:l},X(`stop`,{class:T.navigationPathOffset0,offset:0}),X(`stop`,{class:T.navigationPathOffset1,offset:1}))),X(`g`,null,X(`circle`,{class:this.classes(T.sector,T.outerSector),cx:w[3],cy:w[3],r:w[3],onclick:this._scaleNavigationTool}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[2]}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[1]}),X(`circle`,{class:T.sector,cx:w[3],cy:w[3],r:w[0]}),X(`path`,{class:T.pointer,d:`M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z`,key:`${T.pointer}-west`}),X(`path`,{class:this.classes(T.pointer,T.north),d:`M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z`,key:`${T.pointer}-north`}),X(`path`,{class:T.pointer,d:`M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z`,key:`${T.pointer}-east`}),X(`path`,{class:T.pointer,d:`M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z`,key:`${T.pointer}-south`}),X(`path`,{class:this.classes(T.sector,T.sectorSeparator),d:`M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076`,key:T.sectorSeparator}),y([w[2],w[1],w[0]],w[3],w[3]).map((t,n)=>X(`path`,{afterRemoved:h,class:this.classes(T.sector,e?.[n]?.length?T.sectorEnabled:T.sectorDisabled),d:t,"data-sector":`${n}`,key:`${T.sector}-${n}`,onclick:u})),X(`path`,{class:this.classes(T.sector,T.sectorCross),d:`M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53`,key:T.sectorCross}),m,n.attributes.cameraPitch>=5&&a?X(`path`,{class:T.selectedFeaturePath,d:a,fill:`url(#${this.id}-coverage-fill)`,key:T.selectedFeaturePath}):null))):null}_renderSketch(){let{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t||(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value))return null;let{geometryType:n}=e,r=n===`point`?`pin`:n===`polyline`?`line`:`polygon`,i=this._sketchLoaderTask.value;return X(`div`,{class:T.sketchTools},X(i,{icon:r,messages:this._imageSketchToolsMessages,type:n,onAction:this._onAction}))}get _renderThumbnails(){let{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?X(`div`,{class:T.carouselContent},t?.items.map(({url:t,objectId:n,rotation:r},i)=>X(`div`,{class:`${T.carouselItemWrapper}${e.attributes.objectId===n?`--selected`:``}`,key:`${T.carouselItemWrapper}-${i}`},X(`canvas`,{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${n}`,class:T.carouselItem,"data-objectid":`${n}`,"data-rotation":`${r}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){let e=!this.shouldShowSelectedImage;e&&this._disableExploreImages3D(),this.shouldShowSelectedImage=e,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if(this.viewModel.mode==="default"){this._defaultSuperimposeZOffsetPercentage=100,this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);return}this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_disableExploreImages3D(){this._exploreImages3DMenuOpen=!1,this._exploreImages3DCollapsed=!1,this.verticalFilterEnabled=!1,this.viewModel.setFrustumSearchEnabled(!1)}_setExploreImages3DSearchMode(e){let t=e===`3d`||e===`both`,n=e===`frustum`||e===`both`,r=this.verticalFilterEnabled===t&&this.viewModel.frustumSearchEnabled===n;this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=t,this.viewModel.setFrustumSearchEnabled(n),this._toggleDisabledViewer(!0),r&&this.scheduleRender()}_toggleExploreImages3DMenu(e){if(e.stopPropagation(),this._exploreImages3DMenuOpen){this._disableExploreImages3D();return}this._closeAllImageTools(),this.shouldShowSelectedImage=!1,this._exploreImages3DCollapsed=!1,!this.verticalFilterEnabled&&!this.viewModel.frustumSearchEnabled&&this._setExploreImages3DSearchMode(`3d`),this._exploreImages3DMenuOpen=!0}_toggleExploreImages3DSelection(e,{currentTarget:t}){this._setExploreImages3DSearchMode(this._getNextExploreImages3DSearchMode(e)),t.checked=e===`3d`?this.verticalFilterEnabled:this.viewModel.frustumSearchEnabled}_getNextExploreImages3DSearchMode(e){let t=this.verticalFilterEnabled,n=this.viewModel.frustumSearchEnabled,r=t&&n;return e===`3d`?r?`frustum`:n?`both`:`frustum`:r?`3d`:t?`both`:`3d`}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();let t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this._disableExploreImages3D())}_toggleGroupSelection(e,t){let n=this._rootActionTitleToFocus;e&&(this._rootActionTitleToFocus=t?.currentTarget?.getAttribute(`title`)),this.selectedGroup=e,this._actionTitleToFocus=e?this.messages.previous:n}_toggleImageOverlays(e){e.stopPropagation();let t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();let t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=this.imageGalleryEnabled?!t:!1}_toggleLocationTool(e){let t=this.imageLocationToolActive,n=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=n||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();let n=this.measureType,r=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=n===t&&!r?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){let e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements(`area`)}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements(`distance`)}_toggleTriangularLocation(){let e=this.triangularMeasurementActive,t=this.navigationToolActive;if(!e){this._activateTriangulatedImageLocationWorkflow(e,t);return}if(this.measureType!==null){this._resetMeasureTypeAndActivateImageLocationTool();return}this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool()}_toggleTriangularMeasurements(e){let t=this.triangularMeasurementActive,n=this.viewModel.measureType,r=this.navigationToolActive;t?e===n?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!r):(this.imageLocationToolActive=!1,this.measureType=e,this.viewModel.displayNewMeasurementButton=!0):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=r?!0:!r,this.viewModel.displayNewMeasurementButton=!0)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){let{previousFeatureAngle:t,bestFeatureAngle:n}=this.viewModel,r=(n-t+540)%360-180;e.style.setProperty(E,`${t}deg`),e.style.setProperty(D,`${t+r}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,n){return e==="default"?this.viewModel.loadMediaSource(t,n):this.viewModel.loadPanoramicMediaSource(t,n)}async overlayMapFeatures(e,t){return this.removeHandles(`${Q.overlayed}-${e.id}`),this.addHandles(u(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${Q.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${Q.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return X(`div`,{class:this.classes(q.widget,O)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([g({readOnly:!0})],$.prototype,`accuracyParametersMissing`,null),e([g()],$.prototype,`actionBarPosition`,void 0),e([g()],$.prototype,`activeLayer`,null),e([g()],$.prototype,`activeVideoIcon`,null),e([g()],$.prototype,`activeAudioIcon`,null),e([g()],$.prototype,`cameraHeadingThreshold`,null),e([g()],$.prototype,`cameraPitchThreshold`,null),e([g()],$.prototype,`canNavigateSequentially`,null),e([g()],$.prototype,`currentBestFeature`,null),e([g()],$.prototype,`currentCoverageVisible`,null),e([g()],$.prototype,`dataCaptureEnabled`,void 0),e([g()],$.prototype,`dataCaptureLayer`,null),e([g()],$.prototype,`depthImageNotSupported`,null),e([g()],$.prototype,`disabled`,null),e([g()],$.prototype,`enhancementToolActive`,null),e([g()],$.prototype,`features`,null),e([g()],$.prototype,`imagePointsInView`,null),e([g()],$.prototype,`galleryOpened`,void 0),e([g()],$.prototype,`icon`,null),e([g()],$.prototype,`imageEnhancementToolActive`,void 0),e([g()],$.prototype,`videoEnhancementToolActive`,void 0),e([g({readOnly:!0})],$.prototype,`imageGalleryEnabled`,null),e([g()],$.prototype,`imageLocationToolActive`,null),e([g()],$.prototype,`imageOverlaysOpened`,void 0),e([g({readOnly:!0})],$.prototype,`invalidCameraHeading`,null),e([g()],$.prototype,`isAdditionalCoverageVisible`,null),e([g()],$.prototype,`isAdditionalPointSourcesVisible`,null),e([g()],$.prototype,`mapImageConversionToolState`,null),e([g()],$.prototype,`measureType`,null),e([g()],$.prototype,`layer`,null),e([g()],$.prototype,`navigationToolActive`,void 0),e([g()],$.prototype,`navigationMode`,null),e([J(b()),g({type:N})],$.prototype,`viewModel`,void 0),e([g(),Y(`esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer`)],$.prototype,`messages`,void 0),e([g(),Y(`esri/core/t9n/Units`)],$.prototype,`measurementUnitMessages`,void 0),e([g(),Y(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([g(),Y(`esri/widgets/Sketch/t9n/Sketch`)],$.prototype,`messagesSketch`,void 0),e([g()],$.prototype,`pixelMeasurementUnit`,void 0),e([g()],$.prototype,`pixelAreaMeasurementUnit`,void 0),e([g({readOnly:!0})],$.prototype,`popupEnabled`,null),e([g()],$.prototype,`preloadMedia`,null),e([g()],$.prototype,`referencePoint`,null),e([g()],$.prototype,`selectedFeatureObjectId`,null),e([g()],$.prototype,`selectedPoint`,null),e([g()],$.prototype,`selectedGroup`,void 0),e([g()],$.prototype,`showCameraLocations`,void 0),e([g()],$.prototype,`showMapFeatures`,void 0),e([J([`create`,`delete`,`redo`,`undo`,`update`]),g({readOnly:!0})],$.prototype,`sketchViewModel`,null),e([g()],$.prototype,`triangularMeasurementActive`,null),e([g()],$.prototype,`videoLoaded`,null),e([g()],$.prototype,`view`,null),e([g({type:P,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([g()],$.prototype,`determineWorkflowForFeature`,null),e([g()],$.prototype,`shouldShowSelectedImage`,null),e([g()],$.prototype,`superimposeViewEnabled`,null),e([g()],$.prototype,`defaultSuperimposeCameraLockEnabled`,null),e([g()],$.prototype,`updateFootprint`,null),e([g()],$.prototype,`verticalFilterEnabled`,null),e([g()],$.prototype,`_defaultSuperimposeZOffsetPercentage`,void 0),e([g()],$.prototype,`_panoramicSuperimposeRadiusOffsetPercentage`,void 0),e([g()],$.prototype,`_exploreImages3DMenuOpen`,void 0),e([g()],$.prototype,`_exploreImages3DCollapsed`,void 0),e([g()],$.prototype,`_actionBarLayout`,null),e([g()],$.prototype,`_activeMeasurementHeading`,null),e([g()],$.prototype,`_imageOverlaysLoaderTask`,void 0),e([g()],$.prototype,`_imageMeasurementToolsLoaderTask`,void 0),e([g()],$.prototype,`_navigationSettingsLoaderTask`,void 0),e([g()],$.prototype,`_navigationTask`,void 0),e([g()],$.prototype,`_measurementToggle`,null),e([g()],$.prototype,`_renderRoot`,null),e([g()],$.prototype,`_imageEnhancementTools`,null),e([g()],$.prototype,`_videoEnhancementTools`,null),e([g()],$.prototype,`_superimposeTools`,null),e([g()],$.prototype,`_exploreImages3DTools`,null),e([g()],$.prototype,`_imageGalleryPanel`,null),e([g()],$.prototype,`_imageGalleryContext`,null),e([g()],$.prototype,`_imageOverlaysComponent`,null),e([g()],$.prototype,`_navigationUI`,null),e([g()],$.prototype,`_imageOverlayMessages`,null),e([g()],$.prototype,`_imageSketchToolsMessages`,null),e([g()],$.prototype,`_imageOverlaysEnabled`,null),e([g()],$.prototype,`_imageViewer`,null),e([g()],$.prototype,`_imageViewerTriangular`,null),e([g()],$.prototype,`_videoViewer`,null),e([g()],$.prototype,`_locationToggle`,null),e([g()],$.prototype,`_messageBox`,null),e([g()],$.prototype,`_navigationToolExpanded`,void 0),e([g()],$.prototype,`_navigationTool`,void 0),e([g()],$.prototype,`_panoramicVideoViewer`,null),e([g()],$.prototype,`_panoramicViewer`,null),e([g({readOnly:!0})],$.prototype,`noImageInSequenceError`,null),e([g()],$.prototype,`_renderNavigation`,null),e([g()],$.prototype,`_renderThumbnails`,null),e([g()],$.prototype,`_sketchLoaderTask`,void 0),$=e([ee(`esri.widgets.OrientedImageryViewer`)],$);const le=$;export{le as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import n from"../../Graphic.js";import r from"../../PopupTemplate.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import s from"../../core/Logger.js";import{mappedFind as c}from"../../core/maybe.js";import{eachAlways as l,after as u}from"../../core/promiseUtils.js";import{watch as d,initial as f,whenOnce as p}from"../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../core/accessorSupport/decorators.js";import g from"../../geometry/Point.js";import _ from"../../geometry/SpatialReference.js";import{getPointWithElevation as v}from"../../geometry/support/geometryUtils.js";import{getPopupLayer as y}from"../../popup/support/featureUtils.js";import b from"../../portal/Portal.js";import{isApiKeyApplicable as x}from"../../support/apiKeyUtils.js";import S from"../../symbols/PictureMarkerSymbol.js";import C from"../../symbols/SimpleFillSymbol.js";import w from"../../symbols/SimpleLineSymbol.js";import T from"../../symbols/TextSymbol.js";import{highlightsSupported as E}from"../../views/support/layerViewUtils.js";import D from"./LayerSearchSource.js";import O from"./LocatorSearchSource.js";import{SourceCollection as k}from"./types.js";import{isSearchableLayer as A}from"./support/layerSearchUtils.js";import{isArcGISWorldGeocoder as j,meteredArcGISLocatorUrl as M,isProxiedArcGISWorldGeocoder as N,isMeteredArcGISWorldGeocoder as P}from"./support/locatorUtils.js";import{supported as F,getCurrentPosition as I,positionToPoint as L}from"../support/geolocationUtils.js";import{GoTo as R}from"../support/GoTo.js";function z(e,t){return e.hasOwnProperty(t)&&e[t]!=null&&e[t]!==``}const B=`highlight`,V=_.WGS84,H=/<[\s\S]*?>/g;let U=class extends R(o){constructor(e){super(e),this._defaultPopupTemplate=new r({content:`{Match_addr}`}),this._gotoController=null,this._searching=null,this._updatingPromise=null,this._createdFeatureLayers=[],this.autoNavigate=!0,this.autoSelect=!0,this.defaultSources=new k,this.defaultSymbols={point:new S({url:t(`esri/images/search/search-symbol-32.png`),size:24,width:24,height:24}),polyline:new w({color:[130,130,130,1],width:2}),polygon:new C({color:[235,235,235,.4],outline:{color:[130,130,130,1],width:2}})},this.includeDefaultSources=!0,this.maxInputLength=128,this.maxResults=6,this.maxSuggestions=6,this.messages=null,this.minSuggestCharacters=3,this.popupEnabled=!0,this.popupTemplate=null,this.portal=b.getDefault(),this.resultCount=null,this.resultGraphicEnabled=!0,this.resultGraphic=null,this.resultLocation=null,this.results=null,this.selectedSuggestion=null,this.searchAllEnabled=!0,this.selectedResult=null,this.sources=new k,this.suggestionDelay=350,this.suggestionCount=null,this.suggestions=null,this.suggestionsEnabled=!0,this.view=null}initialize(){this.addHandles([d(()=>[this.includeDefaultSources,this.view,this.portal],()=>this._update(),f),d(()=>this.messages,()=>{this._defaultPopupTemplate.title=this.messages?.searchResult??``,this._update()},f)])}destroy(){this._destroyFeatureLayers(),this._abortGoTo(),this.clearGraphics()}static{this.ALL_INDEX=-1}get activeSource(){return this.allSources.at(this.activeSourceIndex)??null}get activeSourceIndex(){return this.allSources.length===1||!this.searchAllEnabled?0:-1}set activeSourceIndex(e){this._overrideIfSome(`activeSourceIndex`,e)}get allPlaceholder(){return this.messages?.allPlaceholder}set allPlaceholder(e){this._overrideIfSome(`allPlaceholder`,e)}get allSources(){let{sources:e,defaultSources:t,includeDefaultSources:n}=this,r=typeof n==`function`?n.call(null,{sources:e,defaultSources:t}):n?t.concat(e):e,i=this._get(`allSources`)||new k;return i.removeAll(),i.addMany(r.filter(Boolean)),i}get defaultPopupTemplate(){return this._defaultPopupTemplate}set defaultPopupTemplate(e){this._overrideIfSome(`defaultPopupTemplate`,e)}get locationEnabled(){return this._get(`locationEnabled`)||F()}set locationEnabled(e){if(e===void 0){this._clearOverride(`locationEnabled`);return}let t=F();if(e&&!t){let e=new a(`locationEnabled:geolocation-unsupported`,`Geolocation API is unsupported.`,{geolocation:navigator.geolocation});s.getLogger(this).error(e)}this._override(`locationEnabled`,!!e&&t)}get placeholder(){let{allSources:e,activeSourceIndex:t,allPlaceholder:n}=this;return t===-1?n??``:e.at(t)?.placeholder??``}set searchTerm(e){this._set(`searchTerm`,e||``),this.clearGraphics(),this.selectedSuggestion&&this.selectedSuggestion.text!==e&&this._set(`selectedSuggestion`,null),e===``&&this._clear()}get searchTerm(){return this._get(`searchTerm`)||``}get state(){return this._searching?`searching`:this.updating?`loading`:this.allSources.length===0?`disabled`:`ready`}get updating(){return this._updatingPromise!=null}clear(){this.searchTerm=``}clearGraphics(){this._removeHighlight();let{view:e,resultGraphic:t}=this;e&&t&&e.graphics.remove(t),this._set(`resultLocation`,null),this._set(`resultGraphic`,null)}search(e,t){this.emit(`search-start`),this.clearGraphics();let n=(async()=>{try{let n=await this._createSuggestionForSearch(e);await this.when();let r=await this._getResultsFromSources(n,t);if(t?.signal?.aborted)return null;let i={activeSourceIndex:this.activeSourceIndex,searchTerm:n.text??``,numResults:0,numErrors:0,errors:[],results:[]};this._formatResponse(i,r,n);let a=this._getFirstResult(i.results),o=(n.location&&a?a.name:n.text)?.replaceAll(H,``);return this._set(`searchTerm`,o),(n.key&&typeof n.sourceIndex==`number`||n.location)&&this._set(`selectedSuggestion`,n),this._set(`results`,i.results),this._set(`resultCount`,i.results.reduce((e,t)=>e+(t.results?.length??0),0)),this.emit(`search-complete`,i),await this._selectFirstResult(a),i}finally{this._clearSearching()}})();return this._searching=n,n}async searchNearby(e){if(!this.locationEnabled){let e=new a(`searchNearby:geolocation-unsupported`,`Geolocation API is unsupported.`,{geolocation:navigator.geolocation});throw s.getLogger(this).error(e),e}let t=(async()=>{try{let t=await I(),n=await L({position:t,view:this.view},e);return await this.search(n,e)}finally{this._clearSearching()}})();return this._searching=t,t}async select(e){if(this.clearGraphics(),!e){let t=new a(`select:missing-parameter`,`Cannot select without a searchResult.`,{value:e});throw s.getLogger(this).error(t),t}let{view:t}=this,r=z(e,`sourceIndex`)?e.sourceIndex:this._getSourceIndexOfResult(e),i=r==null?null:this.allSources.at(r);if(!i){let e=new a(`select:missing-source`,`Cannot select without a source.`,{source:i});throw s.getLogger(this).error(e),e}let o=i instanceof D?this._getLayerSourcePopupTemplate(i):i.popupTemplate,c=i.resultSymbol||this._getDefaultSymbol(e),u=z(i,`resultGraphicEnabled`)?!!i.resultGraphicEnabled:this.resultGraphicEnabled,d=z(i,`autoNavigate`)?!!i.autoNavigate:this.autoNavigate,f=z(i,`popupEnabled`)?!!i.popupEnabled:this.popupEnabled,p=f?o||this.popupTemplate||this.defaultPopupTemplate:null,{feature:m}=e;if(!m){let e=new a(`select:missing-feature`,`Cannot select without a feature.`,{feature:m});throw s.getLogger(this).error(e),e}let{attributes:h,geometry:g}=m,_=y(m),b=null;if(g){let{labelPointExecute:e}=await import(`../../geometry/operators/labelPointOperator.js`);b=e(g)}let x={layerViewQuery:this._getLayerView(m),elevationQuery:t&&b!=null?v(b,t):Promise.resolve(b)},S=await l(x),C=S.layerViewQuery.value,w=S.elevationQuery.value;c instanceof T&&(c.text=e.name);let O=t&&d?e.target||e.extent:null;await(O==null?Promise.resolve():this._goToSearchResult(O));let k=C?m:new n({geometry:g,symbol:c,attributes:h,layer:_,origin:m.origin,popupTemplate:p});return C&&E(C)&&!f&&this._highlightFeature({graphic:k,layerView:C}),!C&&u&&t&&t.graphics.push(k),this._setResultFloor(e),this._set(`selectedResult`,e),this._set(`resultGraphic`,k),this._set(`resultLocation`,w),this.emit(`select-result`,{popupEnabled:f,result:e,source:i,sourceIndex:r}),e}async suggest(e,t,n){let r=e||this.searchTerm;this.emit(`suggest-start`,{searchTerm:r}),await this._suggestTimer(t,n);let i=await this._suggestImmediate(r,n);return this._set(`suggestions`,i?.results),this._set(`suggestionCount`,i?.results.reduce((e,t)=>e+(t.results?.length??0),0)??null),this.emit(`suggest-complete`,i),i}async when(){await p(()=>!this.updating)}async _update(){let{portal:e,view:t}=this;if(this.includeDefaultSources){let n=this._updatingPromise=l([e?.load(),t?.when()]);if(this.destroyed||(await n,n!==this._updatingPromise))return}if(this.destroyed){this._updatingPromise=null;return}this._updateDefaultSources(),this._updatingPromise=null}_clearSearching(){this._searching=null}_convertHelperServices(){let e=this.portal?.helperServices?.geocode;return e?e.map(e=>{if(e.placefinding===!1)return;let t=j(e.url)&&x(e.url)?{url:M}:null,n=O.fromJSON({...e,...t}),r=n.url;if(j(r)||N(r)||P(r)){let e=n.outFields??[`Addr_type`,`Match_addr`,`StAddr`,`City`],t=(n.placeholder||this.messages?.placeholder)??``,r=typeof n.defaultZoomScale==`number`?n.defaultZoomScale:2500;n.singleLineFieldName=`SingleLine`,n.outFields=e,n.placeholder=t,n.defaultZoomScale=r}if(n.singleLineFieldName)return n}).filter(i):[]}_destroyFeatureLayers(){this._createdFeatureLayers.forEach(e=>e?.destroy()),this._createdFeatureLayers=[]}_getLayerSources(e,t){let n=this.view?.map;return e.map(e=>{let r=n.findLayerById(e.id);if(!r)return;let i=this._getLayerJSON(e),a=D.fromJSON(i);return a.placeholder=t,this._getLayer(r,i).then(e=>{a.layer=e}),a}).filter(i).toArray()}_getTableSources(e,t){let n=this.view?.map;return e.map(e=>{if(!e.id)return;let r=n.findTableById(e.id);if(!r)return;let i=this._getLayerJSON(e),a=D.fromJSON(i);return a.placeholder=t,this._getLayer(r,i).then(e=>{a.layer=e}),a}).filter(i).toArray()}_convertApplicationProperties(){let e=(this.view?.map)?.applicationProperties?.viewing?.search;if(!e)return[];let{enabled:t,hintText:n,layers:r,tables:i}=e;if(!t)return[];let a=this._getLayerSources(r,n),o=this._getTableSources(i,n);return[...a,...o]}async _getSubLayer(e,t){if(await e.load(),!e.allSublayers)throw Error();let n=e.allSublayers.find(e=>e.id===t.subLayer);if(!n)throw Error();let r=await n.createFeatureLayer?.();if(!r)throw Error();return this._createdFeatureLayers.push(r),r}async _getBuildingSubLayer(e,t){await e.load();let n=e.allSublayers.find(e=>e.id===t.subLayer);if(n?.type!==`building-component`||(await n.load(),n.associatedLayer==null))throw Error();return await n.associatedLayer.load(),n}async _getLayer(e,t){if(e.type===`map-image`)try{return await this._getSubLayer(e,t)}catch{let t=new a(`search:create-featurelayer`,`Could not create a FeatureLayer from the MapImageLayer`,{layer:e});return s.getLogger(this).error(t),null}return e.type===`building-scene`?this._getBuildingSubLayer(e,t):(await e.load(),e.capabilities?.operations?.supportsQuery?e:null)}_getLayerJSON(e){return typeof e.toJSON==`function`?e.toJSON():e}_updateDefaultSources(){let{defaultSources:e,includeDefaultSources:t}=this;this._destroyFeatureLayers(),e.removeAll(),t&&e.addMany([...this._convertApplicationProperties(),...this._convertHelperServices()])}_abortGoTo(){this._gotoController&&this._gotoController.abort(),this._gotoController=null}_clear(){this._abortGoTo(),this._set(`resultCount`,null),this._set(`results`,null),this._set(`suggestions`,null),this._set(`suggestionCount`,null),this._set(`selectedResult`,null),this._set(`selectedSuggestion`,null),this.emit(`search-clear`)}_suggestTimer(e,t){let n=e??this.suggestionDelay;return u(n,null,t?.signal)}async _createLocationForSearch(e){if(e instanceof n&&e.geometry){let{labelPointExecute:t}=await import(`../../geometry/operators/labelPointOperator.js`);return t(e.geometry)}return e instanceof g?e:Array.isArray(e)&&e.length===2?new g({longitude:e[0],latitude:e[1]}):null}async _createSuggestionForSearch(e){if(e&&z(e,`key`)&&z(e,`text`)&&z(e,`sourceIndex`))return e;let t=await this._createLocationForSearch(e),n=typeof e==`string`?e:this.searchTerm,{selectedSuggestion:r,selectedResult:i}=this,a=!e&&r&&i,o=a&&r.key===i.key&&r.sourceIndex===i.sourceIndex,s=a&&r.location;return o||s?r:{location:t,text:t?``:n,sourceIndex:null,key:null}}_getFirstResult(e){return c(e,({results:e})=>e?.[0])??null}async _selectFirstResult(e){return!this.autoSelect||!e?null:this.select(e)}async _suggestImmediate(e,t){await this.when();let n=await this._getSuggestionsFromSources(e,t);if(t?.signal?.aborted)return null;let r={activeSourceIndex:this.activeSourceIndex,searchTerm:e??``,numResults:0,numErrors:0,errors:[],results:[]};return this._formatResponse(r,n),r}_formatSourceResponse(e,t,n){let r=t?.value||[],i=t?.error,a=this.allSources.at(n);if(i){let t={sourceIndex:n,source:a,error:i};e.errors.push(t),s.getLogger(this).error(i),e.numErrors++}else{let t={sourceIndex:n,source:a,results:r};e.results.push(t),e.numResults+=r.length}}_formatResponse(e,t,n){if(t){if(e.activeSourceIndex===-1){let r=n&&z(n,`sourceIndex`)&&n.sourceIndex!==-1?n.sourceIndex:void 0;t.forEach((t,n)=>{let i=r===void 0?n:r;this._formatSourceResponse(e,t,i)})}else this._formatSourceResponse(e,t[0],e.activeSourceIndex)}}async _getResultsFromSources(e,t){let{allSources:n}=this,r=!e.location&&z(e,`sourceIndex`)?e.sourceIndex:this.activeSourceIndex,i=[];if(!n.length){let e=new a(`search:no-sources-defined`,`At least one source is required.`,{allSources:n});throw s.getLogger(this).error(e),e}return r===-1?n.forEach((n,r)=>{i.push(this._getResultsFromSource(e,r,t))}):i.push(this._getResultsFromSource(e,r,t)),l(i)}async _getSuggestionsFromSources(e,t){let{allSources:n,activeSourceIndex:r}=this,i=[];if(!n.length){let e=new a(`suggest:no-sources-defined`,`At least one source is required.`,{allSources:n});throw s.getLogger(this).error(e),e}return r===-1?n.forEach((n,r)=>{i.push(this._getSuggestionsFromSource(e,r,t))}):i.push(this._getSuggestionsFromSource(e,r,t)),l(i)}async _getResultsFromSource(e,t,n){let r=t==null?null:this.allSources.at(t);if(!r)return null;let{location:i=null}=e,a=this.view?.spatialReference??V,o=z(r,`maxResults`)?r.maxResults:this.maxResults,s=r instanceof D&&z(r,`exactMatch`)?r.exactMatch:!1,{view:c}=this;return r.getResults?.({exactMatch:s,location:i,maxResults:o,sourceIndex:t,spatialReference:a,suggestResult:e,view:c},n)}async _getSuggestionsFromSource(e,t,n){let r=this.allSources.at(t);if(!r)return null;e??=``;let i=z(r,`suggestionsEnabled`)?r.suggestionsEnabled:this.suggestionsEnabled,a=e?.length,o=z(r,`minSuggestCharacters`)?r.minSuggestCharacters:this.minSuggestCharacters;if(i&&e.trim()&&a>=o){let i=this.view?.spatialReference||V,a=z(r,`maxSuggestions`)?r.maxSuggestions:this.maxSuggestions,{view:o}=this,s=r instanceof D&&z(r,`exactMatch`)?r.exactMatch:!1;return r.getSuggestions?.({view:o,sourceIndex:t,suggestTerm:e,spatialReference:i,maxSuggestions:a,exactMatch:s},n)}return null}_getLayerSourcePopupTemplate(e){let{layer:t}=e;if(t)return z(e,`popupTemplate`)?e.popupTemplate:t.popupTemplate}_getSourceIndexOfResult(e){return c(this.results??[],({results:t,sourceIndex:n})=>t?.includes(e)?n:null)??null}async _goToSearchResult(e){this._abortGoTo();let t=new AbortController;this._gotoController=t;let n={target:{target:e},options:{signal:t.signal}};e||(n.options.animate=!1),await this.callGoTo(n),this._gotoController=null}_getDefaultSymbol(e){let{defaultSymbols:t}=this,n=e.feature?.geometry;if(n==null)return null;switch(n.type){case`point`:case`multipoint`:return t.point;case`polyline`:return t.polyline;case`extent`:case`polygon`:return t.polygon;default:return null}}_removeHighlight(){this.removeHandles(B)}async _getLayerView(e){let{view:t}=this;if(!e||!t)return null;let n=y(e);return!n||n.type===`building-component`||n.type===`subtype-sublayer`?null:(await t.when(),t.whenLayerView(n))}_highlightFeature(e){let{graphic:t,layerView:n}=e,{attributes:r}=t,i=y(t);if(!A(i))return;let{objectIdField:a}=i,o=(a&&r?.[a])??null,s=n.highlight(o??t);this.addHandles(s,B)}_setResultFloor(e){let{view:t}=this,n=e.feature?.attributes,r=y(e.feature);if(A(r)&&r.floorInfo?.floorField&&n){let e=n[r.floorInfo.floorField];t?.emit(`select-result-floor`,e)}}};e([m()],U.prototype,`_searching`,void 0),e([m()],U.prototype,`_updatingPromise`,void 0),e([m({readOnly:!0,value:null})],U.prototype,`activeSource`,null),e([m()],U.prototype,`activeSourceIndex`,null),e([m()],U.prototype,`allPlaceholder`,null),e([m({readOnly:!0})],U.prototype,`allSources`,null),e([m()],U.prototype,`autoNavigate`,void 0),e([m()],U.prototype,`autoSelect`,void 0),e([m({type:r})],U.prototype,`defaultPopupTemplate`,null),e([m({readOnly:!0})],U.prototype,`defaultSources`,void 0),e([m()],U.prototype,`defaultSymbols`,void 0),e([m()],U.prototype,`includeDefaultSources`,void 0),e([m()],U.prototype,`locationEnabled`,null),e([m()],U.prototype,`maxInputLength`,void 0),e([m()],U.prototype,`maxResults`,void 0),e([m()],U.prototype,`maxSuggestions`,void 0),e([m()],U.prototype,`messages`,void 0),e([m()],U.prototype,`minSuggestCharacters`,void 0),e([m({readOnly:!0})],U.prototype,`placeholder`,null),e([m()],U.prototype,`popupEnabled`,void 0),e([m({type:r})],U.prototype,`popupTemplate`,void 0),e([m({type:b})],U.prototype,`portal`,void 0),e([m()],U.prototype,`resultCount`,void 0),e([m()],U.prototype,`resultGraphicEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`resultGraphic`,void 0),e([m({readOnly:!0})],U.prototype,`resultLocation`,void 0),e([m({readOnly:!0})],U.prototype,`results`,void 0),e([m({readOnly:!0})],U.prototype,`selectedSuggestion`,void 0),e([m()],U.prototype,`searchAllEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`selectedResult`,void 0),e([m()],U.prototype,`searchTerm`,null),e([m({type:k})],U.prototype,`sources`,void 0),e([m({readOnly:!0})],U.prototype,`state`,null),e([m()],U.prototype,`suggestionDelay`,void 0),e([m()],U.prototype,`suggestionCount`,void 0),e([m({readOnly:!0})],U.prototype,`suggestions`,void 0),e([m()],U.prototype,`suggestionsEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`updating`,null),e([m()],U.prototype,`view`,void 0),e([m()],U.prototype,`clear`,null),U=e([h(`esri.widgets.Search.SearchViewModel`)],U);const W=U;export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import n from"../../Graphic.js";import r from"../../PopupTemplate.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import s from"../../core/Logger.js";import{mappedFind as c}from"../../core/maybe.js";import{eachAlways as l,after as u}from"../../core/promiseUtils.js";import{watch as d,initial as f,whenOnce as p}from"../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../core/accessorSupport/decorators.js";import g from"../../geometry/Point.js";import _ from"../../geometry/SpatialReference.js";import{getPointWithElevation as v}from"../../geometry/support/geometryUtils.js";import{getPopupLayer as y}from"../../popup/support/featureUtils.js";import b from"../../portal/Portal.js";import{isApiKeyApplicable as x}from"../../support/apiKeyUtils.js";import S from"../../symbols/PictureMarkerSymbol.js";import C from"../../symbols/SimpleFillSymbol.js";import w from"../../symbols/SimpleLineSymbol.js";import T from"../../symbols/TextSymbol.js";import{highlightsSupported as E}from"../../views/support/layerViewUtils.js";import D from"./LayerSearchSource.js";import O from"./LocatorSearchSource.js";import{SourceCollection as k}from"./types.js";import{isSearchableLayer as A}from"./support/layerSearchUtils.js";import{isArcGISWorldGeocoder as j,meteredArcGISLocatorUrl as M,isProxiedArcGISWorldGeocoder as N,isMeteredArcGISWorldGeocoder as P}from"./support/locatorUtils.js";import{supported as F,getCurrentPosition as I,positionToPoint as L}from"../support/geolocationUtils.js";import{GoTo as R}from"../support/GoTo.js";function z(e,t){return e.hasOwnProperty(t)&&e[t]!=null&&e[t]!==``}const B=`highlight`,V=_.WGS84,H=/<[\s\S]*?>/g;let U=class extends R(o){constructor(e){super(e),this._defaultPopupTemplate=new r({content:`{Match_addr}`}),this._gotoController=null,this._searching=null,this._updatingPromise=null,this._createdFeatureLayers=[],this.autoNavigate=!0,this.autoSelect=!0,this.defaultSources=new k,this.defaultSymbols={point:new S({url:t(`esri/images/search/search-symbol-32.png`),size:24,width:24,height:24}),polyline:new w({color:[130,130,130,1],width:2}),polygon:new C({color:[235,235,235,.4],outline:{color:[130,130,130,1],width:2}})},this.includeDefaultSources=!0,this.maxInputLength=128,this.maxResults=6,this.maxSuggestions=6,this.messages=null,this.minSuggestCharacters=3,this.popupEnabled=!0,this.popupTemplate=null,this.portal=b.getDefault(),this.resultCount=null,this.resultGraphicEnabled=!0,this.resultGraphic=null,this.resultLocation=null,this.results=null,this.selectedSuggestion=null,this.searchAllEnabled=!0,this.selectedResult=null,this.sources=new k,this.suggestionDelay=350,this.suggestionCount=null,this.suggestions=null,this.suggestionsEnabled=!0,this.view=null}initialize(){this.addHandles([d(()=>[this.includeDefaultSources,this.view,this.portal],()=>this._update(),f),d(()=>this.messages,()=>{this._defaultPopupTemplate.title=this.messages?.searchResult??``,this._update()},f)])}destroy(){this._destroyFeatureLayers(),this._abortGoTo(),this.clearGraphics()}static{this.ALL_INDEX=-1}get activeSource(){return this.allSources.at(this.activeSourceIndex)??null}get activeSourceIndex(){return this.allSources.length===1||!this.searchAllEnabled?0:-1}set activeSourceIndex(e){this._overrideIfSome(`activeSourceIndex`,e)}get allPlaceholder(){return this.messages?.allPlaceholder}set allPlaceholder(e){this._overrideIfSome(`allPlaceholder`,e)}get allSources(){let{sources:e,defaultSources:t,includeDefaultSources:n}=this,r=typeof n==`function`?n.call(null,{sources:e,defaultSources:t}):n?t.concat(e):e,i=this._get(`allSources`)||new k;return i.removeAll(),i.addMany(r.filter(Boolean)),i}get defaultPopupTemplate(){return this._defaultPopupTemplate}set defaultPopupTemplate(e){this._overrideIfSome(`defaultPopupTemplate`,e)}get locationEnabled(){return this._get(`locationEnabled`)||F()}set locationEnabled(e){if(e===void 0){this._clearOverride(`locationEnabled`);return}let t=F();if(e&&!t){let e=new a(`locationEnabled:geolocation-unsupported`,`Geolocation API is unsupported.`,{geolocation:navigator.geolocation});s.getLogger(this).error(e)}this._override(`locationEnabled`,!!e&&t)}get placeholder(){let{allSources:e,activeSourceIndex:t,allPlaceholder:n}=this;return t===-1?n??``:e.at(t)?.placeholder??``}set searchTerm(e){this._set(`searchTerm`,e||``),this.clearGraphics(),this.selectedSuggestion&&this.selectedSuggestion.text!==e&&this._set(`selectedSuggestion`,null),e===``&&this._clear()}get searchTerm(){return this._get(`searchTerm`)||``}get state(){return this._searching?`searching`:this.updating?`loading`:this.allSources.length===0?`disabled`:`ready`}get updating(){return this._updatingPromise!=null}clear(){this.searchTerm=``}clearGraphics(){this._removeHighlight();let{view:e,resultGraphic:t}=this;e&&t&&e.graphics.remove(t),this._set(`resultLocation`,null),this._set(`resultGraphic`,null)}search(e,t){this.emit(`search-start`),this.clearGraphics();let n=(async()=>{try{let n=await this._createSuggestionForSearch(e);await this.when();let r=await this._getResultsFromSources(n,t);if(t?.signal?.aborted)return null;let i={activeSourceIndex:this.activeSourceIndex,searchTerm:n.text??``,numResults:0,numErrors:0,errors:[],results:[]};this._formatResponse(i,r,n);let a=this._getFirstResult(i.results),o=(n.location&&a?a.name:n.text)?.replaceAll(H,``);return this._set(`searchTerm`,o),(n.key&&typeof n.sourceIndex==`number`||n.location)&&this._set(`selectedSuggestion`,n),this._set(`results`,i.results),this._set(`resultCount`,i.results.reduce((e,t)=>e+(t.results?.length??0),0)),this.emit(`search-complete`,i),await this._selectFirstResult(a),i}finally{this._clearSearching()}})();return this._searching=n,n}async searchNearby(e){if(!this.locationEnabled){let e=new a(`searchNearby:geolocation-unsupported`,`Geolocation API is unsupported.`,{geolocation:navigator.geolocation});throw s.getLogger(this).error(e),e}let t=(async()=>{try{let t=await I(),n=await L({position:t,view:this.view},e);return await this.search(n,e)}finally{this._clearSearching()}})();return this._searching=t,t}async select(e){if(this.clearGraphics(),!e){let t=new a(`select:missing-parameter`,`Cannot select without a searchResult.`,{value:e});throw s.getLogger(this).error(t),t}let{view:t}=this,r=z(e,`sourceIndex`)?e.sourceIndex:this._getSourceIndexOfResult(e),i=r==null?null:this.allSources.at(r);if(!i){let e=new a(`select:missing-source`,`Cannot select without a source.`,{source:i});throw s.getLogger(this).error(e),e}let o=i instanceof D?this._getLayerSourcePopupTemplate(i):i.popupTemplate,c=i.resultSymbol||this._getDefaultSymbol(e),u=z(i,`resultGraphicEnabled`)?!!i.resultGraphicEnabled:this.resultGraphicEnabled,d=z(i,`autoNavigate`)?!!i.autoNavigate:this.autoNavigate,f=z(i,`popupEnabled`)?!!i.popupEnabled:this.popupEnabled,p=f?o||this.popupTemplate||this.defaultPopupTemplate:null,{feature:m}=e;if(!m){let e=new a(`select:missing-feature`,`Cannot select without a feature.`,{feature:m});throw s.getLogger(this).error(e),e}let{attributes:h,geometry:g}=m,_=y(m),b=null;if(g){let{labelPointExecute:e}=await import(`../../geometry/operators/labelPointOperator.js`);b=e(g)}let x={layerViewQuery:this._getLayerView(m),elevationQuery:t&&b!=null?v(b,t):Promise.resolve(b)},S=await l(x),C=S.layerViewQuery.value,w=S.elevationQuery.value;c instanceof T&&(c.text=e.name);let O=t&&d?e.target||e.extent:null;await(O==null?Promise.resolve():this._goToSearchResult(O));let k=C?m:new n({geometry:g,symbol:c,attributes:h,layer:_,origin:m.origin,popupTemplate:p});return C&&E(C)&&!f&&this._highlightFeature({graphic:k,layerView:C}),!C&&u&&t&&t.graphics.push(k),this._setResultFloor(e),this._set(`selectedResult`,e),this._set(`resultGraphic`,k),this._set(`resultLocation`,w),this.emit(`select-result`,{popupEnabled:f,result:e,source:i,sourceIndex:r}),e}async suggest(e,t,n){let r=e||this.searchTerm;this.emit(`suggest-start`,{searchTerm:r}),await this._suggestTimer(t,n);let i=await this._suggestImmediate(r,n);return this._set(`suggestions`,i?.results),this._set(`suggestionCount`,i?.results.reduce((e,t)=>e+(t.results?.length??0),0)??null),this.emit(`suggest-complete`,i),i}async when(){await p(()=>!this.updating)}async _update(){let{portal:e,view:t}=this;if(!this.includeDefaultSources){this._updateDefaultSources(),this._updatingPromise=null;return}let n=l([e?.load(),t?.when()]).then(async()=>{this.destroyed||n!==this._updatingPromise||await this._updateDefaultSources()});this._updatingPromise=n,await n,n===this._updatingPromise&&(this._updatingPromise=null)}_clearSearching(){this._searching=null}_convertHelperServices(){let e=this.portal?.helperServices?.geocode;return e?e.map(e=>{if(e.placefinding===!1)return;let t=j(e.url)&&x(e.url)?{url:M}:null,n=O.fromJSON({...e,...t}),r=n.url;if(j(r)||N(r)||P(r)){let e=n.outFields??[`Addr_type`,`Match_addr`,`StAddr`,`City`],t=(n.placeholder||this.messages?.placeholder)??``,r=typeof n.defaultZoomScale==`number`?n.defaultZoomScale:2500;n.singleLineFieldName=`SingleLine`,n.outFields=e,n.placeholder=t,n.defaultZoomScale=r}if(n.singleLineFieldName)return n}).filter(i):[]}_destroyFeatureLayers(){this._createdFeatureLayers.forEach(e=>e?.destroy()),this._createdFeatureLayers=[]}async _getLayerSources(e,t){let n=this.view?.map;return(await l(e.map(async e=>{let r=n.findLayerById(e.id);if(!r)return;let i=this._getLayerJSON(e),a=await this._getLayer(r,i);if(!a)return;let o=D.fromJSON(i);return o.placeholder=t,o.layer=a,o}).toArray())).map(({value:e})=>e).filter(i)}async _getTableSources(e,t){let n=this.view?.map;return(await l(e.map(async e=>{if(!e.id)return;let r=n.findTableById(e.id);if(!r)return;let i=this._getLayerJSON(e),a=await this._getLayer(r,i);if(!a)return;let o=D.fromJSON(i);return o.placeholder=t,o.layer=a,o}).toArray())).map(({value:e})=>e).filter(i)}async _convertApplicationProperties(){let e=(this.view?.map)?.applicationProperties?.viewing?.search;if(!e)return[];let{enabled:t,hintText:n,layers:r,tables:i}=e;if(!t)return[];let[a,o]=await Promise.all([this._getLayerSources(r,n),this._getTableSources(i,n)]);return[...a,...o]}async _getSubLayer(e,t){let n=this._updatingPromise;if(await e.load(),!e.allSublayers)throw Error();let r=e.allSublayers.find(e=>e.id===t.subLayer);if(!r)throw Error();let i=await r.createFeatureLayer?.();if(!i)throw Error();if(this.destroyed||n!==this._updatingPromise)return i.destroy(),null;this._createdFeatureLayers.push(i);try{await i.load()}catch(e){throw this._createdFeatureLayers=this._createdFeatureLayers.filter(e=>e!==i),i.destroy(),e}return this.destroyed||n!==this._updatingPromise?(this._createdFeatureLayers=this._createdFeatureLayers.filter(e=>e!==i),i.destroy(),null):i}async _getBuildingSubLayer(e,t){await e.load();let n=e.allSublayers.find(e=>e.id===t.subLayer);if(n?.type!==`building-component`||(await n.load(),n.associatedLayer==null))throw Error();return await n.associatedLayer.load(),n}async _getLayer(e,t){if(e.type===`map-image`)try{return await this._getSubLayer(e,t)}catch{let t=new a(`search:create-featurelayer`,`Could not create a FeatureLayer from the MapImageLayer`,{layer:e});return s.getLogger(this).error(t),null}return e.type===`building-scene`?this._getBuildingSubLayer(e,t):(await e.load(),e.capabilities?.operations?.supportsQuery?e:null)}_getLayerJSON(e){return typeof e.toJSON==`function`?e.toJSON():e}async _updateDefaultSources(){let{defaultSources:e,includeDefaultSources:t}=this,n=this._updatingPromise;if(this._destroyFeatureLayers(),e.removeAll(),t){let t=await this._convertApplicationProperties();if(this.destroyed||n!==this._updatingPromise)return;e.addMany([...t,...this._convertHelperServices()])}}_abortGoTo(){this._gotoController&&this._gotoController.abort(),this._gotoController=null}_clear(){this._abortGoTo(),this._set(`resultCount`,null),this._set(`results`,null),this._set(`suggestions`,null),this._set(`suggestionCount`,null),this._set(`selectedResult`,null),this._set(`selectedSuggestion`,null),this.emit(`search-clear`)}_suggestTimer(e,t){let n=e??this.suggestionDelay;return u(n,null,t?.signal)}async _createLocationForSearch(e){if(e instanceof n&&e.geometry){let{labelPointExecute:t}=await import(`../../geometry/operators/labelPointOperator.js`);return t(e.geometry)}return e instanceof g?e:Array.isArray(e)&&e.length===2?new g({longitude:e[0],latitude:e[1]}):null}async _createSuggestionForSearch(e){if(e&&z(e,`key`)&&z(e,`text`)&&z(e,`sourceIndex`))return e;let t=await this._createLocationForSearch(e),n=typeof e==`string`?e:this.searchTerm,{selectedSuggestion:r,selectedResult:i}=this,a=!e&&r&&i,o=a&&r.key===i.key&&r.sourceIndex===i.sourceIndex,s=a&&r.location;return o||s?r:{location:t,text:t?``:n,sourceIndex:null,key:null}}_getFirstResult(e){return c(e,({results:e})=>e?.[0])??null}async _selectFirstResult(e){return!this.autoSelect||!e?null:this.select(e)}async _suggestImmediate(e,t){await this.when();let n=await this._getSuggestionsFromSources(e,t);if(t?.signal?.aborted)return null;let r={activeSourceIndex:this.activeSourceIndex,searchTerm:e??``,numResults:0,numErrors:0,errors:[],results:[]};return this._formatResponse(r,n),r}_formatSourceResponse(e,t,n){let r=t?.value||[],i=t?.error,a=this.allSources.at(n);if(i){let t={sourceIndex:n,source:a,error:i};e.errors.push(t),s.getLogger(this).error(i),e.numErrors++}else{let t={sourceIndex:n,source:a,results:r};e.results.push(t),e.numResults+=r.length}}_formatResponse(e,t,n){if(t){if(e.activeSourceIndex===-1){let r=n&&z(n,`sourceIndex`)&&n.sourceIndex!==-1?n.sourceIndex:void 0;t.forEach((t,n)=>{let i=r===void 0?n:r;this._formatSourceResponse(e,t,i)})}else this._formatSourceResponse(e,t[0],e.activeSourceIndex)}}async _getResultsFromSources(e,t){let{allSources:n}=this,r=!e.location&&z(e,`sourceIndex`)?e.sourceIndex:this.activeSourceIndex,i=[];if(!n.length){let e=new a(`search:no-sources-defined`,`At least one source is required.`,{allSources:n});throw s.getLogger(this).error(e),e}return r===-1?n.forEach((n,r)=>{i.push(this._getResultsFromSource(e,r,t))}):i.push(this._getResultsFromSource(e,r,t)),l(i)}async _getSuggestionsFromSources(e,t){let{allSources:n,activeSourceIndex:r}=this,i=[];if(!n.length){let e=new a(`suggest:no-sources-defined`,`At least one source is required.`,{allSources:n});throw s.getLogger(this).error(e),e}return r===-1?n.forEach((n,r)=>{i.push(this._getSuggestionsFromSource(e,r,t))}):i.push(this._getSuggestionsFromSource(e,r,t)),l(i)}async _getResultsFromSource(e,t,n){let r=t==null?null:this.allSources.at(t);if(!r)return null;let{location:i=null}=e,a=this.view?.spatialReference??V,o=z(r,`maxResults`)?r.maxResults:this.maxResults,s=r instanceof D&&z(r,`exactMatch`)?r.exactMatch:!1,{view:c}=this;return r.getResults?.({exactMatch:s,location:i,maxResults:o,sourceIndex:t,spatialReference:a,suggestResult:e,view:c},n)}async _getSuggestionsFromSource(e,t,n){let r=this.allSources.at(t);if(!r)return null;e??=``;let i=z(r,`suggestionsEnabled`)?r.suggestionsEnabled:this.suggestionsEnabled,a=e?.length,o=z(r,`minSuggestCharacters`)?r.minSuggestCharacters:this.minSuggestCharacters;if(i&&e.trim()&&a>=o){let i=this.view?.spatialReference||V,a=z(r,`maxSuggestions`)?r.maxSuggestions:this.maxSuggestions,{view:o}=this,s=r instanceof D&&z(r,`exactMatch`)?r.exactMatch:!1;return r.getSuggestions?.({view:o,sourceIndex:t,suggestTerm:e,spatialReference:i,maxSuggestions:a,exactMatch:s},n)}return null}_getLayerSourcePopupTemplate(e){let{layer:t}=e;if(t)return z(e,`popupTemplate`)?e.popupTemplate:t.popupTemplate}_getSourceIndexOfResult(e){return c(this.results??[],({results:t,sourceIndex:n})=>t?.includes(e)?n:null)??null}async _goToSearchResult(e){this._abortGoTo();let t=new AbortController;this._gotoController=t;let n={target:{target:e},options:{signal:t.signal}};e||(n.options.animate=!1),await this.callGoTo(n),this._gotoController=null}_getDefaultSymbol(e){let{defaultSymbols:t}=this,n=e.feature?.geometry;if(n==null)return null;switch(n.type){case`point`:case`multipoint`:return t.point;case`polyline`:return t.polyline;case`extent`:case`polygon`:return t.polygon;default:return null}}_removeHighlight(){this.removeHandles(B)}async _getLayerView(e){let{view:t}=this;if(!e||!t)return null;let n=y(e);return!n||n.type===`building-component`||n.type===`subtype-sublayer`?null:(await t.when(),t.whenLayerView(n))}_highlightFeature(e){let{graphic:t,layerView:n}=e,{attributes:r}=t,i=y(t);if(!A(i))return;let{objectIdField:a}=i,o=(a&&r?.[a])??null,s=n.highlight(o??t);this.addHandles(s,B)}_setResultFloor(e){let{view:t}=this,n=e.feature?.attributes,r=y(e.feature);if(A(r)&&r.floorInfo?.floorField&&n){let e=n[r.floorInfo.floorField];t?.emit(`select-result-floor`,e)}}};e([m()],U.prototype,`_searching`,void 0),e([m()],U.prototype,`_updatingPromise`,void 0),e([m({readOnly:!0,value:null})],U.prototype,`activeSource`,null),e([m()],U.prototype,`activeSourceIndex`,null),e([m()],U.prototype,`allPlaceholder`,null),e([m({readOnly:!0})],U.prototype,`allSources`,null),e([m()],U.prototype,`autoNavigate`,void 0),e([m()],U.prototype,`autoSelect`,void 0),e([m({type:r})],U.prototype,`defaultPopupTemplate`,null),e([m({readOnly:!0})],U.prototype,`defaultSources`,void 0),e([m()],U.prototype,`defaultSymbols`,void 0),e([m()],U.prototype,`includeDefaultSources`,void 0),e([m()],U.prototype,`locationEnabled`,null),e([m()],U.prototype,`maxInputLength`,void 0),e([m()],U.prototype,`maxResults`,void 0),e([m()],U.prototype,`maxSuggestions`,void 0),e([m()],U.prototype,`messages`,void 0),e([m()],U.prototype,`minSuggestCharacters`,void 0),e([m({readOnly:!0})],U.prototype,`placeholder`,null),e([m()],U.prototype,`popupEnabled`,void 0),e([m({type:r})],U.prototype,`popupTemplate`,void 0),e([m({type:b})],U.prototype,`portal`,void 0),e([m()],U.prototype,`resultCount`,void 0),e([m()],U.prototype,`resultGraphicEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`resultGraphic`,void 0),e([m({readOnly:!0})],U.prototype,`resultLocation`,void 0),e([m({readOnly:!0})],U.prototype,`results`,void 0),e([m({readOnly:!0})],U.prototype,`selectedSuggestion`,void 0),e([m()],U.prototype,`searchAllEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`selectedResult`,void 0),e([m()],U.prototype,`searchTerm`,null),e([m({type:k})],U.prototype,`sources`,void 0),e([m({readOnly:!0})],U.prototype,`state`,null),e([m()],U.prototype,`suggestionDelay`,void 0),e([m()],U.prototype,`suggestionCount`,void 0),e([m({readOnly:!0})],U.prototype,`suggestions`,void 0),e([m()],U.prototype,`suggestionsEnabled`,void 0),e([m({readOnly:!0})],U.prototype,`updating`,null),e([m()],U.prototype,`view`,void 0),e([m()],U.prototype,`clear`,null),U=e([h(`esri.widgets.Search.SearchViewModel`)],U);const W=U;export{W as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{substitute as e,formatDate as t}from"../../../intl.js";import n from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{mappedFind as a}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import s from"../../../geometry/Polygon.js";import{getExtentFromGeometry as c,scaleExtent as l}from"../../../geometry/support/geometryUtils.js";import{getPopupLayer as u}from"../../../popup/support/featureUtils.js";import d from"../../../rest/support/FullTextSearch.js";const f=/https?:\/\/services.*\.arcgis\.com/i,p=/(?:\{([^}]+)\})/g,m=()=>i.getLogger(`esri.widgets.Search.support.layerSearchUtils`);function h(e,t){let{exactMatch:r=!1,location:i,maxResults:a,spatialReference:s,source:c,sourceIndex:l,suggestResult:u,view:d}=e,{layer:f,zoomScale:p}=c,h=d?.scale,g=_(c,d),x=t?.signal;return y(f).then(()=>{let e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(e=>{let{objectIdField:t,returnZ:_}=f,y=O(c);if(!A(f,y))throw m().error(`invalid-field: displayField is invalid.`),new n(`getResults():invalid-field`,`displayField is invalid.`);let S=e?.length?e:[y],w=c.outFields||S,T=v(w);if(!w.includes(t)&&!T&&w.push(t),f.floorInfo?.floorField&&w.push(f.floorInfo.floorField),!(T||k(f,w)))throw m().error(`invalid-field: outField is invalid.`),new n(`getResults():invalid-field`,`outField is invalid.`);let D=f.createQuery(),{orderByFields:j}=c;if(j&&(D.orderByFields=j),s){D.outSpatialReference=s;let e=1/o(s);e&&(D.maxAllowableOffset=e)}let M=f.geometryType===`mesh`||f.geometryType===`multipatch`;if(D.returnZ=f.capabilities?.data?.supportsZ&&!M&&_!==!1,D.returnGeometry=!0,D.multipatchOption=M?`xyFootprint`:null,w&&(D.outFields=w),i)D.geometry=i;else if(u.key)D.objectIds=[u.key];else{let e=c.searchFields||[y];if(!k(f,e))throw m().error(`invalid-field: search field is invalid.`),new n(`getResults():invalid-field`,`search field is invalid.`);E(f)&&(D.num=a),g&&(D.geometry=g);let t=u.text;if(!t?.trim()||(C({source:c,searchTerm:t,searchFields:e,exactMatch:r,query:D,type:`search`}),!b(D)))return[]}return f.queryFeatures(D,{signal:x}).then(async e=>{let{labelPointExecute:t}=await import(`../../../geometry/operators/labelPointOperator.js`);return K(e,d,c,l,y,h,p,t)})})}function g(e,t){let{source:r,spatialReference:i,view:a,suggestTerm:o,maxSuggestions:s,sourceIndex:c,exactMatch:l}=e,{layer:u}=r,d=t?.signal,f=_(r,a);return y(u).then(()=>{if(!E(u))return[];let e=O(r),t=r.searchFields||[e],a=[];r.suggestionTemplate?r.suggestionTemplate.replaceAll(p,(e,t)=>(a.push(t),e)):a.push(e);let h=v(a);!a.includes(u.objectIdField)&&!h&&a.push(u.objectIdField);let g=A(u,e),_=h||k(u,a),y=k(u,t);if(!g)throw m().error(`invalid-field: displayField is invalid.`),new n(`getSuggestions():invalid-field`,`displayField is invalid.`);if(!_)throw m().error(`invalid-field: outField is invalid.`),new n(`getSuggestions():invalid-field`,`outField is invalid.`);if(!y)throw m().error(`invalid-field: search field is invalid.`),new n(`getSuggestions():invalid-field`,`search field is invalid.`);let x=u.createQuery(),{orderByFields:S}=r;return S&&(x.orderByFields=S),x.outSpatialReference=i,x.returnGeometry=!1,x.num=s,x.outFields=a,f&&(x.geometry=f),!o.trim()||(C({source:r,searchTerm:o,searchFields:t,exactMatch:l,query:x,type:`suggest`}),!b(x))?[]:u.queryFeatures(x,{signal:d}).then(t=>U(t,r,c,e))})}function _(e,t){let{filter:n,withinViewEnabled:r}=e,i=t?.extent;return n?.geometry??(r&&i?i:void 0)}function v(e){return e&&e.includes(`*`)}async function y(e){e
|
|
2
|
+
import{substitute as e,formatDate as t}from"../../../intl.js";import n from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{mappedFind as a}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import s from"../../../geometry/Polygon.js";import{getExtentFromGeometry as c,scaleExtent as l}from"../../../geometry/support/geometryUtils.js";import{getPopupLayer as u}from"../../../popup/support/featureUtils.js";import d from"../../../rest/support/FullTextSearch.js";const f=/https?:\/\/services.*\.arcgis\.com/i,p=/(?:\{([^}]+)\})/g,m=()=>i.getLogger(`esri.widgets.Search.support.layerSearchUtils`);function h(e,t){let{exactMatch:r=!1,location:i,maxResults:a,spatialReference:s,source:c,sourceIndex:l,suggestResult:u,view:d}=e,{layer:f,zoomScale:p}=c,h=d?.scale,g=_(c,d),x=t?.signal;return y(f).then(()=>{let e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(e=>{let{objectIdField:t,returnZ:_}=f,y=O(c);if(!A(f,y))throw m().error(`invalid-field: displayField is invalid.`),new n(`getResults():invalid-field`,`displayField is invalid.`);let S=e?.length?e:[y],w=c.outFields||S,T=v(w);if(!w.includes(t)&&!T&&w.push(t),f.floorInfo?.floorField&&w.push(f.floorInfo.floorField),!(T||k(f,w)))throw m().error(`invalid-field: outField is invalid.`),new n(`getResults():invalid-field`,`outField is invalid.`);let D=f.createQuery(),{orderByFields:j}=c;if(j&&(D.orderByFields=j),s){D.outSpatialReference=s;let e=1/o(s);e&&(D.maxAllowableOffset=e)}let M=f.geometryType===`mesh`||f.geometryType===`multipatch`;if(D.returnZ=f.capabilities?.data?.supportsZ&&!M&&_!==!1,D.returnGeometry=!0,D.multipatchOption=M?`xyFootprint`:null,w&&(D.outFields=w),i)D.geometry=i;else if(u.key)D.objectIds=[u.key];else{let e=c.searchFields||[y];if(!k(f,e))throw m().error(`invalid-field: search field is invalid.`),new n(`getResults():invalid-field`,`search field is invalid.`);E(f)&&(D.num=a),g&&(D.geometry=g);let t=u.text;if(!t?.trim()||(C({source:c,searchTerm:t,searchFields:e,exactMatch:r,query:D,type:`search`}),!b(D)))return[]}return f.queryFeatures(D,{signal:x}).then(async e=>{let{labelPointExecute:t}=await import(`../../../geometry/operators/labelPointOperator.js`);return K(e,d,c,l,y,h,p,t)})})}function g(e,t){let{source:r,spatialReference:i,view:a,suggestTerm:o,maxSuggestions:s,sourceIndex:c,exactMatch:l}=e,{layer:u}=r,d=t?.signal,f=_(r,a);return y(u).then(()=>{if(!E(u))return[];let e=O(r),t=r.searchFields||[e],a=[];r.suggestionTemplate?r.suggestionTemplate.replaceAll(p,(e,t)=>(a.push(t),e)):a.push(e);let h=v(a);!a.includes(u.objectIdField)&&!h&&a.push(u.objectIdField);let g=A(u,e),_=h||k(u,a),y=k(u,t);if(!g)throw m().error(`invalid-field: displayField is invalid.`),new n(`getSuggestions():invalid-field`,`displayField is invalid.`);if(!_)throw m().error(`invalid-field: outField is invalid.`),new n(`getSuggestions():invalid-field`,`outField is invalid.`);if(!y)throw m().error(`invalid-field: search field is invalid.`),new n(`getSuggestions():invalid-field`,`search field is invalid.`);let x=u.createQuery(),{orderByFields:S}=r;return S&&(x.orderByFields=S),x.outSpatialReference=i,x.returnGeometry=!1,x.num=s,x.outFields=a,f&&(x.geometry=f),!o.trim()||(C({source:r,searchTerm:o,searchFields:t,exactMatch:l,query:x,type:`suggest`}),!b(x))?[]:u.queryFeatures(x,{signal:d}).then(t=>U(t,r,c,e))})}function _(e,t){let{filter:n,withinViewEnabled:r}=e,i=t?.extent;return n?.geometry??(r&&i?i:void 0)}function v(e){return e&&e.includes(`*`)}async function y(e){if(!e)throw new n(`search:missing-layer`,`A layer is required for a layer search source.`);await e.load()}function b(e){return!!(e.fullText||e.where)}function x(e,t){let n=e?.indexes;return!n||!t?.length?!1:n.filter(e=>e.indexType===`FullText`).some(e=>{let n=e.fields?.split(`,`).map(e=>e.trim().toLowerCase())||[];return t.every(e=>n.includes(e.toLowerCase()))})}function S({text:e,searchFields:t,searchType:n=`prefix`}){return(n===`simple`?[e.trim()]:e.trim().split(` `)).filter(e=>!!e.trim()).map(e=>new d({onFields:t,searchTerm:e,searchType:n}))}function C({source:e,searchTerm:t,searchFields:n,exactMatch:r,query:i,type:a}){let{layer:o,filter:s,prefix:c=``,suffix:l=``,searchMode:u}=e,d=w(u,r,o,n);d.fullTextSearchType&&t&&(i.fullText=S({text:t,searchFields:n,searchType:d.fullTextSearchType})),i.where=L({searchTerm:N(`${c}${t}${l}`),layer:o,searchFields:n,filter:s,exactMatch:d.exactMatch,query:i,type:a})}function w(e,t,n,r){let i=T(n)&&x(n,r),a=e??(t?`simple`:`starts-with`);return a===`simple`?{exactMatch:!0,fullTextSearchType:null}:e===`starts-with`?{exactMatch:!1,fullTextSearchType:null}:a===`full-text-simple`?i?{exactMatch:!1,fullTextSearchType:`simple`}:{exactMatch:!0,fullTextSearchType:null}:i?{exactMatch:!1,fullTextSearchType:`prefix`}:{exactMatch:!1,fullTextSearchType:null}}function T(e){return e?.capabilities?.query?.supportsFullTextSearch??!1}function E(e){return e?.capabilities?.query?.supportsPagination??!1}function D(e){return e?.fieldsIndex?.fields?.find(e=>e.type===`string`)?.name??``}function O(e){return e.displayField||e.layer.displayField||D(e.layer)}function k(e,t){return!e||!t?.length?!1:t.every(t=>A(e,t))}function A(e,t){return!!e.getField(t)}function j(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!0;return!1}function M({codedValues:e},t,n){return a(e??[],e=>{let r=e.name,i=n?r:r.toLowerCase();return(n?t:t.toLowerCase())===i?e.code.toString():null})??null}function N(e){return e.replaceAll(`'`,`''`)}function P(e,t){let n=t?.where;return n?`(${e}) AND (${n})`:e}function F({currentTerm:e,field:t,filter:n,exactMatch:r,url:i,type:a}){let o=t?.type,s=t?.name;if(o===`string`||o===`date`||o===`global-id`){let t=f.test(i??``),o=t&&j(e)?`N`:``;return P(r&&a===`search`?`${s} = ${o}'${e}'`:t?`${s} LIKE ${o}${`'${e}%'`}`:`${`LOWER(${s})`} LIKE ${o}${`'${e.toLowerCase()}%'`}`,n)}if(o===`oid`||o===`small-integer`||o===`integer`||o===`single`||o===`double`){let t=Number(e);return isNaN(t)?null:P(`${s} = ${t}`,n)}return P(`${s} = ${e}`,n)}function I(e,t){return e?` OR (${t})`:`(${t})`}function L({searchTerm:e,layer:t,searchFields:n,filter:r,exactMatch:i,query:a,type:o}){let{definitionExpression:s,url:c}=t,l=``;if(!a.fullText&&e&&n&&n.forEach(n=>{let a=t.getField(n),s=t.getFieldDomain?.(n),u=(s?.type===`coded-value`?M(s,e,i):null)||e||null;if(u!==null){let e=F({currentTerm:u,field:a,filter:r,exactMatch:i,url:c,type:o});e&&(l+=I(l,e))}}),a.fullText){let e=r?.where;return s&&e?`(${s}) AND (${e})`:s||e||``}return s&&l?`(${s}) AND (${l})`:l}function R(e,t){let n=null,{codedValues:r}=e;return r&&r.length&&r.some(e=>e.code===t&&(n=e.name,!0)),n}function z(e,t){return e[t]??e[Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase())]}function B(e){return!!e&&`getField`in e&&`queryFeatures`in e}function V(n,r,i){let a=u(n);if(!B(a))return``;let{attributes:o}=n,s=a.getFieldDomain?.(i,{feature:n});if(r)return e(r,o);if(i&&o){let e=a.getField(i),n=z(o,i);return n==null?``:s?.type===`coded-value`?R(s,n)??``:e?.type===`date`?t(new Date(n)):typeof n==`number`?n.toString():typeof n==`string`?n.trim():``}return``}function H(e,t,n,r){let i=u(e),{attributes:a}=e,o=B(i)&&i.objectIdField?a[i.objectIdField]:null;return{text:V(e,t.suggestionTemplate,r),key:o,sourceIndex:n}}function U(e,t,n,r){return e.features.map(e=>H(e,t,n,r))}function W(e){return e!=null&&e.minScale!=null&&e.maxScale!=null}function G(e,t,n,i,a,o,d,f){let p=e.clone(),m=u(e);p.layer=m,p.origin=e.origin;let h=B(m)?m.objectIdField:void 0,g=h?e.attributes[h]:null,_=V(e,n.searchTemplate,a);o!=null&&W(m)&&(m.minScale&&m.minScale<o?o=m.minScale:m.maxScale&&m.maxScale>o&&(o=m.maxScale));let v=c(p.geometry,t,o,f),y=typeof d==`number`&&v?l(r(v),t??void 0,d):v,b=e.clone();return b.layer=m,b.origin=e.origin,y!=null&&(b.geometry=s.fromExtent(y)),{extent:y,target:b,feature:p,key:g,name:_,sourceIndex:i}}function K(e,t,n,r,i,a,o,s){return e.features.map(e=>G(e,t,n,r,i,a,o,s))}export{S as createFullTextSearchInfos,h as getResults,g as getSuggestions,B as isSearchableLayer};
|
|
@@ -6,6 +6,8 @@ import type MapNotesLayer from "../../layers/MapNotesLayer.js";
|
|
|
6
6
|
import type SketchLayer from "../../layers/SketchLayer.js";
|
|
7
7
|
import type CIMSymbol from "../../symbols/CIMSymbol.js";
|
|
8
8
|
import type SimpleFillSymbol from "../../symbols/SimpleFillSymbol.js";
|
|
9
|
+
import type SimpleLineSymbol from "../../symbols/SimpleLineSymbol.js";
|
|
10
|
+
import type SimpleMarkerSymbol from "../../symbols/SimpleMarkerSymbol.js";
|
|
9
11
|
import type TextSymbol from "../../symbols/TextSymbol.js";
|
|
10
12
|
import type Tooltip from "../../views/interactive/Tooltip.js";
|
|
11
13
|
import type SketchLabelOptions from "../../views/interactive/sketch/SketchLabelOptions.js";
|
|
@@ -33,7 +35,7 @@ import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.
|
|
|
33
35
|
import type { SketchTooltipOptionsProperties } from "../../views/interactive/sketch/SketchTooltipOptions.js";
|
|
34
36
|
import type { SketchValueOptionsProperties } from "../../views/interactive/sketch/SketchValueOptions.js";
|
|
35
37
|
|
|
36
|
-
export interface SketchViewModelProperties extends Partial<Pick<SketchViewModel, "cancelUpdateOnClickAway" | "creationMode" | "layer" | "rootPlugins" | "updateOnGraphicClick" | "useLegacyCreateTools" | "useViewOptions" | "view">> {
|
|
38
|
+
export interface SketchViewModelProperties extends Partial<Pick<SketchViewModel, "activeLineSymbol" | "activeVertexSymbol" | "cancelUpdateOnClickAway" | "creationMode" | "layer" | "rootPlugins" | "updateOnGraphicClick" | "useLegacyCreateTools" | "useViewOptions" | "view">> {
|
|
37
39
|
/**
|
|
38
40
|
* The [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/) displayed when actively creating a new `polygon` graphic using the [polygon](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#activeTool) tool.
|
|
39
41
|
*
|
|
@@ -549,7 +551,9 @@ export default class SketchViewModel extends EventedAccessor {
|
|
|
549
551
|
constructor(properties?: SketchViewModelProperties);
|
|
550
552
|
/**
|
|
551
553
|
* When creating new graphics (for example after [create()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#create) has been called),
|
|
552
|
-
* this property reflects the drawing mode being used.
|
|
554
|
+
* this property reflects the drawing mode (freehand, hybrid, or click) being used. The drawing mode affects
|
|
555
|
+
* how clicks/touches and drag gestures are interpreted during drawing.
|
|
556
|
+
*
|
|
553
557
|
* If no update operation is in progress, this is `null`.
|
|
554
558
|
*
|
|
555
559
|
* @since 4.32
|
|
@@ -581,6 +585,55 @@ export default class SketchViewModel extends EventedAccessor {
|
|
|
581
585
|
*/
|
|
582
586
|
get activeFillSymbol(): SimpleFillSymbol | CIMSymbol | null | undefined;
|
|
583
587
|
set activeFillSymbol(value: (SimpleFillSymbolProperties & { type: "simple-fill" }) | (CIMSymbolProperties & { type: "cim" }) | null | undefined);
|
|
588
|
+
/**
|
|
589
|
+
* The [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/) displayed when actively creating a new `polyline` graphic with [activeTool](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#activeTool) set to `polyline`.
|
|
590
|
+
* This differs from the [polylineSymbol](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#polylineSymbol) because the `polylineSymbol` is only displayed when the graphic has been completed. Setting this
|
|
591
|
+
* symbol will also affect the default outline symbol of the `polygon` draw tool when actively creating a new polygon. Even though the default line symbol is a `CIMSymbol`,
|
|
592
|
+
* a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) is also a valid symbol to use.
|
|
593
|
+
*
|
|
594
|
+
* The default value is the following:
|
|
595
|
+
* ```js
|
|
596
|
+
* new CIMSymbol({
|
|
597
|
+
* data: {
|
|
598
|
+
* type: "CIMSymbolReference",
|
|
599
|
+
* symbol: {
|
|
600
|
+
* type: "CIMLineSymbol",
|
|
601
|
+
* symbolLayers: [
|
|
602
|
+
* {
|
|
603
|
+
* type: "CIMSolidStroke",
|
|
604
|
+
* effects: [
|
|
605
|
+
* {
|
|
606
|
+
* type: "CIMGeometricEffectDashes",
|
|
607
|
+
* dashTemplate: [3.75, 3.75],
|
|
608
|
+
* lineDashEnding: "HalfPattern",
|
|
609
|
+
* controlPointEnding: "NoConstraint"
|
|
610
|
+
* }
|
|
611
|
+
* ],
|
|
612
|
+
* enable: true,
|
|
613
|
+
* capStyle: "Butt",
|
|
614
|
+
* joinStyle: "Round",
|
|
615
|
+
* miterLimit: 10,
|
|
616
|
+
* width: 1.6,
|
|
617
|
+
* color: [255, 255, 255, 255]
|
|
618
|
+
* },
|
|
619
|
+
* {
|
|
620
|
+
* type: "CIMSolidStroke",
|
|
621
|
+
* enable: true,
|
|
622
|
+
* capStyle: "Butt",
|
|
623
|
+
* joinStyle: "Round",
|
|
624
|
+
* miterLimit: 10,
|
|
625
|
+
* width: 2,
|
|
626
|
+
* color: [0, 0, 0, 255]
|
|
627
|
+
* }
|
|
628
|
+
* ]
|
|
629
|
+
* }
|
|
630
|
+
* }
|
|
631
|
+
* });
|
|
632
|
+
* ```
|
|
633
|
+
*
|
|
634
|
+
* @since 5.2
|
|
635
|
+
*/
|
|
636
|
+
accessor activeLineSymbol: (SimpleLineSymbol | CIMSymbol) | null | undefined;
|
|
584
637
|
/**
|
|
585
638
|
* The configurations for plugins in the active DrawTool plugin stack.
|
|
586
639
|
*
|
|
@@ -602,6 +655,12 @@ export default class SketchViewModel extends EventedAccessor {
|
|
|
602
655
|
* @since 4.31
|
|
603
656
|
*/
|
|
604
657
|
get activeTooltip(): Tooltip | null;
|
|
658
|
+
/**
|
|
659
|
+
* The symbol used to indicate active vertices while creating graphics.
|
|
660
|
+
*
|
|
661
|
+
* @since 5.2
|
|
662
|
+
*/
|
|
663
|
+
accessor activeVertexSymbol: (SimpleMarkerSymbol | CIMSymbol) | null | undefined;
|
|
605
664
|
/**
|
|
606
665
|
* Indicates if clicking away from an update graphic should end any current update
|
|
607
666
|
* operation.
|