@arcgis/core 5.1.0-next.89 → 5.1.0-next.90

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 (42) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeRuntime.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +1 -0
  6. package/assets/esri/core/workers/chunks/{9d10db72e342fe63c981.js → 36f6673b23579b88d8f7.js} +1 -1
  7. package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +1 -0
  8. package/assets/esri/core/workers/chunks/{456d269e3982c437010a.js → 71cfab6305f275cfb04e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/740588250eaffb7301fd.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7160e3e7340beb7fdb42.js → bea170f08f5261e22d29.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{d5ad036d282df54b9ddc.js → f971dcfd04af1fd652b4.js} +1 -1
  12. package/chunks/array.js +1 -1
  13. package/config.js +1 -1
  14. package/core/workers/workerFactory.js +1 -1
  15. package/kernel.js +1 -1
  16. package/layers/graphics/featureConversionUtils.js +1 -1
  17. package/package.json +1 -1
  18. package/support/revision.js +1 -1
  19. package/symbols/cim/placements/PlacementAtMeasuredUnits.js +1 -1
  20. package/views/2d/FrameTask.js +1 -1
  21. package/views/2d/LabelManager.js +1 -1
  22. package/views/2d/engine/DisplayObject.js +1 -1
  23. package/views/2d/engine/Stage.js +1 -1
  24. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  25. package/views/2d/input/MapViewInputManager.js +1 -1
  26. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  27. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  28. package/views/2d/layers/LayerView2D.js +1 -1
  29. package/views/2d/layers/MediaLayerView2D.js +1 -1
  30. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  31. package/views/2d/layers/features/FeatureContainer.js +1 -1
  32. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  33. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  34. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  35. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  36. package/views/2d/layers/support/UpdateTracking2D.js +1 -1
  37. package/views/VideoView.js +1 -1
  38. package/views/View2D.js +1 -1
  39. package/views/support/waitForResources.js +1 -1
  40. package/assets/esri/core/workers/chunks/0e3dcf99382478181366.js +0 -1
  41. package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +0 -1
  42. package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{property as a,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{mosaicPixelData as o}from"../../../../layers/raster/functions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import p from"../../engine/ImageryBitmapSource.js";import h from"../support/ExportStrategy.js";import{readFromPixelData as c}from"../../../support/rasterHitTestUtils.js";let g=class extends e{constructor(){super(...arguments),this.attached=!1,this.container=new n,this.updateRequested=!1,this.pixelHighlights=[],this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(t=>{r(t)||i.getLogger(this).error(t)})}async hitTest(t){if(this.layer.isRenderedFormat)return null;let e=null;const{bitmaps:i}=this.strategy;if(1===i.length&&i[0].source)e={extent:i[0].source.extent,pixelBlock:i[0].source.originalPixelBlock};else if(i.length>1){const r=i.map(t=>t.source).find(e=>e.extent&&e.extent.contains(t));r&&(e={extent:r.extent,pixelBlock:r.originalPixelBlock})}return e?.pixelBlock?await c({mapPoint:t,layer:this.layer,pixelData:e}):null}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new h({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,{pixelHighlights:r}=this,a=r.length>0,s=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:a}),o=s.pixelBlock;a&&i&&o&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:o,highlightOptions:r}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...s,extent:e.extent}}).catch(t=>{r(t)||i.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=o(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent;const a=this.pixelHighlights.length>0;r.requestAsImageElement=!a,r.returnImageBitmap=!a,r.requestRawData=a;const s=await this.layer.internalFetchImage(t,e,i,r);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer({...s.pixelData,isRawData:a},{signal:r.signal}),l=s.pixelData.pixelBlock,n=o.pixelBlock;a&&l&&n&&await this.layer.highlightPixels({pixelBlock:l,renderedPixelBlock:n,highlightOptions:this.pixelHighlights});const h=new p(n,o.extent?.clone(),l);return h.filter=t=>this.layer.applyFilter(t),h}};t([a()],g.prototype,"attached",void 0),t([a()],g.prototype,"container",void 0),t([a()],g.prototype,"layer",void 0),t([a()],g.prototype,"strategy",void 0),t([a()],g.prototype,"timeExtent",void 0),t([a()],g.prototype,"view",void 0),t([a()],g.prototype,"updateRequested",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"pixelHighlights",void 0),t([a()],g.prototype,"type",void 0),g=t([s("esri.views.2d.layers.imagery.ImageryView2D")],g);export{g as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{property as s,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{mosaicPixelData as o}from"../../../../layers/raster/functions/pixelUtils.js";import{BitmapContainer as l}from"../../engine/BitmapContainer.js";import{Container as n}from"../../engine/Container.js";import p from"../../engine/ImageryBitmapSource.js";import h from"../support/ExportStrategy.js";import{readFromPixelData as c}from"../../../support/rasterHitTestUtils.js";let g=class extends e{constructor(t){super(t),this.attached=!1,this.container=new n,this.updateRequested=!1,this.pixelHighlights=[],this.type="imagery",this._bitmapView=new l}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.updatingHandles.consumePromise(this.strategy.update(t).catch(t=>{r(t)||i.getLogger(this).error(t)}))}async hitTest(t){if(this.layer.isRenderedFormat)return null;let e=null;const{bitmaps:i}=this.strategy;if(1===i.length&&i[0].source)e={extent:i[0].source.extent,pixelBlock:i[0].source.originalPixelBlock};else if(i.length>1){const r=i.map(t=>t.source).find(e=>e.extent&&e.extent.contains(t));r&&(e={extent:r.extent,pixelBlock:r.originalPixelBlock})}return e?.pixelBlock?await c({mapPoint:t,layer:this.layer,pixelData:e}):null}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new h({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){const t=this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=e.originalPixelBlock??e.pixelBlock,{pixelHighlights:r}=this,s=r.length>0,a=await this.layer.applyRenderer({extent:e.extent,pixelBlock:i,isRawData:s}),o=a.pixelBlock;s&&i&&o&&await this.layer.highlightPixels({pixelBlock:i,renderedPixelBlock:o,highlightOptions:r}),e.filter=t=>this.layer.pixelFilter?this.layer.applyFilter(t):{...a,extent:e.extent}});this.updatingHandles.consumePromise(t),t.catch(t=>{r(t)||i.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.updateRequested||this.updatingHandles.updating}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(1===t.length&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(t=>t.source).filter(t=>t.extent&&t.extent.intersects(e)).map(t=>({extent:t.extent,pixelBlock:t.originalPixelBlock})),r=o(i,e);return null!=r?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent;const s=this.pixelHighlights.length>0;r.requestAsImageElement=!s,r.returnImageBitmap=!s,r.requestRawData=s;const a=await this.layer.internalFetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const o=await this.layer.applyRenderer({...a.pixelData,isRawData:s},{signal:r.signal}),l=a.pixelData.pixelBlock,n=o.pixelBlock;s&&l&&n&&await this.layer.highlightPixels({pixelBlock:l,renderedPixelBlock:n,highlightOptions:this.pixelHighlights});const h=new p(n,o.extent?.clone(),l);return h.filter=t=>this.layer.applyFilter(t),h}};t([s()],g.prototype,"attached",void 0),t([s()],g.prototype,"container",void 0),t([s()],g.prototype,"layer",void 0),t([s()],g.prototype,"strategy",void 0),t([s()],g.prototype,"timeExtent",void 0),t([s()],g.prototype,"view",void 0),t([s()],g.prototype,"updateRequested",void 0),t([s()],g.prototype,"updatingHandles",void 0),t([s()],g.prototype,"updating",null),t([s()],g.prototype,"pixelHighlights",void 0),t([s()],g.prototype,"type",void 0),g=t([a("esri.views.2d.layers.imagery.ImageryView2D")],g);export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import s from"../../../../core/Accessor.js";import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import o from"../../../../core/ReactiveMap.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";let n=class extends s{constructor(t){super(t),this.debugName="",this._updatingHandles=new d,this._idToUpdatingState=new o}destroy(){this._updatingHandles=e(this._updatingHandles),this._idToUpdatingState.clear()}get updating(){const t=!this.destroyed&&(this._updatingHandles?.updating||Array.from(this._idToUpdatingState.values()).some(t=>t));if(has("esri-2d-log-updating")){const s=Array.from(this._idToUpdatingState.entries()).map(([t,s])=>`-> ${t}: ${s}`).join("\n");console.log(`${this.debugName}: Updating: ${t}\n-> Handles: ${this._updatingHandles.updating}\n${s}`)}return t}addUpdateTracking(t,s){const e=r(()=>s.updating,s=>this._idToUpdatingState.set(t,s),{sync:!0});this.addHandles(e)}consumePromise(t){this._updatingHandles.consumePromise(t)}addPromise(t){return this._updatingHandles.addPromise(t)}};t([i({constructOnly:!0})],n.prototype,"debugName",void 0),t([i({readOnly:!0})],n.prototype,"updating",null),n=t([a("esri.views.2d.layers.support.UpdateTracking2D")],n);export{n as UpdateTracking2D};
2
+ import{__decorate as t}from"tslib";import s from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import r from"../../../../core/ReactiveMap.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";let p=class extends s{constructor(t){super(t),this.debugName="",this._updatingHandles=new d,this._idToUpdatingState=new r}destroy(){this._updatingHandles=e(this._updatingHandles),this._idToUpdatingState.clear()}get updating(){return!this.destroyed&&(this._updatingHandles?.updating||Array.from(this._idToUpdatingState.values()).some(t=>t))}addUpdateTracking(t,s){const e=o(()=>s.updating,s=>this._idToUpdatingState.set(t,s),{sync:!0});this.addHandles(e)}consumePromise(t){this._updatingHandles.consumePromise(t)}addPromise(t){return this._updatingHandles.addPromise(t)}};t([i({constructOnly:!0})],p.prototype,"debugName",void 0),t([i({readOnly:!0})],p.prototype,"updating",null),p=t([a("esri.views.2d.layers.support.UpdateTracking2D")],p);export{p as UpdateTracking2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as o}from"../core/Evented.js";import{destroyMaybe as r}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,syncAndInitial as p,whenOnce as l,when as h}from"../core/reactiveUtils.js";import{property as d,cast as m,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import{create as y,fromValues as u}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import f from"../geometry/Extent.js";import w from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import{load as j,execute as _}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import S from"../layers/support/TileInfo.js";import V from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DBaseMixin as x}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as R}from"./Viewport2DMixin.js";import D from"./2d/AnimationManager.js";import z from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import{ManagedCanvas as P}from"./2d/engine/ManagedCanvas.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"../core/has.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"../core/Logger.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as T}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/GpuMeshState.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import E from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as G}from"./2d/ViewStateManager.js";import O from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import U from"./navigation/Navigation.js";import H from"./ui/DefaultUI.js";import F from"./ui/video/DefaultUIVideo.js";const k=new t("#000");let A;async function I(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);A=e}const L=.01,N=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let W=class extends(R(x(M(o(a(s)))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new U,this.ready=!1,this.spatialReference=new v({wkid:0}),this.stateManager=new G({constraints:new z({view:this,minScale:1,maxScale:L})}),this.type="2d",this.ui=new F,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},p)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},p)]),this.addResolvingPromise(I().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=r(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get layer(){return this._get("layer")}set layer(e){e!==this._get("layer")&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set("layer",e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,o=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,o]:o<=t?[e,o]:[s,t]:i>=1?o<=t?[e,o]:[s,t]:s<=e?[s,t]:[e,o]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};const i=this._operationalDataView.videoToMap(e);if(!i)return{screenPoint:e,results:[]};const s=this._operationalDataView.state.toScreen(y(),i);return this._operationalDataView.hitTest({x:s[0],y:s[1]},t)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:k,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},i=new A(this.surface,t,new P(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new D({view:this});this._set("animationManager",s);const o=new E({view:this,animationManager:s});this._set("mapViewNavigation",o),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new i({targetGeometry:new w({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,p),n(()=>this.state.id,()=>e.state=this.state,p),n(()=>this.renderingOptions,t=>e.renderingOptions=t,p)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new V({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new O(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new T,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(N).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>u(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},p),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),o=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:r}=t[e];s[e]=_(new w(r,i),o)}let r=1/0,a=1/0,n=-1/0,p=-1/0;for(const e of s)r=Math.min(r,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),p=Math.max(p,e.y);const l=f.fromJSON({xmin:r,ymin:a,xmax:n,ymax:p,spatialReference:o});await(this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{}))},p)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let o=t;o>L;o/=2)i.push(o);i.push(L);const{lods:s}=S.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,o=i*e.scale/2,r=e.targetGeometry.clone();return r.x=Math.max(s,Math.min(t-s,r.x)),r.y=Math.max(o,Math.min(i-o,r.y)),e.targetGeometry=r,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(h(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],W.prototype,"_overlayContainer",void 0),e([d()],W.prototype,"_isValid",void 0),e([d()],W.prototype,"_readyCycleForced",void 0),e([d()],W.prototype,"_effectsContainer",void 0),e([d()],W.prototype,"constraintsInfo",null),e([d()],W.prototype,"operationalDataVisible",void 0),e([d()],W.prototype,"layer",null),e([d()],W.prototype,"map",void 0),e([d({type:U,nonNullable:!0})],W.prototype,"navigation",void 0),e([d({readOnly:!0})],W.prototype,"preconditionsReady",null),e([d({readOnly:!0})],W.prototype,"ready",void 0),e([d({readOnly:!0})],W.prototype,"rendering",null),e([d()],W.prototype,"scale",null),e([d()],W.prototype,"spatialReference",void 0),e([d()],W.prototype,"stateManager",void 0),e([d()],W.prototype,"type",void 0),e([d(),m(e=>e instanceof H?e:g(F,e))],W.prototype,"ui",void 0),e([d({readOnly:!0})],W.prototype,"videoSize",null),e([d({readOnly:!0})],W.prototype,"view2dType",void 0),W=e([c("esri.views.VideoView")],W);const Z=W;export{Z as default};
2
+ import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as o}from"../core/Evented.js";import{destroyMaybe as r}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,syncAndInitial as p,whenOnce as l,when as h}from"../core/reactiveUtils.js";import{property as d,cast as m,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import{create as y,fromValues as u}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import f from"../geometry/Extent.js";import w from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import{load as j,execute as _}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import S from"../layers/support/TileInfo.js";import V from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DBaseMixin as x}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as R}from"./Viewport2DMixin.js";import D from"./2d/AnimationManager.js";import z from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import{ManagedCanvas as P}from"./2d/engine/ManagedCanvas.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import{Container as T}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/GpuMeshState.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import E from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/mathUtils.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as G}from"./2d/ViewStateManager.js";import O from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import U from"./navigation/Navigation.js";import H from"./ui/DefaultUI.js";import F from"./ui/video/DefaultUIVideo.js";const k=new t("#000");let A;async function I(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);A=e}const L=.01,N=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let W=class extends(R(x(M(o(a(s)))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new U,this.ready=!1,this.spatialReference=new v({wkid:0}),this.stateManager=new G({constraints:new z({view:this,minScale:1,maxScale:L})}),this.type="2d",this.ui=new F,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},p)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},p)]),this.addResolvingPromise(I().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=r(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get layer(){return this._get("layer")}set layer(e){e!==this._get("layer")&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set("layer",e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,o=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,o]:o<=t?[e,o]:[s,t]:i>=1?o<=t?[e,o]:[s,t]:s<=e?[s,t]:[e,o]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};const i=this._operationalDataView.videoToMap(e);if(!i)return{screenPoint:e,results:[]};const s=this._operationalDataView.state.toScreen(y(),i);return this._operationalDataView.hitTest({x:s[0],y:s[1]},t)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:k,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},i=new A(this.surface,t,new P(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new D({view:this});this._set("animationManager",s);const o=new E({view:this,animationManager:s});this._set("mapViewNavigation",o),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new i({targetGeometry:new w({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,p),n(()=>this.state.id,()=>e.state=this.state,p),n(()=>this.renderingOptions,t=>e.renderingOptions=t,p)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new V({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new O(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new T,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(N).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>u(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},p),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),o=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:r}=t[e];s[e]=_(new w(r,i),o)}let r=1/0,a=1/0,n=-1/0,p=-1/0;for(const e of s)r=Math.min(r,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),p=Math.max(p,e.y);const l=f.fromJSON({xmin:r,ymin:a,xmax:n,ymax:p,spatialReference:o});await(this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{}))},p)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let o=t;o>L;o/=2)i.push(o);i.push(L);const{lods:s}=S.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,o=i*e.scale/2,r=e.targetGeometry.clone();return r.x=Math.max(s,Math.min(t-s,r.x)),r.y=Math.max(o,Math.min(i-o,r.y)),e.targetGeometry=r,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(h(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],W.prototype,"_overlayContainer",void 0),e([d()],W.prototype,"_isValid",void 0),e([d()],W.prototype,"_readyCycleForced",void 0),e([d()],W.prototype,"_effectsContainer",void 0),e([d()],W.prototype,"constraintsInfo",null),e([d()],W.prototype,"operationalDataVisible",void 0),e([d()],W.prototype,"layer",null),e([d()],W.prototype,"map",void 0),e([d({type:U,nonNullable:!0})],W.prototype,"navigation",void 0),e([d({readOnly:!0})],W.prototype,"preconditionsReady",null),e([d({readOnly:!0})],W.prototype,"ready",void 0),e([d({readOnly:!0})],W.prototype,"rendering",null),e([d()],W.prototype,"scale",null),e([d()],W.prototype,"spatialReference",void 0),e([d()],W.prototype,"stateManager",void 0),e([d()],W.prototype,"type",void 0),e([d(),m(e=>e instanceof H?e:g(F,e))],W.prototype,"ui",void 0),e([d({readOnly:!0})],W.prototype,"videoSize",null),e([d({readOnly:!0})],W.prototype,"view2dType",void 0),W=e([c("esri.views.VideoView")],W);const Z=W;export{Z as default};
package/views/View2D.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{initialize as u}from"../core/workers/workers.js";import c from"../geometry/Point.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import f from"../layers/support/TileInfo.js";import{BreakpointsOwner as w}from"./BreakpointsOwner.js";import{DOMContainer as V}from"./DOMContainer.js";import{PopupView as v}from"./PopupView.js";import M from"./View.js";import{Viewport2DBaseMixin as _}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as b}from"./Viewport2DMixin.js";import S from"./2d/AnimationManager.js";import{layerView2DImporter as R}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as T}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as L}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as O}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{clipContainsPoint as x}from"./2d/support/clippingUtils.js";import{hitTest as D}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as P,takeScreenshot as z}from"./2d/support/screenshotUtils.js";import{Timeline as A}from"./2d/support/Timeline.js";import E from"./navigation/Navigation.js";import U from"./navigation/NavigationActionMap.js";import I from"./support/AnalysisViewManager.js";import G from"./ui/DefaultUI.js";import F from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as N}from"./webgl/RenderingContextOptions.js";import{isWebMap as q}from"../webmap/utils.js";import W from"../webmap/background/ColorBackground.js";let $,B,H,Z,J,K;async function Q(){const[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:i,MagnifierView2D:r,GridView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);B=e,H=t,Z=i,J=r,K=s,$=a}let X=class extends(b(_(w(v(V(M)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new E({actionMap:new U({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new I({importAnalysisViewModule:e=>L(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new A,this.type="2d",this.view2dType=null,this.ui=new F,this.test={takeScreenshot:async e=>P(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},u()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return q(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||this.stage.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> stage.updating: ${this.stage?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return D(this,e,t)}async takeScreenshot(e){return z(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return q(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return q(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return R.hasLayerViewModule(e)}importLayerView(e){return R.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>x(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Q()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&T(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=this._createFeaturesTilingScheme(),i=new O(this.surface),r=new $(this.surface,{canvas:this.renderCanvas,contextOptions:new N(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline},i);this.stage=r,this._magnifierView=new J,this._magnifierView.magnifier=this.magnifier,this._gridView=new K;const s=new S({view:this});this._set("animationManager",s);const a=new Z({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),r.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>r.stationary=e,l),o(()=>this.background,e=>{r.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>r.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{r.highlightGradient=C(r.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>r.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set("featuresTilingScheme",e),this.stage.labelManager.featuresTilingScheme=e;const t=new B({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new H(e,!0)});this._set("graphicsView",t)}_createFeaturesTilingScheme(){return new j(f.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p()],X.prototype,"_magnifierView",void 0),e([p()],X.prototype,"_gridView",void 0),e([p({constructOnly:!0})],X.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],X.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],X.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],X.prototype,"graphicsTileStore",null),e([p()],X.prototype,"graphicsView",void 0),e([p()],X.prototype,"constraintsInfo",null),e([p()],X.prototype,"initialExtentRequired",null),e([p({type:E,nonNullable:!0})],X.prototype,"navigation",void 0),e([p({constructOnly:!0})],X.prototype,"renderCanvas",void 0),e([p()],X.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],X.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],X.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],X.prototype,"typeSpecificPreconditionsReady",null),e([p()],X.prototype,"analysisViewManager",void 0),e([p({type:W})],X.prototype,"background",null),e([p({type:c})],X.prototype,"center",null),e([p({type:i})],X.prototype,"floors",void 0),e([p()],X.prototype,"grid",void 0),e([p()],X.prototype,"map",void 0),e([p()],X.prototype,"padding",null),e([p({readOnly:!0})],X.prototype,"rendering",null),e([p({readOnly:!0})],X.prototype,"resolution",null),e([p()],X.prototype,"scale",null),e([p({type:Boolean,value:!1})],X.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],X.prototype,"tileInfo",null),e([p({type:A,readOnly:!0})],X.prototype,"timeline",void 0),e([p({readOnly:!0})],X.prototype,"type",void 0),e([p({readOnly:!0})],X.prototype,"updating",null),e([p({readOnly:!0})],X.prototype,"view2dType",void 0),e([p({readOnly:!0})],X.prototype,"visibleArea",null),e([p()],X.prototype,"zoom",null),e([p({readOnly:!0})],X.prototype,"navigating",null),e([p(),h(e=>e instanceof G?e:d(F,e))],X.prototype,"ui",void 0),X=e([g("esri.views.View2D")],X);const Y=X;export{Y as default};
2
+ import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{initialize as u}from"../core/workers/workers.js";import c from"../geometry/Point.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import f from"../layers/support/TileInfo.js";import{BreakpointsOwner as w}from"./BreakpointsOwner.js";import{DOMContainer as V}from"./DOMContainer.js";import{PopupView as v}from"./PopupView.js";import M from"./View.js";import{Viewport2DBaseMixin as _}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as b}from"./Viewport2DMixin.js";import S from"./2d/AnimationManager.js";import{layerView2DImporter as R}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as T}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as L}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as O}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{clipContainsPoint as x}from"./2d/support/clippingUtils.js";import{hitTest as D}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as P,takeScreenshot as z}from"./2d/support/screenshotUtils.js";import{Timeline as A}from"./2d/support/Timeline.js";import E from"./navigation/Navigation.js";import I from"./navigation/NavigationActionMap.js";import U from"./support/AnalysisViewManager.js";import G from"./ui/DefaultUI.js";import F from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as q}from"./webgl/RenderingContextOptions.js";import{isWebMap as W}from"../webmap/utils.js";import N from"../webmap/background/ColorBackground.js";let B,H,Z,K,Q,J;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:i,MagnifierView2D:r,GridView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);H=e,Z=t,K=i,Q=r,J=s,B=a}let Y=class extends(b(_(w(v(V(M)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new E({actionMap:new I({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new U({importAnalysisViewModule:e=>L(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new A,this.type="2d",this.view2dType=null,this.ui=new F,this.test={takeScreenshot:async e=>P(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},u()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return W(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;const{analysisViewManager:e,allLayerViews:t,frameTask:i,graphicsView:r,inputManager:s,layerViewManager:a,magnifier:n,map:o,ready:l,rendering:p,selectionManager:h,stationary:g,toolViewManager:d,updatingHandles:u,stage:c}=this,m=o?.basemap,y=o?.ground,f="loading"===m?.loadStatus||"loading"===y?.loadStatus||!!o?.allLayers?.some(e=>e.parent!==y&&!e.isFulfilled()),w=!c||c.updating,V=!u||u.updating,v=!e||e.updating,M=!d||d.updating,_=!s||s.updating,b=!r||r.updating,S=!i||i.updating,R=!a||a.updating,j=!h||h.updating,T=!(!n.visible||null===n.position||!this._magnifierView?.updatingHandles.updating),L=t.some(e=>e.updating&&!e.destroyed&&!("layerViews"in e));return!l||!g||p||f||L||T||V||v||S||M||_||R||b||j||w}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return D(this,e,t)}async takeScreenshot(e){return z(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return W(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return W(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return R.hasLayerViewModule(e)}importLayerView(e){return R.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>x(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&T(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=this._createFeaturesTilingScheme(),i=new O(this.surface),r=new B(this.surface,{canvas:this.renderCanvas,contextOptions:new q(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline},i);this.stage=r,this._magnifierView=new Q,this._magnifierView.magnifier=this.magnifier,this._gridView=new J;const s=new S({view:this});this._set("animationManager",s);const a=new K({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),r.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>r.stationary=e,l),o(()=>this.background,e=>{r.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>r.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{r.highlightGradient=C(r.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>r.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set("featuresTilingScheme",e),this.stage.labelManager.featuresTilingScheme=e;const t=new H({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Z(e,!0)});this._set("graphicsView",t)}_createFeaturesTilingScheme(){return new j(f.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p()],Y.prototype,"_magnifierView",void 0),e([p()],Y.prototype,"_gridView",void 0),e([p({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([p()],Y.prototype,"graphicsView",void 0),e([p()],Y.prototype,"constraintsInfo",null),e([p()],Y.prototype,"initialExtentRequired",null),e([p({type:E,nonNullable:!0})],Y.prototype,"navigation",void 0),e([p({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([p()],Y.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],Y.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([p()],Y.prototype,"analysisViewManager",void 0),e([p({type:N})],Y.prototype,"background",null),e([p({type:c})],Y.prototype,"center",null),e([p({type:i})],Y.prototype,"floors",void 0),e([p()],Y.prototype,"grid",void 0),e([p()],Y.prototype,"map",void 0),e([p()],Y.prototype,"padding",null),e([p({readOnly:!0})],Y.prototype,"rendering",null),e([p({readOnly:!0})],Y.prototype,"resolution",null),e([p()],Y.prototype,"scale",null),e([p({type:Boolean,value:!1})],Y.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],Y.prototype,"tileInfo",null),e([p({type:A,readOnly:!0})],Y.prototype,"timeline",void 0),e([p({readOnly:!0})],Y.prototype,"type",void 0),e([p({type:Boolean,readOnly:!0})],Y.prototype,"updating",null),e([p({readOnly:!0})],Y.prototype,"view2dType",void 0),e([p({readOnly:!0})],Y.prototype,"visibleArea",null),e([p()],Y.prototype,"zoom",null),e([p({readOnly:!0})],Y.prototype,"navigating",null),e([p(),h(e=>e instanceof G?e:d(F,e))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const $=Y;export{$ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{whenOnce as r}from"../../core/reactiveUtils.js";import{debug as t}from"../../core/scheduling.js";import{dispatch as e}from"../../core/accessorSupport/watch.js";async function o(o){switch(o.type){case"2d":await s(o);break;case"3d":e(),t.dispatch(),await r(()=>o.fatalError||!o.updating).then(()=>n(o))}if(o.fatalError)throw o.fatalError}function n(r){const t="3d"===r.type?r.resourceController?.scheduler?.test?.getRunning()??null:null;if(null!=t)throw new Error(`View is not updating, but scheduler is running:${t} at ${(new Error).stack}`)}function s(r){const o=Promise.withResolvers();let n=performance.now();const s=()=>(e(),t.dispatch(),!r.fatalError&&(!r.ready||r.updating||!r.stationary));function a(){if(!r.destroyed&&s())n=null,setTimeout(a,16);else{n||(n=performance.now());performance.now()-n>=100?o.resolve():setTimeout(a,16)}}return setTimeout(a,16),o.promise}export{o as default};
2
+ import{whenOnce as r}from"../../core/reactiveUtils.js";import{debug as t}from"../../core/scheduling.js";import{dispatch as e}from"../../core/accessorSupport/watch.js";async function o(o){switch(o.type){case"2d":case"3d":e(),t.dispatch(),await r(()=>o.fatalError||!o.updating).then(()=>n(o))}if(o.fatalError)throw o.fatalError}function n(r){const t="3d"===r.type?r.resourceController?.scheduler?.test?.getRunning()??null:null;if(null!=t)throw new Error(`View is not updating, but scheduler is running:${t} at ${(new Error).stack}`)}export{o as default};