@arcgis/core 4.34.0-next.75 → 4.34.0-next.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Components/arcadeEditorUtils.d.ts +4 -0
- package/applications/Components/arcadeEditorUtils.js +5 -0
- package/applications/Components/featureUtils.d.ts +1 -0
- package/applications/Components/featureUtils.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +1 -0
- package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +1 -0
- package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
- package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
- package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
- package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +1 -0
- package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +1 -0
- package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +1 -0
- package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +1 -0
- package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
- package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
- package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +1 -0
- package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{a25b75de1bca1dd21941.js → 70367da4ba916376f40c.js} +1 -1
- package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +1 -0
- package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
- package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +1 -0
- package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
- package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +1 -0
- package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
- package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
- package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +1 -0
- package/assets/esri/core/workers/chunks/{356c96fad88558be9054.js → c6fecf2bbd2a711f15d3.js} +1 -1
- package/assets/esri/core/workers/chunks/c86f5bb199cf046b8952.js +1 -0
- package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → d1f181f91b36351f1d3b.js} +2 -2
- package/assets/esri/core/workers/chunks/{8e428b0f33ef4688415e.js → d95554f43694b4769675.js} +1 -1
- package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +1 -0
- package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
- package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/Compositing.glsl.js +4 -3
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/config.js +1 -1
- package/core/sql.d.ts +1 -0
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +45 -0
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/Lyr3DWorkerHandle.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/support/Circuit.js +1 -1
- package/networks/support/CircuitSection.js +1 -1
- package/networks/support/Subcircuit.js +1 -1
- package/package.json +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/modeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
- package/views/VideoView.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
- package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
- package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
- package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
- package/assets/esri/core/workers/chunks/37ff19a9c5c99bd4e7c7.js +0 -1
- package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
- package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
- package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
- package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
- package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
- package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
- package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
- package/assets/esri/core/workers/chunks/93b2e0a300b2758a1ca4.js +0 -1
- package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
- package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
- package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
- package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
- package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
- package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
- package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
- package/layers/support/gaussianSplatUtils.js +0 -5
package/interfaces.d.ts
CHANGED
|
@@ -2011,6 +2011,32 @@ declare namespace __esri {
|
|
|
2011
2011
|
whenReady?: InternalElevationProfileChartWhenReady;
|
|
2012
2012
|
}
|
|
2013
2013
|
|
|
2014
|
+
/**
|
|
2015
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2016
|
+
*
|
|
2017
|
+
* Arcade editor utils for Components.
|
|
2018
|
+
*/
|
|
2019
|
+
interface arcadeEditorUtils {
|
|
2020
|
+
/**
|
|
2021
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2022
|
+
*
|
|
2023
|
+
* Collect the members that will be available on an arcade Pixel coming from the provided layer.
|
|
2024
|
+
*
|
|
2025
|
+
* @param layer The layer a pixel will come from.
|
|
2026
|
+
*/
|
|
2027
|
+
getDeclaredPixelMembers(layer: ImageryLayer | ImageryTileLayer): Promise<ProfileVariable[]>;
|
|
2028
|
+
/**
|
|
2029
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2030
|
+
*
|
|
2031
|
+
* Collect the members that will be available on an arcade Voxel coming from the provided layer.
|
|
2032
|
+
*
|
|
2033
|
+
* @param layer The layer a voxel will come from.
|
|
2034
|
+
*/
|
|
2035
|
+
getDeclaredVoxelMembers(layer: VoxelLayer): Promise<ProfileVariable[]>;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
export const arcadeEditorUtils: arcadeEditorUtils;
|
|
2039
|
+
|
|
2014
2040
|
/**
|
|
2015
2041
|
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2016
2042
|
*
|
|
@@ -2107,6 +2133,15 @@ declare namespace __esri {
|
|
|
2107
2133
|
* @param relationship The relationship info to use for finding related layers.
|
|
2108
2134
|
*/
|
|
2109
2135
|
findRelatedLayer(map: Map | WebMap, layer: any, relationship: Relationship): any | nullish;
|
|
2136
|
+
/**
|
|
2137
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2138
|
+
*
|
|
2139
|
+
* Used to find an instance of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html UtilityNetwork}.
|
|
2140
|
+
*
|
|
2141
|
+
* @param map Map that contains a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html UtilityNetwork}.
|
|
2142
|
+
* @param layer The layer being validated as a UtilityLayer.
|
|
2143
|
+
*/
|
|
2144
|
+
findUtilityNetwork(map: Map, layer: any): UtilityNetwork | nullish;
|
|
2110
2145
|
/**
|
|
2111
2146
|
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2112
2147
|
*
|
|
@@ -5208,6 +5243,15 @@ declare namespace __esri {
|
|
|
5208
5243
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-core-sql.html#parseWhereClause Read more...}
|
|
5209
5244
|
*/
|
|
5210
5245
|
parseWhereClause(clause: string, fieldsIndex: FieldsIndex | nullish): Promise<WhereClause>;
|
|
5246
|
+
/**
|
|
5247
|
+
* Builds an SQL IN clause for the given field and list of values.
|
|
5248
|
+
*
|
|
5249
|
+
* @param fieldName The name of the field on the table.
|
|
5250
|
+
* @param values The value of the field.
|
|
5251
|
+
*
|
|
5252
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-core-sql.html#sqlIn Read more...}
|
|
5253
|
+
*/
|
|
5254
|
+
sqlIn(fieldName: string, values: any): string | nullish;
|
|
5211
5255
|
}
|
|
5212
5256
|
|
|
5213
5257
|
export const sql: sql;
|
|
@@ -128818,6 +128862,7 @@ declare namespace __esri {
|
|
|
128818
128862
|
*/
|
|
128819
128863
|
export interface FetchPopupFeaturesResult {
|
|
128820
128864
|
allGraphicsPromise: Promise<Graphic[]>;
|
|
128865
|
+
pendingFeatures: Promise<Graphic[]>[];
|
|
128821
128866
|
location: Point | nullish;
|
|
128822
128867
|
}
|
|
128823
128868
|
|
package/kernel.js
CHANGED
|
@@ -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 has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.76",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -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"../request.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as a}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 p from"../geometry/Extent.js";import n from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as f}from"./mixins/ScaleRangeLayer.js";import{url as d,elevationInfo as x}from"./support/commonProperties.js";import{hasEsriCrs as S,initFullExtent as v}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as j,elevationModeRequiredMessage as g,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";let w=class extends(y(h(f(s(u(c(m))))))){constructor(e){super(e),this.operationalLayerType="GaussianSplatLayer",this.type="gaussian-splat",this.opacity=1,this.minScale=0,this.maxScale=0,this.url=null,this.rootTilesetJSON=null,this.fullExtent=new p(-180,-90,180,90,this.spatialReference),this.spatialReference=new n({wkid:4326,vcsWkid:115700}),this.esriCrsSpatialReference=null,this.esriCrsFullExtent=null}get supportedSpatialReferences(){return this.initialized&&this.esriCrsSpatialReference?[this.spatialReference,this.esriCrsSpatialReference]:[this.spatialReference]}get fullExtents(){return this.initialized&&this.esriCrsFullExtent?[this.fullExtent,this.esriCrsFullExtent]:[this.fullExtent]}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service"})}},e)}catch(s){o(s)}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data;const t=S(this.rootTilesetJSON);this.fullExtent=v(this.rootTilesetJSON,!1),this.spatialReference=this.fullExtent.spatialReference,t&&(this.esriCrsFullExtent=v(this.rootTilesetJSON,!0),this.esriCrsSpatialReference=this.esriCrsFullExtent.spatialReference)},e=>{o(e)});await e}}_validateElevationInfo(e){const t="Gaussian Splat layers";j(r.getLogger(this),g(t,"absolute-height",e)),j(r.getLogger(this),R(t,e))}};e([a({type:["GaussianSplatLayer"]})],w.prototype,"operationalLayerType",void 0),e([a({readOnly:!0})],w.prototype,"type",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],w.prototype,"opacity",void 0),e([a({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],w.prototype,"minScale",void 0),e([a({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],w.prototype,"maxScale",void 0),e([a(d)],w.prototype,"url",void 0),e([a({type:p})],w.prototype,"fullExtent",void 0),e([a({type:n})],w.prototype,"spatialReference",void 0),e([a({readOnly:!0})],w.prototype,"supportedSpatialReferences",null),e([a({type:[p]})],w.prototype,"fullExtents",null),e([a({type:["show","hide"]})],w.prototype,"listMode",void 0),e([a(x)],w.prototype,"elevationInfo",null),w=e([l("esri.layers.GaussianSplatLayer")],w);const E=w;export{E 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"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.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{wasmFailedToInit as d,invalidLayerView as h}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as u}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as y}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";let m=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:d})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=u().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,u=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,u,d,Math.max(this._debugLevel,0))?(this._workerHandle=new _(g(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r,s){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===s.type){if(e.origin===r.origin&&e.pathname===r.pathname){if(s.rootTileset){a.push(Promise.resolve(s.rootTileset.slice()));continue}}else s.session&&e.searchParams.append("session",s.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,r,a,n,o){const l=this._getRequestPromises(e.urls,t,i,r);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return s(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r=t.layerView.layer,a="integrated-mesh-3dtiles"===r.type?r.key:null,n="integrated-mesh-3dtiles"===r.type?r.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(r.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,r);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),s(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,r,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===r.type&&n===r.session&&null!==r.session){await r.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,r,l,i,n))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{s(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_addLayerView(e){const t=e.layer,i="integrated-mesh-3dtiles"===t.type?0:2;if(!t.url)return{wasmLayerId:h};if(0===i){if(!t.rootTilesetJSON)return{wasmLayerId:h};const e=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==e.errorCode)return{wasmLayerId:h,check:e}}const r=this._lyr3DMain.get_next_layer_id(),s=new AbortController;this._layers.set(r,{layerView:e,abortController:s,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const a=y(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,r,i,a)?(this._updateWasmCamera(),{wasmLayerId:r}):(this._layers.delete(r),{wasmLayerId:h})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([l("esri.layers.Lyr3DWasmPerSceneView")],m);const c=m;export{c as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.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{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as y}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";let w=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=r?`[js] ${i}`:`${i}`;0===t||1===t?s.getLogger(this).error(e):2===t&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,t.length,i),this._lyr3DMain._free(r),s.needFrame=!0,s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;5===l?this._viewSR.wkid=this._viewSR.latestWkid=4326:this.view.renderSpatialReference?.isWebMercator?this._viewSR.wkid=this._viewSR.latestWkid=3857:32662===this.view.renderSpatialReference?.wkid&&(this._viewSR.wkid=this._viewSR.latestWkid=4326);const d=this.view.heightModelInfo?.heightModel,h=!d||"gravity-related-height"===d;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=h?5773:115700;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,t,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new y(m(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,s=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,s,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,s=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,s,e),this._lyr3DMain._free(s)}this._decrementJobCount(e)}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,a,n,o){const l=this._getRequestPromises(e.urls,t,i,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return r(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,s=t.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,s);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,s,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===s.type&&n===s.session&&null!==s.session){await s.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,s,l,i,n))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{r(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:u};const i="integrated-mesh-3dtiles"===t.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==r.errorCode)return{wasmLayerId:u,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const o=g(t.elevationInfo),l=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let _=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const e=d(i);let s=1,r=1;!e&&i.wkid&&-1!==i.wkid&&(s=h.values[h[i.wkid]],r=s),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),e,s,r).catch(l)}_=this._lyr3DMain.add_gaussian_splat_layer(t.url,a,o)}else _=this._lyr3DMain.add_3dtiles_layer(t.url,a,o);return _?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:u})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],w.prototype,"view",void 0),w=e([l("esri.layers.Lyr3DWasmPerSceneView")],w);const b=w;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{WorkerHandle as r}from"../core/workers/WorkerHandle.js";class
|
|
5
|
+
import{WorkerHandle as r}from"../core/workers/WorkerHandle.js";class e extends r{constructor(r){super("Lyr3DWorker","process",{process:r=>r.inputs},r,{hasInitialize:!0})}destroyWasm(){return this.broadcast({},"destroyWasm")}addSpatialReferenceInfo(r,e,s,t){const o={sr:r,isGCS:e,toMetersXY:s,toMetersZ:t};return this.broadcast(o,"addSpatialReferenceInfo")}}export{e as Lyr3DWorkerHandle};
|
|
@@ -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{rad2deg as e}from"../../core/mathUtils.js";import{d as
|
|
5
|
+
import{rad2deg as e}from"../../core/mathUtils.js";import{d as t,f as r,t as n,c as o,A as i,z as s,a as m}from"../../chunks/vec32.js";import{fromValues as a,create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as f}from"../../geometry/ellipsoidUtils.js";import l from"../../geometry/Extent.js";import x from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{projectBuffer as h}from"../../geometry/projection/projectBuffer.js";function g(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const r of e)if("number"!=typeof r)return!1;return!0}const d=7645211,p={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850},E=new Map([[5773,new x({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM96_Geoid"})],[3855,new x({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM2008_Geoid"})],[115700,new x({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"WGS_1984"})],[115701,new x({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"ETRS_1989"})]]);function R(e){if(!e)return null;const t=e.vcsWkid||e.latestVcsWkid;return t?E.get(t):null}function S(e){return!(!(e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt)||!e.root?.extensions?.ESRI_crs?.boundingVolume?.box&&!e.root?.extensions?.ESRI_crs?.boundingVolume?.sphere)}function _(x,E=!1){let R=new u({wkid:4326,vcsWkid:115700}),S=x.root?.boundingVolume,_=!1,b=x?.root?.transform;if(E&&(x.extensions?.ESRI_crs?.wkid||x.extensions?.ESRI_crs?.latestWkid||x.extensions?.ESRI_crs?.wkt)&&(x.root?.extensions?.ESRI_crs?.boundingVolume?.box||x.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))R=new u(x.extensions?.ESRI_crs),S=x.root?.extensions?.ESRI_crs?.boundingVolume,b=x.root?.transform,_=!0;else if(!S)return new l(-180,-90,180,90,R);if(S.box){const e=S?.box;if(e[3]>d&&e[7]>d&&e[11]>d)return new l({...p,spatialReference:R})}const w=c();if(!_&&S.region&&g(S.region,6)){const t=S.region,r=e(t[0]),n=e(t[1]),o=t[4],i=e(t[2]),s=e(t[3]),m=t[5];return new l({xmin:r,ymin:n,zmin:o,xmax:i,ymax:s,zmax:m,spatialReference:R})}if(S.sphere&&g(S.sphere,4)){const e=S.sphere,m=a(e[0],e[1],e[2]),x=e[3]/Math.sqrt(3),d=c();t(d,m,a(x,x,x));const p=c();if(r(p,m,a(x,x,x)),b&&g(b,16)){const e=b;n(w,d,e),o(d,w),n(w,p,e),o(p,w)}_||(h(d,f,0,d,u.WGS84,0),h(p,f,0,p,u.WGS84,0));const E=c(),y=c();return i(E,d,p),s(y,d,p),new l({xmin:E[0],ymin:E[1],zmin:E[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:R})}if(S.box&&g(S.box,12)){const e=S.box,t=a(e[0],e[1],e[2]),o=a(e[3],e[4],e[5]),x=a(e[6],e[7],e[8]),d=a(e[9],e[10],e[11]),p=[];for(let r=0;r<8;++r)p.push(c());if(r(p[0],t,o),r(p[0],p[0],x),r(p[0],p[0],d),m(p[1],t,o),r(p[1],p[1],x),r(p[1],p[1],d),r(p[2],t,o),m(p[2],p[2],x),r(p[2],p[2],d),m(p[3],t,o),m(p[3],p[3],x),r(p[3],p[3],d),r(p[4],t,o),r(p[4],p[4],x),m(p[4],p[4],d),m(p[5],t,o),r(p[5],p[5],x),m(p[5],p[5],d),r(p[6],t,o),m(p[6],p[6],x),m(p[6],p[6],d),m(p[7],t,o),m(p[7],p[7],x),m(p[7],p[7],d),b&&g(b,16)){const e=b;for(let t=0;t<8;++t)n(p[t],p[t],e)}const E=a(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),w=a(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let r=0;r<8;++r)_||h(p[r],f,0,p[r],u.WGS84,0),i(w,w,p[r]),s(E,E,p[r]);return new l({xmin:w[0],ymin:w[1],zmin:w[2],xmax:E[0],ymax:E[1],zmax:E[2],spatialReference:R})}return new l(-180,-90,180,90,R)}export{R as getHeightModelInfoFromVCS,S as hasEsriCrs,_ as initFullExtent,g as verifyArray};
|
|
@@ -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{JSONSupport as r}from"../core/JSONSupport.js";import{property as i}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{emitApplyEditsEvent as o}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import{isVersionInEditSession as n,currentSessionId as c,isSafeToEditVersion as d}from"../versionManagement/support/versionManagementUtils.js";let u=class extends r{constructor(e){super(e),this.telecomDomainNetwork=null,this.utilityNetwork=null}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}async create(e){const[{createCircuit:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),i=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.gdbVersion=this.gdbVersion;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:r},{default:i}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const a=o(this.featureServiceUrl,null,this.gdbVersion,!1),u=await r(this.networkServiceUrl,s);a.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:u.exceededTransferLimit,historicMoment:u.moment,editedFeatures:u.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),i=r.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.gdbVersion=this.gdbVersion;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),i=r.from(e);n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.domainNetworkName=this.telecomDomainNetworkName,i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0}),a.circuits}async verify(e,t=!1){const[{verifyCircuits:r},{default:i}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=i.from({circuits:e,synthesizeGeometries:t,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const a=o(this.featureServiceUrl,null,this.gdbVersion,!1),u=await r(this.networkServiceUrl,s);return a.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:u.exceededTransferLimit,historicMoment:u.moment,editedFeatures:u.serviceEdits||void 0}),u.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),i=Array.isArray(e)?{circuits:e}:e,s=r.from(i);n(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=c:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;return(await t(this.networkServiceUrl,s)).circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),i=r.from(e);n(this.featureServiceUrl,this.gdbVersion||null)?i.sessionId=c:i.sessionId=null,i.domainNetworkName=this.telecomDomainNetworkName,i.resultTypes=["name"],i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment;return(await t(this.networkServiceUrl,i)).circuitNames||[]}};e([i({constructOnly:!0})],u.prototype,"telecomDomainNetwork",void 0),e([i({type:a,constructOnly:!0})],u.prototype,"utilityNetwork",void 0),e([i()],u.prototype,"networkServiceUrl",null),e([i()],u.prototype,"featureServiceUrl",null),e([i()],u.prototype,"gdbVersion",null),e([i()],u.prototype,"historicMoment",null),e([i()],u.prototype,"telecomDomainNetworkName",null),u=e([s("esri.networks.CircuitManager")],u);const l=u;export{l as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as n}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import l from"./support/Circuit.js";import{isVersionInEditSession as u,currentSessionId as d,isSafeToEditVersion as m}from"../versionManagement/support/versionManagementUtils.js";let h=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l({circuitManager:this,name:e,sections:t?new Map:null})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async verify(e,t=!1){const[{verifyCircuits:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=r.from({circuits:e,synthesizeGeometries:t,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);return o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0}),c.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=Array.isArray(e)?{circuits:e}:e,s=i.from(r);u(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=d:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?r.sessionId=d:r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.resultTypes=["name"],r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;return(await t(this.networkServiceUrl,r)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}};e([s()],h.prototype,"_circuitTable",void 0),e([s()],h.prototype,"_circuitSectionTable",void 0),e([s()],h.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],h.prototype,"telecomDomainNetwork",void 0),e([s({type:a,constructOnly:!0})],h.prototype,"utilityNetwork",void 0),e([s()],h.prototype,"networkServiceUrl",null),e([s()],h.prototype,"featureServiceUrl",null),e([s()],h.prototype,"gdbVersion",null),e([s()],h.prototype,"historicMoment",null),e([s()],h.prototype,"telecomDomainNetworkName",null),e([s()],h.prototype,"circuitTable",null),e([s()],h.prototype,"circuitSectionTable",null),e([s()],h.prototype,"subcircuitTable",null),h=e([o("esri.networks.CircuitManager")],h);const b=h;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 t}from"tslib";import{isSome as o}from"../../core/arrayUtils.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import{isSome as o}from"../../core/arrayUtils.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{watch as s,initial as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"./CircuitLocation.js";import u from"./CircuitSection.js";import d from"./Subcircuit.js";import{CircuitTypeKebabDict as h,CircuitStatusKebabDict as y}from"./typeUtils.js";let m=class extends e{constructor(t){super(t),this._sectionIdLookup=new Map,this.attributes=null,this.circuitManager=null,this.circuitType="physical",this.globalId=null,this.isDeleted=!1,this.lastExportedTime=null,this.lastVerifiedTime=null,this.name=null,this.sections=null,this.startLocation=null,this.status="dirty",this.stopLocation=null,this.subcircuits=[]}initialize(){this.addHandles([s(()=>this.sections,t=>{this._sectionIdLookup.clear(),null!=t&&Array.from(t.keys()).forEach(t=>this._sectionIdLookup.set(t.sectionId,t))},r)])}normalizeCtorArgs(t){if(void 0===t)return t;const{name:o,startLocation:e,stopLocation:s,sections:r}=t;return(e||s)&&r?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate Circuit with both start/stop locations and sections.",`Circuit '${o}' was defaulted to having sections only.`)):(e&&!s||!e&&s)&&!r&&i.getLogger(this).warn(`Non-sectioned circuit '${o}' must have both start and stop locations.`,"Create/alter operations involving this circuit will fail unless both are populated."),t}get isSectioned(){return null==this.startLocation&&null==this.stopLocation&&null!=this.sections}readSections(t,e){const{sectionOrder:i,sections:s}=e,r=new Map;if(null==s)return null;if(this._sectionIdLookup.clear(),s.forEach(t=>this._sectionIdLookup.set(t.sectionId,u.fromJSON(t))),null==i)return Array.from(this._sectionIdLookup.values()).forEach(t=>r.set(t,[])),r;for(const[n,a]of Object.entries(i)){const t=Number(n),e=this._sectionIdLookup.get(t);if(null==e)continue;const i=a.map(t=>this._sectionIdLookup.get(t)).filter(o);r.set(e,i)}return r}writeSections(t,o){const e={},i=[];t?.forEach((t,o)=>{const s=o.sectionId.toString(),r=t.map(t=>t.sectionId);e[s]=r,i.push(o.toJSON())}),o.sectionOrder=e,o.sections=i}getSectionById(t){return this._sectionIdLookup.get(t)??null}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.sections=null}setSections(t){this.sections=t,this.startLocation=null,this.stopLocation=null}getAttribute(t){return this.attributes?.[t]}setAttribute(t,o){this.attributes?this.attributes[t]=o:this.attributes={[t]:o}}};t([n({json:{write:{allowNull:!0,writer:(t,o)=>o.attributes=t??{}}}})],m.prototype,"attributes",void 0),t([n()],m.prototype,"circuitManager",void 0),t([n({type:h.apiValues,json:{type:h.jsonValues,read:h.read,write:h.write}})],m.prototype,"circuitType",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"globalId",void 0),t([n({type:Boolean,readOnly:!0})],m.prototype,"isDeleted",void 0),t([n({type:Boolean,json:{write:!0},readOnly:!0})],m.prototype,"isSectioned",null),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastExportedTime",void 0),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastVerifiedTime",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"name",void 0),t([n({json:{read:{source:["sectionOrder","sections"]},write:!0}})],m.prototype,"sections",void 0),t([a("sections")],m.prototype,"readSections",null),t([p("sections")],m.prototype,"writeSections",null),t([n({type:l,json:{write:!0}})],m.prototype,"startLocation",void 0),t([n({type:y.apiValues,json:{type:y.jsonValues,read:y.read}})],m.prototype,"status",void 0),t([n({type:l,json:{write:!0}})],m.prototype,"stopLocation",void 0),t([n({type:[d],json:{write:!0}})],m.prototype,"subcircuits",void 0),m=t([c("esri.networks.support.Circuit")],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 t}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import e from"./CircuitLocation.js";import a from"./CircuitPath.js";import c from"./Subcircuit.js";import{CircuitSectionRoleKebabDict as n,CircuitTypeKebabDict as p}from"./typeUtils.js";let u=class extends o{constructor(t){super(t),this.sectionId=null,this.role="start-and-end",this.sectionType="physical",this.startLocation=null,this.stopLocation=null,this.subcircuit=null,this.path=null}normalizeCtorArgs(t){if(void 0===t)return t;const{sectionId:o,startLocation:r,stopLocation:s,subcircuit:e}=t;return(r||s)&&e?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate CircuitSection with both start/stop locations and subcircuit.",`CircuitSection with ID '${o}' was defaulted to having a subcircuit only.`)):(r&&!s||!r&&s)&&!e&&i.getLogger(this).warn(`CircuitSection with ID '${o}' must have both start and stop locations.`,"Create/alter operations involving this section will fail unless both are populated."),t}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.subcircuit=null}setSubcircuit(t){this.subcircuit=t,this.startLocation=null,this.stopLocation=null}};t([r({type:Number,json:{write:!0}})],u.prototype,"sectionId",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read},readOnly:!0})],u.prototype,"role",void 0),t([r({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"sectionType",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"startLocation",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"stopLocation",void 0),t([r({type:c,json:{write:!0}})],u.prototype,"subcircuit",void 0),t([r({type:a,readOnly:!0})],u.prototype,"path",void 0),u=t([s("esri.networks.support.CircuitSection")],u);
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import e from"./CircuitLocation.js";import a from"./CircuitPath.js";import c from"./Subcircuit.js";import{CircuitSectionRoleKebabDict as n,CircuitTypeKebabDict as p}from"./typeUtils.js";let u=class extends o{constructor(t){super(t),this.sectionId=null,this.role="start-and-end",this.sectionType="physical",this.startLocation=null,this.stopLocation=null,this.subcircuit=null,this.path=null}normalizeCtorArgs(t){if(void 0===t)return t;const{sectionId:o,startLocation:r,stopLocation:s,subcircuit:e}=t;return(r||s)&&e?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate CircuitSection with both start/stop locations and subcircuit.",`CircuitSection with ID '${o}' was defaulted to having a subcircuit only.`)):(r&&!s||!r&&s)&&!e&&i.getLogger(this).warn(`CircuitSection with ID '${o}' must have both start and stop locations.`,"Create/alter operations involving this section will fail unless both are populated."),t}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.subcircuit=null}setSubcircuit(t){this.subcircuit=t,this.startLocation=null,this.stopLocation=null}};t([r({type:Number,json:{write:!0}})],u.prototype,"sectionId",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read},readOnly:!0})],u.prototype,"role",void 0),t([r({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"sectionType",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"startLocation",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"stopLocation",void 0),t([r({type:c,json:{write:!0}})],u.prototype,"subcircuit",void 0),t([r({type:a,readOnly:!0})],u.prototype,"path",void 0),u=t([s("esri.networks.support.CircuitSection")],u);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{__decorate as
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.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 e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(t){super(t),this.name=null,this.globalId=null,this.providerId=null,this.consumerId=null,this.isReserved=!1,this.attributes=null}getAttribute(t){return this.attributes?.[t]}setAttribute(t,r){this.attributes?this.attributes[t]=r:this.attributes={[t]:r}}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],s.prototype,"globalId",void 0),t([o({type:String})],s.prototype,"providerId",void 0),t([o({type:String})],s.prototype,"consumerId",void 0),t([o({type:Boolean,json:{write:!0}})],s.prototype,"isReserved",void 0),t([o({json:{write:{allowNull:!0,writer:(t,r)=>r.attributes=t??{}}}})],s.prototype,"attributes",void 0),s=t([e("esri.networks.support.Subcircuit")],s);const i=s;export{i as default};
|
package/package.json
CHANGED
package/support/arcadeUtils.js
CHANGED
|
@@ -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{p as e,c as r,e as n,a as t,r as o,l as a,b as l,d as s,f as u,s as c,g as f,h as p}from"../chunks/arcade.js";export{i as arcade}from"../chunks/arcade.js";import{ArcadeDate as m}from"../arcade/ArcadeDate.js";import{toSymbolId as d}from"../arcade/arcadeEnvironment.js";import y from"../arcade/Dictionary.js";import v
|
|
5
|
+
import{p as e,c as r,e as n,a as t,r as o,l as a,b as l,d as s,f as u,s as c,g as f,h as p}from"../chunks/arcade.js";export{i as arcade}from"../chunks/arcade.js";import{ArcadeDate as m}from"../arcade/ArcadeDate.js";import{toSymbolId as d}from"../arcade/arcadeEnvironment.js";import y from"../arcade/Dictionary.js";import{Feature as v}from"../arcade/Feature.js";import{j as x,e as g,k as j,m as S,l as h}from"../chunks/languageUtils.js";export{Pixel}from"../arcade/Pixel.js";export{Voxel}from"../arcade/Voxel.js";import{clone as w}from"../core/lang.js";import{DateOnly as A}from"../core/sql/DateOnly.js";import{TimeOnly as $}from"../core/sql/TimeOnly.js";import b from"../geometry/Extent.js";import E from"../geometry/Multipoint.js";import F from"../geometry/Point.js";import P from"../geometry/Polygon.js";import C from"../geometry/Polyline.js";import{isArray as M,isString as _,isBoolean as D,isNumber as I}from"./guards.js";const R={vars:{$feature:"any",$view:"any"}};function T(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function k(e){return null==e?null:M(e)||x(e)?"array":g(e)?"date":_(e)?"text":D(e)?"boolean":I(e)?"number":e instanceof y?"dictionary":j(e)?"feature":e instanceof F?"point":e instanceof P?"polygon":e instanceof C?"polyline":e instanceof E?"multipoint":e instanceof b?"extent":e instanceof A?"dateOnly":e instanceof $?"time":S(e)?"featureSet":h(e)?"featureSetCollection":null}function z(r){if(!r)return null;try{return e(r)}catch(n){}return null}function J(e,n){const t="string"==typeof e?z(e):e;if(!t)return null;try{return n=n||w(R),r(t,n)}catch(o){}return null}function V(e,r,n){return{vars:{$feature:null==e?new v:v.createFromGraphic(e,n),$view:r?.view},spatialReference:r?.sr,timeZone:n??null}}function O(e,r,n){return v.createFromGraphicLikeObject(r,e,n,null)}function Z(e,r){null!=e.vars&&(e.vars.$feature=r)}function q(e,r){let t;try{t=n(e,r)}catch(o){t=null}return t}function G(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function L(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}const N=["$feature","$aggregatedFeatures","$voxel"].map(e=>d(e));function U(e,r){if(!e)return[];const n="string"==typeof e?z(e):e;if(!n)return[];const o=new Map;if(Array.isArray(r)||null==r)for(const t of N)o.set(t,r);else for(const[t,i]of r)o.set(d(t),i);const a=t(n).flatMap(({varId:e,memberNamePattern:r})=>{if(!o.has(e))return[];if(r.includes("*")){const n=o.get(e);if(null==n)return[];const t=new RegExp(`^${r.split(/\*+/).map(T).join(".*")}$`,"i");return n.filter(e=>t.test(e))}return r.toLowerCase()});return[...new Set(a.sort())]}function B(e){return o(e,"$view")}function H(e,r){return!!e&&o(e,r)}function K(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;let r,n;const{timeProperties:t,timeZone:o}=e;if(null!=t){const{currentStart:e,currentEnd:a}=t;null!=o?(r=null!=e?m.dateJSAndZoneToArcadeDate(e,o):null,n=null!=a?m.dateJSAndZoneToArcadeDate(a,o):null):(r=null!=e?m.dateJSToArcadeDate(e):null,n=null!=a?m.dateJSToArcadeDate(a):null)}return{view:e.viewingMode&&null!=e.scale?new y({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:null!=r||null!=n?new y({__proto__:null,currentStart:r,currentEnd:n,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function Q({url:e,spatialReference:r,lrucache:n,interceptor:t}){const o=u();return o?o.createFeatureSetCollectionFromService(e,r,n,t):null}function W({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:o,interceptor:a}){if(null===e)return null;const i=u();return i?i.constructFeatureSet(e,r,n,t??!0,o,a):null}function X(e){if(null===e?.map)return null;const r=u();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Y(e,r){return y.convertJsonToArcade(e,r)}function ee(e,r,n=[]){return a(e,r,n)}function re(){return l()}function ne(){return s()}function te(e){return"type"in e&&("class-breaks"===e.type||"dictionary"===e.type||"dot-density"===e.type||"pie-chart"===e.type||"simple"===e.type||"unique-value"===e.type)}function oe(e){return"esri.layers.support.LabelClass"===e.declaredClass}function ae(e){return"esri.PopupTemplate"===e.declaredClass}function ie(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(te(n)){if("dot-density"===n.type){const e=n.attributes?.some(e=>r(e.valueExpression));if(e)return e}const e=n.visualVariables,t=!!e&&e.some(e=>{let n=r(e.valueExpression);return"size"===e.type&&(pe(e.minSize)&&(n=n||r(e.minSize.valueExpression)),pe(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n});return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(oe(n)){const e=n.labelExpressionInfo?.expression;return!(!e||!r(e))||!1}return!!ae(n)&&(!!n.expressionInfos&&n.expressionInfos.some(e=>r(e.expression))||Array.isArray(n.content)&&n.content.some(e=>"expression"===e.type&&r(e.expressionInfo?.expression)))}function le(e){const r=z(e);return!!r&&f(r)}function se(e){return ie(e,le)}function ue(e){const r=z(e);return!!r&&p(r)}function ce(e){return ie(e,ue)}function fe(e){return ie(e,e=>{const r=z(e);return!!r&&c(r)})}function pe(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}export{y as Dictionary,v as arcadeFeature,W as convertFeatureLayerToFeatureSet,Y as convertJsonToArcade,X as convertMapToFeatureSetCollection,Q as convertServiceUrlToWorkspace,V as createExecContext,O as createFeature,J as createFunction,z as createSyntaxTree,B as dependsOnView,ne as enableFeatureSetOperations,re as enableGeometryOperations,q as evalSyntaxTree,L as executeAsyncFunction,G as executeFunction,U as extractFieldNames,k as getArcadeType,K as getViewInfo,se as hasGeometryFunctions,ce as hasGeometryOperations,H as hasVariable,ee as loadScriptDependencies,fe as requiresTrack,Z as updateExecContext};
|
package/support/modeUtils.js
CHANGED
|
@@ -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{unsafeGetCalciteModeName as t}from"@arcgis/toolkit/dom";const o="calcite-mode-";function r(o){return t(o??document.body)}function
|
|
5
|
+
import{unsafeGetCalciteModeName as t}from"@arcgis/toolkit/dom";const o="--esri-calcite-mode-name";function e(){const t=getComputedStyle(document.body).getPropertyValue(o).replaceAll(/\W/g,"").toLowerCase();return"dark"===t||"light"===t?t:void 0}const r="calcite-mode-";function n(o){return e()??t(o??document.body)}function c(t){return"dark"===n(t)}function i(t){return`${r}${n(t)}`}function s(t){const o=i(t);a(t),t.classList.add(o)}function a(t){Array.from(t.classList).forEach(o=>{o.startsWith(r)&&t.classList.remove(o)})}export{i as getCalciteModeClass,c as isDarkMode,o as modeNameCustomCSSProp,s as setCalciteModeClass};
|
package/support/revision.js
CHANGED
|
@@ -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
|
-
const
|
|
5
|
+
const c="20250906",e="3cec4ae1b9b8af3c59c378372296bd6ae364be1f";export{c as buildDate,e as commitHash};
|
|
@@ -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"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.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"../../../geometry/support/spatialReferenceUtils.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/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.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/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.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"./graphics/GraphicsView2D.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"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new C(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class C{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const P=G;export{P as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.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"../../../geometry/support/spatialReferenceUtils.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/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.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/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.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"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.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/SpatialReference.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new P(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class P{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;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{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"../../../symbols/cim/defaultCIMValues.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/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.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/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.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 G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const I=[0,0];let P=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:S.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}),G(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 T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(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=V(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()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const v=P;export{v 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"../../../symbols/cim/defaultCIMValues.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/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.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/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.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/normalizeUtils.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/SpatialReference.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.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 G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const I=[0,0];let P=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:S.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}),G(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 T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(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=V(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()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const v=P;export{v as default};
|