@arcgis/core 4.34.0-next.38 → 4.34.0-next.39

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 (130) hide show
  1. package/Color.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{00f3fe4a09bbdbc8f8b4.js → 00ae094cc21bc42faa54.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{7e04b4592128e884b58c.js → 0f51e51db83f303ce5a6.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{6e82c1d1e02e320ec5e7.js → 14d3039f92b0d96944f0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{54658c87396223d85abd.js → 1cbd59918c60a1a21494.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{7c97c4c8c2cf73835517.js → 1cd15aa69f85ecfa32b0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +1 -0
  9. package/assets/esri/core/workers/chunks/{21aaf2dede61f28727a9.js → 2ae0bda04fd5386b462f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{49eac96a01931b8c4ace.js → 364fb103cb139f26b455.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8ad95fe91ba0a9f284a2.js → 3f7d7dc05e63fc50325e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/{48369e4c340413c531ff.js → 4e6e5677b90b00622146.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{257428fff4bef42716e0.js → 4f3c187a7cb2b1444281.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{31c6716d9ca188d3b870.js → 554c789f4e875d7e6fd5.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{a939d2af7e4a359c7b4d.js → 560bb06cf1bf30df4af3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{80a930881a99ceda240a.js → 5f11fff5bc16fdec42db.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{9155dbfce5ef2c25bbbf.js → 791b3130b34b52160c1f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5b2d40a2ce2594ce8eef.js → 95f0c15d83d1f38e01d0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{3488e88882f40199ab33.js → a85acb948cc7d22be592.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7159e7a3274e64b337ce.js → b481807b31e59cce9931.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d29f894491618931d92a.js → bc27cdd7c415ab166536.js} +1 -1
  24. package/assets/esri/core/workers/chunks/c474800508e3ad5ce9d7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{23a85252e4164354553e.js → c52314b987c63cd630f7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{022091e5240b9d872dd2.js → d1635a7ab0c204852237.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{c8c85ba6451b5dfc2fc0.js → da228aed337f492456cc.js} +1 -1
  28. package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +1 -0
  29. package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +1 -0
  30. package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +1 -0
  31. package/colorUtils.js +1 -1
  32. package/config.js +1 -1
  33. package/core/AsyncUpdate.js +1 -1
  34. package/core/Collection.js +1 -1
  35. package/core/Evented.js +1 -1
  36. package/core/MultiOriginJSONSupport.js +1 -1
  37. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  38. package/identity/IdentityManagerBase.js +1 -1
  39. package/kernel.js +1 -1
  40. package/package.json +1 -1
  41. package/support/revision.js +1 -1
  42. package/symbols/WaterSymbol3DLayer.js +1 -1
  43. package/views/2d/engine/AFeatureContainer.js +1 -1
  44. package/views/2d/engine/Bitmap.js +1 -1
  45. package/views/2d/engine/Stage.js +1 -1
  46. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  47. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  48. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  49. package/views/2d/engine/webgl/ClippingInfo.js +1 -1
  50. package/views/2d/engine/webgl/Overlay.js +1 -1
  51. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  52. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  53. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  55. package/views/2d/grid/GridView2D.js +1 -1
  56. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  57. package/views/2d/layers/BaseLayerView2D.js +1 -1
  58. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  59. package/views/2d/layers/CatalogDynamicGroupLayerView2D.js +1 -1
  60. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  61. package/views/2d/layers/CatalogLayerView2D.js +1 -1
  62. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  63. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  64. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  65. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  66. package/views/2d/layers/MediaLayerView2D.js +1 -1
  67. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  68. package/views/2d/layers/StreamLayerView2D.js +1 -1
  69. package/views/2d/layers/TileLayerView2D.js +1 -1
  70. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  71. package/views/2d/layers/WMSLayerView2D.js +1 -1
  72. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  73. package/views/2d/layers/features/support/TileStore.js +1 -1
  74. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  75. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  76. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  77. package/views/3d/layers/CatalogDynamicGroupLayerView3D.js +1 -1
  78. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  79. package/views/3d/layers/CatalogLayerView3D.js +1 -1
  80. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  81. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  82. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  83. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  84. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  85. package/views/3d/layers/StreamLayerView3D.js +1 -1
  86. package/views/3d/layers/TileLayerView3D.js +1 -1
  87. package/views/3d/layers/WMSLayerView3D.js +1 -1
  88. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  89. package/views/3d/layers/graphics/GraphicStateTracking.js +1 -1
  90. package/views/3d/support/LimitGraphicsMap.js +1 -1
  91. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  92. package/views/View.js +1 -1
  93. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  94. package/views/layers/CatalogDynamicGroupLayerView.d.ts +1 -1
  95. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  96. package/views/layers/CatalogFootprintLayerView.d.ts +1 -1
  97. package/views/layers/CatalogFootprintLayerView.js +1 -1
  98. package/views/layers/CatalogLayerView.d.ts +1 -1
  99. package/views/layers/CatalogLayerView.js +1 -1
  100. package/views/layers/FeatureLayerView.d.ts +1 -1
  101. package/views/layers/FeatureLayerView.js +1 -1
  102. package/views/layers/LayerView.js +1 -1
  103. package/views/layers/OGCFeatureLayerView.d.ts +1 -1
  104. package/views/layers/OGCFeatureLayerView.js +1 -1
  105. package/views/layers/PointCloudLayerView.d.ts +1 -1
  106. package/views/layers/PointCloudLayerView.js +1 -1
  107. package/views/layers/RefreshableLayerView.js +1 -1
  108. package/views/layers/StreamLayerView.d.ts +1 -1
  109. package/views/layers/StreamLayerView.js +1 -1
  110. package/views/layers/WMSLayerView.js +1 -1
  111. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  112. package/widgets/Compass/CompassViewModel.js +1 -1
  113. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  114. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  115. package/widgets/Directions/DirectionsViewModel.js +1 -1
  116. package/widgets/Features/FeaturesViewModel.js +1 -1
  117. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  118. package/widgets/Home/HomeViewModel.js +1 -1
  119. package/widgets/Search/SearchViewModel.js +1 -1
  120. package/widgets/Widget.js +1 -1
  121. package/widgets/support/GeolocationPositioning.js +1 -1
  122. package/widgets/support/GoTo.d.ts +1 -1
  123. package/widgets/support/GoTo.js +1 -1
  124. package/assets/esri/core/workers/chunks/508c302fed242956d3b7.js +0 -1
  125. package/assets/esri/core/workers/chunks/60d889c58a542e59b07b.js +0 -1
  126. package/assets/esri/core/workers/chunks/7617fe2fbf223c108f1e.js +0 -1
  127. package/assets/esri/core/workers/chunks/9595b39e882f9a9ac839.js +0 -1
  128. package/assets/esri/core/workers/chunks/9ffbd5216aa0a45a4199.js +0 -1
  129. package/assets/esri/core/workers/chunks/a5c0b365b9f55e63ab52.js +0 -1
  130. package/assets/esri/core/workers/chunks/d5262c95116d3bdfd117.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./FeatureLayerView2D.js";import o from"../../layers/OGCFeatureLayerView.js";let t=class extends(o(s)){supportsSpatialReference(r){return this.layer.serviceSupportsSpatialReference(r)}};t=r([e("esri.views.2d.layers.OGCFeatureLayerView2D")],t);const a=t;export{a as default};
5
+ import{__decorate as r}from"tslib";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./FeatureLayerView2D.js";import{OGCFeatureLayerView as o}from"../../layers/OGCFeatureLayerView.js";let t=class extends(o(s)){supportsSpatialReference(r){return this.layer.serviceSupportsSpatialReference(r)}};t=r([e("esri.views.2d.layers.OGCFeatureLayerView2D")],t);const a=t;export{a 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{handlesGroup as t,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.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 i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import l from"./FeatureLayerView2D.js";import{handleNoEngineError as h}from"./support/handleNoEngineError.js";import p from"../../layers/StreamLayerView.js";let u=class extends(p(l)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n(()=>this.layer.customParameters,async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)}),this.layer.on("send-message-to-socket",async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)}),this.layer.on("send-message-to-client",async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()}),n(()=>this.layer.purgeOptions,()=>this._update()),n(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new r("stream-controller",this.pipelineErrorString):null}on(e,r){if(Array.isArray(e))return t(e.map(e=>this.on(e,r)));const n=["data-received","message-received"].includes(e);n&&this.getWorker().then(r=>r.streamMessenger.enableEvent(e,!0));const o=super.on(e,r),i=this;return s(()=>{o.remove(),n&&(i._workerProxy.closed||i.hasEventListener(e)||i.getWorker().then(r=>r.streamMessenger.enableEvent(e,!1)))})}async queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new r("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const s=await this.getWorker();return h(s.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(e=>{const r=a.fromJSON(e);return r.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,e.origin=this.layer.graphicOrigin}),r}),new a({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(c)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){null==this._refreshInterval&&(this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval))}_doDisconnect(){this.getWorker().then(e=>e.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(e=>e.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(e=>e.streamMessenger.clear()),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),r=this;return{...e,get container(){return r.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([o()],u.prototype,"pipelineConnectionStatus",void 0),e([o()],u.prototype,"pipelineErrorString",void 0),e([o({readOnly:!0})],u.prototype,"connectionError",null),e([o({readOnly:!0})],u.prototype,"_streamConnectionStatus",null),u=e([i("esri.views.2d.layers.StreamLayerView2D")],u);const d=u;export{d as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{handlesGroup as t,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.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 i}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../rest/support/FeatureSet.js";import{isNumber as c}from"../../../support/guards.js";import l from"./FeatureLayerView2D.js";import{handleNoEngineError as h}from"./support/handleNoEngineError.js";import{StreamLayerView as p}from"../../layers/StreamLayerView.js";let u=class extends(p(l)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n(()=>this.layer.customParameters,async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)}),this.layer.on("send-message-to-socket",async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)}),this.layer.on("send-message-to-client",async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()}),n(()=>this.layer.purgeOptions,()=>this._update()),n(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new r("stream-controller",this.pipelineErrorString):null}on(e,r){if(Array.isArray(e))return t(e.map(e=>this.on(e,r)));const n=["data-received","message-received"].includes(e);n&&this.getWorker().then(r=>r.streamMessenger.enableEvent(e,!0));const o=super.on(e,r),i=this;return s(()=>{o.remove(),n&&(i._workerProxy.closed||i.hasEventListener(e)||i.getWorker().then(r=>r.streamMessenger.enableEvent(e,!1)))})}async queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new r("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const s=await this.getWorker();return h(s.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(e=>{const r=a.fromJSON(e);return r.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,e.origin=this.layer.graphicOrigin}),r}),new a({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(c)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){null==this._refreshInterval&&(this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval))}_doDisconnect(){this.getWorker().then(e=>e.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(e=>e.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(e=>e.streamMessenger.clear()),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),r=this;return{...e,get container(){return r.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([o()],u.prototype,"pipelineConnectionStatus",void 0),e([o()],u.prototype,"pipelineErrorString",void 0),e([o({readOnly:!0})],u.prototype,"connectionError",null),e([o({readOnly:!0})],u.prototype,"_streamConnectionStatus",null),u=e([i("esri.views.2d.layers.StreamLayerView2D")],u);const d=u;export{d 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/BufferObject.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import b from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as V}from"../../support/drapedUtils.js";import{getHighlightName as q}from"../../support/highlightOptionsUtils.js";import{TaskPriority as P}from"../../support/Scheduler.js";const v=[0,0];let I=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:P.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>V(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=q(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(v,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],I.prototype,"resampling",null),e([o()],I.prototype,"tilemapCache",null),I=e([l("esri.views.2d.layers.TileLayerView2D")],I);const S=I;export{S as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/BufferObject.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as V}from"../../support/drapedUtils.js";import{getHighlightName as q}from"../../support/highlightOptionsUtils.js";import{TaskPriority as P}from"../../support/Scheduler.js";const I=[0,0];let v=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:P.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>V(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=q(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],v.prototype,"resampling",null),e([o()],v.prototype,"tilemapCache",null),v=e([l("esri.views.2d.layers.TileLayerView2D")],v);const S=v;export{S 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{clone as t}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as n,hasDiff as o}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{create as u}from"../../../geometry/support/aaBoundingRect.js";import{equals as c}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as y}from"../../../graphic/isVectorTileGraphicOrigin.js";import{TileHandler as d}from"../engine/vectorTiles/TileHandler.js";import{TileManager as p}from"../engine/vectorTiles/TileManager.js";import{VectorTile as _}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as f}from"../engine/vectorTiles/VectorTileContainer.js";import g from"../engine/vectorTiles/VectorTileFeatureIndex.js";import m from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import C from"../tiling/TileInfoViewPOT.js";import v from"../tiling/TileQueue.js";import w from"../../layers/LayerView.js";import R from"../../layers/RefreshableLayerView.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=2,Q=8,S=512;let P=class extends(R(T(w))){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return this._vectorTileContainer?.fading??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r=null;const a=this._vectorTileContainer?.symbolRepository;a&&(r=a.querySymbols(t,I,s.decluttererOffset,{}));const l=this.view.state,n=this._tileManager.getIntersectingTiles(t.x,t.y,I,l,r);if((!n||0===n.length)&&0===r?.length)return null;e=e.clone().normalize();const o=[],h=[];for(const u of n)o.push(this._queryTile(h,e,I,this.view.state.rotation,u,r?.filter(e=>e.tileKey.id===u.id)));return await Promise.all(o),h}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._tileHandler.devicePixelRatio=e.pixelRatio,void this._loadStyle()):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new m(e),this._tileInfoView=new C(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new f(this._tileInfoView),this._tileHandler=new d(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=3===i.type;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=n(i.layout,e.layout);if(null!=s){if(o(s,"visibility")&&1===b(s))return t.setLayoutProperties(e.layer,e.layout),3===i.type&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:1,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),3===i.type&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case 3:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:1,data:{layer:i.id,layout:i.layout}});break;case 2:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case 1:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=s(this._vectorTileContainer),this._tileHandler=s(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return c(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once("attach",()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{r(e)||i.getLogger(this).error(e)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(e=>this._parseQueue.push({key:i.key,data:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(e)}await Promise.all(t)}catch(s){i.getLogger(this).error("error refreshing vector-tiles layer-view",s),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new p({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:H.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=s(this._fetchQueue),this._parseQueue=s(this._parseQueue),this._tileManager=s(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){i.getLogger(this).error("error applying vector-tiles style update",l.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set;e.forEach(e=>{if(3!==e.type)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.add(r.uid)});const r=new Set;e.forEach(e=>{let i;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case 3:return void t.deleteStyleLayer(e.data.layer);case 2:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&r.add(e.uid)}});const a=this._vectorTileContainer.children;if(s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),r.size>0){const e=Array.from(r),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=t(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new m(i),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,i,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!r(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const a=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new C(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(a,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new p({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(u(),e),i=this._tileInfoView.getTileResolution(e.level);return new _(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,i,s,r,a){if(0===r.layerData.size)return;const l=this._ensureTileIndex(r),n=this._tileInfoView.getTileBounds(u(),r.key,!0),o=Q*S*((t.x-n[0])/(n[2]-n[0])),h=Q*S*(1-(t.y-n[1])/(n[3]-n[1])),c=await l.queryAttributes(o,h,i,s,a);for(const u of c)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:t.clone()});e.sort((e,t)=>(y(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(y(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new h({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=g.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function b(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([a()],P.prototype,"_isTileHandlerReady",void 0),P=e([l("esri.views.2d.layers.VectorTileLayerView2D")],P);const V=P;export{V as default};
5
+ import{__decorate as e}from"tslib";import{clone as t}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as n,hasDiff as o}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{create as u}from"../../../geometry/support/aaBoundingRect.js";import{equals as c}from"../../../geometry/support/spatialReferenceUtils.js";import{isVectorTileGraphicOrigin as y}from"../../../graphic/isVectorTileGraphicOrigin.js";import{TileHandler as d}from"../engine/vectorTiles/TileHandler.js";import{TileManager as p}from"../engine/vectorTiles/TileManager.js";import{VectorTile as _}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as f}from"../engine/vectorTiles/VectorTileContainer.js";import g from"../engine/vectorTiles/VectorTileFeatureIndex.js";import m from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import C from"../tiling/TileInfoViewPOT.js";import v from"../tiling/TileQueue.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as R}from"../../layers/RefreshableLayerView.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=2,Q=8,S=512;let P=class extends(R(T(w))){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return this._vectorTileContainer?.fading??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r=null;const a=this._vectorTileContainer?.symbolRepository;a&&(r=a.querySymbols(t,I,s.decluttererOffset,{}));const l=this.view.state,n=this._tileManager.getIntersectingTiles(t.x,t.y,I,l,r);if((!n||0===n.length)&&0===r?.length)return null;e=e.clone().normalize();const o=[],h=[];for(const u of n)o.push(this._queryTile(h,e,I,this.view.state.rotation,u,r?.filter(e=>e.tileKey.id===u.id)));return await Promise.all(o),h}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._tileHandler.devicePixelRatio=e.pixelRatio,void this._loadStyle()):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new m(e),this._tileInfoView=new C(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new f(this._tileInfoView),this._tileHandler=new d(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:0,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=3===i.type;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=n(i.layout,e.layout);if(null!=s){if(o(s,"visibility")&&1===b(s))return t.setLayoutProperties(e.layer,e.layout),3===i.type&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:1,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),3===i.type&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:2,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:3,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:4,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case 3:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:1,data:{layer:i.id,layout:i.layout}});break;case 2:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case 1:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:0,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=s(this._vectorTileContainer),this._tileHandler=s(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return c(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once("attach",()=>this.requestUpdate()),t.setData(e),this.requestUpdate()}).catch(e=>{r(e)||i.getLogger(this).error(e)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(e=>this._parseQueue.push({key:i.key,data:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(e)}await Promise.all(t)}catch(s){i.getLogger(this).error("error refreshing vector-tiles layer-view",s),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new p({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:H.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=s(this._fetchQueue),this._parseQueue=s(this._parseQueue),this._tileManager=s(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){i.getLogger(this).error("error applying vector-tiles style update",l.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set;e.forEach(e=>{if(3!==e.type)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.add(r.uid)});const r=new Set;e.forEach(e=>{let i;switch(e.type){case 0:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case 1:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case 3:return void t.deleteStyleLayer(e.data.layer);case 2:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case 4:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&r.add(e.uid)}});const a=this._vectorTileContainer.children;if(s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),r.size>0){const e=Array.from(r),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then(t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e})).then(e=>i.setData(e)).finally(()=>i.featureIndex=null));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=t(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new m(i),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,i,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!r(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const a=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new C(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(a,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new p({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(u(),e),i=this._tileInfoView.getTileResolution(e.level);return new _(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,i,s,r,a){if(0===r.layerData.size)return;const l=this._ensureTileIndex(r),n=this._tileInfoView.getTileBounds(u(),r.key,!0),o=Q*S*((t.x-n[0])/(n[2]-n[0])),h=Q*S*(1-(t.y-n[1])/(n[3]-n[1])),c=await l.queryAttributes(o,h,i,s,a);for(const u of c)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:t.clone()});e.sort((e,t)=>(y(t.graphic.origin)?t.graphic.origin.layerIndex:0)-(y(e.graphic.origin)?e.graphic.origin.layerIndex:0))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new h({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=g.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function b(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([a()],P.prototype,"_isTileHandlerReady",void 0),P=e([l("esri.views.2d.layers.VectorTileLayerView2D")],P);const V=P;export{V 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../geometry/Extent.js";import{BitmapContainer as p}from"../engine/BitmapContainer.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import h from"./support/ExportStrategy.js";import c from"../../layers/LayerView.js";import d from"../../layers/RefreshableLayerView.js";import u from"../../layers/WMSLayerView.js";let g=class extends(u(d(m(c)))){constructor(){super(...arguments),this.bitmapContainer=new p}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}update(t){this.strategy.update(t).catch(t=>{i(t)||e.getLogger(this).error(t)})}attach(){const{layer:t}=this,{imageMaxHeight:e,imageMaxWidth:r}=t;this.bitmapContainer=new p,this.container.addChild(this.bitmapContainer),this.strategy=new h({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:e,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(a(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=r(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(t){const{view:e,bitmapContainer:r}=this,{x:i,y:a}=t,{spatialReference:s}=e;let o,p=0,m=0;if(r.children.some(t=>{const{width:e,height:r,resolution:h,x:c,y:d}=t,u=c+h*e,g=d-h*r;return i>=c&&i<=u&&a<=d&&a>=g&&(o=new n({xmin:c,ymin:g,xmax:u,ymax:d,spatialReference:s}),p=e,m=r,!0)}),!o)return null;const h=o.width/p,c=Math.round((i-o.xmin)/h),d=Math.round((o.ymax-a)/h);return{extent:o,width:p,height:m,x:c,y:d}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,r,i){return this.layer.fetchImageBitmap(t,e,r,{timeExtent:this.timeExtent,...i})}};t([s()],g.prototype,"strategy",void 0),t([s()],g.prototype,"updating",void 0),g=t([o("esri.views.2d.layers.WMSLayerView2D")],g);const y=g;export{y as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../geometry/Extent.js";import{BitmapContainer as p}from"../engine/BitmapContainer.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import h from"./support/ExportStrategy.js";import c from"../../layers/LayerView.js";import{RefreshableLayerView as d}from"../../layers/RefreshableLayerView.js";import{WMSLayerView as u}from"../../layers/WMSLayerView.js";let g=class extends(u(d(m(c)))){constructor(){super(...arguments),this.bitmapContainer=new p}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}update(t){this.strategy.update(t).catch(t=>{i(t)||e.getLogger(this).error(t)})}attach(){const{layer:t}=this,{imageMaxHeight:e,imageMaxWidth:r}=t;this.bitmapContainer=new p,this.container.addChild(this.bitmapContainer),this.strategy=new h({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:e,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(a(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=r(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(t){const{view:e,bitmapContainer:r}=this,{x:i,y:a}=t,{spatialReference:s}=e;let o,p=0,m=0;if(r.children.some(t=>{const{width:e,height:r,resolution:h,x:c,y:d}=t,u=c+h*e,g=d-h*r;return i>=c&&i<=u&&a<=d&&a>=g&&(o=new n({xmin:c,ymin:g,xmax:u,ymax:d,spatialReference:s}),p=e,m=r,!0)}),!o)return null;const h=o.width/p,c=Math.round((i-o.xmin)/h),d=Math.round((o.ymax-a)/h);return{extent:o,width:p,height:m,x:c,y:d}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,r,i){return this.layer.fetchImageBitmap(t,e,r,{timeExtent:this.timeExtent,...i})}};t([s()],g.prototype,"strategy",void 0),t([s()],g.prototype,"updating",void 0),g=t([o("esri.views.2d.layers.WMSLayerView2D")],g);const y=g;export{y 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import p from"../tiling/TileStrategy.js";import f from"../../layers/LayerView.js";import m from"../../layers/RefreshableLayerView.js";import{TaskPriority as d}from"../../support/Scheduler.js";const y=[0,0];let _=class extends(m(l(o(f)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:e}=this.layer,{tileMatrixSet:t}=e;if(t&&a(t.tileInfo?.spatialReference,this.view.spatialReference))return t;const i=this._getTileMatrixSetBySpatialReference(e);return i&&i.id!==e.tileMatrixSetId?(e.tileMatrixSetId=i.id,i):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:d.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new p({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>a(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw n}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(s){i(s)||t.getLogger(this).error(s)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){return e.tileMatrixSets?.find(e=>a(e.tileInfo?.spatialReference,this.view.spatialReference))}};e([s({readOnly:!0})],_.prototype,"tileMatrixSet",null),_=e([r("esri.views.2d.layers.WMTSLayerView2D")],_);const w=_;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import n from"../tiling/TileInfoView.js";import c from"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import p from"../tiling/TileStrategy.js";import f from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{TaskPriority as d}from"../../support/Scheduler.js";const y=[0,0];let _=class extends(m(l(o(f)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:e}=this.layer,{tileMatrixSet:t}=e;if(t&&a(t.tileInfo?.spatialReference,this.view.spatialReference))return t;const i=this._getTileMatrixSetBySpatialReference(e);return i&&i.id!==e.tileMatrixSetId?(e.tileMatrixSetId=i.id,i):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new n(e),this._fetchQueue=new u({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:d.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new p({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>a(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new c(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(n){if(i(n))throw n;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new c(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw n}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(s){i(s)||t.getLogger(this).error(s)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){return e.tileMatrixSets?.find(e=>a(e.tileInfo?.spatialReference,this.view.spatialReference))}};e([s({readOnly:!0})],_.prototype,"tileMatrixSet",null),_=e([r("esri.views.2d.layers.WMTSLayerView2D")],_);const w=_;export{w 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{Evented as e}from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{r as t}from"../../../../../chunks/rbush.js";import{width as s,height as i,create as o}from"../../../../../geometry/support/aaBoundingRect.js";import{getInfo as n}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Tile as r}from"./Tile.js";import l from"../../../tiling/TileCoverage.js";import h from"../../../tiling/TileKey.js";const d={added:[],removed:[]},a=new Set,c=new h(0,0,0,0);function m(e,t){const s=n(t);if(!s)return null;const[i,r]=s.valid;return e[2]>r?[o([e[0],e[1],r,e[3]]),o([i,e[1],i+e[2]-r,e[3]])]:e[0]<i?[o([i,e[1],e[2],e[3]]),o([r-(i-e[0]),e[1],r,e[3]])]:null}class u extends e{constructor(e){super(),this._tiles=new Map,this._index=t(9,has("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||0===s(e)||0===i(e))return[];const t=m(e,this.tileScheme.spatialReference);return null!=t?[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]:this.boundsIntersections(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new r(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach(e=>this.tiles.push(e)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:i}=t,{level:o}=i;if(s.length>0)for(const{row:n,colFrom:l,colTo:h}of s)for(let e=l;e<=h;e++){const t=c.set(o,n,i.normalizeCol(e),i.getWorldForColumn(e)).id;if(a.add(t),!this.has(t)){const e=new r(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),d.added.push(e)}}for(let n=this.tiles.length-1;n>=0;n--){const e=this.tiles[n];a.has(e.id)||(this._tiles.delete(e.id),this.tiles.splice(n,1),this._index.remove(e),d.removed.push(e))}(d.added.length||d.removed.length)&&this.emit("update",d),l.pool.release(t),a.clear(),d.added.length=0,d.removed.length=0}}export{u as default};
5
+ import{Evented as e}from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import{r as t}from"../../../../../chunks/rbush.js";import{width as s,height as i,create as o}from"../../../../../geometry/support/aaBoundingRect.js";import{getInfo as n}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Tile as r}from"./Tile.js";import l from"../../../tiling/TileCoverage.js";import h from"../../../tiling/TileKey.js";const d={added:[],removed:[]},a=new Set,c=new h(0,0,0,0);function m(e,t){const s=n(t);if(!s)return null;const[i,r]=s.valid;return e[2]>r?[o([e[0],e[1],r,e[3]]),o([i,e[1],i+e[2]-r,e[3]])]:e[0]<i?[o([i,e[1],e[2],e[3]]),o([r-(i-e[0]),e[1],r,e[3]])]:null}class u extends e{constructor(e){super(),this._tiles=new Map,this._index=t(9,has("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){super.destroy(),this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||0===s(e)||0===i(e))return[];const t=m(e,this.tileScheme.spatialReference);return null!=t?[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]:this.boundsIntersections(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new r(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach(e=>this.tiles.push(e)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:i}=t,{level:o}=i;if(s.length>0)for(const{row:n,colFrom:l,colTo:h}of s)for(let e=l;e<=h;e++){const t=c.set(o,n,i.normalizeCol(e),i.getWorldForColumn(e)).id;if(a.add(t),!this.has(t)){const e=new r(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),d.added.push(e)}}for(let n=this.tiles.length-1;n>=0;n--){const e=this.tiles[n];a.has(e.id)||(this._tiles.delete(e.id),this.tiles.splice(n,1),this._index.remove(e),d.removed.push(e))}(d.added.length||d.removed.length)&&this.emit("update",d),l.pool.release(t),a.clear(),d.added.length=0,d.removed.length=0}}export{u 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,multiply as r,translate as i,scale as s,rotate as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{normalizeMapX as f}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as m}from"../../engine/DisplayObject.js";import{createProgramDescriptor as c}from"../../engine/webgl/Utils.js";import{BufferObject as u}from"../../../webgl/BufferObject.js";import{PrimitiveType as h,DataType as _}from"../../../webgl/enums.js";import{VertexArrayObject as p}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as d}from"../../../webgl/VertexBuffer.js";const g=Math.PI/180,x=4;class v extends m{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=a(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=t(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(1,771),e.setColorMask(!0,!0,!0,!0);const i=this._program;e.bindVAO(this._vao),e.useProgram(i),i.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(h.LINES,8*r.length,_.UNSIGNED_INT,0),e.bindVAO(null)}_createTransforms(){return{displayViewScreenMat3:a()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",r="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,r,b().attributes)}_updateMatricesAndLocalOrigin(t){const{state:a}=t,{displayMat3:m,size:c,resolution:u,pixelRatio:h,rotation:_,viewpoint:p}=a,d=g*_,{x,y:v}=p.targetGeometry,b=f(x,a.spatialReference);this._localOrigin.x=b,this._localOrigin.y=v;const B=h*c[0],y=h*c[1],j=u*B,M=u*y,O=e(this._dvsMat3);r(O,O,m),i(O,O,n(B/2,y/2)),s(O,O,l(c[0]/j,-y/M,1)),o(O,O,-d)}_updateBufferData(t,e){const{x:r,y:i}=this._localOrigin,s=2*x*e.length,o=new Float32Array(s),a=new Uint32Array(8*e.length);let n=0,l=0;for(const f of e)f&&(o[2*n]=f[0]-r,o[2*n+1]=f[1]-i,o[2*n+2]=f[0]-r,o[2*n+3]=f[3]-i,o[2*n+4]=f[2]-r,o[2*n+5]=f[3]-i,o[2*n+6]=f[2]-r,o[2*n+7]=f[1]-i,a[l]=n+0,a[l+1]=n+3,a[l+2]=n+3,a[l+3]=n+2,a[l+4]=n+2,a[l+5]=n+1,a[l+6]=n+1,a[l+7]=n+0,n+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=u.createVertex(t,35048,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=u.createIndex(t,35048,a),!this._vao){const e=b();this._vao=new p(t,new d(e.bufferLayout,this._vertexBuffer),this._indexBuffer)}}}const b=()=>c("bounds",[{location:0,name:"a_position",count:2,type:_.FLOAT}]);export{v as default};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,multiply as r,translate as i,scale as s,rotate as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{normalizeMapX as f}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as m}from"../../engine/DisplayObject.js";import{createProgramDescriptor as u}from"../../engine/webgl/Utils.js";import{BufferObject as c}from"../../../webgl/BufferObject.js";import{PrimitiveType as h,DataType as _}from"../../../webgl/enums.js";import{VertexArrayObject as p}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as d}from"../../../webgl/VertexBuffer.js";const g=Math.PI/180,x=4;class v extends m{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=a(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){super.destroy(),this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=t(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(1,771),e.setColorMask(!0,!0,!0,!0);const i=this._program;e.bindVAO(this._vao),e.useProgram(i),i.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(h.LINES,8*r.length,_.UNSIGNED_INT,0),e.bindVAO(null)}_createTransforms(){return{displayViewScreenMat3:a()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",r="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,r,b().attributes)}_updateMatricesAndLocalOrigin(t){const{state:a}=t,{displayMat3:m,size:u,resolution:c,pixelRatio:h,rotation:_,viewpoint:p}=a,d=g*_,{x,y:v}=p.targetGeometry,b=f(x,a.spatialReference);this._localOrigin.x=b,this._localOrigin.y=v;const B=h*u[0],y=h*u[1],j=c*B,M=c*y,O=e(this._dvsMat3);r(O,O,m),i(O,O,n(B/2,y/2)),s(O,O,l(u[0]/j,-y/M,1)),o(O,O,-d)}_updateBufferData(t,e){const{x:r,y:i}=this._localOrigin,s=2*x*e.length,o=new Float32Array(s),a=new Uint32Array(8*e.length);let n=0,l=0;for(const f of e)f&&(o[2*n]=f[0]-r,o[2*n+1]=f[1]-i,o[2*n+2]=f[0]-r,o[2*n+3]=f[3]-i,o[2*n+4]=f[2]-r,o[2*n+5]=f[3]-i,o[2*n+6]=f[2]-r,o[2*n+7]=f[1]-i,a[l]=n+0,a[l+1]=n+3,a[l+2]=n+3,a[l+3]=n+2,a[l+4]=n+2,a[l+5]=n+1,a[l+6]=n+1,a[l+7]=n+0,n+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=c.createVertex(t,35048,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=c.createIndex(t,35048,a),!this._vao){const e=b();this._vao=new p(t,new d(e.bufferLayout,this._vertexBuffer),this._indexBuffer)}}}const b=()=>u("bounds",[{location:0,name:"a_position",count:2,type:_.FLOAT}]);export{v 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../request.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Handles.js";import{destroyMaybe as i,abortMaybe as t}from"../../../core/maybe.js";import{watch as n,initial as a}from"../../../core/reactiveUtils.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{UpdatingHandles as l}from"../../../core/support/UpdatingHandles.js";import{DisplayObject as h}from"../engine/DisplayObject.js";import{MagnifierTechnique as u}from"../engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js";import{loadMagnifierResources as m}from"../../magnifier/resources.js";class d extends h{constructor(){super(),this._handles=new r,this._magnifierTechnique=new u,this.updatingHandles=new l,this.visible=!1}destroy(){this._handles=i(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=t(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([n(()=>e.version,()=>{this.visible=e.visible&&null!=e.position&&e.size>0,this.requestRender()},a),n(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),n(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:o()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(1!==e.drawPhase||!this._canRender())return;const s=this._magnifier;if(null==s.position)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,s);const r=this.backgroundColor,i=r?[r.a*r.r/255,r.a*r.g/255,r.a*r.b/255,r.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:s.maskEnabled?1:0,overlayEnabled:s.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&null!=this._magnifier}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const r=null!=this._magnifier?this._magnifier.maskUrl:null,i=null!=this._magnifier?this._magnifier.overlayUrl:null;this._resourcesTask=s(async s=>{const t=null==r||null==i?m(s):null,n=null!=r?e(r,{responseType:"image",signal:s}).then(e=>e.data):t.then(e=>e.mask),a=null!=i?e(i,{responseType:"image",signal:s}).then(e=>e.data):t.then(e=>e.overlay),[o,l]=await Promise.all([n,a]);this._mask=o,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}export{d as default};
5
+ import e from"../../../request.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Handles.js";import{destroyMaybe as i,abortMaybe as t}from"../../../core/maybe.js";import{watch as n,initial as a}from"../../../core/reactiveUtils.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{UpdatingHandles as l}from"../../../core/support/UpdatingHandles.js";import{DisplayObject as h}from"../engine/DisplayObject.js";import{MagnifierTechnique as u}from"../engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js";import{loadMagnifierResources as m}from"../../magnifier/resources.js";class d extends h{constructor(){super(),this._handles=new r,this._magnifierTechnique=new u,this.updatingHandles=new l,this.visible=!1}destroy(){super.destroy(),this._handles=i(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=t(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([n(()=>e.version,()=>{this.visible=e.visible&&null!=e.position&&e.size>0,this.requestRender()},a),n(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),n(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:o()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(1!==e.drawPhase||!this._canRender())return;const s=this._magnifier;if(null==s.position)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,s);const r=this.backgroundColor,i=r?[r.a*r.r/255,r.a*r.g/255,r.a*r.b/255,r.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:s.maskEnabled?1:0,overlayEnabled:s.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&null!=this._magnifier}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const r=null!=this._magnifier?this._magnifier.maskUrl:null,i=null!=this._magnifier?this._magnifier.overlayUrl:null;this._resourcesTask=s(async s=>{const t=null==r||null==i?m(s):null,n=null!=r?e(r,{responseType:"image",signal:s}).then(e=>e.data):t.then(e=>e.mask),a=null!=i?e(i,{responseType:"image",signal:s}).then(e=>e.data):t.then(e=>e.overlay),[o,l]=await Promise.all([n,a]);this._mask=o,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}export{d 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import i from"../../../core/Accessor.js";import s from"../../../core/Collection.js";import{EventedMixin as o}from"../../../core/Evented.js";import"../../../core/has.js";import{abortMaybe as r,destroyMaybe as e}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as p}from"./AnalysisView3D.js";import{LineOfSightController as y}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as u}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as h}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as c,removeAnalysisViewTool as m,startPlaceOperation as d}from"../../analysis/analysisViewUtils.js";let g=class extends(p(o(i))){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new s,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=l(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new y({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new h({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),c(this,u)])}destroy(){m(this),this.userOperation=r(this.userOperation),this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return d(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([a({readOnly:!0})],g.prototype,"type",void 0),t([a({constructOnly:!0,nonNullable:!0})],g.prototype,"analysis",void 0),t([a()],g.prototype,"tool",void 0),t([a({readOnly:!0})],g.prototype,"results",null),t([a()],g.prototype,"priority",null),t([a()],g.prototype,"computations",void 0),t([a()],g.prototype,"cursorTarget",void 0),t([a()],g.prototype,"editable",void 0),t([a()],g.prototype,"elevationAlignedObserver",void 0),t([a()],g.prototype,"observerEngineLocation",void 0),t([a()],g.prototype,"updating",null),t([a()],g.prototype,"userOperation",void 0),t([a()],g.prototype,"_analysisController",void 0),t([a()],g.prototype,"_analysisVisualization",void 0),g=t([n("esri.views.3d.analysis.LineOfSightAnalysisView3D")],g);const f=g;export{f as default};
5
+ import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import{EventedAccessor as s}from"../../../core/Evented.js";import"../../../core/has.js";import{abortMaybe as o,destroyMaybe as r}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as l}from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as y}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as u}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as h,removeAnalysisViewTool as c,startPlaceOperation as m}from"../../analysis/analysisViewUtils.js";let d=class extends(l(s)){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=n(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new u({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),h(this,y)])}destroy(){c(this),this.userOperation=o(this.userOperation),this._analysisController=r(this._analysisController),this._analysisVisualization=r(this._analysisVisualization)}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return m(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([e({readOnly:!0})],d.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",void 0),t([e()],d.prototype,"tool",void 0),t([e({readOnly:!0})],d.prototype,"results",null),t([e()],d.prototype,"priority",null),t([e()],d.prototype,"computations",void 0),t([e()],d.prototype,"cursorTarget",void 0),t([e()],d.prototype,"editable",void 0),t([e()],d.prototype,"elevationAlignedObserver",void 0),t([e()],d.prototype,"observerEngineLocation",void 0),t([e()],d.prototype,"updating",null),t([e()],d.prototype,"userOperation",void 0),t([e()],d.prototype,"_analysisController",void 0),t([e()],d.prototype,"_analysisVisualization",void 0),d=t([a("esri.views.3d.analysis.LineOfSightAnalysisView3D")],d);const g=d;export{g 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import o from"../../../core/Collection.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as s}from"./LayerView3D.js";import a from"../../layers/CatalogDynamicGroupLayerView.js";import i from"../../layers/LayerView.js";let p=class extends(a(s(i))){constructor(){super(...arguments),this.type="catalog-dynamic-group-3d",this.layerViews=new o}initialize(){this.addHandles([this.enableLayerUpdates()])}};r([e()],p.prototype,"layerViews",void 0),r([e()],p.prototype,"parent",void 0),r([e()],p.prototype,"view",void 0),p=r([t("esri.views.3d.layers.CatalogDynamicGroupLayerView3D")],p);const c=p;export{c as default};
5
+ import{__decorate as r}from"tslib";import o from"../../../core/Collection.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as s}from"./LayerView3D.js";import{CatalogDynamicGroupLayerView as a}from"../../layers/CatalogDynamicGroupLayerView.js";import i from"../../layers/LayerView.js";let p=class extends(a(s(i))){constructor(){super(...arguments),this.type="catalog-dynamic-group-3d",this.layerViews=new o}initialize(){this.addHandles([this.enableLayerUpdates()])}};r([e()],p.prototype,"layerViews",void 0),r([e()],p.prototype,"parent",void 0),r([e()],p.prototype,"view",void 0),p=r([t("esri.views.3d.layers.CatalogDynamicGroupLayerView3D")],p);const c=p;export{c 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";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 t}from"../../../core/accessorSupport/decorators/subclass.js";import e from"../../../graphic/CatalogGraphicOrigin.js";import s from"./FeatureLayerViewBase3D.js";import a from"../../layers/CatalogFootprintLayerView.js";let i=class extends(a(s)){constructor(){super(...arguments),this.type="catalog-footprint-3d"}get graphicOrigin(){return new e(this.layer)}};r([o()],i.prototype,"parent",void 0),r([o()],i.prototype,"graphicOrigin",null),i=r([t("esri.views.3d.layers.CatalogFootprintLayerView3D")],i);const p=i;export{p as default};
5
+ import{__decorate as r}from"tslib";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 t}from"../../../core/accessorSupport/decorators/subclass.js";import e from"../../../graphic/CatalogGraphicOrigin.js";import s from"./FeatureLayerViewBase3D.js";import{CatalogFootprintLayerView as a}from"../../layers/CatalogFootprintLayerView.js";let i=class extends(a(s)){constructor(){super(...arguments),this.type="catalog-footprint-3d"}get graphicOrigin(){return new e(this.layer)}};r([o()],i.prototype,"parent",void 0),r([o()],i.prototype,"graphicOrigin",null),i=r([t("esri.views.3d.layers.CatalogFootprintLayerView3D")],i);const p=i;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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import o from"../../../core/Collection.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as t}from"./LayerView3D.js";import a from"../../layers/CatalogLayerView.js";import i from"../../layers/LayerView.js";let p=class extends(a(t(i))){constructor(){super(...arguments),this.type="catalog-3d",this.layerViews=new o}};r([e()],p.prototype,"layerViews",void 0),p=r([s("esri.views.3d.layers.CatalogLayerView3D")],p);const c=p;export{c as default};
5
+ import{__decorate as r}from"tslib";import o from"../../../core/Collection.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as t}from"./LayerView3D.js";import{CatalogLayerView as a}from"../../layers/CatalogLayerView.js";import i from"../../layers/LayerView.js";let p=class extends(a(t(i))){constructor(){super(...arguments),this.type="catalog-3d",this.layerViews=new o}};r([e()],p.prototype,"layerViews",void 0),p=r([s("esri.views.3d.layers.CatalogLayerView3D")],p);const c=p;export{c 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{debounce as s,isAbortError as i}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./DrapedSubView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import d from"../../layers/LayerView.js";import u from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as c}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as h}from"../../support/projectionUtils.js";let m=class extends(u(p(d))){constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=s(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{i(e)||r.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){const e=this.layer,r="effectiveScaleRange"in e?e.effectiveScaleRange:null;return c(r,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),"local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await h(this.layer.fullExtent,this.view.spatialReference))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=t(this.subView)}_initSubView(){this.subView=new n({layerView:this})}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new l(this.usedMemory)}};e([o()],m.prototype,"layer",void 0),e([o()],m.prototype,"suspended",void 0),e([o()],m.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([o({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([o()],m.prototype,"updating",void 0),e([o()],m.prototype,"subView",void 0),m=e([a("esri.views.3d.layers.DynamicLayerView3D")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{debounce as s,isAbortError as i}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./DrapedSubView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as u}from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as c}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as h}from"../../support/projectionUtils.js";let m=class extends(u(p(d))){constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=s(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{i(e)||r.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){const e=this.layer,r="effectiveScaleRange"in e?e.effectiveScaleRange:null;return c(r,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),"local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await h(this.layer.fullExtent,this.view.spatialReference))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=t(this.subView)}_initSubView(){this.subView=new n({layerView:this})}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new l(this.usedMemory)}};e([o()],m.prototype,"layer",void 0),e([o()],m.prototype,"suspended",void 0),e([o()],m.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([o({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([o()],m.prototype,"updating",void 0),e([o()],m.prototype,"subView",void 0),m=e([a("esri.views.3d.layers.DynamicLayerView3D")],m);export{m 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import c from"../../layers/FeatureLayerView.js";import d from"../../layers/LayerView.js";import h from"../../layers/RefreshableLayerView.js";let y=class extends(h(n(c(p(d))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"graphicsPipeline",void 0),e([a()],y.prototype,"maximumNumberOfFeatures",null),e([a()],y.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],y.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],y.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],y.prototype,"updatePolicy",null),e([a({readOnly:!0})],y.prototype,"hasZ",null),e([a({readOnly:!0})],y.prototype,"hasM",null),y=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import{FeatureLayerView as c}from"../../layers/FeatureLayerView.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";let y=class extends(h(n(c(p(d))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"graphicsPipeline",void 0),e([a()],y.prototype,"maximumNumberOfFeatures",null),e([a()],y.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],y.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],y.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],y.prototype,"updatePolicy",null),e([a({readOnly:!0})],y.prototype,"hasZ",null),e([a({readOnly:!0})],y.prototype,"hasM",null),y=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],y);export{y 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,initial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as o}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as n}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import h from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as p}from"../terrain/RasterTile.js";import d from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as u}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let g=class extends(d(y(m(n(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._updatingHandles.add(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this.refresh())});this.addResolvingPromise(e),this.addHandles(r(()=>this.layer.renderer,e=>this._setSubView(e),s))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new h({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){if(this._hasFlow){const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;return this.levelRangeFromScaleRange(e,t)}const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,m=await a.fetchTile(l,o,n,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!r&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const d=new p([l,o,n],h,i.size[0],i.size[1]);return r?(d.symbolizerRenderer=a.symbolizer.rendererJSON,d.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),d.transformGrid=m.transformGrid,d.bandIds=a.bandIds):(d.isRendereredSource=!0,d.bandIds=null),d.interpolation=a.interpolation,d}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return u(e,t,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||(await(this._flowSubView?.doRefresh()),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get test(){}};e([a({readOnly:!0})],g.prototype,"_blankTile",null),e([a()],g.prototype,"_hasFlow",null),e([a({readOnly:!0})],g.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],g.prototype,"hasMixedImageFormats",null),e([a()],g.prototype,"_flowSubView",void 0),e([a({readOnly:!0})],g.prototype,"dataLevelRange",null),g=e([l("esri.views.3d.layers.ImageryTileLayerView3D")],g);const b=g;export{b as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,initial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as o}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as n}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import h from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as p}from"../terrain/RasterTile.js";import d from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as u}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let g=class extends(d(y(m(n(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._updatingHandles.add(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this.refresh())});this.addResolvingPromise(e),this.addHandles(r(()=>this.layer.renderer,e=>this._setSubView(e),s))}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new h({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){if(this._hasFlow){const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;return this.levelRangeFromScaleRange(e,t)}const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,m=await a.fetchTile(l,o,n,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!r&&!this._hasFlow&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const d=new p([l,o,n],h,i.size[0],i.size[1]);return r?(d.symbolizerRenderer=a.symbolizer.rendererJSON,d.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),d.transformGrid=m.transformGrid,d.bandIds=a.bandIds):(d.isRendereredSource=!0,d.bandIds=null),d.interpolation=a.interpolation,d}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return u(e,t,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||(await(this._flowSubView?.doRefresh()),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get test(){}};e([a({readOnly:!0})],g.prototype,"_blankTile",null),e([a()],g.prototype,"_hasFlow",null),e([a({readOnly:!0})],g.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],g.prototype,"hasMixedImageFormats",null),e([a()],g.prototype,"_flowSubView",void 0),e([a({readOnly:!0})],g.prototype,"dataLevelRange",null),g=e([l("esri.views.3d.layers.ImageryTileLayerView3D")],g);const b=g;export{b 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../graphic/OGCFeatureGraphicOrigin.js";import s from"./FeatureLayerViewBase3D.js";import a from"../../layers/OGCFeatureLayerView.js";let p=class extends(a(s)){constructor(){super(...arguments),this.type="ogc-feature-3d"}get graphicOrigin(){return new o(this.layer)}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial references supported by this OGC layer are incompatible with the spatial reference of the view",{layer:this.layer})))}};e([t()],p.prototype,"layer",void 0),e([t()],p.prototype,"graphicOrigin",null),p=e([i("esri.views.3d.layers.OGCFeatureLayerView3D")],p);const c=p;export{c as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../graphic/OGCFeatureGraphicOrigin.js";import s from"./FeatureLayerViewBase3D.js";import{OGCFeatureLayerView as a}from"../../layers/OGCFeatureLayerView.js";let p=class extends(a(s)){constructor(){super(...arguments),this.type="ogc-feature-3d"}get graphicOrigin(){return new o(this.layer)}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial references supported by this OGC layer are incompatible with the spatial reference of the view",{layer:this.layer})))}};e([t()],p.prototype,"layer",void 0),e([t()],p.prototype,"graphicOrigin",null),p=e([i("esri.views.3d.layers.OGCFeatureLayerView3D")],p);const c=p;export{c as default};