@arcgis/core 4.30.0-next.20240613 → 4.30.0-next.20240614

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.
Files changed (26) hide show
  1. package/UndoRedo.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/31f7a3c8e1a5b4ca4a73.js +1 -0
  4. package/assets/esri/core/workers/chunks/{82f982d9dde0ab137403.js → 339929c10fa8366b1615.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{de21dffe546dd45dd1fb.js → 7fd9134246a9dbfa603b.js} +1 -1
  6. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  7. package/package.json +1 -1
  8. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  9. package/smartMapping/renderers/size.js +1 -1
  10. package/support/revision.js +1 -1
  11. package/symbols/cim/CIMSymbolHelper.js +1 -1
  12. package/symbols/cim/effects/EffectDashes.js +1 -1
  13. package/symbols/cim/rasterizingUtils.js +1 -1
  14. package/undoredo/support/ServiceVersionInfo.js +1 -1
  15. package/views/2d/engine/webgl/collisions/CollisionGrid.js +1 -1
  16. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  17. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  18. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  19. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  20. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  21. package/widgets/FeatureTable/RelationshipColumn.js +1 -1
  22. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  23. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
  24. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  25. package/widgets/PanoramicViewer.js +1 -1
  26. package/assets/esri/core/workers/chunks/5379a5f4cb36b8003dcc.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{waitTick as o,throwIfAborted as r,isAbortError as a}from"../../../core/promiseUtils.js";import{createCoveragePolygon as s}from"../../../layers/orientedImagery/core/coverageUtils.js";import{transformPoints as n}from"../../../layers/orientedImagery/transformations/imageToGroundUtils.js";import{activePolygonSymbol as l,polygonSymbol as m}from"../symbols.js";import c from"../../../geometry/Polygon.js";class g{constructor(g){this.viewModel=g,this.createFootprints=async t=>{await o(t);const{coveragePolygons:i,currentBestFeature:r,isAdditionalCoverageVisible:a}=this.viewModel;for(const o of i)o?.imageID===r.attributes.objectId?this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:o?.imageID},geometry:o,symbol:l,visible:!1}):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:o?.imageID},geometry:o,symbol:m.clone(),visible:a}))},this.updateFootprint=async(o,s)=>{const{activeViewer:m,currentBestFeature:g,currentCoverageVisible:p,footprintExtent:d}=this.viewModel,u=m?.imageSize;if(g&&u&&d)try{const i=await n(o,{feature:g,imageProperties:{width:u[0],height:u[1]},options:s,footprintExtent:d});r(s);const a=i.filter(t);if(!a.length)return;const m=[a.map((({x:e,y:t})=>[e,t,1]))];m[0].push(m[0][0]);const y=new c({rings:m,spatialReference:a[0].spatialReference});this.viewModel.updateCurrentCoveragePolygon(new e({geometry:y,attributes:{imageID:g.attributes.objectId},symbol:l,visible:p}))}catch(y){a(y)||i.getLogger(this.viewModel).error("update-footprint",y)}},this.updateFootprintPanorama=async(t,i)=>{await o(i);const{horizontalFieldOfView:r,pitch:a,verticalFieldOfView:n,yaw:m}=t,c=this.viewModel.currentBestFeature?.clone();if(!c)return;const{attributes:g}=c;g.orientedImageryType=null,g.cameraHeading=(m+g.cameraHeading)%360,g.cameraPitch=a,g.horizontalFieldOfView=r,g.verticalFieldOfView=n,g.cameraRoll=0;const{polygon:p}=s(g);this.viewModel.updateCurrentCoveragePolygon(new e({attributes:{imageID:g.objectId},geometry:p,symbol:l.clone(),visible:this.viewModel.currentCoverageVisible}))}}}export{g as default};
5
+ import"../../../geometry.js";import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{waitTick as o,throwIfAborted as r,isAbortError as s}from"../../../core/promiseUtils.js";import{transformPoints as a}from"../../../layers/orientedImagery/transformations/imageToGroundUtils.js";import{convertOrientationToPixelLocation as n}from"../../../layers/orientedImagery/transformations/utils.js";import{activePolygonSymbol as l,polygonSymbol as m}from"../symbols.js";import c from"../../../geometry/Polygon.js";class p{constructor(p){this.viewModel=p,this.createFootprints=async t=>{await o(t);const{coveragePolygons:i,currentBestFeature:r,isAdditionalCoverageVisible:s}=this.viewModel;for(const o of i)o?.imageID===r.attributes.objectId?this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:o?.imageID},geometry:o,symbol:l,visible:!1}):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:o?.imageID},geometry:o,symbol:m.clone(),visible:s}))},this.updateFootprint=async(o,n)=>{const{activeViewer:m,currentBestFeature:p,currentCoverageVisible:g,footprintExtent:u}=this.viewModel,f=m?.imageSize;if(p&&f&&u)try{const i=await a(o,{feature:p,imageProperties:{width:f[0],height:f[1]},options:n,footprintExtent:u});r(n);const s=i.filter(t);if(!s.length)return;const m=[s.map((({x:e,y:t})=>[e,t,1]))];m[0].push(m[0][0]);const d=new c({rings:m,spatialReference:s[0].spatialReference});this.viewModel.updateCurrentCoveragePolygon(new e({geometry:d,attributes:{imageID:p.attributes.objectId},symbol:l,visible:g}))}catch(d){s(d)||i.getLogger(this.viewModel).error("update-footprint",d)}},this.updateFootprintPanorama=async(t,i)=>{const{horizontalFieldOfView:o,pitch:s,verticalFieldOfView:m,yaw:p}=t,{activeViewer:g,currentBestFeature:u,currentCoverageVisible:f,footprintExtent:d}=this.viewModel,h=g?.imageSize;if(!u||!h||!d)return;const{cameraPitch:y,objectId:w}=u.attributes;if(s+y-m/2>180)return void this.viewModel.updateCurrentCoveragePolygon(null);let v=[];if(s+y+m/2<180){v=[[-o/2,m/2],[o/2,m/2],...s-m/2<0?[[-o/2,-m/2],[o/2,-m/2]]:[[o/2,-m/2],[-o/2,-m/2]]]}else if(s+y-m/2<180&&s+y+m/2>180){v=[[-o/2,-m/2]];const e=o/6,t=o/e;for(let i=0;i<=e;i++)v.push([i*t-o/2,90-s]);v.push([o/2,-m/2])}const b=v.map((([e,t])=>n(p+e,s+t,h[0],h[1]))),j=await a(b,{feature:u,imageProperties:{width:h[0],height:h[1]},options:i,footprintExtent:d});r(i);const I=[j.map((({x:e,y:t})=>[e,t,1]))];I[0].push(I[0][0]);const F=new c({rings:I,spatialReference:j[0].spatialReference});this.viewModel.updateCurrentCoveragePolygon(new e({geometry:F,attributes:{imageID:w},symbol:l.clone(),visible:f}))}}}export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import i from"../../Camera.js";import"../../geometry.js";import t from"../../Ground.js";import o from"../../Map.js";import a from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{destroyMaybe as m}from"../../core/maybe.js";import{isAbortError as l,waitTick as d}from"../../core/promiseUtils.js";import{watch as c,when as p,syncAndInitial as g}from"../../core/reactiveUtils.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as u}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import v from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as f}from"../../layers/orientedImagery/transformations/utils.js";import w from"../../views/SceneView.js";import V from"../Zoom.js";import{logAndThrow as C,getMissingPropertyErrorName as j,getMissingPropertyErrorMessage as P}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as z}from"./constants.js";import R from"./PanoramicZoomConditions.js";import H from"./PanoramicZoomViewModel.js";import{meshToGraphic as b,createImageSphere as S}from"./utils.js";import M from"../../geometry/SpatialReference.js";const x={autoLoad:"auto-load",default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let O=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new v({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new t({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.maxHFOV=120,this.minHFOV=50,this.imageSize=null,this.imageSource=null,this.pitch=90,this.state="ready",this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(x.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",(e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()}))],x.navigation)},this._addHFOVHandles=()=>{this.removeHandles(x.fovConstraint),this.addHandles(c((()=>[this.maxHFOV,this.minHFOV]),(()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new R({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))}),g),x.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new H({view:this.imageRenderer,panoramicZoomConditions:new R({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=new V({viewModel:this._zoomViewModel});this.imageRenderer.ui.add(e,"top-left"),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:o}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:o};break;case"update":this._targetPosition={x:t,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.async((async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});this.emit("hittest-response",i)}));break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=f(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:M.WebMercator,meshVertex:e.mapPoint});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>!this._graphics.graphics.includes(e)));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter((e=>this._graphics.graphics.includes(e)));return this._graphics.removeMany(i),!0},this._imageRenderer=new w({map:this._map,viewingMode:"local",camera:{position:z},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:M.WebMercator,ui:{components:["attribution"]}})}initialize(){this.state="initialized",this.addHandles([c((()=>this.imageSource),(()=>{this.imageSource&&this.autoLoad&&this._loadWithController()}),g),c((()=>this.fov),(()=>{this._reloadCamera()}),g),c((()=>this.yaw),(e=>{this.camera.heading=e,this._reloadCamera()}),g),c((()=>this.pitch),(e=>{this.camera.tilt=e,this._reloadCamera()}),g),p((()=>this.imageRenderer.ready),(()=>{this._addNavigationHandles(),this._addZoomHandles()}),g),c((()=>this.clickAction),(e=>{this.removeHandles(x.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))}),g)],x.default)}get camera(){return this.imageRenderer.camera}set camera(e){e&&(this.imageRenderer.camera=e.clone())}get fov(){return this.camera.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get imageRenderer(){return this._imageRenderer}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await a(e,{responseType:"image",...i})).data}catch(o){throw l(o)?this.state="image-load-aborted":this.state="image-load-error",o}return this._updateImageSphere(t,i)}_reloadCamera(){this.camera=this.camera.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=m(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.fov;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){return await d(i),this._imageGraphic=b(S(e)),this._graphics.add(this._imageGraphic),this.state="image-loaded",this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):C(this.declaredClass,new s(j("panoramic-viewer"),P("PanoramicViewerViewModel","imageSource")))}};e([_()],O.prototype,"_graphics",void 0),e([_()],O.prototype,"_imageGraphic",void 0),e([_()],O.prototype,"_imageRenderer",void 0),e([_()],O.prototype,"_loadController",void 0),e([_()],O.prototype,"_map",void 0),e([_()],O.prototype,"_zoomViewModel",void 0),e([_({type:Boolean})],O.prototype,"autoLoad",void 0),e([_({type:i})],O.prototype,"camera",null),e([u(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],O.prototype,"clickAction",void 0),e([_({type:Number})],O.prototype,"fov",null),e([_({type:Number})],O.prototype,"maxHFOV",void 0),e([_({type:Number})],O.prototype,"minHFOV",void 0),e([_()],O.prototype,"imageSize",void 0),e([_()],O.prototype,"imageSource",void 0),e([_({type:Number})],O.prototype,"pitch",void 0),e([_({readOnly:!0})],O.prototype,"imageRenderer",null),e([_()],O.prototype,"state",void 0),e([_({type:Number})],O.prototype,"yaw",void 0),O=e([y("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],O);const k=O;export{k as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Camera.js";import"../../geometry.js";import i from"../../Ground.js";import o from"../../Map.js";import a from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{rad2deg as m,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as d}from"../../core/maybe.js";import{isAbortError as c,waitTick as p}from"../../core/promiseUtils.js";import{watch as g,when as _,syncAndInitial as u}from"../../core/reactiveUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as v}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as V}from"../../layers/orientedImagery/transformations/utils.js";import C from"../../views/SceneView.js";import M from"../Zoom.js";import{logAndThrow as j,getMissingPropertyErrorName as z,getMissingPropertyErrorMessage as R}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as P}from"./constants.js";import H from"./PanoramicZoomConditions.js";import b from"./PanoramicZoomViewModel.js";import{meshToGraphic as S,createImageSphere as O}from"./utils.js";import x from"../../geometry/SpatialReference.js";const k={autoLoad:"auto-load",default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let I=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new w({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new i({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.maxHFOV=120,this.minHFOV=50,this.imageSize=null,this.imageSource=null,this.pitch=90,this.state="ready",this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(k.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",(e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()}))],k.navigation)},this._addHFOVHandles=()=>{this.removeHandles(k.fovConstraint),this.addHandles(g((()=>[this.maxHFOV,this.minHFOV]),(()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new H({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))}),u),k.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new b({view:this.imageRenderer,panoramicZoomConditions:new H({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=new M({viewModel:this._zoomViewModel});this.imageRenderer.ui.add(e,"top-left"),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:o}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:o};break;case"update":this._targetPosition={x:i,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.async((async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});this.emit("hittest-response",t)}));break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=V(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...t,spatialReference:x.WebMercator,meshVertex:e.mapPoint});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter((e=>!this._graphics.graphics.includes(e)));return this._graphics.graphics.addMany(t),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter((e=>this._graphics.graphics.includes(e)));return this._graphics.removeMany(t),!0},this._imageRenderer=new C({map:this._map,viewingMode:"local",camera:{position:P},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:x.WebMercator,ui:{components:["attribution"]}})}initialize(){this.state="initialized",this.addHandles([g((()=>this.imageSource),(()=>{this.imageSource&&this.autoLoad&&this._loadWithController()}),u),g((()=>this.fov),(()=>{this._reloadCamera()}),u),g((()=>this.yaw),(e=>{this.camera.heading=e,this._reloadCamera()}),u),g((()=>this.pitch),(e=>{this.camera.tilt=e,this._reloadCamera()}),u),_((()=>this.imageRenderer.ready),(()=>{this._addNavigationHandles(),this._addZoomHandles()}),u),g((()=>this.clickAction),(e=>{this.removeHandles(k.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))}),u)],k.default)}get camera(){return this.imageRenderer.camera}set camera(e){e&&(this.imageRenderer.camera=e.clone())}get fov(){return this.camera.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*m(Math.atan(Math.tan(l(e/2))*Math.sin(a)))}get imageRenderer(){return this._imageRenderer}get vfov(){const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*m(Math.atan(Math.tan(l(e/2))*Math.cos(a)))}async _loadImageInternal(e,t){let i;this.state="image-loading";try{i=(await a(e,{responseType:"image",...t})).data}catch(o){throw c(o)?this.state="image-load-aborted":this.state="image-load-error",o}return this._updateImageSphere(i,t)}_reloadCamera(){this.camera=this.camera.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=d(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){return await p(t),this._imageGraphic=S(O(e)),this._graphics.add(this._imageGraphic),this.state="image-loaded",this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):j(this.declaredClass,new s(z("panoramic-viewer"),R("PanoramicViewerViewModel","imageSource")))}};e([y()],I.prototype,"_graphics",void 0),e([y()],I.prototype,"_imageGraphic",void 0),e([y()],I.prototype,"_imageRenderer",void 0),e([y()],I.prototype,"_loadController",void 0),e([y()],I.prototype,"_map",void 0),e([y()],I.prototype,"_zoomViewModel",void 0),e([y({type:Boolean})],I.prototype,"autoLoad",void 0),e([y({type:t})],I.prototype,"camera",null),e([v(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],I.prototype,"clickAction",void 0),e([y({type:Number})],I.prototype,"fov",null),e([y({readOnly:!0})],I.prototype,"hfov",null),e([y({type:Number})],I.prototype,"maxHFOV",void 0),e([y({type:Number})],I.prototype,"minHFOV",void 0),e([y()],I.prototype,"imageSize",void 0),e([y()],I.prototype,"imageSource",void 0),e([y({type:Number})],I.prototype,"pitch",void 0),e([y({readOnly:!0})],I.prototype,"imageRenderer",null),e([y()],I.prototype,"state",void 0),e([y({readOnly:!0})],I.prototype,"vfov",null),e([y({type:Number})],I.prototype,"yaw",void 0),I=e([f("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],I);const F=I;export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import i from"../views/SceneView.js";import s from"./Widget.js";import a from"./PanoramicViewer/PanoramicViewerViewModel.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{vmEvent as p}from"./support/decorators/vmEvent.js";import{tsx as l}from"./support/jsxFactory.js";const n="esri-panoramic-viewer";let d=class extends s{constructor(e){super(e),this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get fov(){return this.camera.fov}set fov(e){this.viewModel.fov=e}get icon(){return"360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}render(){return l("div",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(c.widget,n)})}};e([r({type:Boolean})],d.prototype,"autoLoad",null),e([r({type:t})],d.prototype,"camera",null),e([r()],d.prototype,"clickAction",null),e([r({type:Number})],d.prototype,"fov",null),e([r()],d.prototype,"icon",null),e([r({readOnly:!0,type:i})],d.prototype,"imageRenderer",null),e([r({readOnly:!0})],d.prototype,"imageSize",null),e([r()],d.prototype,"imageSource",null),e([r({type:Number})],d.prototype,"pitch",null),e([r({readOnly:!0})],d.prototype,"state",null),e([p(["click","hittest-response","pixel-location"]),r({type:a})],d.prototype,"viewModel",void 0),e([r({type:Number})],d.prototype,"yaw",null),d=e([o("esri.widgets.PanoramicViewer")],d);const m=d;export{m as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import i from"../views/SceneView.js";import s from"./Widget.js";import a from"./PanoramicViewer/PanoramicViewerViewModel.js";import{globalCss as p}from"./support/globalCss.js";import"./support/widgetUtils.js";import{vmEvent as l}from"./support/decorators/vmEvent.js";import{tsx as c}from"./support/jsxFactory.js";const n="esri-panoramic-viewer";let d=class extends s{constructor(e){super(e),this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get fov(){return this.camera.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}render(){return c("div",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,n)})}};e([o({type:Boolean})],d.prototype,"autoLoad",null),e([o({type:t})],d.prototype,"camera",null),e([o()],d.prototype,"clickAction",null),e([o({type:Number})],d.prototype,"fov",null),e([o({readOnly:!0,type:Number})],d.prototype,"hfov",null),e([o()],d.prototype,"icon",null),e([o({readOnly:!0,type:i})],d.prototype,"imageRenderer",null),e([o({readOnly:!0})],d.prototype,"imageSize",null),e([o()],d.prototype,"imageSource",null),e([o({type:Number})],d.prototype,"pitch",null),e([o({readOnly:!0})],d.prototype,"state",null),e([o({readOnly:!0,type:Number})],d.prototype,"vfov",null),e([l(["click","hittest-response","pixel-location"]),o({type:a})],d.prototype,"viewModel",void 0),e([o({type:Number})],d.prototype,"yaw",null),d=e([r("esri.widgets.PanoramicViewer")],d);const m=d;export{m as default};