@arcgis/core 5.2.0-next.155 → 5.2.0-next.156
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/0590857215c547e63b51.js +1 -0
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/0cb50bc2b2125c5fedf2.js +1 -0
- package/assets/esri/core/workers/chunks/1201b8c5852830836eac.js +1 -0
- package/assets/esri/core/workers/chunks/129e04d24ced77c9bb6d.js +1 -0
- package/assets/esri/core/workers/chunks/15e1117a706a98b17ad5.js +1 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/168a523bdc3653081f8a.js +1 -0
- package/assets/esri/core/workers/chunks/{6f4e6022a52de0c54aab.js → 172cfeb5f415e4662432.js} +1 -1
- package/assets/esri/core/workers/chunks/1aa4f5394a596e544aeb.js +1 -0
- package/assets/esri/core/workers/chunks/22b01fe31bbf0bdc48db.js +1 -0
- package/assets/esri/core/workers/chunks/27c2da2e779def2ee08b.js +1 -0
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a226b69d38c72a47a08.js → 3914d96147642a9d4b01.js} +1 -1
- package/assets/esri/core/workers/chunks/{731018c0deffc41ffc97.js → 3e3e076fa5e8d5d5f33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{96b6ea199ad949fef17c.js → 43cf862577bf37344ff4.js} +1 -1
- package/assets/esri/core/workers/chunks/4932773663469919d10a.js +1 -0
- package/assets/esri/core/workers/chunks/4996869b9cbd8c8ddcfa.js +1 -0
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/{eb815148ae65388dd733.js → 544070198d2ca556103a.js} +1 -1
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +1 -0
- package/assets/esri/core/workers/chunks/{320e5942a098dd104366.js → 74137ffec5265628c33b.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/7711ae5612f685078fc8.js +1 -0
- package/assets/esri/core/workers/chunks/{5116b569a8dbda4910c8.js → 784a2fba3e18286958d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{f6e62d2d279a328cbed7.js → 7bcedf479b07a4b4a234.js} +1 -1
- package/assets/esri/core/workers/chunks/842893e75696428d536f.js +1 -0
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/ace2e0a9d9013edd8624.js +1 -0
- package/assets/esri/core/workers/chunks/b1d5d236d5268fcbc74b.js +1 -0
- package/assets/esri/core/workers/chunks/{49ff0985fb307ac193ab.js → b573df59391ca41ee5a7.js} +1 -1
- package/assets/esri/core/workers/chunks/bac8c32665e982896ecc.js +1 -0
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c469b43089767176ced.js → c5ed67fdf261cbb1624b.js} +1 -1
- package/assets/esri/core/workers/chunks/d9b1aed88b205689cec6.js +1 -0
- package/assets/esri/core/workers/chunks/{c598b22f78ccc57f9d6d.js → dfd2dc5cdc97ffba8926.js} +1 -1
- package/assets/esri/core/workers/chunks/e1b7806ab3e1967b15f0.js +1 -0
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/{c62738f84c914671b143.js → f4a7aa3cdbc0c429c359.js} +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/FeatureLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/package.json +2 -2
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +0 -1
- package/assets/esri/core/workers/chunks/19743dedaa40446259ec.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/251921cd10ecfbc89451.js +0 -1
- package/assets/esri/core/workers/chunks/3252b1fae363bb0129a0.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/50036a323c2e7f155311.js +0 -1
- package/assets/esri/core/workers/chunks/55dcbf296d8d0092e473.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- package/assets/esri/core/workers/chunks/60d3056a31d982c9cad0.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +0 -1
- package/assets/esri/core/workers/chunks/6b43bb78f9839ed43135.js +0 -1
- package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/88c74f3316f1fc253207.js +0 -1
- package/assets/esri/core/workers/chunks/912080c90b5cc2e817cf.js +0 -1
- package/assets/esri/core/workers/chunks/a97d85774f9a417202df.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +0 -1
- package/assets/esri/core/workers/chunks/b6ba66a05030d3815dfd.js +0 -1
- package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +0 -1
- package/assets/esri/core/workers/chunks/bf69024804ac51c8f733.js +0 -1
- package/assets/esri/core/workers/chunks/c1254cd131a62750ff6f.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
package/config.d.ts
CHANGED
|
@@ -373,6 +373,8 @@ export interface RequestConfig {
|
|
|
373
373
|
* Maximum number of characters allowed in the URL for HTTP GET requests made by
|
|
374
374
|
* [request](https://developers.arcgis.com/javascript/latest/references/core/request/). If this limit is exceeded, HTTP POST method will be used.
|
|
375
375
|
*
|
|
376
|
+
* Set to `0` to skip URL-length checks.
|
|
377
|
+
*
|
|
376
378
|
* @default 2000
|
|
377
379
|
*/
|
|
378
380
|
maxUrlLength: number;
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.156/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
|
package/core/ObjectPool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
|
|
2
|
+
import has from"./has.js";const e=()=>!!has(`esri-tests-disable-memory-pools`);function t(e){return e?.release&&typeof e.release==`function`}function n(e){return e?.acquire&&typeof e.acquire==`function`}class r{constructor(e,t,n,r=1,i=0){this._creator=e,this._acquireFunction=t,this._releaseFunction=n,this.allocationSize=r,this._pool=Array(i),this._initialSize=i;for(let e=0;e<i;e++)this._pool[e]=this._creator();this.allocationSize=Math.max(r,1)}destroy(){this.prune(0)}acquire(...t){let r;if(e())r=this._creator();else{if(this._pool.length===0){let e=this.allocationSize;for(let t=0;t<e;t++)this._pool[t]=this._creator()}r=this._pool.pop()}return this._acquireFunction?this._acquireFunction(r,...t):n(r)&&r.acquire(...t),r}release(n){n&&!e()&&(this._releaseFunction?this._releaseFunction(n):t(n)&&n.release(),this._pool.push(n))}prune(e=this._initialSize){if(!(e>=this._pool.length)){for(let t=e;t<this._pool.length;++t){let e=this._pool[t];this._dispose(e)}this._pool.length=e}}_dispose(e){e.dispose&&typeof e.dispose==`function`&&e.dispose()}}export{r as default};
|
package/core/PooledArray.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{PositionHint as e,indexOf as t,removeUnorderedMany as n}from"./arrayUtils.js";import{toConst as r}from"./compilerUtils.js";import{sort as i,iterableSort as a}from"./heapSort.js";class o{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new e,t&&(t.initialSize&&(this.data=Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),t.deallocator!==void 0&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>s(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){let t=[];for(let n=0;n<this._length;n++){let r=this.data[n];e(r)&&t.push(r)}return t}at(e){if(e=Math.trunc(e)||0,e<0&&(e+=this._length),!(e<0||e>=this._length))return this.data[e]}includes(e,t){let n=this.data.indexOf(e,t);return n!==-1&&n<this.length}get length(){return this._length}set length(e){if(e>this._length){if(this._allocator){for(;this._length<e;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=e;return}if(this._deallocator)for(let t=e;t<this._length;++t)this.data[t]=this._deallocator(this.data[t]);this._length=e,this._shrink()}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(e){this.data[this._length++]=e}pushArray(e,t=e.length){for(let n=0;n<t;n++)this.data[this._length++]=e[n]}pushAll(e){for(let t of e)this.data[this._length++]=t}fill(e,t){for(let n=0;n<t;n++)this.data[this._length++]=e}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));let e=this.data[this._length];return++this._length,e}unshift(e){this.data.unshift(e),this._length++,s(this)}pop(){if(this.length===0)return;let e=this.data[this.length-1];return--this.length,this._shrink(),e}remove(e){let n=t(this.data,r(e),this.length,this._hint);if(n!==-1)return this.data.splice(n,1),--this.length,e}removeUnordered(e){return this.removeUnorderedIndex(t(this.data,r(e),this.length,this._hint))}removeUnorderedIndex(e){if(!(e>=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=n(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;let n=this.data[e];this.data[e]=this.data[t],this.data[t]=n}sort(e){i(this.data,0,this.length,e)}iterableSort(e){return a(this.data,0,this.length,e)}some(e,t){for(let n=0;n<this.length;++n)if(e.call(t,this.data[n],n,this.data))return!0;return!1}find(e,t){let{data:n,length:r}=this;for(let i=0;i<r;++i)if(e.call(t,n[i]))return n[i]}filterInPlace(e,t){let n=0;for(let r=0;r<this._length;++r){let i=this.data[r];e.call(t,i,r,this.data)&&(this.data[r]=this.data[n],this.data[n]=i,n++)}if(this._deallocator)for(let e=n;e<this._length;e++)this.data[e]=this._deallocator(this.data[e]);return this._length=n,this._shrink(),this}forAll(e,t){let{data:n,length:r}=this;for(let i=0;i<r;++i)e.call(t,n[i],i,n)}forEach(e,t){this.data.slice(0,this.length).forEach(e,t)}map(e,t){let n=Array(this.length);for(let r=0;r<this.length;++r)n[r]=e.call(t,this.data[r],r,this.data);return n}reduce(e,t){let n=t;for(let t=0;t<this.length;++t)n=e(n,this.data[t],t,this.data);return n}has(e){let t=this.length,n=this.data;for(let r=0;r<t;++r)if(n[r]===e)return!0;return!1}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.data[e]}}function s(e){e.data.length>1.5*e.length&&(e.data.length=Math.floor(e.length*1.1))}export{o as default};
|
|
2
|
+
import{PositionHint as e,indexOf as t,removeUnorderedMany as n}from"./arrayUtils.js";import{toConst as r}from"./compilerUtils.js";import{sort as i,iterableSort as a}from"./heapSort.js";class o{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new e,t&&(t.initialSize&&(this.data=Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),t.deallocator!==void 0&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>s(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){let t=[];for(let n=0;n<this._length;n++){let r=this.data[n];e(r)&&t.push(r)}return t}at(e){if(e=Math.trunc(e)||0,e<0&&(e+=this._length),!(e<0||e>=this._length))return this.data[e]}includes(e,t){let n=this.data.indexOf(e,t);return n!==-1&&n<this.length}get length(){return this._length}set length(e){if(e>this._length){if(this._allocator){for(;this._length<e;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=e;return}if(this._deallocator)for(let t=e;t<this._length;++t)this.data[t]=this._deallocator(this.data[t]);this._length=e,this._shrink()}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(e){this.data[this._length++]=e}pushArray(e,t=e.length){for(let n=0;n<t;n++)this.data[this._length++]=e[n]}pushAll(e){for(let t of e)this.data[this._length++]=t}fill(e,t){for(let n=0;n<t;n++)this.data[this._length++]=e}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));let e=this.data[this._length];return++this._length,e}unshift(e){this.data.unshift(e),this._length++,s(this)}pop(){if(this.length===0)return;let e=this.data[this.length-1];return--this.length,this._shrink(),e}remove(e){let n=t(this.data,r(e),this.length,this._hint);if(n!==-1)return this.data.splice(n,1),--this.length,e}removeUnordered(e){return this.removeUnorderedIndex(t(this.data,r(e),this.length,this._hint))}removeUnorderedIndex(e){if(!(e>=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=n(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;let n=this.data[e];this.data[e]=this.data[t],this.data[t]=n}sort(e){i(this.data,0,this.length,e)}stableSort(e){let t=this.toArray().sort(e);for(let e=0;e<t.length;++e)this.data[e]=t[e]}iterableSort(e){return a(this.data,0,this.length,e)}some(e,t){for(let n=0;n<this.length;++n)if(e.call(t,this.data[n],n,this.data))return!0;return!1}find(e,t){let{data:n,length:r}=this;for(let i=0;i<r;++i)if(e.call(t,n[i]))return n[i]}filterInPlace(e,t){let n=0;for(let r=0;r<this._length;++r){let i=this.data[r];e.call(t,i,r,this.data)&&(this.data[r]=this.data[n],this.data[n]=i,n++)}if(this._deallocator)for(let e=n;e<this._length;e++)this.data[e]=this._deallocator(this.data[e]);return this._length=n,this._shrink(),this}forAll(e,t){let{data:n,length:r}=this;for(let i=0;i<r;++i)e.call(t,n[i],i,n)}forEach(e,t){this.data.slice(0,this.length).forEach(e,t)}map(e,t){let n=Array(this.length);for(let r=0;r<this.length;++r)n[r]=e.call(t,this.data[r],r,this.data);return n}reduce(e,t){let n=t;for(let t=0;t<this.length;++t)n=e(n,this.data[t],t,this.data);return n}has(e){let t=this.length,n=this.data;for(let r=0;r<t;++r)if(n[r]===e)return!0;return!1}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.data[e]}}function s(e){e.data.length>1.5*e.length&&(e.data.length=Math.floor(e.length*1.1))}export{o as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{TrackingTarget as e}from"./TrackingTarget.js";class t extends e{constructor(e){super(new n(e)),this._observer&&r.register(this,new WeakRef(this._observer),this)}destroy(){this._observer&&r.unregister(this
|
|
2
|
+
import{TrackingTarget as e}from"./TrackingTarget.js";class t extends e{constructor(e){super(new n(e)),this._observer&&r.register(this,new WeakRef(this._observer),this)}destroy(){this._observer&&r.unregister(this),this.accessed?.clear(),this.clear(),this._observer?.destroy()}}class n{constructor(e){this._notify=e,this._invalidCount=0,this.destroyed=!1}onInvalidated(){this._invalidCount++}onCommitted(){if(this.destroyed)return;let e=this._invalidCount;if(e===1){this._invalidCount=0,this._notify();return}this._invalidCount=e>0?e-1:0}destroy(){this.destroyed=!0,this._notify=i}}const r=new FinalizationRegistry(e=>{e.deref()?.destroy()});function i(){}export{t as SimpleTrackingTarget};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../core/has.js";import e from"../../../core/PooledArray.js";class
|
|
2
|
+
import has from"../../../core/has.js";import e from"../../../core/PooledArray.js";const t=()=>!!has(`esri-tests-disable-memory-pools`);class n{constructor(e,t){this._factoryCallback=e,this._lengthCallback=t,this._pool=new Map}acquire(e){if(!t()){let t=this._pool.get(e);if(t&&t.length!==0)return t.pop()}try{return this._factoryCallback(e)}catch(e){throw e}}release(n){if(t())return;let r=this._lengthCallback(n),i=this._pool.get(r);i||(i=new e({shrink:!0}),this._pool.set(r,i)),i.push(n)}clear(){this._pool.clear()}get test(){}}export{n as BufferPool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{equals as e}from"../../core/arrayUtils.js";import{curvesAreSameType as t}from"./curves/curveUtils.js";function n(e){if(!e)return null;if(Array.isArray(e))return e;let t=e.hasZ,n=e.hasM;if(e.type===`point`)return n&&t?[e.x,e.y,e.z,e.m]:t?[e.x,e.y,e.z]:n?[e.x,e.y,e.m]:[e.x,e.y];if(e.type===`polygon`)return e.rings.slice();if(e.type===`polyline`)return e.paths.slice();if(e.type===`multipoint`)return e.points.map(e=>[e]);if(e.type===`extent`){let t=e.clone().normalize();if(!t)return null;let n=!1,r=!1;return t.forEach(e=>{e.hasZ&&(n=!0),e.hasM&&(r=!0)}),t.map(e=>{let t=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]];if(n&&e.hasZ){let n=(e.zmax-e.zmin)*.5;for(let e=0;e<t.length;e++)t[e].push(n)}if(r&&e.hasM){let n=(e.mmax-e.mmin)*.5;for(let e=0;e<t.length;e++)t[e].push(n)}return t})}return null}function r(e,t){let n=t[0]-e[0],r=t[1]-e[1];if(e.length>2&&t.length>2){let i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}return Math.sqrt(n*n+r*r)}function i(e,t,n){let r=e[0]+n*(t[0]-e[0]),i=e[1]+n*(t[1]-e[1]);return e.length>2&&t.length>2?[r,i,e[2]+n*(t[2]-e[2])]:[r,i]}function a(e,t,n,r){return o(e,t,n[r],n[r+1])}function o(e,t,n,r){let[i,a]=t,[o,s]=n,[c,l]=r,u=c-o,d=l-s,f=i-o,p=a-s,m=u*u+d*d,h=f*u+p*d,g=Math.min(1,Math.max(0,h/m));return e[0]=o+u*g,e[1]=s+d*g,e}function s(e,t,n){let r=!1,i=1/0,a,o,s,l;for(n.reset();n.nextPath();)if(n.nextPoint())for(a=n.x,o=n.y;n.nextPoint();)s=n.x,l=n.y,o>t!=l>t&&e<(s-a)*(t-o)/(l-o)+a&&(r=!r),i=Math.min(i,c(e,t,a,o,s,l)),a=s,o=l;return i===0?0:(r?1:-1)*Math.sqrt(i)}function c(e,t,n,r,i,a){let o=n,s=r,c=i-o,l=a-s;if(c!==0||l!==0){let n=((e-o)*c+(t-s)*l)/(c*c+l*l);n>1?(o=i,s=a):n>0&&(o+=c*n,s+=l*n)}return c=e-o,l=t-s,c*c+l*l}function l(e,t){return i(e,t,.5)}function u(e){let t=e.length,n=0;for(let i=0;i<t-1;++i)n+=r(e[i],e[i+1]);return n}function d(e,t){if(t<=0)return e[0];let n=e.length,a=0;for(let o=0;o<n-1;++o){let n=r(e[o],e[o+1]);if(t-a<n){let r=(t-a)/n;return i(e[o],e[o+1],r)}a+=n}return e[n-1]}function f(e,t=0,n=1){let r=0,i=e.length,a=e[0];for(let o=1;o<i;o++){let i=e[o];r+=(i[t]-a[t])*(i[n]+a[n]),a=i}if(p(e)){let i=e[0];r+=(i[t]-a[t])*(i[n]+a[n])}return r>=0}function p(t){let n=t.length;return n>0&&!e(t[0],t[n-1])}function m(e){`rings`in e&&(h(e),g(e))}function h(e){if(`rings`in e)for(let t of e.rings)p(t)&&t.push(t[0].slice())}function g(e){if(!(`rings`in e)||e.rings.length===0||f(e.rings[0]))return!1;for(let t of e.rings)t.reverse();return!0}function _(e,t){return e===t?!0:e.type===t.type?e.type===`point`||e.type===`mesh`||e.type===`extent`?!0:e.type===`multipoint`&&t.type===`multipoint`?e.points.length===t.points.length:e.type===`polyline`&&t.type===`polyline`?e.curvePaths?.length!==t.curvePaths?.length||e.paths.length!==t.paths.length?!1:e.curvePaths?.length?v(e.curvePaths,t.curvePaths,!0):v(e.paths,t.paths,!1):e.type!==`polygon`||t.type!==`polygon`||e.curveRings?.length!==t.curveRings?.length||e.rings.length!==t.rings.length?!1:e.curveRings?.length?v(e.curveRings,t.curveRings,!0):v(e.rings,t.rings,!1):!1}function v(e,n,r){if(e===void 0&&n===void 0)return!0;if(e===void 0||n===void 0)return!1;for(let i=0;i<e.length;i++){if(e[i].length!==n[i].length)return!1;if(r){for(let r=0;r<e[i].length;r++)if(!t(e[i][r],n[i][r]))return!1}}return!0}export{h as closeRings,m as closeRingsAndFixWinding,s as distanceFromPointToPolygon,c as distanceToSegmentSquared,n as geometryToCoordinates,r as getLength,l as getMidpoint,u as getPathLength,d as getPointOnPath,_ as hasCompatibleTopology,f as isClockwise,a as projectPointOnLine,o as projectPointOnLineSeg};
|
|
2
|
+
import{equals as e}from"../../core/arrayUtils.js";import{curvesAreSameType as t}from"./curves/curveUtils.js";function n(e){if(!e)return null;if(Array.isArray(e))return e;let t=e.hasZ,n=e.hasM;if(e.type===`point`)return n&&t?[e.x,e.y,e.z,e.m]:t?[e.x,e.y,e.z]:n?[e.x,e.y,e.m]:[e.x,e.y];if(e.type===`polygon`)return e.rings.slice();if(e.type===`polyline`)return e.paths.slice();if(e.type===`multipoint`)return e.points.map(e=>[e]);if(e.type===`extent`){let t=e.clone().normalize();if(!t)return null;let n=!1,r=!1;return t.forEach(e=>{e.hasZ&&(n=!0),e.hasM&&(r=!0)}),t.map(e=>{let t=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]];if(n&&e.hasZ){let n=(e.zmax-e.zmin)*.5;for(let e=0;e<t.length;e++)t[e].push(n)}if(r&&e.hasM){let n=(e.mmax-e.mmin)*.5;for(let e=0;e<t.length;e++)t[e].push(n)}return t})}return null}function r(e,t){let n=t[0]-e[0],r=t[1]-e[1];if(e.length>2&&t.length>2){let i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}return Math.sqrt(n*n+r*r)}function i(e,t,n){let r=e[0]+n*(t[0]-e[0]),i=e[1]+n*(t[1]-e[1]);return e.length>2&&t.length>2?[r,i,e[2]+n*(t[2]-e[2])]:[r,i]}function a(e,t,n,r){return o(e,t,n[r],n[r+1])}function o(e,t,n,r){let[i,a]=t,[o,s]=n,[c,l]=r,u=c-o,d=l-s,f=i-o,p=a-s,m=u*u+d*d,h=f*u+p*d,g=Math.min(1,Math.max(0,h/m));return e[0]=o+u*g,e[1]=s+d*g,e}function s(e,t,n){let r=!1,i=1/0,a,o,s,l;for(n.reset();n.nextPath();)if(n.nextPoint())for(a=n.x,o=n.y;n.nextPoint();)s=n.x,l=n.y,o>t!=l>t&&e<(s-a)*(t-o)/(l-o)+a&&(r=!r),i=Math.min(i,c(e,t,a,o,s,l)),a=s,o=l;return i===0?0:(r?1:-1)*Math.sqrt(i)}function c(e,t,n,r,i,a){let o=n,s=r,c=i-o,l=a-s;if(c!==0||l!==0){let n=((e-o)*c+(t-s)*l)/(c*c+l*l);n>1?(o=i,s=a):n>0&&(o+=c*n,s+=l*n)}return c=e-o,l=t-s,c*c+l*l}function l(e,t){return i(e,t,.5)}function u(e){let t=e.length,n=0;for(let i=0;i<t-1;++i)n+=r(e[i],e[i+1]);return n}function d(e,t){if(t<=0)return e[0];let n=e.length,a=0;for(let o=0;o<n-1;++o){let n=r(e[o],e[o+1]);if(t-a<n){let r=(t-a)/n;return i(e[o],e[o+1],r)}a+=n}return e[n-1]}function f(e,t=0,n=1){let r=0,i=e.length,a=e[0];for(let o=1;o<i;o++){let i=e[o];r+=(i[t]-a[t])*(i[n]+a[n]),a=i}if(p(e)){let i=e[0];r+=(i[t]-a[t])*(i[n]+a[n])}return r>=0}function p(t){let n=t.length;return n>0&&!e(t[0],t[n-1])}function m(e){`rings`in e&&(h(e),g(e))}function h(e){if(`rings`in e)for(let t of e.rings)p(t)&&t.push(t[0].slice())}function g(e){if(!(`rings`in e)||e.rings.length===0||f(e.rings[0]))return!1;for(let t of e.rings)t.reverse();return!0}function _(e,t){return e===t?!0:e.type===t.type?e.type===`point`||e.type===`mesh`||e.type===`extent`?!0:e.type===`multipoint`&&t.type===`multipoint`?e.points.length===t.points.length:e.type===`polyline`&&t.type===`polyline`?e.curvePaths?.length!==t.curvePaths?.length||e.paths.length!==t.paths.length?!1:e.curvePaths?.length?v(e.curvePaths,t.curvePaths,!0):v(e.paths,t.paths,!1):e.type!==`polygon`||t.type!==`polygon`||e.curveRings?.length!==t.curveRings?.length||e.rings.length!==t.rings.length?!1:e.curveRings?.length?v(e.curveRings,t.curveRings,!0):v(e.rings,t.rings,!1):!1}function v(e,n,r){if(e===void 0&&n===void 0)return!0;if(e===void 0||n===void 0)return!1;for(let i=0;i<e.length;i++){if(e[i].length!==n[i].length)return!1;if(r){for(let r=0;r<e[i].length;r++)if(!t(e[i][r],n[i][r]))return!1}}return!0}export{h as closeRings,m as closeRingsAndFixWinding,s as distanceFromPointToPolygon,c as distanceToSegmentSquared,n as geometryToCoordinates,r as getLength,l as getMidpoint,u as getPathLength,d as getPointOnPath,_ as hasCompatibleTopology,f as isClockwise,a as projectPointOnLine,o as projectPointOnLineSeg,p as ringNeedsClosure};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.156`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
|
|
@@ -17,10 +17,10 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
|
17
17
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
18
18
|
import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
19
19
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
20
|
-
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
21
20
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
22
21
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
23
22
|
import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
23
|
+
import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
|
|
24
24
|
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
|
|
25
25
|
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
|
|
26
26
|
import type { PortalItemProperties } from "../portal/PortalItem.js";
|
|
@@ -457,4 +457,4 @@ export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperc
|
|
|
457
457
|
*/
|
|
458
458
|
saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
|
|
459
459
|
}
|
|
460
|
-
declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof
|
|
460
|
+
declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof ReloadableLayer
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as c,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as f,whenOrAbort as p,onAbort as m}from"../core/promiseUtils.js";import{watch as h,sync as ee}from"../core/reactiveUtils.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/SpatialReference.js";import y from"../graphic/AnnotationFeatureGraphicOrigin.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as T}from"./mixins/DataElementMixin.js";import{EditBusLayer as E}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as D}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as O}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import P from"./support/AnnotationFeatureSublayer.js";import{parse as te,cleanTitle as F,titleFromUrlAndName as I}from"./support/arcgisLayerUrl.js";import{barrierWeight as L,id as R,popupEnabled as z}from"./support/commonProperties.js";import{ensureLayerCredential as B,createQuery as V,getFieldDomain as H,hasDataChanged as U}from"./support/featureLayerUtils.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{fixTimeInfoFields as G}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{createPopupTemplate as J}from"../support/popupUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=`annotation-feature-layer`,Z=W(),Q=o.ofType(P);function ne(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let $=class extends O(T(D(C(N(E(M(j(S(k(A(u(w(x(a(b))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight=`high`,this.elementField=`element`,this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new y(this,null),this.operationalLayerType=`ArcGISAnnotationLayer`,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField=`status`,this.sublayers=new Q,this.sublayerTitleMode=`item-title`,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Annotation Layer`]),this.symbolCollection=null,this.type=`annotation-feature`,this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(h(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ee))}destroy(){this.source?.destroy()}load(e){let t=e?.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(f).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(this.layerId=e)}if(!this.url)throw new s(`${X}:missing-url`,`AnnotationFeatureLayer must be created with a url`);return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new s(`${X}:missing-symbol-collection`,`Invalid service with no symbol collection`)}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>B(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){let n=new Q(t.subtypes.map(({code:e})=>new P({subtypeCode:e})).reverse());if(this.visibleLayers){let e=new Set(this.visibleLayers);n.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return n}readTitleFromService(e,t){let{url:n}=this,r=t.name||te(n)?.title;switch(this.sublayerTitleMode){case`item-title`:if(n)return I(n,r);break;case`item-title-and-service-name`:{let e=this.portalItem?.title;if(e&&e!==r)return e=F(e),r?`${e} - ${F(r)}`:e;break}}return r?F(r):void 0}readTitleFromPortalItem(e){return this.sublayerTitleMode===`item-title`?e:void 0}get visibleLayers(){return this.sublayers.length===0?this._get(`visibleLayers`)??null:Array.from(new Set(ne(this)))}set visibleLayers(e){this._set(`visibleLayers`,e)}createPopupTemplate(e){return J(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{let{default:t}=await p(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,c(m(n,()=>i.cancelLoad())??l()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=V(this);return e.where=this.definitionExpression||`1=1`,e}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return H(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(q.from(e)??n.createQuery(),t);if(r?.features)for(let e of r.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin??this.graphicOrigin,e.layer=e.sourceLayer=this;return r}async queryObjectIds(e,t){let n=await this.load();return n.source.queryObjectIds(q.from(e)??n.createQuery(),t)}async queryFeatureCount(e,t){let n=await this.load();return n.source.queryFeatureCount(q.from(e)??n.createQuery(),t)}async queryExtent(e,t){let n=await this.load();return n.source.queryExtent(q.from(e)??n.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&K(this,e)}async initLayerProperties(e){this._set(`source`,e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:`service`,portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),G(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await Promise.all([t.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(t)}async hasDataChanged(){return U(this)}_verifySource(){if(this.version&&this.version<10.8)throw new s(X+`:unsupported-version`,`The feature service must be version 10.8 or above.`);let e=[`ZOrder`,`AnnotationClassID`,`Element`,`SymbolID`,`Status`],t=e.filter(e=>!this.fieldsIndex.has(e));if(!this.fieldsIndex.has(`FeatureID`)&&!this.fieldsIndex.has(`FeatureGlobalID`)&&t.unshift(`FeatureID`,`FeatureGlobalID`),t.length)throw new s(X+`:missing-fields`,`There are missing fields to operate properly`,{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let t=e.data;return t?(this.applyPreferredHost(t),[...t.layers||[],...t.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id):void 0})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}};n([g({type:v,json:{origins:{service:{read:{source:`sourceSpatialReference`}}}}})],$.prototype,`attributeSpatialReference`,void 0),n([g(L)],$.prototype,`barrierWeight`,void 0),n([g({nonNullable:!0,json:{name:`enableEditing`,write:!0}})],$.prototype,`editingEnabled`,null),n([g({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([g({readOnly:!0})],$.prototype,`elementField`,void 0),n([g({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],$.prototype,`fields`,void 0),n([g(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([g({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([g(R)],$.prototype,`id`,void 0),n([g({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),n([g({type:[`ArcGISAnnotationLayer`],json:{origins:{"portal-item":{name:`layerType`,write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],$.prototype,`operationalLayerType`,void 0),n([g(Z.outFields)],$.prototype,`outFields`,void 0),n([g(z)],$.prototype,`popupEnabled`,void 0),n([g({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([g({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([g({readOnly:!0})],$.prototype,`referenceScale`,void 0),n([g({clonable:!1,readOnly:!0})],$.prototype,`source`,void 0),n([g({readOnly:!0})],$.prototype,`statusField`,void 0),n([g({type:Q,json:{name:`layers`,write:{ignoreOrigin:!0}}})],$.prototype,`sublayers`,void 0),n([Y(`service`,`sublayers`,[`subtypes`])],$.prototype,`readSublayers`,null),n([g({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([g({readOnly:!0})],$.prototype,`symbolCollection`,void 0),n([Y(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),n([Y(`portal-item`,`title`)],$.prototype,`readTitleFromPortalItem`,null),n([g({json:{read:!1},value:`annotation-feature`,readOnly:!0})],$.prototype,`type`,void 0),n([g()],$.prototype,`unplacedAnnotationsVisible`,void 0),n([g({type:[Number]})],$.prototype,`visibleLayers`,null),$=n([_(`esri.layers.AnnotationFeatureLayer`)],$);const re=$;export{re as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as c,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as f,whenOrAbort as p,onAbort as m}from"../core/promiseUtils.js";import{watch as h,sync as ee}from"../core/reactiveUtils.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/SpatialReference.js";import y from"../graphic/AnnotationFeatureGraphicOrigin.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as T}from"./mixins/DataElementMixin.js";import{EditBusLayer as E}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as D}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as k}from"./mixins/PortalLayer.js";import{RefreshableLayer as A}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as j}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import P from"./support/AnnotationFeatureSublayer.js";import{parse as te,cleanTitle as F,titleFromUrlAndName as I}from"./support/arcgisLayerUrl.js";import{barrierWeight as L,id as R,popupEnabled as z}from"./support/commonProperties.js";import{ensureLayerCredential as B,createQuery as V,getFieldDomain as H,hasDataChanged as U}from"./support/featureLayerUtils.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{fixTimeInfoFields as G}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{createPopupTemplate as J}from"../support/popupUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=`annotation-feature-layer`,Z=W(),Q=o.ofType(P);function ne(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let $=class extends j(T(D(C(N(E(M(A(S(O(k(u(w(x(a(b))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight=`high`,this.elementField=`element`,this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new y(this,null),this.operationalLayerType=`ArcGISAnnotationLayer`,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField=`status`,this.sublayers=new Q,this.sublayerTitleMode=`item-title`,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Annotation Layer`]),this.symbolCollection=null,this.type=`annotation-feature`,this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(h(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ee))}destroy(){this.source?.destroy()}load(e){let t=e?.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(f).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(this.layerId=e)}if(!this.url)throw new s(`${X}:missing-url`,`AnnotationFeatureLayer must be created with a url`);return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new s(`${X}:missing-symbol-collection`,`Invalid service with no symbol collection`)}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>B(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){let n=new Q(t.subtypes.map(({code:e})=>new P({subtypeCode:e})).reverse());if(this.visibleLayers){let e=new Set(this.visibleLayers);n.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return n}readTitleFromService(e,t){let{url:n}=this,r=t.name||te(n)?.title;switch(this.sublayerTitleMode){case`item-title`:if(n)return I(n,r);break;case`item-title-and-service-name`:{let e=this.portalItem?.title;if(e&&e!==r)return e=F(e),r?`${e} - ${F(r)}`:e;break}}return r?F(r):void 0}readTitleFromPortalItem(e){return this.sublayerTitleMode===`item-title`?e:void 0}get visibleLayers(){return this.sublayers.length===0?this._get(`visibleLayers`)??null:Array.from(new Set(ne(this)))}set visibleLayers(e){this._set(`visibleLayers`,e)}createPopupTemplate(e){return J(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{let{default:t}=await p(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,c(m(n,()=>i.cancelLoad())??l()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=V(this);return e.where=this.definitionExpression||`1=1`,e}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return H(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(q.from(e)??n.createQuery(),t);if(r?.features)for(let e of r.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin??this.graphicOrigin,e.layer=e.sourceLayer=this;return r}async queryObjectIds(e,t){let n=await this.load();return n.source.queryObjectIds(q.from(e)??n.createQuery(),t)}async queryFeatureCount(e,t){let n=await this.load();return n.source.queryFeatureCount(q.from(e)??n.createQuery(),t)}async queryExtent(e,t){let n=await this.load();return n.source.queryExtent(q.from(e)??n.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&K(this,e)}async initLayerProperties(e){this._set(`source`,e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:`service`,portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),G(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await Promise.all([t.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(t)}async hasDataChanged(){return U(this)}_verifySource(){if(this.version&&this.version<10.8)throw new s(X+`:unsupported-version`,`The feature service must be version 10.8 or above.`);let e=[`ZOrder`,`AnnotationClassID`,`Element`,`SymbolID`,`Status`],t=e.filter(e=>!this.fieldsIndex.has(e));if(!this.fieldsIndex.has(`FeatureID`)&&!this.fieldsIndex.has(`FeatureGlobalID`)&&t.unshift(`FeatureID`,`FeatureGlobalID`),t.length)throw new s(X+`:missing-fields`,`There are missing fields to operate properly`,{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let t=e.data;return t?(this.applyPreferredHost(t),[...t.layers||[],...t.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id):void 0})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}};n([g({type:v,json:{origins:{service:{read:{source:`sourceSpatialReference`}}}}})],$.prototype,`attributeSpatialReference`,void 0),n([g(L)],$.prototype,`barrierWeight`,void 0),n([g({nonNullable:!0,json:{name:`enableEditing`,write:!0}})],$.prototype,`editingEnabled`,null),n([g({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([g({readOnly:!0})],$.prototype,`elementField`,void 0),n([g({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],$.prototype,`fields`,void 0),n([g(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([g({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([g(R)],$.prototype,`id`,void 0),n([g({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),n([g({type:[`ArcGISAnnotationLayer`],json:{origins:{"portal-item":{name:`layerType`,write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],$.prototype,`operationalLayerType`,void 0),n([g(Z.outFields)],$.prototype,`outFields`,void 0),n([g(z)],$.prototype,`popupEnabled`,void 0),n([g({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([g({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([g({readOnly:!0})],$.prototype,`referenceScale`,void 0),n([g({clonable:!1,readOnly:!0})],$.prototype,`source`,void 0),n([g({readOnly:!0})],$.prototype,`statusField`,void 0),n([g({type:Q,json:{name:`layers`,write:{ignoreOrigin:!0}}})],$.prototype,`sublayers`,void 0),n([Y(`service`,`sublayers`,[`subtypes`])],$.prototype,`readSublayers`,null),n([g({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([g({readOnly:!0})],$.prototype,`symbolCollection`,void 0),n([Y(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),n([Y(`portal-item`,`title`)],$.prototype,`readTitleFromPortalItem`,null),n([g({json:{read:!1},value:`annotation-feature`,readOnly:!0})],$.prototype,`type`,void 0),n([g()],$.prototype,`unplacedAnnotationsVisible`,void 0),n([g({type:[Number]})],$.prototype,`visibleLayers`,null),$=n([_(`esri.layers.AnnotationFeatureLayer`)],$);const re=$;export{re as default};
|
package/layers/CatalogLayer.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ import type { CustomParametersMixin, CustomParametersMixinProperties } from "./m
|
|
|
15
15
|
import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
|
|
16
16
|
import type { EditBusLayer } from "./mixins/EditBusLayer.js";
|
|
17
17
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
18
|
-
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
19
18
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
20
19
|
import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
|
|
21
20
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
22
21
|
import type { RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
22
|
+
import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
|
|
23
23
|
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
|
|
24
24
|
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
|
|
25
25
|
import type { RequestOptions } from "../request/types.js";
|
|
@@ -673,4 +673,4 @@ export default class CatalogLayer extends CatalogLayerSuperclass {
|
|
|
673
673
|
*/
|
|
674
674
|
queryObjectIds(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<ObjectId[]>;
|
|
675
675
|
}
|
|
676
|
-
declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer & typeof
|
|
676
|
+
declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer & typeof ReloadableLayer
|
package/layers/CatalogLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{hasSamePortal as s}from"../core/urlUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import f from"./catalog/CatalogFootprintLayer.js";import p from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as m}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as v}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as y}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as x}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as C}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as T}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as D}from"./mixins/TemporalLayer.js";import{legendEnabled as O,id as k}from"./support/commonProperties.js";import{ensureLayerCredential as A,applyEdits as j,getFeatureType as M,hasDataChanged as N,validateBinsQuery as P}from"./support/featureLayerUtils.js";import F from"./support/FeatureType.js";import{defineFieldProperties as I}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as L}from"./support/versionUtils.js";import R from"../portal/Portal.js";import z from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as B}from"../portal/support/urlUtils.js";import V from"../rest/support/Query.js";const H=I();function U(e){return typeof e==`object`&&!!e&&`itemId`in e&&`portalUrl`in e}function W(e){return typeof e==`object`&&!!e&&`url`in e}function G(e){if(e==null)return!0;let t=Object.keys(e);return!t.length||t.length===1&&t[0]===`id`}function K(e,t,n,r){let i=e.write({},r);G(i)||(t[n]=i)}let q=class extends x(v(b(y(g(C(D(E(T(h(S(w(a(_(m(u))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField=`cd_draworder`,this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new f({parent:this}),this.itemNameField=`cd_itemname`,this.itemSourceField=`cd_itemsource`,this.itemTypeField=`cd_itemtype`,this.layers=new n([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField=`cd_maxscale`,this.minScaleField=`cd_minscale`,this.orderBy=null,this.outFields=null,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Catalog Layer`]),this.source=new p({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type=`catalog`,this.typeIdField=null,this.types=null}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(o).then(async()=>{let{url:e,source:n}=this;if(!e)throw new r(`catalog-layer:missing-url`,`Catalog layer must be created with a url`);if(this.layerId==null){let n=await this._fetchFirstValidLayerId(t);if(n!=null)this.layerId=n;else throw new r(`catalog-layer:missing-layerId`,`There is no Catalog Layer in the service`,{service:e})}await n.load({signal:t}),this._initLayerProperties(),this._verifyFields()}).then(()=>A(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(let e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`capabilities`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return j(this,e,t)}async createLayerFromFootprint(e){let t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){let e=new V,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=[`*`];let{timeOffset:n,timeExtent:r}=this;return e.timeExtent=n!=null&&r!=null?r.offset(-n.value,n.unit):r||null,e.where=this.definitionExpression||`1=1`,e}getFeatureType(e){return M(this.types,this.typeIdField,e)}getFieldDomain(e,t){let n=t?.feature,r=this.getFeatureType(n);if(r){let t=r.domains&&r.domains[e];if(t&&t.type!==`inherited`)return t}return this.getField(e)?.domain}async reloadFromService(e){await this.source.reload({signal:e}),this._initLayerProperties(),this._verifyFields()}async hasDataChanged(){return N(this)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(V.from(e)??n.createQuery(),t),i=n.footprintLayer.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n.footprintLayer,e.origin=i;return r}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(V.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(V.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(V.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&L(this,e)}read(e,t){if(super.read(e,t),e){let{footprintLayer:n,dynamicGroupLayer:r}=e;n&&this.footprintLayer.read(n,t),r&&this.dynamicGroupLayer.read(r,t)}}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();P(e,r,`CatalogLayer`);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t);if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this.footprintLayer;return a}_initLayerProperties(){let{portalItem:e,source:t}=this,{sourceJSON:n}=t;n&&(this.sourceJSON=n,this.read(n,{origin:`service`,portalItem:e,portal:e?.portal,url:this.parsedUrl}))}_verifyFields(){let e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new r(`catalog-layer:missing-fields`,`There are missing fields to operate properly`,{requiredFields:e,missingFields:t})}async _fetchFirstValidLayerId(e){let{data:n}=await t(this.url,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e});if(this.applyPreferredHost(n),Array.isArray(n?.layers))return n.layers.find(({type:e})=>e?this.supportedSourceTypes.has(e):!1)?.id}async _createLayer(e){let t=e.getAttribute(this.itemSourceField);if(!t)throw new r(`catalog-layer:item-source-missing`,`The footprint is missing the "${this.itemSourceField}" attribute`);let n=JSON.parse(t);if(U(n)){let{itemId:e,portalUrl:t}=n,r=B(t),a=this.portalItem?.portal,o=R.getDefault(),c,l=!0;a&&s(t,a.url)?c=a:s(t,o.url)?c=o:(c=i(this._portals,r,()=>new R({url:r})),l=!1);let d=await u.fromPortalItem(new z({id:e,portal:c}));return l||await J(d),d}if(W(n))return u.fromArcGISServerUrl({url:n.url});let{default:a}=await import(`./UnsupportedLayer.js`);return new a}_configureLayer(e,t){let n=t.getAttribute(this.itemNameField);n&&(e.title=n);let r=t.getAttribute(this.maxScaleField);r!=null&&`maxScale`in e&&(e.maxScale=r);let i=t.getAttribute(this.minScaleField);i!=null&&`minScale`in e&&(e.minScale=i)}};e([c(O)],q.prototype,`legendEnabled`,void 0),e([c({readOnly:!0})],q.prototype,`createQueryVersion`,null),e([c({readOnly:!0})],q.prototype,`drawOrderField`,void 0),e([c({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],q.prototype,`dynamicGroupLayer`,void 0),e([c({readOnly:!0})],q.prototype,`editingEnabled`,null),e([c({readOnly:!0})],q.prototype,`effectiveEditingEnabled`,null),e([c({json:{origins:{"web-scene":{name:`layerDefinition.elevationInfo`,read:!1,write:!1}}}})],q.prototype,`elevationInfo`,void 0),e([c({...H.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],q.prototype,`fields`,void 0),e([c(H.fieldsIndex)],q.prototype,`fieldsIndex`,void 0),e([c({json:{origins:{"web-scene":{name:`layerDefinition.floorInfo`,read:!1,write:!1}}}})],q.prototype,`floorInfo`,void 0),e([c({type:f,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],q.prototype,`footprintLayer`,void 0),e([c(k)],q.prototype,`id`,void 0),e([c({readOnly:!0})],q.prototype,`itemNameField`,void 0),e([c({readOnly:!0})],q.prototype,`itemSourceField`,void 0),e([c({readOnly:!0})],q.prototype,`itemTypeField`,void 0),e([c({readOnly:!0})],q.prototype,`layers`,void 0),e([c({type:[`show`,`hide`,`hide-children`]})],q.prototype,`listMode`,void 0),e([c({readOnly:!0})],q.prototype,`maxScaleField`,void 0),e([c({readOnly:!0})],q.prototype,`minScaleField`,void 0),e([c({value:`CatalogLayer`,type:[`CatalogLayer`]})],q.prototype,`operationalLayerType`,void 0),e([c({json:{origins:{"web-scene":{name:`layerDefinition.orderBy`,write:!0,read:!0}}}})],q.prototype,`orderBy`,void 0),e([c(H.outFields)],q.prototype,`outFields`,void 0),e([c({readOnly:!0})],q.prototype,`source`,void 0),e([c({json:{read:!1}})],q.prototype,`type`,void 0),e([c({type:String})],q.prototype,`typeIdField`,void 0),e([c({type:[F]})],q.prototype,`types`,void 0),q=e([l(`esri.layers.CatalogLayer`)],q);async function J(e){if(`portalItem`in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type===`group`&&await Promise.allSettled([...e.layers.map(e=>J(e)),...e.tables.map(e=>J(e))])}}const Y=q;export{Y as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{hasSamePortal as s}from"../core/urlUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import f from"./catalog/CatalogFootprintLayer.js";import p from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as m}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as v}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as y}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{OrderedLayer as S}from"./mixins/OrderedLayer.js";import{PortalLayer as C}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as T}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as D}from"./mixins/TemporalLayer.js";import{legendEnabled as O,id as k}from"./support/commonProperties.js";import{ensureLayerCredential as A,applyEdits as j,getFeatureType as M,hasDataChanged as N,validateBinsQuery as P}from"./support/featureLayerUtils.js";import F from"./support/FeatureType.js";import{defineFieldProperties as I}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as L}from"./support/versionUtils.js";import R from"../portal/Portal.js";import z from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as B}from"../portal/support/urlUtils.js";import V from"../rest/support/Query.js";const H=I();function U(e){return typeof e==`object`&&!!e&&`itemId`in e&&`portalUrl`in e}function W(e){return typeof e==`object`&&!!e&&`url`in e}function G(e){if(e==null)return!0;let t=Object.keys(e);return!t.length||t.length===1&&t[0]===`id`}function K(e,t,n,r){let i=e.write({},r);G(i)||(t[n]=i)}let q=class extends T(v(b(y(g(S(D(E(w(h(x(C(a(_(m(u))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField=`cd_draworder`,this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new f({parent:this}),this.itemNameField=`cd_itemname`,this.itemSourceField=`cd_itemsource`,this.itemTypeField=`cd_itemtype`,this.layers=new n([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField=`cd_maxscale`,this.minScaleField=`cd_minscale`,this.orderBy=null,this.outFields=null,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Catalog Layer`]),this.source=new p({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type=`catalog`,this.typeIdField=null,this.types=null}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(o).then(async()=>{let{url:e,source:n}=this;if(!e)throw new r(`catalog-layer:missing-url`,`Catalog layer must be created with a url`);if(this.layerId==null){let n=await this._fetchFirstValidLayerId(t);if(n!=null)this.layerId=n;else throw new r(`catalog-layer:missing-layerId`,`There is no Catalog Layer in the service`,{service:e})}await n.load({signal:t}),this._initLayerProperties(),this._verifyFields()}).then(()=>A(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(let e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`capabilities`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return j(this,e,t)}async createLayerFromFootprint(e){let t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){let e=new V,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=[`*`];let{timeOffset:n,timeExtent:r}=this;return e.timeExtent=n!=null&&r!=null?r.offset(-n.value,n.unit):r||null,e.where=this.definitionExpression||`1=1`,e}getFeatureType(e){return M(this.types,this.typeIdField,e)}getFieldDomain(e,t){let n=t?.feature,r=this.getFeatureType(n);if(r){let t=r.domains&&r.domains[e];if(t&&t.type!==`inherited`)return t}return this.getField(e)?.domain}async reloadFromService(e){await this.source.reload({signal:e}),this._initLayerProperties(),this._verifyFields()}async hasDataChanged(){return N(this)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(V.from(e)??n.createQuery(),t),i=n.footprintLayer.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n.footprintLayer,e.origin=i;return r}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(V.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(V.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(V.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&L(this,e)}read(e,t){if(super.read(e,t),e){let{footprintLayer:n,dynamicGroupLayer:r}=e;n&&this.footprintLayer.read(n,t),r&&this.dynamicGroupLayer.read(r,t)}}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();P(e,r,`CatalogLayer`);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t);if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this.footprintLayer;return a}_initLayerProperties(){let{portalItem:e,source:t}=this,{sourceJSON:n}=t;n&&(this.sourceJSON=n,this.read(n,{origin:`service`,portalItem:e,portal:e?.portal,url:this.parsedUrl}))}_verifyFields(){let e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new r(`catalog-layer:missing-fields`,`There are missing fields to operate properly`,{requiredFields:e,missingFields:t})}async _fetchFirstValidLayerId(e){let{data:n}=await t(this.url,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e});if(this.applyPreferredHost(n),Array.isArray(n?.layers))return n.layers.find(({type:e})=>e?this.supportedSourceTypes.has(e):!1)?.id}async _createLayer(e){let t=e.getAttribute(this.itemSourceField);if(!t)throw new r(`catalog-layer:item-source-missing`,`The footprint is missing the "${this.itemSourceField}" attribute`);let n=JSON.parse(t);if(U(n)){let{itemId:e,portalUrl:t}=n,r=B(t),a=this.portalItem?.portal,o=R.getDefault(),c,l=!0;a&&s(t,a.url)?c=a:s(t,o.url)?c=o:(c=i(this._portals,r,()=>new R({url:r})),l=!1);let d=await u.fromPortalItem(new z({id:e,portal:c}));return l||await J(d),d}if(W(n))return u.fromArcGISServerUrl({url:n.url});let{default:a}=await import(`./UnsupportedLayer.js`);return new a}_configureLayer(e,t){let n=t.getAttribute(this.itemNameField);n&&(e.title=n);let r=t.getAttribute(this.maxScaleField);r!=null&&`maxScale`in e&&(e.maxScale=r);let i=t.getAttribute(this.minScaleField);i!=null&&`minScale`in e&&(e.minScale=i)}};e([c(O)],q.prototype,`legendEnabled`,void 0),e([c({readOnly:!0})],q.prototype,`createQueryVersion`,null),e([c({readOnly:!0})],q.prototype,`drawOrderField`,void 0),e([c({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],q.prototype,`dynamicGroupLayer`,void 0),e([c({readOnly:!0})],q.prototype,`editingEnabled`,null),e([c({readOnly:!0})],q.prototype,`effectiveEditingEnabled`,null),e([c({json:{origins:{"web-scene":{name:`layerDefinition.elevationInfo`,read:!1,write:!1}}}})],q.prototype,`elevationInfo`,void 0),e([c({...H.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],q.prototype,`fields`,void 0),e([c(H.fieldsIndex)],q.prototype,`fieldsIndex`,void 0),e([c({json:{origins:{"web-scene":{name:`layerDefinition.floorInfo`,read:!1,write:!1}}}})],q.prototype,`floorInfo`,void 0),e([c({type:f,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],q.prototype,`footprintLayer`,void 0),e([c(k)],q.prototype,`id`,void 0),e([c({readOnly:!0})],q.prototype,`itemNameField`,void 0),e([c({readOnly:!0})],q.prototype,`itemSourceField`,void 0),e([c({readOnly:!0})],q.prototype,`itemTypeField`,void 0),e([c({readOnly:!0})],q.prototype,`layers`,void 0),e([c({type:[`show`,`hide`,`hide-children`]})],q.prototype,`listMode`,void 0),e([c({readOnly:!0})],q.prototype,`maxScaleField`,void 0),e([c({readOnly:!0})],q.prototype,`minScaleField`,void 0),e([c({value:`CatalogLayer`,type:[`CatalogLayer`]})],q.prototype,`operationalLayerType`,void 0),e([c({json:{origins:{"web-scene":{name:`layerDefinition.orderBy`,write:!0,read:!0}}}})],q.prototype,`orderBy`,void 0),e([c(H.outFields)],q.prototype,`outFields`,void 0),e([c({readOnly:!0})],q.prototype,`source`,void 0),e([c({json:{read:!1}})],q.prototype,`type`,void 0),e([c({type:String})],q.prototype,`typeIdField`,void 0),e([c({type:[F]})],q.prototype,`types`,void 0),q=e([l(`esri.layers.CatalogLayer`)],q);async function J(e){if(`portalItem`in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type===`group`&&await Promise.allSettled([...e.layers.map(e=>J(e)),...e.tables.map(e=>J(e))])}}const Y=q;export{Y as default};
|
|
@@ -14,10 +14,10 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
|
|
|
14
14
|
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
|
|
15
15
|
import type { EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
16
16
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
17
|
-
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
18
17
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
19
18
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
20
19
|
import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
20
|
+
import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
|
|
21
21
|
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
|
|
22
22
|
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
|
|
23
23
|
import type { PortalItemProperties } from "../portal/PortalItem.js";
|
|
@@ -381,4 +381,4 @@ export default class DimensionFeatureLayer extends DimensionFeatureLayerSupercla
|
|
|
381
381
|
*/
|
|
382
382
|
saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
|
|
383
383
|
}
|
|
384
|
-
declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof
|
|
384
|
+
declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof ReloadableLayer
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Error.js";import{disposable as s,makeHandle as c}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as f,onAbort as p}from"../core/promiseUtils.js";import{property as m,subclass as h}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import _ from"../graphic/DimensionFeatureGraphicOrigin.js";import v from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as x}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as C}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as w}from"./mixins/FeatureLayerBase.js";import{
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Error.js";import{disposable as s,makeHandle as c}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as f,onAbort as p}from"../core/promiseUtils.js";import{property as m,subclass as h}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import _ from"../graphic/DimensionFeatureGraphicOrigin.js";import v from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as x}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as C}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as w}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as E}from"./mixins/PortalLayer.js";import{RefreshableLayer as D}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as O}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as k}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as A}from"./mixins/TemporalLayer.js";import{parse as j,cleanTitle as M,titleFromUrlAndName as N}from"./support/arcgisLayerUrl.js";import{barrierWeight as P,id as F,popupEnabled as I}from"./support/commonProperties.js";import{ensureLayerCredential as L,createQuery as R,getFieldDomain as z,hasDataChanged as B}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as U}from"./support/versionUtils.js";import W from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";import{reader as K}from"../core/accessorSupport/decorators/reader.js";const q=`dimension-feature-layer`,J=V();let Y=class extends O(C(w(x(A(k(D(b(T(E(l(S(y(a(v)))))))))))))){constructor(e){super(e),this.barrierWeight=`high`,this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new _(this),this.operationalLayerType=`ArcGISDimensionLayer`,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode=`item-title`,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Dimension Layer`]),this.symbolFields=[`STYLEID`,`BEGINX`,`BEGINY`,`ENDX`,`ENDY`,`DIMDISPLAY`,`EXTDISPLAY`,`MARKERDISPLAY`,`DIMX`,`DIMY`,`TEXTX`,`TEXTY`,`DIMLENGTH`,`DIMTYPE`,`EXTANGLE`,`TEXTANGLE`,`USECUSTOMLENGTH`,`CUSTOMLENGTH `],this.type=`dimension-feature`,this._debouncedSaveOperations=u(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}destroy(){this.source?.destroy()}load(e){let t=e?.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(d).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(this.layerId=e)}if(!this.url)throw new o(`${q}:missing-url`,`DimensionFeatureLayer must be created with a url`);return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new o(`${q}:missing-style-collection`,`Invalid service with no style collection`)}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>L(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,t){let{url:n}=this,r=t.name||j(n)?.title;switch(this.sublayerTitleMode){case`item-title`:if(n)return N(n,r);break;case`item-title-and-service-name`:{let e=this.portalItem?.title;if(e&&e!==r)return e=M(e),r?`${e} - ${M(r)}`:e;break}}return r?M(r):void 0}readTitleFromPortalItem(e){return this.sublayerTitleMode===`item-title`?e:void 0}createPopupTemplate(e){return G(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{let{default:t}=await f(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,s(p(n,()=>i.cancelLoad())??c()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=R(this);return e.where=this.definitionExpression||`1=1`,e}getFieldDomain(e,t){return z(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(W.from(e)??n.createQuery(),t),i=this.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n,e.origin=i;return r}async queryObjectIds(e,t){let n=await this.load();return n.source.queryObjectIds(W.from(e)??n.createQuery(),t)}async queryFeatureCount(e,t){let n=await this.load();return n.source.queryFeatureCount(W.from(e)??n.createQuery(),t)}async queryExtent(e,t){let n=await this.load();return n.source.queryExtent(W.from(e)??n.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&U(this,e)}async initLayerProperties(e){this._set(`source`,e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:`service`,portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),H(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await Promise.all([t.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(t)}async hasDataChanged(){return B(this)}_verifySource(){if(this.version&&this.version<10.8)throw new o(q+`:unsupported-version`,`The feature service must be version 10.8 or above.`);let e=[`DIMLENGTH`,`BEGINX`,`BEGINY`,`ENDX`,`ENDY`,`DIMX`,`DIMY`,`TEXTX`,`TEXTY`,`DIMTYPE`,`EXTANGLE`,`STYLEID`,`USECUSTOMLENGTH`,`CUSTOMLENGTH`,`DIMDISPLAY`,`EXTDISPLAY`,`MARKERDISPLAY`,`TEXTANGLE`],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new o(q+`:missing-fields`,`There are missing fields to operate properly`,{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let t=e.data;return t?(this.applyPreferredHost(t),[...t.layers||[],...t.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id):void 0})}};n([m({type:g,json:{origins:{service:{read:{source:`sourceSpatialReference`}}}}})],Y.prototype,`attributeSpatialReference`,void 0),n([m(P)],Y.prototype,`barrierWeight`,void 0),n([m({nonNullable:!0,json:{name:`enableEditing`,write:!0}})],Y.prototype,`editingEnabled`,null),n([m({readOnly:!0})],Y.prototype,`effectiveEditingEnabled`,null),n([m({...J.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Y.prototype,`fields`,void 0),n([m(J.fieldsIndex)],Y.prototype,`fieldsIndex`,void 0),n([m({readOnly:!0,clonable:!1})],Y.prototype,`graphicOrigin`,void 0),n([m(F)],Y.prototype,`id`,void 0),n([m({type:[`show`,`hide`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],Y.prototype,`listMode`,void 0),n([m({type:[`ArcGISDimensionLayer`],json:{origins:{"portal-item":{name:`layerType`,write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],Y.prototype,`operationalLayerType`,void 0),n([m(J.outFields)],Y.prototype,`outFields`,void 0),n([m(I)],Y.prototype,`popupEnabled`,void 0),n([m({type:r,json:{name:`popupInfo`,write:!0}})],Y.prototype,`popupTemplate`,void 0),n([m({readOnly:!0})],Y.prototype,`defaultPopupTemplate`,null),n([m({readOnly:!0})],Y.prototype,`referenceScale`,void 0),n([m({clonable:!1,readOnly:!0})],Y.prototype,`source`,void 0),n([m()],Y.prototype,`styleCollection`,void 0),n([m({type:String})],Y.prototype,`sublayerTitleMode`,void 0),n([m({readOnly:!0})],Y.prototype,`symbolFields`,void 0),n([K(`service`,`title`,[`name`])],Y.prototype,`readTitleFromService`,null),n([K(`portal-item`,`title`)],Y.prototype,`readTitleFromPortalItem`,null),n([m({json:{read:!1},value:`dimension-feature`,readOnly:!0})],Y.prototype,`type`,void 0),Y=n([h(`esri.layers.DimensionFeatureLayer`)],Y);const X=Y;export{X as default};
|
package/layers/FeatureLayer.d.ts
CHANGED
|
@@ -32,13 +32,13 @@ import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mix
|
|
|
32
32
|
import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
33
33
|
import type { FeatureEffectLayer, FeatureEffectLayerProperties } from "./mixins/FeatureEffectLayer.js";
|
|
34
34
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
35
|
-
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
36
35
|
import type { FeatureReductionLayer, FeatureReductionLayerProperties } from "./mixins/FeatureReductionLayer.js";
|
|
37
36
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
38
37
|
import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
|
|
39
38
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
40
39
|
import type { PublishableLayer, PublishableLayerProperties } from "./mixins/PublishableLayer.js";
|
|
41
40
|
import type { RefreshableLayerEvents, RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
41
|
+
import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
|
|
42
42
|
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
|
|
43
43
|
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
|
|
44
44
|
import type { TrackableLayer, TrackableLayerProperties } from "./mixins/TrackableLayer.js";
|
|
@@ -2166,4 +2166,4 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
2166
2166
|
*/
|
|
2167
2167
|
updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData, options?: AttachmentEditOptions): Promise<FeatureEditResult>;
|
|
2168
2168
|
}
|
|
2169
|
-
declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase & typeof
|
|
2169
|
+
declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase & typeof ReloadableLayer
|
package/layers/FeatureLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as ee,makeHandle as te}from"../core/handleUtils.js";import{clone as c}from"../core/lang.js";import ne from"../core/Logger.js";import{destroyMaybe as re}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as ie}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{debounce as ae,throwIfAbortError as oe,whenOrAbort as se,onAbort as ce}from"../core/promiseUtils.js";import{sqlAnd as le}from"../core/sql.js";import{property as u,subclass as ue}from"../core/accessorSupport/decorators.js";import{excludeTables as d}from"../core/accessorSupport/layerContainerType.js";import de from"../form/FormTemplate.js";import fe from"../geometry/SpatialReference.js";import pe from"../graphic/FeatureGraphicOrigin.js";import me from"./Layer.js";import{MemorySource as f}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as he}from"./mixins/APIKeyMixin.js";import{ArcGISService as p}from"./mixins/ArcGISService.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as g}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as y}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as x}from"./mixins/FeatureLayerReload.js";import{FeatureReductionLayer as S}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as C}from"./mixins/OperationalLayer.js";import{OrderedLayer as w}from"./mixins/OrderedLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{PublishableLayer as E}from"./mixins/PublishableLayer.js";import{RefreshableLayer as D}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as k}from"./mixins/TemporalLayer.js";import{TrackableLayer as A}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as j,parse as M,cleanTitle as N}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as P,id as F,labelsVisible as I,opacityDrawingInfo as L,legendEnabled as R,listMode as ge,popupEnabled as _e,screenSizePerspectiveEnabled as ve}from"./support/commonProperties.js";import{ensureLayerCredential as ye,computeEffectiveEditingEnabled as be,readGlobalIdField as xe,readObjectIdField as Se,createDefaultRenderer as Ce,addAttachment as we,updateAttachment as Te,applyEdits as Ee,uploadAssets as De,createQuery as Oe,deleteAttachments as ke,fetchRecomputedExtents as Ae,getFeatureType as je,getFieldDomain as Me,queryAttachments as Ne,queryObjectIds as Pe,queryFeatureCount as Fe,queryExtent as Ie,queryRelatedFeatures as Le,queryRelatedFeaturesCount as Re,validateBinsQuery as ze,hasDataChanged as Be,geometryTypeKebabDict as z}from"./support/featureLayerUtils.js";import B from"./support/FeatureTemplate.js";import V from"./support/FeatureType.js";import Ve from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as He,fieldConfigurationsFromPopupTemplate as Ue,fieldConfigurationsFromFields as We}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ge}from"./support/fieldProperties.js";import{fixRendererFields as H,fixTimeInfoFields as Ke}from"./support/fieldUtils.js";import qe from"./support/LabelClass.js";import{reader as U}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Je}from"./support/serviceCapabilitiesUtils.js";import W from"./support/SymbolLayerDrawing.js";import Ye from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Xe}from"./support/versionUtils.js";import{read as Ze}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Qe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as $e,rendererTypes as et}from"../renderers/support/typeUtils.js";import tt from"../rest/layerSources/DynamicDataLayer.js";import nt from"../rest/support/FeatureSet.js";import G from"../rest/support/Query.js";import{isNumber as rt}from"../support/guards.js";import{createPopupTemplate as it}from"../support/popupUtils.js";import{symbolTypes as at}from"../symbols/support/typeUtils.js";import{opacityToTransparency as ot}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as K}from"../webdoc/support/unsupportedErrors.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=`FeatureLayer`;function X(e){return e&&e instanceof o}const Z=Ge();function Q(e,t,n){let r=!!n?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let $=class extends x(b(S(y(E(v(_(m(w(k(g(A(O(D(p(C(T(ie(h(he(a(me))))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new pe(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType=`ArcGISFeatureLayer`,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=fe.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedPortalItemTypes=[`Feature Service`,`Feature Collection`,`Scene Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`]),this.templates=null,this.title=null,this.sublayerTitleMode=`item-title`,this.type=`feature`,this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ae(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);let n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(oe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s(`feature-layer:missing-url-or-source`,`Feature layer must be created with either a url or a source`);return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ye(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return re(e),new Ye({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Je(t,this.url)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`dynamicDataSource`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&!this.capabilities?.operations.supportsEditing?!1:this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this._hasMemorySource()||this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,n){return this._readEditingEnabled(t,!0,n)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,n,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return be(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource()||(this._override(`fieldConfigurations`,e),!this.loaded))return;let t=He(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):Ue(this)||null}readIsTable(e,t){return t=t?.layerDefinition??t,t.type===`Table`||!t.geometryType}writeIsTable(e,t,n,r){r?.writeLayerSchema&&l(n,e?`Table`:`Feature Layer`,t)}readSymbolLayerDrawing(e,t){let n=t.layerDefinition?.drawingInfo,r=n?.renderer,i=n?.symbolLayerDrawing;return r&&i?new W(i):null}readGlobalIdField(e,t){return xe(t.layerDefinition||t)}readObjectIdField(e,t){return Se(t.layerDefinition||t)}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!r?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){H(e,this.fieldsIndex),this._set(`renderer`,e)}readRenderer(e,t,n){t=t.layerDefinition||t;let r=t.drawingInfo?.renderer;if(r){let e=Ze(r,t,n)??void 0;return e||ne.getLogger(this).error(`Failed to create renderer`,{rendererDefinition:t.drawingInfo.renderer,layer:this,context:n}),e}return Ce(t,n)}get source(){return this._get(`source`)}set source(e){e||=null;let t=this._get(`source`);t!==e&&((Array.isArray(e)||e instanceof o)&&(e=new f({layer:this,items:e})),X(t)&&this._resetMemorySource(t),X(e)&&this._initMemorySource(e),this._set(`source`,e))}readSource(e,t){let n=nt.fromJSON(t.featureSet);return new f({layer:this,items:n?.features??[]})}readTemplates(e,t){let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e=e?.map(e=>B.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,i),e}readTitle(e,t){let n=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(n){if(this.sublayerTitleMode===`item-title`)return this.url?j(this.url,n):n;let e=n;if(!e&&this.url){let t=M(this.url);t!=null&&(e=t.title)}if(!e)return;let t=this.portalItem?.title;return this.sublayerTitleMode===`item-title-and-service-name`&&t&&t!==e&&(e=t+` - `+e),N(e)}if(this.sublayerTitleMode===`item-title`&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readTypes(e,t){t=t.layerDefinition||t,e=t.types;let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e?.map(e=>(e=V.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,i),e))}readVisible(e,t){if(t.layerDefinition?.defaultVisibility!=null)return!!t.layerDefinition.defaultVisibility;if(t.visibility!=null)return!!t.visibility}async addAttachment(e,t,n){let r=await we(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await Te(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Ee(this,e,t)}async uploadAssets(e,t){return De(this,e,t)}createFieldConfigurations(){return We(this)}createPopupTemplate(e){return it(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:n});let{default:t}=await se(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,ee(ce(n,()=>i.cancelLoad())??te()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=Oe(this);e.dynamicDataSource=this.dynamicDataSource;let t=this.subtypeCode==null?null:`${this.subtypeField} = ${this.subtypeCode}`;return e.where=le(this.definitionExpression,t)||`1=1`,e}async deleteAttachments(e,t,n){let r=await ke(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return Ae(this,e,Y)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return je(this.types,this.typeIdField,e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return Me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return Ne(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(G.from(e)??n.createQuery(),t),i=this.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n,e.origin=i;return r}async queryObjectIds(e,t){return await Pe(this,e,t,Y)}async queryFeatureCount(e,t){return Fe(this,e,t,Y)}async queryExtent(e,t){return Ie(this,e,t,Y)}async queryRelatedFeatures(e,t){return Le(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return Re(this,e,t,Y)}async queryPivot(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryPivot||!r?.operations?.supportsQueryPivot)throw new s(Y,`Layer source does not support queryPivot capability`);let i=await import(`../rest/support/PivotQuery.js`),a=await n.queryPivot(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopFeatures(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopFeatures||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopFeatures capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`),a=await n.queryTopFeatures(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryAttributeBins)throw new s(Y,`Layer source does not support queryAttributeBins capability`);ze(e,r,Y);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t),o=this.graphicOrigin;if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopObjectIds(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopObjectIds||!r?.query.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopObjectIds capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return(await n.queryTopObjectIds(i.default.from(e),t)).filter(rt)}async queryTopFeaturesExtent(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopExtents||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopExtents capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopExtents(i.default.from(e),t)}async queryTopFeatureCount(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopCount||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryFeatureCount capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopCount(i.default.from(e),t)}read(e,t){let n=e.featureCollection;if((n||e.type===`Feature Collection`)&&(this.resourceInfo=e),n){let{layers:e,showLegend:r}=n;e?.length===1&&(super.read(e[0],t),r!=null&&super.read({showLegend:r},t))}super.read(e,t),X(this.source)&&t?.origin===`service`&&([`objectIdField`,`fields`,`timeInfo`,`dateFieldsTimeZone`,`uniqueIdFields`].forEach(e=>{this.revertToOrigin(e,`service`)}),this.spatialReference||this.revertToOrigin(`spatialReference`,`service`))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};let{origin:n,layerContainerType:r}=t;if(this.dynamicDataSource)return K(t,this,`a dynamic data source cannot be written to web scenes, web maps and feature service items`),null;if(this.isTable){if((n===`web-map`||n===`web-scene`)&&r!==`tables`)return K(t,this,`a table source can only be written to tables`),null;if(this._hasMemorySource())return K(t,this,`an in-memory table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&(n===`web-map`||n===`web-scene`)&&r===`tables`)return K(t,this,`a non-table source cannot be written to tables in web maps or web scenes`),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Y,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return this.loaded?this.source?.type===`memory`||Xe(this,e):!1}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,n){let r=e.layerDefinition?.capabilities;if(r||(r=e.capabilities,t&&n?.origin===`web-map`&&!this._hasMemorySource()&&r))return this._hasEditingCapability(r)}_hasEditingCapability(e){return e.toLowerCase().split(`,`).map(e=>e.trim()).includes(`editing`)}_writeEditingEnabled(e,t,n,r){if(!e){let e=this.capabilities?.operations?.supportsSync?`Query,Sync`:`Query`;l(`layerDefinition.capabilities`,e,t),n&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set(`source`,e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:`service`,portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),H(this.renderer,this.fieldsIndex),Ke(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&this.geometryType===`mesh`&&(this.capabilities.query.supportsReturnMesh=!0),Qe(this,{origin:`service`})}canReload(){return super.canReload()&&!this._hasMemorySource()}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),await this.initLayerProperties(t)}async hasDataChanged(){return Be(this)}async fetchPublishingStatus(){let e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():`unavailable`}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`FeatureLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&!this._hasMemorySource()&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_fixTemplates(e,t){e&&e.forEach(e=>{let n=e.prototype?.attributes;n&&t&&delete n[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s(`feature-layer:mixed-source-and-url`,`FeatureLayer cannot be created with both an in-memory source and a url`)}else if(!this.url)throw new s(`feature-layer:source-or-url-required`,`FeatureLayer requires either a url, a valid portal item or a source`)}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on(`after-add`,e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on(`after-remove`,e=>{e.item.layer=null,e.item.sourceLayer=null})],`fl-source`)}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles(`fl-source`)}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return[...e.layers||[],...e.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};n([u({clonable:!1,readOnly:!0})],$.prototype,`_titleCreator`,null),n([u(P)],$.prototype,`attributeTableTemplate`,void 0),n([q(`service`,`capabilities`)],$.prototype,`readCapabilities`,null),n([u({json:{origins:{"web-scene":{write:!1}},write:!0}})],$.prototype,`charts`,void 0),n([u({readOnly:!0})],$.prototype,`createQueryVersion`,null),n([u({json:{read:{source:`layerDefinition.copyrightText`}}})],$.prototype,`copyright`,void 0),n([u({json:{read:{source:`layerDefinition.displayField`}}})],$.prototype,`displayField`,void 0),n([u({types:at,readOnly:!0})],$.prototype,`defaultSymbol`,void 0),n([u({type:tt})],$.prototype,`dynamicDataSource`,void 0),n([u({type:Boolean})],$.prototype,`editingEnabled`,null),n([q([`portal-item`,`web-scene`],`editingEnabled`,[`layerDefinition.capabilities`])],$.prototype,`readEditingEnabled`,null),n([q(`web-map`,`editingEnabled`,[`capabilities`,`layerDefinition.capabilities`])],$.prototype,`readEditingEnabledFromWebMap`,null),n([J([`portal-item`,`web-scene`],`editingEnabled`,{"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabled`,null),n([J(`web-map`,`editingEnabled`,{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabledToWebMap`,null),n([u({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([u({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),n([u({type:[Ve],json:{name:`layerDefinition.fieldConfigurations`,write:{overridePolicy(e,t,n){return{enabled:!n?.writeLayerSchema,ignoreOrigin:this.originIdOf(t)===1}}}}})],$.prototype,`fieldConfigurations`,null),n([u({...Z.fields,json:{read:{source:`layerDefinition.fields`},origins:{service:{name:`fields`},"web-map":{write:{target:`layerDefinition.fields`,overridePolicy:Q}}}}})],$.prototype,`fields`,void 0),n([u(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([u({type:de,json:{name:`formInfo`,write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`formTemplate`,void 0),n([u({json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.geometryType`,overridePolicy:Q,writer(e,t,n){let r=e?z.toJSON(e):null;r&&l(n,r,t)}}}},read:{source:`layerDefinition.geometryType`,reader:z.read}}})],$.prototype,`geometryType`,void 0),n([u({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([u({json:{read:{source:`layerDefinition.hasM`}}})],$.prototype,`hasM`,void 0),n([u({json:{read:{source:`layerDefinition.hasZ`}}})],$.prototype,`hasZ`,void 0),n([u(F)],$.prototype,`id`,void 0),n([u({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`infoFor3D`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.type`}}}}})],$.prototype,`isTable`,void 0),n([q(`service`,`isTable`,[`type`,`geometryType`]),q(`isTable`,[`layerDefinition.type`,`layerDefinition.geometryType`])],$.prototype,`readIsTable`,null),n([J(`web-map`,`isTable`)],$.prototype,`writeIsTable`,null),n([u(I)],$.prototype,`labelsVisible`,void 0),n([u({type:[qe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:U,write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:U,write:{layerContainerTypes:d}}})],$.prototype,`labelingInfo`,void 0),n([u({type:W,json:{name:`layerDefinition.drawingInfo.symbolLayerDrawing`,write:!0,origins:{"web-scene":{write:!1}}}})],$.prototype,`symbolLayerDrawing`,void 0),n([q([`portal-item`,`web-map`],`symbolLayerDrawing`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.drawingInfo.symbolLayerDrawing`])],$.prototype,`readSymbolLayerDrawing`,null),n([u((()=>{let e=c(L);return e.json.origins[`portal-item`]={write:{target:`layerDefinition.drawingInfo.transparency`,writer(e,t,n){l(n,ot(e),t)}}},e})())],$.prototype,`opacity`,void 0),n([u(R)],$.prototype,`legendEnabled`,void 0),n([u({type:[`show`,`hide`],json:(()=>{let e=c(ge.json);return e.origins[`portal-item`]={read:!1,write:!1},e})()})],$.prototype,`listMode`,void 0),n([q(`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdField`,null),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.objectIdField`,overridePolicy:Q}}}}})],$.prototype,`objectIdField`,void 0),n([q(`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdField`,null),n([u({type:[`ArcGISFeatureLayer`],json:{write:{target:`layerType`,ignoreOrigin:!0,layerContainerTypes:d}}})],$.prototype,`operationalLayerType`,void 0),n([u(Z.outFields)],$.prototype,`outFields`,void 0),n([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],$.prototype,`path`,void 0),n([u(_e)],$.prototype,`popupEnabled`,void 0),n([u({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([J(`popupTemplate`)],$.prototype,`writePopupTemplate`,null),n([u({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([u({types:et,json:{origins:{service:{write:{target:`drawingInfo.renderer`,enabled:!1}},"web-scene":{types:$e,name:`layerDefinition.drawingInfo.renderer`,write:{layerContainerTypes:d,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}},write:{target:`layerDefinition.drawingInfo.renderer`,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}})],$.prototype,`renderer`,null),n([q(`service`,`renderer`,[`drawingInfo.renderer`,`defaultSymbol`]),q(`renderer`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.defaultSymbol`])],$.prototype,`readRenderer`,null),n([u()],$.prototype,`resourceInfo`,void 0),n([u((()=>{let e=c(ve);return e.json.origins[`portal-item`]={read:!1,write:!1},e})())],$.prototype,`screenSizePerspectiveEnabled`,void 0),n([u({clonable:!1})],$.prototype,`source`,null),n([q(`portal-item`,`source`,[`featureSet`]),q(`web-map`,`source`,[`featureSet`])],$.prototype,`readSource`,null),n([u({json:{read:{source:`layerDefinition.extent.spatialReference`}}})],$.prototype,`spatialReference`,void 0),n([u({type:Number})],$.prototype,`subtypeCode`,void 0),n([u({readOnly:!1})],$.prototype,`subtypeField`,void 0),n([u({readOnly:!1})],$.prototype,`subtypes`,void 0),n([u({type:[B]})],$.prototype,`templates`,void 0),n([q(`templates`,[`editFieldsInfo`,`creatorField`,`editorField`,`templates`])],$.prototype,`readTemplates`,null),n([u()],$.prototype,`title`,void 0),n([q(`service`,`title`,[`name`]),q(`portal-item`,`title`,[`layerDefinition.title`,`layerDefinition.name`,`title`])],$.prototype,`readTitle`,null),n([q(`web-map`,`title`,[`layerDefinition.name`,`title`])],$.prototype,`readTitleFromWebMap`,null),n([u({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([u({json:{read:!1}})],$.prototype,`type`,void 0),n([u({type:String})],$.prototype,`typeIdField`,void 0),n([q(`service`,`typeIdField`),q(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),n([u({type:[V]})],$.prototype,`types`,void 0),n([q(`service`,`types`,[`types`]),q(`types`,[`layerDefinition.types`])],$.prototype,`readTypes`,null),n([u({type:Boolean,json:{origins:{"portal-item":{write:{target:`layerDefinition.defaultVisibility`,layerContainerTypes:d}}}}})],$.prototype,`visible`,void 0),n([q(`portal-item`,`visible`,[`visibility`,`layerDefinition.defaultVisibility`])],$.prototype,`readVisible`,null),$=n([ue(`esri.layers.FeatureLayer`)],$);export{$ as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as n}from"tslib";import r from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as a}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{disposable as ee,makeHandle as te}from"../core/handleUtils.js";import{clone as c}from"../core/lang.js";import ne from"../core/Logger.js";import{destroyMaybe as re}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as ie}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{debounce as ae,throwIfAbortError as oe,whenOrAbort as se,onAbort as ce}from"../core/promiseUtils.js";import{sqlAnd as le}from"../core/sql.js";import{property as u,subclass as ue}from"../core/accessorSupport/decorators.js";import{excludeTables as d}from"../core/accessorSupport/layerContainerType.js";import de from"../form/FormTemplate.js";import fe from"../geometry/SpatialReference.js";import pe from"../graphic/FeatureGraphicOrigin.js";import me from"./Layer.js";import{MemorySource as f}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as he}from"./mixins/APIKeyMixin.js";import{ArcGISService as p}from"./mixins/ArcGISService.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as g}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as y}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as b}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as x}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as C}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{PublishableLayer as T}from"./mixins/PublishableLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as D}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as k}from"./mixins/TemporalLayer.js";import{TrackableLayer as A}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as j,parse as M,cleanTitle as N}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as P,id as F,labelsVisible as I,opacityDrawingInfo as L,legendEnabled as R,listMode as ge,popupEnabled as _e,screenSizePerspectiveEnabled as ve}from"./support/commonProperties.js";import{ensureLayerCredential as ye,computeEffectiveEditingEnabled as be,readGlobalIdField as xe,readObjectIdField as Se,createDefaultRenderer as Ce,addAttachment as we,updateAttachment as Te,applyEdits as Ee,uploadAssets as De,createQuery as Oe,deleteAttachments as ke,fetchRecomputedExtents as Ae,getFeatureType as je,getFieldDomain as Me,queryAttachments as Ne,queryObjectIds as Pe,queryFeatureCount as Fe,queryExtent as Ie,queryRelatedFeatures as Le,queryRelatedFeaturesCount as Re,validateBinsQuery as ze,hasDataChanged as Be,geometryTypeKebabDict as z}from"./support/featureLayerUtils.js";import B from"./support/FeatureTemplate.js";import V from"./support/FeatureType.js";import Ve from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as He,fieldConfigurationsFromPopupTemplate as Ue,fieldConfigurationsFromFields as We}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ge}from"./support/fieldProperties.js";import{fixRendererFields as H,fixTimeInfoFields as Ke}from"./support/fieldUtils.js";import qe from"./support/LabelClass.js";import{reader as U}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Je}from"./support/serviceCapabilitiesUtils.js";import W from"./support/SymbolLayerDrawing.js";import Ye from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Xe}from"./support/versionUtils.js";import{read as Ze}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Qe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as $e,rendererTypes as et}from"../renderers/support/typeUtils.js";import tt from"../rest/layerSources/DynamicDataLayer.js";import nt from"../rest/support/FeatureSet.js";import G from"../rest/support/Query.js";import{isNumber as rt}from"../support/guards.js";import{createPopupTemplate as it}from"../support/popupUtils.js";import{symbolTypes as at}from"../symbols/support/typeUtils.js";import{opacityToTransparency as ot}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as K}from"../webdoc/support/unsupportedErrors.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=`FeatureLayer`;function X(e){return e&&e instanceof o}const Z=Ge();function Q(e,t,n){let r=!!n?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let $=class extends D(b(x(y(T(v(_(m(C(k(g(A(O(E(p(S(w(ie(h(he(a(me))))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new pe(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType=`ArcGISFeatureLayer`,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=fe.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedPortalItemTypes=[`Feature Service`,`Feature Collection`,`Scene Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`]),this.templates=null,this.title=null,this.sublayerTitleMode=`item-title`,this.type=`feature`,this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ae(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);let n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(oe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){let e=await this._fetchFirstValidLayerId(t);e!=null&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s(`feature-layer:missing-url-or-source`,`Feature layer must be created with either a url or a source`);return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ye(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get _titleCreator(){let e=this._get(`_titleCreator`);return re(e),new Ye({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Je(t,this.url)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`dynamicDataSource`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&!this.capabilities?.operations.supportsEditing?!1:this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this._hasMemorySource()||this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,n){return this._readEditingEnabled(t,!0,n)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,n,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return be(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource()||(this._override(`fieldConfigurations`,e),!this.loaded))return;let t=He(this,e);t&&this._set(`popupTemplate`,t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden(`fieldConfigurations`)?this._get(`fieldConfigurations`):Ue(this)||null}readIsTable(e,t){return t=t?.layerDefinition??t,t.type===`Table`||!t.geometryType}writeIsTable(e,t,n,r){r?.writeLayerSchema&&l(n,e?`Table`:`Feature Layer`,t)}readSymbolLayerDrawing(e,t){let n=t.layerDefinition?.drawingInfo,r=n?.renderer,i=n?.symbolLayerDrawing;return r&&i?new W(i):null}readGlobalIdField(e,t){return xe(t.layerDefinition||t)}readObjectIdField(e,t){return Se(t.layerDefinition||t)}writePopupTemplate(e,t,n,r){e&&(t[n]=e.toJSON({...r,writeFieldFormat:!r?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){H(e,this.fieldsIndex),this._set(`renderer`,e)}readRenderer(e,t,n){t=t.layerDefinition||t;let r=t.drawingInfo?.renderer;if(r){let e=Ze(r,t,n)??void 0;return e||ne.getLogger(this).error(`Failed to create renderer`,{rendererDefinition:t.drawingInfo.renderer,layer:this,context:n}),e}return Ce(t,n)}get source(){return this._get(`source`)}set source(e){e||=null;let t=this._get(`source`);t!==e&&((Array.isArray(e)||e instanceof o)&&(e=new f({layer:this,items:e})),X(t)&&this._resetMemorySource(t),X(e)&&this._initMemorySource(e),this._set(`source`,e))}readSource(e,t){let n=nt.fromJSON(t.featureSet);return new f({layer:this,items:n?.features??[]})}readTemplates(e,t){let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e=e?.map(e=>B.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,i),e}readTitle(e,t){let n=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(n){if(this.sublayerTitleMode===`item-title`)return this.url?j(this.url,n):n;let e=n;if(!e&&this.url){let t=M(this.url);t!=null&&(e=t.title)}if(!e)return;let t=this.portalItem?.title;return this.sublayerTitleMode===`item-title-and-service-name`&&t&&t!==e&&(e=t+` - `+e),N(e)}if(this.sublayerTitleMode===`item-title`&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){t=t.layerDefinition||t;let n=t.typeIdField;if(n&&t.fields){n=n.toLowerCase();let e=t.fields.find(e=>e.name.toLowerCase()===n);e&&(n=e.name)}return n}readTypes(e,t){t=t.layerDefinition||t,e=t.types;let n=t.editFieldsInfo,r=n?.creatorField,i=n?.editorField;return e?.map(e=>(e=V.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,i),e))}readVisible(e,t){if(t.layerDefinition?.defaultVisibility!=null)return!!t.layerDefinition.defaultVisibility;if(t.visibility!=null)return!!t.visibility}async addAttachment(e,t,n){let r=await we(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await Te(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Ee(this,e,t)}async uploadAssets(e,t){return De(this,e,t)}createFieldConfigurations(){return We(this)}createPopupTemplate(e){return it(this,e)}async createGraphicsSource(n){let r={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:n});let{default:t}=await se(import(`./graphics/sources/FeatureLayerSource.js`),n),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});return e(r,ee(ce(n,()=>i.cancelLoad())??te()),!1),await i.load({signal:n}),i}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}createQuery(){let e=Oe(this);e.dynamicDataSource=this.dynamicDataSource;let t=this.subtypeCode==null?null:`${this.subtypeField} = ${this.subtypeCode}`;return e.where=le(this.definitionExpression,t)||`1=1`,e}async deleteAttachments(e,t,n){let r=await ke(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return Ae(this,e,Y)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return je(this.types,this.typeIdField,e)}getFieldAlias(e){let t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return Me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return Ne(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=await n.source.queryFeatures(G.from(e)??n.createQuery(),t),i=this.graphicOrigin;if(r?.features)for(let e of r.features)e.layer=e.sourceLayer=n,e.origin=i;return r}async queryObjectIds(e,t){return await Pe(this,e,t,Y)}async queryFeatureCount(e,t){return Fe(this,e,t,Y)}async queryExtent(e,t){return Ie(this,e,t,Y)}async queryRelatedFeatures(e,t){return Le(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return Re(this,e,t,Y)}async queryPivot(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryPivot||!r?.operations?.supportsQueryPivot)throw new s(Y,`Layer source does not support queryPivot capability`);let i=await import(`../rest/support/PivotQuery.js`),a=await n.queryPivot(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopFeatures(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopFeatures||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopFeatures capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`),a=await n.queryTopFeatures(i.default.from(e),t),o=this.graphicOrigin;if(a?.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryAttributeBins(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryAttributeBins)throw new s(Y,`Layer source does not support queryAttributeBins capability`);ze(e,r,Y);let i=await import(`../rest/support/AttributeBinsQuery.js`),a=await n.queryAttributeBins(i.default.from(e),t),o=this.graphicOrigin;if(a.features)for(let e of a.features)e.layer=e.sourceLayer=this,e.origin=o;return a}async queryTopObjectIds(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopObjectIds||!r?.query.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopObjectIds capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return(await n.queryTopObjectIds(i.default.from(e),t)).filter(rt)}async queryTopFeaturesExtent(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopExtents||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryTopExtents capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopExtents(i.default.from(e),t)}async queryTopFeatureCount(e,t){let{source:n,capabilities:r}=await this.load();if(!n.queryTopCount||!r?.query?.supportsTopFeaturesQuery)throw new s(Y,`Layer source does not support queryFeatureCount capability`);let i=await import(`../rest/support/TopFeaturesQuery.js`);return n.queryTopCount(i.default.from(e),t)}read(e,t){let n=e.featureCollection;if((n||e.type===`Feature Collection`)&&(this.resourceInfo=e),n){let{layers:e,showLegend:r}=n;e?.length===1&&(super.read(e[0],t),r!=null&&super.read({showLegend:r},t))}super.read(e,t),X(this.source)&&t?.origin===`service`&&([`objectIdField`,`fields`,`timeInfo`,`dateFieldsTimeZone`,`uniqueIdFields`].forEach(e=>{this.revertToOrigin(e,`service`)}),this.spatialReference||this.revertToOrigin(`spatialReference`,`service`))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};let{origin:n,layerContainerType:r}=t;if(this.dynamicDataSource)return K(t,this,`a dynamic data source cannot be written to web scenes, web maps and feature service items`),null;if(this.isTable){if((n===`web-map`||n===`web-scene`)&&r!==`tables`)return K(t,this,`a table source can only be written to tables`),null;if(this._hasMemorySource())return K(t,this,`an in-memory table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&(n===`web-map`||n===`web-scene`)&&r===`tables`)return K(t,this,`a non-table source cannot be written to tables in web maps or web scenes`),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Y,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return this.loaded?this.source?.type===`memory`||Xe(this,e):!1}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,n){let r=e.layerDefinition?.capabilities;if(r||(r=e.capabilities,t&&n?.origin===`web-map`&&!this._hasMemorySource()&&r))return this._hasEditingCapability(r)}_hasEditingCapability(e){return e.toLowerCase().split(`,`).map(e=>e.trim()).includes(`editing`)}_writeEditingEnabled(e,t,n,r){if(!e){let e=this.capabilities?.operations?.supportsSync?`Query,Sync`:`Query`;l(`layerDefinition.capabilities`,e,t),n&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return i(this.url??``,{query:{f:`json`,...this.customParameters,token:this.apiKey},responseType:`json`,signal:e}).then(e=>{let t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set(`source`,e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:`service`,portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),H(this.renderer,this.fieldsIndex),Ke(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&this.geometryType===`mesh`&&(this.capabilities.query.supportsReturnMesh=!0),Qe(this,{origin:`service`})}canReload(){return super.canReload()&&!this._hasMemorySource()}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),await this.initLayerProperties(t)}async hasDataChanged(){return Be(this)}async fetchPublishingStatus(){let e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():`unavailable`}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`FeatureLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&!this._hasMemorySource()&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_fixTemplates(e,t){e&&e.forEach(e=>{let n=e.prototype?.attributes;n&&t&&delete n[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s(`feature-layer:mixed-source-and-url`,`FeatureLayer cannot be created with both an in-memory source and a url`)}else if(!this.url)throw new s(`feature-layer:source-or-url-required`,`FeatureLayer requires either a url, a valid portal item or a source`)}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on(`after-add`,e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on(`after-remove`,e=>{e.item.layer=null,e.item.sourceLayer=null})],`fl-source`)}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles(`fl-source`)}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return[...e.layers||[],...e.tables||[]].find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};n([u({clonable:!1,readOnly:!0})],$.prototype,`_titleCreator`,null),n([u(P)],$.prototype,`attributeTableTemplate`,void 0),n([q(`service`,`capabilities`)],$.prototype,`readCapabilities`,null),n([u({json:{origins:{"web-scene":{write:!1}},write:!0}})],$.prototype,`charts`,void 0),n([u({readOnly:!0})],$.prototype,`createQueryVersion`,null),n([u({json:{read:{source:`layerDefinition.copyrightText`}}})],$.prototype,`copyright`,void 0),n([u({json:{read:{source:`layerDefinition.displayField`}}})],$.prototype,`displayField`,void 0),n([u({types:at,readOnly:!0})],$.prototype,`defaultSymbol`,void 0),n([u({type:tt})],$.prototype,`dynamicDataSource`,void 0),n([u({type:Boolean})],$.prototype,`editingEnabled`,null),n([q([`portal-item`,`web-scene`],`editingEnabled`,[`layerDefinition.capabilities`])],$.prototype,`readEditingEnabled`,null),n([q(`web-map`,`editingEnabled`,[`capabilities`,`layerDefinition.capabilities`])],$.prototype,`readEditingEnabledFromWebMap`,null),n([J([`portal-item`,`web-scene`],`editingEnabled`,{"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabled`,null),n([J(`web-map`,`editingEnabled`,{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],$.prototype,`writeEditingEnabledToWebMap`,null),n([u({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),n([u({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),n([u({type:[Ve],json:{name:`layerDefinition.fieldConfigurations`,write:{overridePolicy(e,t,n){return{enabled:!n?.writeLayerSchema,ignoreOrigin:this.originIdOf(t)===1}}}}})],$.prototype,`fieldConfigurations`,null),n([u({...Z.fields,json:{read:{source:`layerDefinition.fields`},origins:{service:{name:`fields`},"web-map":{write:{target:`layerDefinition.fields`,overridePolicy:Q}}}}})],$.prototype,`fields`,void 0),n([u(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),n([u({type:de,json:{name:`formInfo`,write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,`formTemplate`,void 0),n([u({json:{read:{source:`layerDefinition.extent`}}})],$.prototype,`fullExtent`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.geometryType`,overridePolicy:Q,writer(e,t,n){let r=e?z.toJSON(e):null;r&&l(n,r,t)}}}},read:{source:`layerDefinition.geometryType`,reader:z.read}}})],$.prototype,`geometryType`,void 0),n([u({readOnly:!0,clonable:!1})],$.prototype,`graphicOrigin`,void 0),n([u({json:{read:{source:`layerDefinition.hasM`}}})],$.prototype,`hasM`,void 0),n([u({json:{read:{source:`layerDefinition.hasZ`}}})],$.prototype,`hasZ`,void 0),n([u(F)],$.prototype,`id`,void 0),n([u({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`infoFor3D`,void 0),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.type`}}}}})],$.prototype,`isTable`,void 0),n([q(`service`,`isTable`,[`type`,`geometryType`]),q(`isTable`,[`layerDefinition.type`,`layerDefinition.geometryType`])],$.prototype,`readIsTable`,null),n([J(`web-map`,`isTable`)],$.prototype,`writeIsTable`,null),n([u(I)],$.prototype,`labelsVisible`,void 0),n([u({type:[qe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:U,write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:U,write:{layerContainerTypes:d}}})],$.prototype,`labelingInfo`,void 0),n([u({type:W,json:{name:`layerDefinition.drawingInfo.symbolLayerDrawing`,write:!0,origins:{"web-scene":{write:!1}}}})],$.prototype,`symbolLayerDrawing`,void 0),n([q([`portal-item`,`web-map`],`symbolLayerDrawing`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.drawingInfo.symbolLayerDrawing`])],$.prototype,`readSymbolLayerDrawing`,null),n([u((()=>{let e=c(L);return e.json.origins[`portal-item`]={write:{target:`layerDefinition.drawingInfo.transparency`,writer(e,t,n){l(n,ot(e),t)}}},e})())],$.prototype,`opacity`,void 0),n([u(R)],$.prototype,`legendEnabled`,void 0),n([u({type:[`show`,`hide`],json:(()=>{let e=c(ge.json);return e.origins[`portal-item`]={read:!1,write:!1},e})()})],$.prototype,`listMode`,void 0),n([q(`globalIdField`,[`layerDefinition.globalIdField`,`layerDefinition.fields`])],$.prototype,`readGlobalIdField`,null),n([u({json:{origins:{"web-map":{write:{target:`layerDefinition.objectIdField`,overridePolicy:Q}}}}})],$.prototype,`objectIdField`,void 0),n([q(`objectIdField`,[`layerDefinition.objectIdField`,`layerDefinition.fields`])],$.prototype,`readObjectIdField`,null),n([u({type:[`ArcGISFeatureLayer`],json:{write:{target:`layerType`,ignoreOrigin:!0,layerContainerTypes:d}}})],$.prototype,`operationalLayerType`,void 0),n([u(Z.outFields)],$.prototype,`outFields`,void 0),n([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],$.prototype,`path`,void 0),n([u(_e)],$.prototype,`popupEnabled`,void 0),n([u({type:r,json:{name:`popupInfo`,write:!0}})],$.prototype,`popupTemplate`,void 0),n([J(`popupTemplate`)],$.prototype,`writePopupTemplate`,null),n([u({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),n([u({types:et,json:{origins:{service:{write:{target:`drawingInfo.renderer`,enabled:!1}},"web-scene":{types:$e,name:`layerDefinition.drawingInfo.renderer`,write:{layerContainerTypes:d,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}},write:{target:`layerDefinition.drawingInfo.renderer`,overridePolicy(e,t,n){return{ignoreOrigin:n?.writeLayerSchema,layerContainerTypes:d}}}}})],$.prototype,`renderer`,null),n([q(`service`,`renderer`,[`drawingInfo.renderer`,`defaultSymbol`]),q(`renderer`,[`layerDefinition.drawingInfo.renderer`,`layerDefinition.defaultSymbol`])],$.prototype,`readRenderer`,null),n([u()],$.prototype,`resourceInfo`,void 0),n([u((()=>{let e=c(ve);return e.json.origins[`portal-item`]={read:!1,write:!1},e})())],$.prototype,`screenSizePerspectiveEnabled`,void 0),n([u({clonable:!1})],$.prototype,`source`,null),n([q(`portal-item`,`source`,[`featureSet`]),q(`web-map`,`source`,[`featureSet`])],$.prototype,`readSource`,null),n([u({json:{read:{source:`layerDefinition.extent.spatialReference`}}})],$.prototype,`spatialReference`,void 0),n([u({type:Number})],$.prototype,`subtypeCode`,void 0),n([u({readOnly:!1})],$.prototype,`subtypeField`,void 0),n([u({readOnly:!1})],$.prototype,`subtypes`,void 0),n([u({type:[B]})],$.prototype,`templates`,void 0),n([q(`templates`,[`editFieldsInfo`,`creatorField`,`editorField`,`templates`])],$.prototype,`readTemplates`,null),n([u()],$.prototype,`title`,void 0),n([q(`service`,`title`,[`name`]),q(`portal-item`,`title`,[`layerDefinition.title`,`layerDefinition.name`,`title`])],$.prototype,`readTitle`,null),n([q(`web-map`,`title`,[`layerDefinition.name`,`title`])],$.prototype,`readTitleFromWebMap`,null),n([u({type:String})],$.prototype,`sublayerTitleMode`,void 0),n([u({json:{read:!1}})],$.prototype,`type`,void 0),n([u({type:String})],$.prototype,`typeIdField`,void 0),n([q(`service`,`typeIdField`),q(`typeIdField`,[`layerDefinition.typeIdField`])],$.prototype,`readTypeIdField`,null),n([u({type:[V]})],$.prototype,`types`,void 0),n([q(`service`,`types`,[`types`]),q(`types`,[`layerDefinition.types`])],$.prototype,`readTypes`,null),n([u({type:Boolean,json:{origins:{"portal-item":{write:{target:`layerDefinition.defaultVisibility`,layerContainerTypes:d}}}}})],$.prototype,`visible`,void 0),n([q(`portal-item`,`visible`,[`visibility`,`layerDefinition.defaultVisibility`])],$.prototype,`readVisible`,null),$=n([ue(`esri.layers.FeatureLayer`)],$);export{$ as default};
|
|
@@ -19,10 +19,10 @@ import type { CustomParametersMixin, CustomParametersMixinProperties } from "./m
|
|
|
19
19
|
import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
|
|
20
20
|
import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
|
|
21
21
|
import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
|
|
22
|
-
import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
|
|
23
22
|
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
|
|
24
23
|
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
|
|
25
24
|
import type { RefreshableLayerEvents, RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
|
|
25
|
+
import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
|
|
26
26
|
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
|
|
27
27
|
import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
|
|
28
28
|
import type { PortalItemProperties } from "../portal/PortalItem.js";
|
|
@@ -880,4 +880,4 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
|
|
|
880
880
|
*/
|
|
881
881
|
updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData, options?: AttachmentEditOptions): Promise<FeatureEditResult>;
|
|
882
882
|
}
|
|
883
|
-
declare const SubtypeGroupLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof EditBusLayer & typeof DisplayFilteredLayer & typeof FeatureLayerBase & typeof
|
|
883
|
+
declare const SubtypeGroupLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof EditBusLayer & typeof DisplayFilteredLayer & typeof FeatureLayerBase & typeof ReloadableLayer
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{getOrCreateMapValue as a}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee,whenOrAbort as c}from"../core/promiseUtils.js";import{watch as te,sync as ne}from"../core/reactiveUtils.js";import{sqlAnd as re}from"../core/sql.js";import{property as l,subclass as ie}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{ArcGISService as ae}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as m}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as h}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as g}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as _}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as y}from"./mixins/PortalLayer.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as w}from"./support/commonProperties.js";import{ensureLayerCredential as T,computeEffectiveEditingEnabled as E,addAttachment as D,updateAttachment as O,applyEdits as k,createQuery as A,deleteAttachments as oe,fetchRecomputedExtents as j,computeDomainFromSubtypes as M,getFeatureSubtype as N,queryAttachments as P,queryObjectIds as F,queryFeatureCount as I,queryExtent as L,queryRelatedFeatures as R,queryRelatedFeaturesCount as z,hasDataChanged as B}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as U,createSimpleRenderersWithUniqueColors as W}from"./support/subtypeGroupLayerUtils.js";import G from"./support/SubtypeSublayer.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{addLayerUnsupportedError as J}from"../webdoc/support/unsupportedErrors.js";import{reader as ce}from"../core/accessorSupport/decorators/reader.js";const Y=`SubtypeGroupLayer`;function X(e,t){let n=[];for(let r of e){let e=new G;e.read(r,t),n.push(e)}return n}const Z=V();function Q(){return{name:`layerType`,read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let $=class extends _(g(m(h(f(S(x(b(ae(v(y(o(p(d(t(u))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(n.ofType(G)),this.useUniqueColorsForSublayers=!0,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Table`]),this.title=`Layer`,this.type=`subtype-group`,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(te(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(ee).then(async()=>{if(!this.url)throw new r(`subtype-grouplayer:missing-url-or-source`,`SubtypeGroupLayer must be created with either a url or a portal item`);if(this.layerId==null)throw new r(`subtype-grouplayer:missing-layerid`,`layerId is required for a SubtypeGroupLayer created with url`);this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>T(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return E(this)}get operationalLayerType(){return this.isTable?`SubtypeGroupTable`:`SubtypeGroupLayer`}set source(e){this._get(`source`)!==e&&this._set(`source`,e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t,n){let r=await D(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await O(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return k(this,e,t)}async createGraphicsSource(e){let{default:t}=await c(import(`./graphics/sources/FeatureLayerSource.js`),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){let e=A(this),t=this.sublayers.map(e=>e.subtypeCode);return e.where=re(`${this.subtypeField} IN (${t.join(`,`)})`,this.definitionExpression),e}async deleteAttachments(e,t,n){let r=await oe(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return j(this,e,Y)}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){let t=M(this,e);if(t)return t}let n=N(this,t?.feature);if(n){let t=n.domains?.[e];return t?.type===`inherited`?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return P(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=q.from(e)??n.createQuery(),i=r.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i);let a=await n.source.queryFeatures(r,t);if(a?.features)for(let e of a.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin,e.layer=e.sourceLayer=this.findSublayerForFeature(e);return a}async queryObjectIds(e,t){return(await F(this,e,t,Y)).filter(se)}async queryFeatureCount(e,t){return I(this,e,t,Y)}async queryExtent(e,t){return L(this,e,t,Y)}async queryRelatedFeatures(e,t){return R(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return z(this,e,t,Y)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){let{origin:n,layerContainerType:i,messages:a}=t;if(this.isTable){if(n===`web-scene`||n===`web-map`&&i!==`tables`)return J(t,this,`a table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&n===`web-map`&&i===`tables`)return J(t,this,`a non-table source cannot be written to tables in web maps`),null;return this.sublayers?.length?super.write(e,t):(a?.push(new r(`web-document-write:invalid-property`,`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return this.loaded?K(this,e):!1}async getFeatureTitle(e,t){let n=this.findSublayerForFeature(e);return n?await n.getFeatureTitle(e,t):this._getFeatureTitleForUnknownSublayer(e)}async getFeatureTitles(e,t){let n=new Map,r=new Map,i=[],o=[r];if(e.forEach(e=>{let o=this.findSublayerForFeature(e);if(o)a(n,o,()=>[]).push(e);else{let n=e.getObjectId()??e.attributes[this.objectIdField];t?.fetchMissingFields?i.push(e):r.set(n,this._getFeatureTitleForUnknownSublayer(e))}}),i.length>0){let e=new Set(this.featureTitleFields);e.add(this.objectIdField),e.add(this.subtypeField);let t=await this.queryFeatures({outFields:[...e],returnGeometry:!1,objectIds:i.map(e=>e.getObjectId()??e.attributes[this.objectIdField])}),o=new Set;for(let e of t.features??[]){let t=e.getObjectId()??e.attributes[this.objectIdField];o.add(t);let i=this.findSublayerForFeature(e);i?a(n,i,()=>[]).push(e):r.set(t,this._getFeatureTitleForUnknownSublayer(e))}for(let e of i){let t=e.getObjectId()??e.attributes[this.objectIdField];o.has(t)||r.set(t,this._getFeatureTitleForUnknownSublayer(e))}}(await Promise.all(Array.from(n).map(([e,n])=>e.getFeatureTitles(n,t)))).forEach(e=>o.push(e));let s=new Map(o.flatMap(e=>[...e]));return r.forEach((e,t)=>{s.set(t,e)}),s}get featureTitleFields(){let e=new Set;for(let t of this.sublayers){let n=t.featureTitleFields;for(let t of n)e.add(t)}return[...e]}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}_initLayerProperties(e){this._set(`source`,e);let{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:`service`,url:this.parsedUrl})),!this.subtypes?.length)throw new r(`subtype-grouplayer:missing-subtypes`,`SubtypeGroupLayer must be created using a layer with subtypes`);this._verifyFields(),H(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),this._initLayerProperties(t)}async hasDataChanged(){return B(this)}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`SubtypeGroupLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}_getFeatureTitleForUnknownSublayer(e){let{displayField:t,fieldsIndex:n,objectIdField:r}=this;if(t&&n.has(t))return e.attributes[n.get(t).name]??``;let i=e.getObjectId();return i==null?r&&n.has(r)?e.attributes[n.get(r).name]??``:``:i.toString()}};e([l({readOnly:!0})],$.prototype,`createQueryVersion`,null),e([l({readOnly:!0})],$.prototype,`editingEnabled`,null),e([l({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([l({...Z.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`fields`,void 0),e([l(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),e([l(w)],$.prototype,`id`,void 0),e([l({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),e([l({type:[`SubtypeGroupLayer`,`SubtypeGroupTable`],json:{...Q(),origins:{"web-document":Q(),"portal-item":Q()}}})],$.prototype,`operationalLayerType`,null),e([l(Z.outFields)],$.prototype,`outFields`,void 0),e([l({clonable:!1})],$.prototype,`source`,null),e([l({type:n.ofType(G),json:{origins:{service:{read:{source:`subtypes`,reader(e,t,r){let i=null;if(this.useUniqueColorsForSublayers){let n=U(t,r);i=n?W(e.length,n):null}let a=e.map(({code:e},n)=>{let a=new G({subtypeCode:e});a.read(t,r);let o=i?.[n];return o&&a.read({drawingInfo:{renderer:o.toJSON()}},r),a});return new(n.ofType(G))(a)}}}},read:{source:[`layers`,`tables`],reader(e,t,r){let i;return t.layerType===`SubtypeGroupLayer`&&t.layers?.length?i=X(t.layers,r):t.layerType===`SubtypeGroupTable`&&t.tables?.length&&(i=X(t.tables,r)),new(n.ofType(G))(i)}},write:{ignoreOrigin:!0,writer(e,t,n,r){let i=[];for(let t of e){let e=t.write({},r);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],$.prototype,`sublayers`,void 0),e([l()],$.prototype,`useUniqueColorsForSublayers`,void 0),e([l({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],$.prototype,`title`,void 0),e([ce(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([l({json:{read:!1}})],$.prototype,`type`,void 0),e([l({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),$=e([ie(`esri.layers.SubtypeGroupLayer`)],$);const le=$;export{le as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{getOrCreateMapValue as a}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee,whenOrAbort as c}from"../core/promiseUtils.js";import{watch as te,sync as ne}from"../core/reactiveUtils.js";import{sqlAnd as re}from"../core/sql.js";import{property as l,subclass as ie}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{ArcGISService as ae}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as m}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as h}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as g}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RefreshableLayer as y}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as b}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as w}from"./support/commonProperties.js";import{ensureLayerCredential as T,computeEffectiveEditingEnabled as E,addAttachment as D,updateAttachment as O,applyEdits as k,createQuery as A,deleteAttachments as oe,fetchRecomputedExtents as j,computeDomainFromSubtypes as M,getFeatureSubtype as N,queryAttachments as P,queryObjectIds as F,queryFeatureCount as I,queryExtent as L,queryRelatedFeatures as R,queryRelatedFeaturesCount as z,hasDataChanged as B}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as U,createSimpleRenderersWithUniqueColors as W}from"./support/subtypeGroupLayerUtils.js";import G from"./support/SubtypeSublayer.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{addLayerUnsupportedError as J}from"../webdoc/support/unsupportedErrors.js";import{reader as ce}from"../core/accessorSupport/decorators/reader.js";const Y=`SubtypeGroupLayer`;function X(e,t){let n=[];for(let r of e){let e=new G;e.read(r,t),n.push(e)}return n}const Z=V();function Q(){return{name:`layerType`,read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let $=class extends b(g(m(h(f(S(x(y(ae(_(v(o(p(d(t(u))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(n.ofType(G)),this.useUniqueColorsForSublayers=!0,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Table`]),this.title=`Layer`,this.type=`subtype-group`,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(te(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(ee).then(async()=>{if(!this.url)throw new r(`subtype-grouplayer:missing-url-or-source`,`SubtypeGroupLayer must be created with either a url or a portal item`);if(this.layerId==null)throw new r(`subtype-grouplayer:missing-layerid`,`layerId is required for a SubtypeGroupLayer created with url`);this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>T(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return E(this)}get operationalLayerType(){return this.isTable?`SubtypeGroupTable`:`SubtypeGroupLayer`}set source(e){this._get(`source`)!==e&&this._set(`source`,e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t,n){let r=await D(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await O(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return k(this,e,t)}async createGraphicsSource(e){let{default:t}=await c(import(`./graphics/sources/FeatureLayerSource.js`),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){let e=A(this),t=this.sublayers.map(e=>e.subtypeCode);return e.where=re(`${this.subtypeField} IN (${t.join(`,`)})`,this.definitionExpression),e}async deleteAttachments(e,t,n){let r=await oe(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return j(this,e,Y)}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){let t=M(this,e);if(t)return t}let n=N(this,t?.feature);if(n){let t=n.domains?.[e];return t?.type===`inherited`?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return P(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=q.from(e)??n.createQuery(),i=r.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i);let a=await n.source.queryFeatures(r,t);if(a?.features)for(let e of a.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin,e.layer=e.sourceLayer=this.findSublayerForFeature(e);return a}async queryObjectIds(e,t){return(await F(this,e,t,Y)).filter(se)}async queryFeatureCount(e,t){return I(this,e,t,Y)}async queryExtent(e,t){return L(this,e,t,Y)}async queryRelatedFeatures(e,t){return R(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return z(this,e,t,Y)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){let{origin:n,layerContainerType:i,messages:a}=t;if(this.isTable){if(n===`web-scene`||n===`web-map`&&i!==`tables`)return J(t,this,`a table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&n===`web-map`&&i===`tables`)return J(t,this,`a non-table source cannot be written to tables in web maps`),null;return this.sublayers?.length?super.write(e,t):(a?.push(new r(`web-document-write:invalid-property`,`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return this.loaded?K(this,e):!1}async getFeatureTitle(e,t){let n=this.findSublayerForFeature(e);return n?await n.getFeatureTitle(e,t):this._getFeatureTitleForUnknownSublayer(e)}async getFeatureTitles(e,t){let n=new Map,r=new Map,i=[],o=[r];if(e.forEach(e=>{let o=this.findSublayerForFeature(e);if(o)a(n,o,()=>[]).push(e);else{let n=e.getObjectId()??e.attributes[this.objectIdField];t?.fetchMissingFields?i.push(e):r.set(n,this._getFeatureTitleForUnknownSublayer(e))}}),i.length>0){let e=new Set(this.featureTitleFields);e.add(this.objectIdField),e.add(this.subtypeField);let t=await this.queryFeatures({outFields:[...e],returnGeometry:!1,objectIds:i.map(e=>e.getObjectId()??e.attributes[this.objectIdField])}),o=new Set;for(let e of t.features??[]){let t=e.getObjectId()??e.attributes[this.objectIdField];o.add(t);let i=this.findSublayerForFeature(e);i?a(n,i,()=>[]).push(e):r.set(t,this._getFeatureTitleForUnknownSublayer(e))}for(let e of i){let t=e.getObjectId()??e.attributes[this.objectIdField];o.has(t)||r.set(t,this._getFeatureTitleForUnknownSublayer(e))}}(await Promise.all(Array.from(n).map(([e,n])=>e.getFeatureTitles(n,t)))).forEach(e=>o.push(e));let s=new Map(o.flatMap(e=>[...e]));return r.forEach((e,t)=>{s.set(t,e)}),s}get featureTitleFields(){let e=new Set;for(let t of this.sublayers){let n=t.featureTitleFields;for(let t of n)e.add(t)}return[...e]}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}_initLayerProperties(e){this._set(`source`,e);let{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:`service`,url:this.parsedUrl})),!this.subtypes?.length)throw new r(`subtype-grouplayer:missing-subtypes`,`SubtypeGroupLayer must be created using a layer with subtypes`);this._verifyFields(),H(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),this._initLayerProperties(t)}async hasDataChanged(){return B(this)}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`SubtypeGroupLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}_getFeatureTitleForUnknownSublayer(e){let{displayField:t,fieldsIndex:n,objectIdField:r}=this;if(t&&n.has(t))return e.attributes[n.get(t).name]??``;let i=e.getObjectId();return i==null?r&&n.has(r)?e.attributes[n.get(r).name]??``:``:i.toString()}};e([l({readOnly:!0})],$.prototype,`createQueryVersion`,null),e([l({readOnly:!0})],$.prototype,`editingEnabled`,null),e([l({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([l({...Z.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`fields`,void 0),e([l(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),e([l(w)],$.prototype,`id`,void 0),e([l({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),e([l({type:[`SubtypeGroupLayer`,`SubtypeGroupTable`],json:{...Q(),origins:{"web-document":Q(),"portal-item":Q()}}})],$.prototype,`operationalLayerType`,null),e([l(Z.outFields)],$.prototype,`outFields`,void 0),e([l({clonable:!1})],$.prototype,`source`,null),e([l({type:n.ofType(G),json:{origins:{service:{read:{source:`subtypes`,reader(e,t,r){let i=null;if(this.useUniqueColorsForSublayers){let n=U(t,r);i=n?W(e.length,n):null}let a=e.map(({code:e},n)=>{let a=new G({subtypeCode:e});a.read(t,r);let o=i?.[n];return o&&a.read({drawingInfo:{renderer:o.toJSON()}},r),a});return new(n.ofType(G))(a)}}}},read:{source:[`layers`,`tables`],reader(e,t,r){let i;return t.layerType===`SubtypeGroupLayer`&&t.layers?.length?i=X(t.layers,r):t.layerType===`SubtypeGroupTable`&&t.tables?.length&&(i=X(t.tables,r)),new(n.ofType(G))(i)}},write:{ignoreOrigin:!0,writer(e,t,n,r){let i=[];for(let t of e){let e=t.write({},r);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],$.prototype,`sublayers`,void 0),e([l()],$.prototype,`useUniqueColorsForSublayers`,void 0),e([l({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],$.prototype,`title`,void 0),e([ce(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([l({json:{read:!1}})],$.prototype,`type`,void 0),e([l({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),$=e([ie(`esri.layers.SubtypeGroupLayer`)],$);const le=$;export{le as default};
|