@arcgis/core 4.33.0-next.20250205 → 4.33.0-next.20250207
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/arcade.js +1 -1
- package/assets/components/assets/icon/dualImageArea16.json +1 -0
- package/assets/components/assets/icon/dualImageArea24.json +1 -0
- package/assets/components/assets/icon/dualImageArea32.json +1 -0
- package/assets/components/assets/icon/dualImageDistance16.json +1 -0
- package/assets/components/assets/icon/dualImageDistance24.json +1 -0
- package/assets/components/assets/icon/dualImageDistance32.json +1 -0
- package/assets/components/assets/icon/dualImageLocation16.json +1 -0
- package/assets/components/assets/icon/dualImageLocation24.json +1 -0
- package/assets/components/assets/icon/dualImageLocation32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{24a86c52c8bdd0b5eb4d.js → 09a99c556089c166d1f8.js} +1 -1
- package/assets/esri/core/workers/chunks/0a8e388e96af44deeabb.js +1 -0
- package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +1 -0
- package/assets/esri/core/workers/chunks/143a193fa3a6e645c8ac.js +1 -0
- package/assets/esri/core/workers/chunks/{9b4f471fcd8a3b5e089f.js → 192569dfa7c0ea8dd864.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad215219e5eef8598745.js → 28dbbfc44cc2bdcd221d.js} +1 -1
- package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js → 32d3657dcae89b740f8b.js} +2 -2
- package/assets/esri/core/workers/chunks/{72cf9192292e5c85c6df.js.LICENSE.txt → 32d3657dcae89b740f8b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/333091ab2e267652ed56.js +1 -0
- package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/35e4af82a08b4eadbfab.js +1 -0
- package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +1 -0
- package/assets/esri/core/workers/chunks/4040158835f9036967cd.js +2 -0
- package/assets/esri/core/workers/chunks/{1a2e1a414e651e988435.js.LICENSE.txt → 4040158835f9036967cd.js.LICENSE.txt} +1 -6
- package/assets/esri/core/workers/chunks/{8a1e4f65fc81aba7a704.js → 4122d10bc910e888eee1.js} +1 -1
- package/assets/esri/core/workers/chunks/433576983754f690bcc7.js +1 -0
- package/assets/esri/core/workers/chunks/459af0c3d62c3ed11c19.js +1 -0
- package/assets/esri/core/workers/chunks/53810519ff5922b42cd2.js +1 -0
- package/assets/esri/core/workers/chunks/5721557a1d8eab23a55b.js +1 -0
- package/assets/esri/core/workers/chunks/594d923400fd74881833.js +1 -0
- package/assets/esri/core/workers/chunks/{7a0415db78c68d31733f.js → 6039da57a2adedd3b83f.js} +1 -1
- package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +1 -0
- package/assets/esri/core/workers/chunks/{81aa8cc289fd02ca4da6.js → 7058001bf66f9f3d5d45.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8ae8a11d8439e2a66ad.js → 706f867a9034d62a8ef7.js} +1 -1
- package/assets/esri/core/workers/chunks/73d03c208242778e67bf.js +1 -0
- package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{1ab83753d9eec0463461.js → 7b367bb0ed9c218ca595.js} +1 -1
- package/assets/esri/core/workers/chunks/{723a9fba144e2fa6d017.js → 7cb09e58bcc537ec1f7a.js} +1 -1
- package/assets/esri/core/workers/chunks/8191dd3d7451b2e7b95e.js +1 -0
- package/assets/esri/core/workers/chunks/842db06ce62758fab1e7.js +1 -0
- package/assets/esri/core/workers/chunks/8c32cee395da0a7b9a8e.js +1 -0
- package/assets/esri/core/workers/chunks/8d8f5f08d730270e1165.js +1 -0
- package/assets/esri/core/workers/chunks/94225d92afbdb10dfedb.js +1 -0
- package/assets/esri/core/workers/chunks/94490937dca566fe2640.js +1 -0
- package/assets/esri/core/workers/chunks/{b9ce0049e27a3e1ed9f9.js → 9b2fab133786e5d47631.js} +1 -1
- package/assets/esri/core/workers/chunks/9d61590c4d21c7421925.js +1 -0
- package/assets/esri/core/workers/chunks/{610b33b7291cffcc4e5d.js → a42ae5d5e5f66d120b4d.js} +1 -1
- package/assets/esri/core/workers/chunks/a5e9ea13e844a62b2a7f.js +1 -0
- package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +1 -0
- package/assets/esri/core/workers/chunks/{6d5bfcc7856cafe7b043.js → b765670b47d209d7655a.js} +2 -2
- package/assets/esri/core/workers/chunks/{6d5bfcc7856cafe7b043.js.LICENSE.txt → b765670b47d209d7655a.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d29c3bf29fcd7fa31f1a.js +1 -0
- package/assets/esri/core/workers/chunks/d339dee99c4820b63f39.js +1 -0
- package/assets/esri/core/workers/chunks/{9c5c6ecaf5be24279fa5.js → ddc30044f61a2c2df3fe.js} +1 -1
- package/assets/esri/core/workers/chunks/de1f3c4b8000c2d73013.js +1 -0
- package/assets/esri/core/workers/chunks/e4b3f2d5c43518b0cde7.js +1 -0
- package/assets/esri/core/workers/chunks/e5e3b6d00d27b5bb354f.js +1 -0
- package/assets/esri/core/workers/chunks/ef6279f5c63ab1e88c71.js +1 -0
- package/assets/esri/core/workers/chunks/{0711d3ad4d403bcfdcad.js → f117a89d1f4001a1f9f0.js} +1 -1
- package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +1 -0
- package/assets/esri/core/workers/chunks/f32ca4381e804cc3481e.js +1 -0
- package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +1 -0
- package/assets/esri/core/workers/chunks/f9e48205178a5a804d38.js +1 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +15 -6
- package/assets/esri/themes/base/widgets/_ItemList.scss +6 -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/chunks/WaterSurface.glsl.js +2 -2
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/interfaces.d.ts +121 -84
- package/layers/FeatureLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/BlendLayer.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/ogc/wcsUtils.js +1 -1
- package/layers/support/RasterFunctionTemplate.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/arcadeUtils.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/multipartParser.js +1 -1
- package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +2 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
- package/package.json +2 -2
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/rest/imageService.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/ImageSampleResult.js +1 -1
- package/rest/support/ImageVolumeResult.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/support/TablesMixin.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/fitVectorMarker.js +5 -0
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/DrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/graphics/HighlightGraphicContainer.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/util.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/VisibleElements.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/07bff9e742f3e5877f3f.js +0 -1
- package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js +0 -2
- package/assets/esri/core/workers/chunks/287362f9af132fafe4de.js +0 -1
- package/assets/esri/core/workers/chunks/2ea5e5e6c4660a06b516.js +0 -1
- package/assets/esri/core/workers/chunks/380d37ceb8cf52bad190.js +0 -1
- package/assets/esri/core/workers/chunks/3984bf01f055fc42bfbf.js +0 -1
- package/assets/esri/core/workers/chunks/39e38aab86dcee3f79be.js +0 -1
- package/assets/esri/core/workers/chunks/41cd1a5c99ab3bbd1fb4.js +0 -1
- package/assets/esri/core/workers/chunks/5e7f16b312077ca8c18d.js +0 -1
- package/assets/esri/core/workers/chunks/69d307758262e5d7a32e.js +0 -1
- package/assets/esri/core/workers/chunks/6ef2514a6b7bbfb8e37d.js +0 -1
- package/assets/esri/core/workers/chunks/7e4d72279cc599b7029c.js +0 -1
- package/assets/esri/core/workers/chunks/82d26884127ed772cc4b.js +0 -1
- package/assets/esri/core/workers/chunks/8438fba57e82e4cc7c11.js +0 -1
- package/assets/esri/core/workers/chunks/858b191c078d04232342.js +0 -1
- package/assets/esri/core/workers/chunks/918bdba41fa470cf77fd.js +0 -1
- package/assets/esri/core/workers/chunks/91d2bdfa6e34c10b7f50.js +0 -1
- package/assets/esri/core/workers/chunks/92155d112ebb6a4c6c6e.js +0 -1
- package/assets/esri/core/workers/chunks/991e0f619f1f81f94d56.js +0 -1
- package/assets/esri/core/workers/chunks/9a27824d94df702e6e28.js +0 -1
- package/assets/esri/core/workers/chunks/b1269b51cef3e11c85e3.js +0 -1
- package/assets/esri/core/workers/chunks/b33122adfd1fb68f7c0f.js +0 -1
- package/assets/esri/core/workers/chunks/bbbe5d6cb8b737811c84.js +0 -1
- package/assets/esri/core/workers/chunks/bf26f58210755875748c.js +0 -1
- package/assets/esri/core/workers/chunks/c1fd87af3129873369fd.js +0 -1
- package/assets/esri/core/workers/chunks/c4c2b94e5cee7b824093.js +0 -1
- package/assets/esri/core/workers/chunks/c85374360ac5e169af16.js +0 -1
- package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +0 -1
- package/assets/esri/core/workers/chunks/d175953337fa655dc6b0.js +0 -1
- package/assets/esri/core/workers/chunks/d8c762ca94e3a11b125d.js +0 -1
- package/assets/esri/core/workers/chunks/dbc447413ab40a79ba87.js +0 -1
- package/assets/esri/core/workers/chunks/e26dc0c1654316bb1558.js +0 -1
- package/assets/esri/core/workers/chunks/e410a09650530d7aad10.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as c,writeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as f,minScale as h,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,hasCurrentUser as b,isLayerCacheStale as j,supportsQueryOnly as S,readGlobalIdField as E,readObjectIdField as x,readVersion as U}from"../support/featureLayerUtils.js";import O from"../support/GeometryFieldsInfo.js";import w from"../support/LayerFloorInfo.js";import D from"../support/Relationship.js";import{getFeatureLayerCapabilities as T}from"../support/serviceCapabilitiesUtils.js";import M from"../support/Subtype.js";import{timeZoneProperty as B}from"../../time/timeZoneUtils.js";const R=R=>{let C=class extends R{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(b(this.serviceDefinitionExpression)||b(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(j(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return T(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return S(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return E(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||S(this))return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return S(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return x(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){if(null==e)return void this._set("url",e);const t=c({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){y(this,e,null,t,i)}readVersion(e,t){return U(t)}};return e([o({readOnly:!0})],C.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],C.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],C.prototype,"capabilities",void 0),e([s("service","capabilities")],C.prototype,"readCapabilitiesFromService",null),e([o(B("dateFieldsTimeReference"))],C.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],C.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],C.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],C.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],C.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],C.prototype,"editingInfo",void 0),e([s("editingInfo")],C.prototype,"readEditingInfo",null),e([o({readOnly:!0})],C.prototype,"effectiveCapabilities",null),e([o()],C.prototype,"effectiveEditingEnabled",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],C.prototype,"elevationInfo",void 0),e([o()],C.prototype,"fieldsIndex",void 0),e([o({type:w,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:l}}}}})],C.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],C.prototype,"fullExtent",void 0),e([o()],C.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:O,json:{read:{source:"geometryProperties"}}})],C.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],C.prototype,"geometryType",void 0),e([o({type:String})],C.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],C.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],C.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],C.prototype,"hasM",void 0),e([o({readOnly:!0})],C.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],C.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],C.prototype,"heightModelInfo",void 0),e([o({type:Date})],C.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],C.prototype,"indexes",void 0),e([o({readOnly:!0})],C.prototype,"isTable",void 0),e([s("service","isTable",["type"])],C.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],C.prototype,"layerId",void 0),e([o(f)],C.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],C.prototype,"readMaxScale",null),e([o(h)],C.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],C.prototype,"readMinScale",null),e([o({type:String})],C.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],C.prototype,"readObjectIdFieldFromService",null),e([o(B("preferredTimeReference"))],C.prototype,"preferredTimeZone",void 0),e([o({type:[D],readOnly:!0})],C.prototype,"relationships",void 0),e([o({type:Boolean})],C.prototype,"returnM",void 0),e([o({type:Boolean})],C.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],C.prototype,"serverGens",void 0),e([o({readOnly:!0})],C.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],C.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],C.prototype,"serviceItemId",void 0),e([o()],C.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],C.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],C.prototype,"subtypeField",void 0),e([o({type:[M],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],C.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],C.prototype,"trackIdField",void 0),e([o(v)],C.prototype,"url",null),e([p("url")],C.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],C.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],C.prototype,"readVersion",null),C=e([n("esri.layers.mixins.FeatureLayerBase")],C),C};export{R as FeatureLayerBase};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as c,writeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as h,minScale as f,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,hasCurrentUser as b,isLayerCacheStale as j,supportsQueryOnly as S,readGlobalIdField as E,readObjectIdField as x,readVersion as U}from"../support/featureLayerUtils.js";import O from"../support/GeometryFieldsInfo.js";import T from"../support/LayerFloorInfo.js";import D from"../support/Relationship.js";import{getFeatureLayerCapabilities as w}from"../support/serviceCapabilitiesUtils.js";import M from"../support/Subtype.js";import{timeZoneProperty as B}from"../../time/timeZoneUtils.js";const R=R=>{let C=class extends R{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(b(this.serviceDefinitionExpression)||b(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(j(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return w(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return S(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return E(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||S(this))return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return S(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return x(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){if(null==e)return void this._set("url",e);const t=c({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){y(this,e,null,t,i)}readVersion(e,t){return U(t)}};return e([o({readOnly:!0})],C.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],C.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],C.prototype,"capabilities",void 0),e([s("service","capabilities")],C.prototype,"readCapabilitiesFromService",null),e([o(B("dateFieldsTimeReference"))],C.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],C.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],C.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],C.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],C.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],C.prototype,"editingInfo",void 0),e([s("editingInfo")],C.prototype,"readEditingInfo",null),e([o({readOnly:!0})],C.prototype,"effectiveCapabilities",null),e([o()],C.prototype,"effectiveEditingEnabled",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],C.prototype,"elevationInfo",void 0),e([o()],C.prototype,"fieldsIndex",void 0),e([o({type:T,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],C.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],C.prototype,"fullExtent",void 0),e([o()],C.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:O,json:{read:{source:"geometryProperties"}}})],C.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],C.prototype,"geometryType",void 0),e([o({type:String})],C.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],C.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],C.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],C.prototype,"hasM",void 0),e([o({readOnly:!0})],C.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],C.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],C.prototype,"heightModelInfo",void 0),e([o({type:Date})],C.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],C.prototype,"indexes",void 0),e([o({readOnly:!0})],C.prototype,"isTable",void 0),e([s("service","isTable",["type"])],C.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],C.prototype,"layerId",void 0),e([o(h)],C.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],C.prototype,"readMaxScale",null),e([o(f)],C.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],C.prototype,"readMinScale",null),e([o({type:String})],C.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],C.prototype,"readObjectIdFieldFromService",null),e([o(B("preferredTimeReference"))],C.prototype,"preferredTimeZone",void 0),e([o({type:[D],readOnly:!0})],C.prototype,"relationships",void 0),e([o({type:Boolean})],C.prototype,"returnM",void 0),e([o({type:Boolean})],C.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],C.prototype,"serverGens",void 0),e([o({readOnly:!0})],C.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],C.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],C.prototype,"serviceItemId",void 0),e([o()],C.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],C.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],C.prototype,"subtypeField",void 0),e([o({type:[M],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],C.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],C.prototype,"trackIdField",void 0),e([o(v)],C.prototype,"url",null),e([n("url")],C.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],C.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],C.prototype,"readVersion",null),C=e([p("esri.layers.mixins.FeatureLayerBase")],C),C};export{R as FeatureLayerBase};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Error.js";import{isBlobProtocol as t}from"../../core/urlUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{Integer as o,Null as s}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{readLoadable as y}from"../../core/accessorSupport/read.js";import{willPropertyWrite as m}from"../../core/accessorSupport/write.js";import{supportedTypes as c}from"./operationalLayers.js";import{listMode as d,opacity as u}from"../support/commonProperties.js";import w from"../../time/TimeExtent.js";const b=b=>{let
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Error.js";import{isBlobProtocol as t}from"../../core/urlUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{Integer as o,Null as s}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{readLoadable as y}from"../../core/accessorSupport/read.js";import{willPropertyWrite as m}from"../../core/accessorSupport/write.js";import{supportedTypes as c}from"./operationalLayers.js";import{listMode as d,opacity as u}from"../support/commonProperties.js";import w from"../../time/TimeExtent.js";const b=b=>{let g=class extends b{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,r,t){return"Group Layer"===t?.portalItem?.type?void 0:e}writeListMode(e,r,t,i){(i&&"ground"===i.layerContainerType||e&&m(this,t,{},i))&&(r[t]=e)}writeOperationalLayerType(e,r,t){e&&(r[t]=e)}writeTitle(e,r){r.title=e??"Layer"}readVisibilityTimeExtent(e){return e?w.fromArray(e):null}writeVisibilityTimeExtent(e,t,i,o){e&&"tables"!==o.layerContainerType&&(e.isEmpty?o?.messages&&o.messages.push(new r("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):t[i]=e.toArray())}read(e,r){r&&(r.layer=this),y(this,e,(r=>super.read(e,r)),r)}write(e,i){if(!this.persistenceEnabled&&!i?.ignorePersistenceEnabled)return null;if(i?.origin){const e=`${i.origin}/${i.layerContainerType||"operational-layers"}`,t=c[e];let o=!!t?.[this.operationalLayerType];if("ArcGISTiledElevationServiceLayer"===this.operationalLayerType&&"web-scene/operational-layers"===e&&(o=!1),"ArcGISDimensionLayer"===this.operationalLayerType&&"web-map/operational-layers"===e&&(o=!1),!o)return i.messages?.push(new r("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this})),null}const o=super.write(e,{...i,layer:this}),s=!!i&&!!i.messages&&!!i.messages.filter((e=>e instanceof r&&"web-document-write:property-required"===e.name)).length;return t(o?.url)?(i?.messages?.push(new r("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:o}beforeSave(){}};return e([i({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],g.prototype,"id",void 0),e([n("id",["id"])],g.prototype,"readId",null),e([i(d)],g.prototype,"listMode",void 0),e([p("listMode")],g.prototype,"writeListMode",null),e([i({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:l,isRequired:!0}}}}})],g.prototype,"operationalLayerType",void 0),e([p("operationalLayerType")],g.prototype,"writeOperationalLayerType",null),e([i(u)],g.prototype,"opacity",void 0),e([i({type:Boolean,readOnly:!1})],g.prototype,"persistenceEnabled",void 0),e([i({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],g.prototype,"title",void 0),e([p("title"),p(["web-scene"],"title")],g.prototype,"writeTitle",null),e([i({type:w,json:{origins:{"web-scene":{write:{layerContainerTypes:l}}}}})],g.prototype,"visibilityTimeExtent",void 0),e([n("visibilityTimeExtent")],g.prototype,"readVisibilityTimeExtent",null),e([p(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[o,s]]}})],g.prototype,"writeVisibilityTimeExtent",null),e([i({type:Boolean,json:{name:"visibility",write:{layerContainerTypes:l}}})],g.prototype,"visible",void 0),g=e([a("esri.layers.mixins.OperationalLayer")],g),g};function g(e){return"operationalLayerType"in e}export{b as OperationalLayer,g as isOperationalLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WCS:async()=>(await import("../WCSLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
|
|
5
|
+
const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WCS:async()=>(await import("../WCSLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,SubtypeGroupTable:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
|
package/layers/ogc/wcsUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../request.js";import r from"../../core/Error.js";import{isAbortError as s}from"../../core/promiseUtils.js";import{isSupportedVersion as t,parseCapabilities as o}from"../support/rasterDatasets/wcsCapabilitiesParser.js";import{parseCoverages as a}from"../support/rasterDatasets/wcsCoverageParser.js";async function i(a,i){const{version:n,customParameters:c,signal:p}=i??{},l=n?.startsWith("1.0")?"version":"acceptVersions",m={service:"WCS",request:"GetCapabilities",[l]:n,...c};try{let{data:r}=await e(a,{query:m,responseType:"xml",signal:p});return i?.version||t(r)||(m[l]="2.0.1",({data:r}=await e(a,{query:m,responseType:"xml",signal:p}))),o(r)}catch(u){if(!s(u))throw new r("wcslayer:open","wcs capabilities is not valid or supported");throw u}}async function n(t,o){const{coverageIds:i,version:n,customParameters:c,signal:p}=o,l=n.slice(0,3),m="1.0"===l?"coverage":"1.1"===l?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:n,[m]:i.join(","),...c};try{const{data:r}=await e(t,{query:u,responseType:"xml",signal:p});return a(r,n)}catch(v){if(!s(v))throw new r("wcslayer:open","wcs coverage description is not valid or supported");throw v}}export{n as describeCoverage,i as getCapabilities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{JSONMap as e}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import s from"./RasterFunctionInfo.js";import n from"./RasterFunctionProperties.js";const y=new e({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let a=class extends o{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};t([r({type:[String],json:{write:!0}})],a.prototype,"aliases",void 0),t([r({type:Object,json:{write:{isRequired:!0}}})],a.prototype,"arguments",void 0),t([r({type:String,json:{write:{isRequired:!0}}})],a.prototype,"description",void 0),t([r({type:s,json:{write:{isRequired:!0},name:"function"}})],a.prototype,"functionInfo",void 0),t([r({type:y.apiValues,json:{type:[0,1,2],read:y.read,write:{writer:y.write,isRequired:!0}}})],a.prototype,"functionType",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"group",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"help",void 0),t([r({type:Number,json:{type:i,write:!0,name:"_object_id"}})],a.prototype,"id",void 0),t([r({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),t([r({type:String,json:{write:!0,name:"definition"}})],a.prototype,"queryDefinition",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"tag",void 0),t([r({type:n,json:{write:!0}})],a.prototype,"properties",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"thumbnail",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"thumbnailEx",void 0),t([r({json:{type:["RasterFunctionTemplate"],write:!0}})],a.prototype,"type",void 0),a=t([p("esri.layers.support.RasterFunctionTemplate")],a);const c=a;export{c as default};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{JSONMap as e}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import s from"./RasterFunctionInfo.js";import n from"./RasterFunctionProperties.js";const y=new e({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let a=class extends o{constructor(){super(...arguments),this.description="",this.functionType="mosaic",this.type="RasterFunctionTemplate"}};t([r({type:[String],json:{write:!0}})],a.prototype,"aliases",void 0),t([r({type:Object,json:{write:{isRequired:!0}}})],a.prototype,"arguments",void 0),t([r({type:String,json:{write:{isRequired:!0}}})],a.prototype,"description",void 0),t([r({type:s,json:{write:{isRequired:!0},name:"function"}})],a.prototype,"functionInfo",void 0),t([r({type:y.apiValues,json:{type:[0,1,2],read:y.read,write:{writer:y.write,isRequired:!0}}})],a.prototype,"functionType",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"group",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"help",void 0),t([r({type:Number,json:{type:i,write:!0,name:"_object_id"}})],a.prototype,"id",void 0),t([r({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),t([r({type:String,json:{write:!0,name:"definition"}})],a.prototype,"queryDefinition",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"tag",void 0),t([r({type:n,json:{write:!0}})],a.prototype,"properties",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"thumbnail",void 0),t([r({type:String,json:{write:!0}})],a.prototype,"thumbnailEx",void 0),t([r({json:{type:["RasterFunctionTemplate"],write:!0}})],a.prototype,"type",void 0),a=t([p("esri.layers.support.RasterFunctionTemplate")],a);const c=a;export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import"../../core/has.js";import i from"../../core/Error.js";import n from"../../core/Identifiable.js";import{clone as o}from"../../core/lang.js";import s from"../../core/Loadable.js";import a from"../../core/Logger.js";import{MultiOriginJSONMixin as l}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../../core/object.js";import{sqlAnd as d}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import{reader as y}from"../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import f from"../../form/FormTemplate.js";import h from"../../geometry/SpatialReference.js";import{labelsVisible as b,legendEnabled as g,minScale as v,maxScale as j,popupEnabled as w}from"./commonProperties.js";import{createQuery as F,computeDomainFromSubtypes as I}from"./featureLayerUtils.js";import O from"./FeatureTemplate.js";import{defineFieldProperties as S}from"./fieldProperties.js";import{fixRendererFields as T}from"./fieldUtils.js";import C from"./LabelClass.js";import{reader as E}from"./labelingInfo.js";import{rendererReader as q,supportedRendererTypes as A}from"./subtypeGroupLayerUtils.js";import x from"../../renderers/SimpleRenderer.js";import R from"../../rest/support/Query.js";import{createPopupTemplate as P}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as L,defaultPolylineSymbol2D as D,defaultPointSymbol2D as G}from"../../symbols/support/defaults.js";import N from"../../tables/AttributeTableTemplate.js";const V=S();let $=0;function M(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function U(e){return new x({symbol:_(e)})}function _(e){switch(e){case"point":case"multipoint":return G.clone();case"polyline":return D.clone();case"polygon":case"multipatch":return L.clone();default:return null}}function k(e,t){return!!t&&("unique-value"===e?.type&&null!=e.field&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression)}function Q(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function B(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const i={},n=Q(e,t);if(null!=n){const{defaultValues:e}=n;for(const t in e)i[t]=e[t]}return i[t.subtypeField]=e,new O({name:"New Feature",drawingTool:r,prototype:{attributes:i}})}let H=class extends(l(r.ClonableMixin(n.IdentifiableMixin(s)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${$++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return T(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:i,parent:n}=this;let s;if(i){s=[];let e=0;i.forEach((({name:t,alias:r,editable:i,visible:o})=>{if(!o)return;const a=n?.fields?.find((e=>e.name===t));if(!a)return;const l={name:t};let p=!1;r!==a.alias&&(l.alias=r,p=!0),i!==a.editable&&(l.editable=i,p=!0),s.push(l),p&&e++})),0===e&&s.length===i.length&&(s=null)}else s=o(e);s?.length&&p(r,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,i=e?.fields;if(!e||!i?.length)return null;const{subtypes:n,subtypeField:o}=e,s=n?.find((e=>e.code===r)),a=s?.defaultValues,l=s?.domains,p=[];for(const d of i){const e=d.clone(),{name:i}=e,n=t?.find((e=>e.name===i));if(e.visible=!t||!!n,n){const{alias:t,editable:r}=n;t&&(e.alias=t),!1===r&&(e.editable=!1)}const s=a?.[i]??null;e.defaultValue=i===o?r:s;const u=l?.[i]??null;e.domain=i===o?null:u?"inherited"===u.type?e.domain:u.clone():null,p.push(e)}return p}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||a.getLogger(this).error(z("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){T(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?U(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const i=t.drawingInfo?.renderer,n=q(i,t,r);let o;const{subtypeCode:s}=this;if(null!=s&&k(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(s)));e&&(o=new x({symbol:e.symbol}))}else"simple"!==n?.type||n.visualVariables?.length||(o=n);return o}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;if(!i)return;const n=i.visualVariables?.some((e=>"rotationInfo"!==e.type));return n?void 0:q(i,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??h.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[B(this.subtypeCode,t)]}readTitleFromService(e,t){const r=Q(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw z("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new i("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw z("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new i("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw z("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new i("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw z("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:i,title:n}=this;if(r){const{displayField:e,editFieldsInfo:o,objectIdField:s}=r;t={displayField:e,editFieldsInfo:o,fields:i,objectIdField:s,title:n}}return P(t,e)}createQuery(){if(!this.parent)throw z("createQuery");const e=F(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=d(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const t=I(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw z("queryAttachments");const i=e.clone();return i.where=W(i.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw z("queryFeatureCount");return r.parent.queryFeatureCount(J(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw z("queryFeatures");return r.parent.queryFeatures(J(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw z("queryObjectIds");return r.parent.queryObjectIds(J(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw z("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw z("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};e([u({type:N,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],H.prototype,"attributeTableTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"capabilities",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"effectiveCapabilities",null),e([u({json:{write:{ignoreOrigin:!0}}})],H.prototype,"charts",void 0),e([u({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],H.prototype,"editingEnabled",void 0),e([u({type:Boolean,readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"elevationInfo",null),e([u({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],H.prototype,"fieldOverrides",void 0),e([m("fieldOverrides")],H.prototype,"writeFieldOverrides",null),e([u({...V.fields,readOnly:!0,json:{read:!1}})],H.prototype,"fields",null),e([u(V.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"floorInfo",null),e([u({type:f,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],H.prototype,"formTemplate",void 0),e([u({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],H.prototype,"id",void 0),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"geometryType",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),e([u(M(o(b)))],H.prototype,"labelsVisible",void 0),e([u({type:[C],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:E},write:{ignoreOrigin:!0}}})],H.prototype,"labelingInfo",void 0),e([u({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],H.prototype,"layerType",void 0),e([u(M(o(g)))],H.prototype,"legendEnabled",void 0),e([u({type:["show","hide"]})],H.prototype,"listMode",void 0),e([u((()=>{const e=o(v);return e.json.origins.service.read=!1,M(e)})())],H.prototype,"minScale",void 0),e([u((()=>{const e=o(j);return e.json.origins.service.read=!1,M(e)})())],H.prototype,"maxScale",void 0),e([u({readOnly:!0})],H.prototype,"effectiveScaleRange",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"objectIdField",null),e([u({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],H.prototype,"opacity",void 0),e([u({clonable:!1})],H.prototype,"parent",void 0),e([u(M(o(w)))],H.prototype,"popupEnabled",void 0),e([u({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],H.prototype,"popupTemplate",void 0),e([u({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"relationships",null),e([u({types:A,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],H.prototype,"renderer",null),e([y("service","renderer",["drawingInfo.renderer","subtypeField","type"])],H.prototype,"readRendererFromService",null),e([y("renderer",["layerDefinition.drawingInfo.renderer"])],H.prototype,"readRenderer",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"spatialReference",null),e([u({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],H.prototype,"subtypeCode",void 0),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"subtypeField",null),e([u({type:[O],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],H.prototype,"templates",void 0),e([y("service","templates",["geometryType","subtypeField","subtypes","type"])],H.prototype,"readTemplatesFromService",null),e([u({type:String,json:{write:{ignoreOrigin:!0}}})],H.prototype,"title",void 0),e([y("service","title",["subtypes"])],H.prototype,"readTitleFromService",null),e([u({readOnly:!0,json:{read:!1}})],H.prototype,"url",null),e([u({readOnly:!0})],H.prototype,"userHasUpdateItemPrivileges",null),e([u({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],H.prototype,"visible",void 0),H=e([c("esri.layers.support.SubtypeSublayer")],H);const J=(e,t,r)=>{if(!r)return t.createQuery();const i=R.from(r);return i.where=W(i.where,e.subtypeField,t.subtypeCode),i},W=(e,t,r)=>{const i=new RegExp(`${t}\\s*=\\s*\\d+`),n=`${t}=${r}`,o=e??"";return i.test(o)?o.replace(i,n):d(n,o)},z=e=>new i(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),K=H;export{K as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import"../../core/has.js";import n from"../../core/Error.js";import i from"../../core/Identifiable.js";import{clone as o}from"../../core/lang.js";import s from"../../core/Loadable.js";import a from"../../core/Logger.js";import{MultiOriginJSONMixin as l}from"../../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../../core/object.js";import{sqlAnd as d}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import{reader as y}from"../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as f}from"../../core/accessorSupport/layerContainerType.js";import h from"../../form/FormTemplate.js";import b from"../../geometry/SpatialReference.js";import{labelsVisible as g,legendEnabled as v,minScale as j,maxScale as w,popupEnabled as F}from"./commonProperties.js";import{createQuery as I,computeDomainFromSubtypes as T}from"./featureLayerUtils.js";import O from"./FeatureTemplate.js";import{defineFieldProperties as S}from"./fieldProperties.js";import{fixRendererFields as C}from"./fieldUtils.js";import E from"./LabelClass.js";import{reader as q}from"./labelingInfo.js";import{rendererReader as A,supportedRendererTypes as x}from"./subtypeGroupLayerUtils.js";import R from"../../renderers/SimpleRenderer.js";import P from"../../rest/support/Query.js";import{createPopupTemplate as L}from"../../support/popupUtils.js";import{defaultPolygonSymbol2D as D,defaultPolylineSymbol2D as G,defaultPointSymbol2D as N}from"../../symbols/support/defaults.js";import V from"../../tables/AttributeTableTemplate.js";const $=S();let M=0;function U(e,t){let r=e.json.write;return"object"!=typeof r&&(r=e.json.write={}),r.ignoreOrigin=!0,t?.spatialOnly&&(r.layerContainerTypes=f),e}function _(e){const t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),"object"==typeof t.write&&(e?.spatialOnly&&(t.write.layerContainerTypes=f),e?.target&&(t.write.target=e.target)),t}function k(e){return new R({symbol:Q(e)})}function Q(e){switch(e){case"point":case"multipoint":return N.clone();case"polyline":return G.clone();case"polygon":case"multipatch":return D.clone();default:return null}}function B(e,t){return!!t&&("unique-value"===e?.type&&null!=e.field&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression)}function H(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function J(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},i=H(e,t);if(null!=i){const{defaultValues:e}=i;for(const t in e)n[t]=e[t]}return n[t.subtypeField]=e,new O({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}let W=class extends(l(r.ClonableMixin(i.IdentifiableMixin(s)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${M++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return C(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:n,parent:i}=this;let s;if(n){s=[];let e=0;n.forEach((({name:t,alias:r,editable:n,visible:o})=>{if(!o)return;const a=i?.fields?.find((e=>e.name===t));if(!a)return;const l={name:t};let p=!1;r!==a.alias&&(l.alias=r,p=!0),n!==a.editable&&(l.editable=n,p=!0),s.push(l),p&&e++})),0===e&&s.length===n.length&&(s=null)}else s=o(e);s?.length&&p(r,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e?.fields;if(!e||!n?.length)return null;const{subtypes:i,subtypeField:o}=e,s=i?.find((e=>e.code===r)),a=s?.defaultValues,l=s?.domains,p=[];for(const d of n){const e=d.clone(),{name:n}=e,i=t?.find((e=>e.name===n));if(e.visible=!t||!!i,i){const{alias:t,editable:r}=i;t&&(e.alias=t),!1===r&&(e.editable=!1)}const s=a?.[n]??null;e.defaultValue=n===o?r:s;const u=l?.[n]??null;e.domain=n===o?null:u?"inherited"===u.type?e.domain:u.clone():null,p.push(e)}return p}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||a.getLogger(this).error(X("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){C(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?k(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const n=t.drawingInfo?.renderer,i=A(n,t,r);let o;const{subtypeCode:s}=this;if(null!=s&&B(i,t.subtypeField)){const e=i.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(s)));e&&(o=new R({symbol:e.symbol}))}else"simple"!==i?.type||i.visualVariables?.length||(o=i);return o}readRenderer(e,t,r){const n=t?.layerDefinition?.drawingInfo?.renderer;if(!n)return;const i=n.visualVariables?.some((e=>"rotationInfo"!==e.type));return i?void 0:A(n,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??b.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[J(this.subtypeCode,t)]}readTitleFromService(e,t){const r=H(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw X("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new n("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:i}=this;if(!i)throw X("updateAttachment");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new n("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return i.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw X("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new n("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw X("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:i}=this;if(r){const{displayField:e,editFieldsInfo:o,objectIdField:s}=r;t={displayField:e,editFieldsInfo:o,fields:n,objectIdField:s,title:i}}return L(t,e)}createQuery(){if(!this.parent)throw X("createQuery");const e=I(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=d(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const t=T(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw X("queryAttachments");const n=e.clone();return n.where=K(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw X("queryFeatureCount");return r.parent.queryFeatureCount(z(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw X("queryFeatures");return r.parent.queryFeatures(z(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw X("queryObjectIds");return r.parent.queryObjectIds(z(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw X("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw X("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};e([u({type:V,json:_({name:"attributeTableInfo"})})],W.prototype,"attributeTableTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"capabilities",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"effectiveCapabilities",null),e([u({json:_()})],W.prototype,"charts",void 0),e([u({type:Boolean,nonNullable:!0,json:_({name:"enableEditing"})})],W.prototype,"editingEnabled",void 0),e([u({type:Boolean,readOnly:!0})],W.prototype,"effectiveEditingEnabled",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"elevationInfo",null),e([u({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],W.prototype,"fieldOverrides",void 0),e([m("fieldOverrides")],W.prototype,"writeFieldOverrides",null),e([u({...$.fields,readOnly:!0,json:{read:!1}})],W.prototype,"fields",null),e([u($.fieldsIndex)],W.prototype,"fieldsIndex",void 0),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"floorInfo",null),e([u({type:h,json:_({name:"formInfo"})})],W.prototype,"formTemplate",void 0),e([u({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],W.prototype,"id",void 0),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"isTable",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"geometryType",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"type",void 0),e([u(U(o(g)))],W.prototype,"labelsVisible",void 0),e([u({type:[E],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:q},write:{ignoreOrigin:!0,layerContainerTypes:f}}})],W.prototype,"labelingInfo",void 0),e([u({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:f}}})],W.prototype,"layerType",void 0),e([u(U(o(v)))],W.prototype,"legendEnabled",void 0),e([u({type:["show","hide"]})],W.prototype,"listMode",void 0),e([u((()=>{const e=o(j);return e.json.origins.service.read=!1,U(e,{spatialOnly:!0})})())],W.prototype,"minScale",void 0),e([u((()=>{const e=o(w);return e.json.origins.service.read=!1,U(e,{spatialOnly:!0})})())],W.prototype,"maxScale",void 0),e([u({readOnly:!0})],W.prototype,"effectiveScaleRange",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"objectIdField",null),e([u({type:Number,range:{min:0,max:1},nonNullable:!0,json:_({spatialOnly:!0})})],W.prototype,"opacity",void 0),e([u({clonable:!1})],W.prototype,"parent",void 0),e([u(U(o(F)))],W.prototype,"popupEnabled",void 0),e([u({type:t,json:_({name:"popupInfo"})})],W.prototype,"popupTemplate",void 0),e([u({readOnly:!0})],W.prototype,"defaultPopupTemplate",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"relationships",null),e([u({types:x,json:_({target:"layerDefinition.drawingInfo.renderer",spatialOnly:!0})})],W.prototype,"renderer",null),e([y("service","renderer",["drawingInfo.renderer","subtypeField","type"])],W.prototype,"readRendererFromService",null),e([y("renderer",["layerDefinition.drawingInfo.renderer"])],W.prototype,"readRenderer",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"spatialReference",null),e([u({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],W.prototype,"subtypeCode",void 0),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"subtypeField",null),e([u({type:[O],json:_({name:"layerDefinition.templates"})})],W.prototype,"templates",void 0),e([y("service","templates",["geometryType","subtypeField","subtypes","type"])],W.prototype,"readTemplatesFromService",null),e([u({type:String,json:_()})],W.prototype,"title",void 0),e([y("service","title",["subtypes"])],W.prototype,"readTitleFromService",null),e([u({readOnly:!0,json:{read:!1}})],W.prototype,"url",null),e([u({readOnly:!0})],W.prototype,"userHasUpdateItemPrivileges",null),e([u({type:Boolean,nonNullable:!0,json:_({name:"visibility",spatialOnly:!0})})],W.prototype,"visible",void 0),W=e([c("esri.layers.support.SubtypeSublayer")],W);const z=(e,t,r)=>{if(!r)return t.createQuery();const n=P.from(r);return n.where=K(n.where,e.subtypeField,t.subtypeCode),n},K=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${r}`,o=e??"";return n.test(o)?o.replace(n,i):d(i,o)},X=e=>new n(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),Y=W;export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter((({valueExpression:e})=>e&&"$view.scale"!==e)).map((({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}})));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter((({valueExpression:e})=>e)).map((({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}})));r.push(...t)}return r}function n(e,n){const r=[];if(e?.expressionInfos){const t=e?.expressionInfos.map((({title:e,name:r,expression:t,returnType:o})=>({title:e,name:r,expression:t,profileInfo:{name:"layer"===n?"popup":"feature-reduction
|
|
5
|
+
function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter((({valueExpression:e})=>e&&"$view.scale"!==e)).map((({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}})));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter((({valueExpression:e})=>e)).map((({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}})));r.push(...t)}return r}function n(e,n){const r=[];if(e?.expressionInfos){const t=e?.expressionInfos.map((({title:e,name:r,expression:t,returnType:o})=>({title:e,name:r,expression:t,profileInfo:{name:"layer"===n?"popup":"popup-feature-reduction",context:"popup-template",returnType:o,source:n}})));r.push(...t)}if(e?.content&&Array.isArray(e.content)){const t=e?.content.filter((({type:e})=>"expression"===e)).map((({expressionInfo:e})=>({title:e.title,expression:e.expression,profileInfo:{name:"layer"===n?"popup-element":"popup-element-feature-reduction",context:"popup-expression-content",returnType:e.returnType,source:n}})));r.push(...t)}return r}function r(e){const n=[];if(e?.featureExpressionInfo?.expression){const r={expression:e?.featureExpressionInfo?.expression,profileInfo:{name:"feature-z",context:"elevation-info",source:"layer"}};n.push(r)}return n}function t(e){const n=[];if(e){const r=e.filter((({valueExpression:e})=>e)).map((({valueExpression:e})=>({expression:e,profileInfo:{name:"feature-z",context:"order-by",source:"layer"}})));n.push(...r)}return n}function o(e){const n=[];if(e?.expressionInfos){const r=e?.expressionInfos.map((({title:e,name:n,expression:r,returnType:t})=>({title:e,name:n,expression:r,profileInfo:{name:"boolean"===t?"form-constraint":"form-calculation",context:"form-template",returnType:t,source:"layer"}})));n.push(...r)}return n}function s(r){return[...n(r?.popupTemplate,"feature-reduction"),...p(r?.labelingInfo,"feature-reduction"),...e(r?.renderer,"feature-reduction"),...i(r?.fields)]}function i(e){const n=[];if(e){const r=e.filter((({onStatisticExpression:e,isAutoGenerated:n})=>e&&!n)).map((({onStatisticExpression:{expression:e,title:n}})=>({expression:e,title:n,profileInfo:{name:"aggregate-field",context:"aggregate-field",source:"feature-reduction"}})));n.push(...r)}return n}function p(e,n){const r=[];if(e){const t=e.filter((({labelExpressionInfo:e})=>e?.expression)).map((({labelExpressionInfo:e})=>({expression:e?.expression,title:e?.title,profileInfo:{name:"labeling",context:"label-class",source:n}})));r.push(...t)}return r}function a(i){const a=[...p(i.labelingInfo,"layer"),...n(i.popupTemplate,"layer"),...e(i.renderer,"layer")];if("elevationInfo"in i&&a.push(...r(i.elevationInfo)),"featureReduction"in i&&a.push(...s(i.featureReduction)),"trackInfo"in i){const r=i.trackInfo;a.push(...e(r?.latestObservations.renderer),...e(r?.previousObservations.renderer),...e(r?.trackLines.renderer),...p(r?.latestObservations.labelingInfo),...p(r?.previousObservations.labelingInfo),...p(r?.trackLines.labelingInfo),...n(r?.popupTemplate))}return"orderBy"in i&&a.push(...t(i.orderBy)),"formTemplate"in i&&a.push(...o(i.formTemplate)),a}export{a as getExpressionsFromLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import
|
|
5
|
+
import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as t}from"../../webdoc/support/opacityUtils.js";const s={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:e}}},l={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},p={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:e}}},y={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},d={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:e}}},c={value:null,type:a,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:e}}};function m(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const w={write:{enabled:!0,layerContainerTypes:e},read:!0},f={type:Number,json:{origins:{"web-document":w,"portal-item":{write:!0}}}},b={...f,json:{...f.json,origins:{"web-document":{...w,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?t(r.layerDefinition.drawingInfo.transparency):void 0:t(r.drawingInfo.transparency)}}},g={type:r,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,i)=>{const a=r.fromJSON(e);return null!=i.spatialReference&&"object"==typeof i.spatialReference&&(a.spatialReference=n.fromJSON(i.spatialReference)),a}}}},read:!1}},u={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},j={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:e}}},v={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:e}}},I={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},T={type:o,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{T as attributeTableTemplate,c as elevationInfo,u as id,p as labelsVisible,d as legendEnabled,I as listMode,v as maxScale,j as minScale,f as opacity,b as opacityDrawingInfo,l as popupEnabled,m as readOnlyService,g as sceneLayerFullExtent,s as screenSizePerspectiveEnabled,y as url};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as
|
|
5
|
+
import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as o}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as n}from"../../renderers/support/styleUtils.js";async function l(e,r,a){if(!r)return;const y=r.map((e=>G(e,a))),t=await Promise.allSettled(y);for(const i of t)"rejected"===i.status||i.value&&e.add(i.value)}const c={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},s={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},u={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},I={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},m={...u,LinkChartLayer:"LinkChartLayer"},g={...d},T={...I};async function G(e,r){return f(await M(e,r),e,r)}async function f(e,r,a){const y=new e;return y.read(r,a.context),"group"===y.type&&("GroupLayer"===r.layerType?await v(y,r,a):b(r)?C(y,r,a.context):A(r)&&await h(y,r,a.context)),await n(y,a.context),y}async function M(e,n){const l=n.context,c=w(l);let s=e.layerType||e.type;!s&&n?.defaultLayerType&&(s=n.defaultLayerType);const p=c[s];let S=p?a[p]:a.UnknownLayer;if(b(e)){const t=l?.portal;if(e.itemId){const i=new y({id:e.itemId,portal:t});await i.load();const L=(await o(i,new r)).className||"UnknownLayer";S=a[L]}}else"ArcGISFeatureLayer"===s?t(e)||i(e)?S=a.MapNotesLayer:L(e)?S=a.RouteLayer:A(e)&&(S=a.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?S=a.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(S=a.UnsupportedLayer);return S()}function A(e){if("ArcGISFeatureLayer"!==e.layerType||b(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function b(e){return"Feature Collection"===e.type}function w(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=S;break;case"ground":r=s;break;case"tables":r=p;break;default:r=c}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=T;break;case"tables":r=g;break;default:r=m}break;default:switch(e.layerContainerType){case"basemap":r=I;break;case"tables":r=d;break;default:r=u}}return r}async function v(r,a,y){const t=new e,i=l(t,Array.isArray(a.layers)?a.layers:[],y);try{try{if(await i,"group"===r.type)return r.layers.addMany(t),r}catch(L){r.destroy();for(const e of t)e.destroy();throw L}}catch(L){throw L}}function C(e,r,a){r.itemId&&(e.portalItem=new y({id:r.itemId,portal:a?.portal}),e.when((()=>{const y=y=>{const t=y.layerId;W(y,e,r,t,a);const i=r.featureCollection?.layers?.[t];i&&y.read(i,a)};e.layers?.forEach(y),e.tables?.forEach(y)})))}async function h(e,r,y){const t=a.FeatureLayer,i=await t(),L=r.featureCollection,o=L?.showLegend,n=L?.layers?.map(((a,t)=>{const L=new i;L.read(a,y);const n={...y,ignoreDefaults:!0};return W(L,e,r,t,n),null!=o&&L.read({showLegend:o},n),L}));e.layers.addMany(n??[])}function W(e,r,a,y,t){e.read({id:`${r.id}-sublayer-${y}`,visibility:a.visibleLayers?.includes(y)??!0},t)}export{v as populateGroupLayer,l as populateOperationalLayers};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{isAxesOrderReversedForWkid as r}from"../../ogc/crsUtils.js";import{getCapabilities as a,describeCoverage as l}from"../../ogc/wcsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{parse as f}from"./multipartParser.js";import{standardizeInterpolations as p,convertOleDateTimeToEpoch as u}from"./wcsCoverageParser.js";import{getFormat as h}from"../rasterFormats/RasterCodec.js";import{clip as m}from"../rasterFunctions/pixelUtils.js";const g=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"],v="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",y="response is not a supported multipart mediaType with inline tiff",x="response is base64 encoded which may impact layer display performance",I="server returns an exception",C=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let b=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,i,n,s={}){if(this.isBlockOutside(e,i,n))return null;const{nativePixelSize:o,spatialReference:r}=this.rasterInfo,a=2**e,l=o.x*a,c=o.y*a,{blockWidth:d,blockHeight:f}=this.getBlockWidthHeight(e),{origin:p}=this.rasterInfo.storageInfo.tileInfo,u=this.getTileExtent({x:l,y:c},i,n,p,r,[d,f]),h=this.rasterInfo.extent,g=u.xmax>h.xmax,w=u.ymin<h.ymin,v=g||w;let y=u,x=d,I=f;if(v&&(y=u.clone().intersection(h),null!=y&&(g&&(x=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*x),w&&(I=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*I))),null==y||x<=1||I<=1)return null;const C=await this._getCoverage(y,x,I,a,s);if(!C)return null;const{coverageDescription:b}=this.coverageInfo,{noDataValue:$,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:j}=s;let T;if(null!=S&&null!=j&&j.length){const e=j[0].variableName;if("2.0"===b.version){const t=b.rangeType[0].find((t=>t.name===e));T=t?.nilValue}else if("1.1"===b.version){const t=b.range.find((t=>t.identifier===e));T=t?.nullValues}}const L=T??$,P=await this.decodePixelBlock(C,{width:x,height:I,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(L)?L[0]:L});if(null==P)return null;if(P&&(P.width!==x||P.height!==I))throw new t("wcsraster-fetch",`the response has unexpected dimension width: ${P.width}, height: {pixelBlock.height}`);return v?m(P,{x:0,y:0},{width:f,height:f}):P}async _open(e){const{customFetchParameters:i}=this.ioConfig,n=e?.signal,s=await a(this.url,{version:i?.version??this.version,customParameters:i,signal:n});if(this.capabilities=s,!this.version){let e=s.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.version:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:o}=this;if(!C.has(o))throw new t("wcsraster-open",`unsupported WCS version ${o}`);const{gridCoverages:r}=s;if(!r.length)throw new t("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:c}=this,d=r.find((e=>e.id===c));if(null==d)throw new t("wcsraster-open",`the coverageId ${c} does not exist in capabilities`);const f=await l(this.url,{coverageIds:[c],version:o,customParameters:i,signal:n});if(this.coverageInfo=f[0],"2.0"===o.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=d.lonLatEnvelope,e.supportedInterpolations=p(s.supportedInterpolations),this._patchDimensionValues201(c,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:u}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(u,512,512),this._set("rasterInfo",u),null==u.spatialReference)throw new t("wcsraster-open",`coverage without spatial reference is not supported: ${c}`);const{pixelType:h,bandCount:m}=await this._getPixelTypeAndBandCount(n);u.pixelType=h,1===u.bandCount&&m>1&&(u.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:i}=this,n=i.rasterInfo.multidimensionalInfo?.variables,s=C.has("1.1.2")?"1.1.2":C.has("1.1.1")?"1.1.1":C.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(n&&s)try{const i=this.url.includes("/ImageServer/"),r=e.length>8&&e.startsWith("Coverage")&&i?e.slice(8):e,a=await l(this.url,{coverageIds:[r??e],version:s,customParameters:o,signal:t}).catch((()=>{if(r)return l(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),c=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(c)for(const e of n){const t=c.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let n=e.dimensions.length-1;n>=0;n--){const s=e.dimensions[n],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[n]={...s,values:o.values}):i&&e.dimensions.splice(n,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:n,extent:s,multidimensionalInfo:r}=this.rasterInfo,a=s.center,l=new o({xmin:a.x-n.x,xmax:a.x+n.x,ymin:a.y-n.y,ymax:a.y+n.y,spatialReference:s.spatialReference});let d=[];if(null!=r){const e=r.variables[0];d=[],e.dimensions.forEach((t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:f}=this.coverageInfo,p={interpolation:"nearest",multidimensionalDefinition:d,signal:e},{version:u}=f,{ioConfig:h}=this,m="2.0"===u&&null==h.allowAnyMediaType||"1.1"===u&&null==h.use2GridOffsets;let g;try{g=await this._getCoverage(l,2,2,1,p,!0)}catch(y){if(!m)throw y;if("1.1"===u){if(!y.details?.isResolutionMismatch)throw y;h.use2GridOffsets=!0}}if(!g&&m&&("2.0"===u&&(h.allowAnyMediaType=!0),g=await this._getCoverage(l,2,2,1,p),g&&i.getLogger(this).warn("wcsraster:getcoverage",v)),!g)throw new t("wcsraster-open","unable to determine pixel type");const w=await this.decodePixelBlock(g,{width:2,height:2,planes:null,pixelType:null});if(null==w)throw new t("wcsraster-open","unable to determine pixel type");return{pixelType:w.pixelType,bandCount:w.getPlaneCount()??0}}async _getCoverage(e,n,s,o,r,a=!1){const{coverageDescription:l}=this.coverageInfo,{version:c}=l,d="2.0"===c?this._getCoverage201Parameters(e,n,s,o,r,l):"1.1"===c?this._getCoverage110Parameters(e,n,s,r,l):this._getCoverage100Parameters(e,n,s,r),p="2.0"===c?await this.request(this._constructWCS201Url(d),{signal:r.signal,responseType:"array-buffer"}):await this.request(this.url,{query:d,signal:r.signal,responseType:"array-buffer"});if("1.0"===c)return p.data;if("2.0"===c&&!1!==this.ioConfig.allowAnyMediaType){if("tiff"===h(p.data))return a&&(this.ioConfig.allowAnyMediaType=!0,i.getLogger(this).warn("wcsraster:getcoverage",v)),p.data}const u=f(p);if(u.isMultipart&&u.data){const e=u.data.find((e=>e.contentType?.toLowerCase().includes("image")&&null!=e.contentData));return a&&"base64"===e?.contentTransferEncoding&&i.getLogger(this).warn("wcsraster:getcoverage",x),e?.contentData}const m=new Uint8Array(p.data,0,Math.min(p.data.byteLength,2e3)),g=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),w=g&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(g)throw new t("wcsraster:getcoverage",I,{isResolutionMismatch:w});throw new t("wcsraster:getcoverage",y)}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,n){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=n,c=this._getInterpolationIndex(l),d=a?a.map((e=>this.coverageInfo.bandNames[e])):null,f=g[c],{multidimensionalDefinition:p}=n;let u;if(null!=p&&null!=this.rasterInfo.multidimensionalInfo){const e=p.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),u=t.map((e=>$(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:s,width:t,height:i,time:u,interpolation:f,band:d?.join(",")}}_getCoverage110Parameters(e,t,i,n,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:l}=n,c=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${c}`,f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(l),u=w[p],h=null==l||0===this.coverageInfo.supportedInterpolations?.indexOf(l),m=s.domain.spatialDomain,g=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,v=e.width/t,y=e.height/i*(g?1:-1),x=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],I=m.useEPSGAxis&&r(c),C=I?`${x[1]},${x[0]}`:`${x[0]},${x[1]}`,b=this.ioConfig.use2GridOffsets,S=I?b?`${y},${v}`:`${y},0,0,${v}`:b?`${v},${y}`:`${v},0,0,${y}`,j=v/2,T=e.xmin+j,L=e.xmax-j,P=Math.abs(y)/2,R=e.ymin+P,_=e.ymax-P,D=I?`${R},${T},${_},${L},${d}`:`${T},${R},${L},${_},${d}`,E=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let A,G=E&&u&&a?h?`${E.identifier}[${E.axis[0].identifier}[${a.join(",")}]]`:`${E.identifier}:${u}[${E.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let r=0;r<o.length;r++){let e=o[r].values;const t=o[r].dimensionName?.toLowerCase(),i=o[r].variableName?.toLowerCase(),n=s.range.find((e=>e.identifier.toLowerCase()===i));if(e.length>0)if(Array.isArray(e[0])&&(e=e[0]),"stdtime"===t)A=e.map((e=>$(e))).join(",");else if(n){const i=n.axis.find((e=>e.identifier.toLowerCase()===t));i&&(G=h?n.identifier+"["+i.identifier+"["+e.join(",")+"]]":n.identifier+":"+u+"["+i.identifier+"["+e.join(",")+"]]")}r===o.length-1&&n&&!G&&(G=h?n.identifier:n.identifier+":"+u)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:f,crs:`EPSG:${c}`,boundingbox:D,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:S,gridBaseCRS:d,timeSequence:A,rangeSubset:G}}_getCoverage201Parameters(e,t,i,n,s,o){const{multidimensionalDefinition:r,interpolation:a}=s,l=this._getInterpolationIndex(a);let c=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(l){case 0:c=d.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=d.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=d.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:p}=this.coverageInfo,{boundedBy:u,domainSet:h,rangeType:m}=o,g=u.isEastFirst?0:1,w=1-g,{axisLabels:v}=u,y=v[g],x=v[w],I=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=I,b=[];b.push(`${y}(${e.xmin},${e.xmax})`),b.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(v.length>2)for(let _=2;_<v.length;_++){const e=h.origin[_];if(v[_].toLowerCase().includes("time")){let t=e.toString();u.uomLabels?.[_].toLowerCase().includes("ole")&&(S.push(v[_]),t=$(e,!0)),b.push(v[_]+",http://www.opengis.net("+t+")")}else b.push(v[_]+",http://www.opengis.net("+e+")")}let j=null;if(null!=r&&r.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<r.length;i++){const n=v.find((e=>e===r[i].dimensionName)),s=e.find((e=>e===r[i].variableName));if(t.includes(s)||t.push(s),n){let e=r[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=n.toLowerCase().includes("time")?e.map((e=>$(e))).join(","):e.join(",");const i=b.findIndex((e=>0===e.indexOf(n+",http://www.opengis.net")));-1===i&&b.push(n+",http://www.opengis.net("+t+")"),-1===i||b[i].includes("("+t+")")||b.splice(i,1,n+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(p?.length>=2){j=(s.bandIds?s.bandIds.map((e=>p[e])):p).join(",")}const T=b.join("&subset="),L=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,P=L?null:`${y}(${t}),${x}(${i})`,R=L?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:c,scaleSize:P,scaleFactor:R,subset:T,format:f,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:I,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const n=t[e];null!=n&&("subset"===e?"string"==typeof n&&n.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(n)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};function $(e,t=!1){return(t?new Date(u(e)):new Date(e)).toISOString()}e([n({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),e([n({readOnly:!0})],b.prototype,"tileType",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"version",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"coverageId",void 0),b=e([s("esri.layers.support.rasterDatasets.WCSRaster")],b);const S=b;export{S as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{isAxesOrderReversedForWkid as r}from"../../ogc/crsUtils.js";import{getCapabilities as a,describeCoverage as l}from"../../ogc/wcsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{parse as f}from"./multipartParser.js";import{standardizeInterpolations as p,convertOleDateTimeToEpoch as u}from"./wcsCoverageParser.js";import{getFormat as h}from"../rasterFormats/RasterCodec.js";import{clip as m}from"../rasterFunctions/pixelUtils.js";const g=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"],v="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",y="response is not a supported multipart mediaType with inline tiff",x="response is base64 encoded which may impact layer display performance",I="server returns an exception",C=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let b=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,i,n,s={}){if(this.isBlockOutside(e,i,n))return null;const{nativePixelSize:o,spatialReference:r}=this.rasterInfo,a=2**e,l=o.x*a,c=o.y*a,{blockWidth:d,blockHeight:f}=this.getBlockWidthHeight(e),{origin:p}=this.rasterInfo.storageInfo.tileInfo,u=this.getTileExtent({x:l,y:c},i,n,p,r,[d,f]),h=this.rasterInfo.extent,g=u.xmax>h.xmax,w=u.ymin<h.ymin,v=g||w;let y=u,x=d,I=f;if(v&&(y=u.clone().intersection(h),null!=y&&(g&&(x=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*x),w&&(I=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*I))),null==y||x<=1||I<=1)return null;const C=await this._getCoverage(y,x,I,a,s);if(!C)return null;const{coverageDescription:b}=this.coverageInfo,{noDataValue:$,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:j}=s;let T;if(null!=S&&null!=j&&j.length){const e=j[0].variableName;if("2.0"===b.version){const t=b.rangeType[0].find((t=>t.name===e));T=t?.nilValue}else if("1.1"===b.version){const t=b.range.find((t=>t.identifier===e));T=t?.nullValues}}const L=T??$,P=await this.decodePixelBlock(C,{width:x,height:I,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(L)?L[0]:L});if(null==P)return null;if(P&&(P.width!==x||P.height!==I))throw new t("wcsraster-fetch",`the response has unexpected dimension width: ${P.width}, height: {pixelBlock.height}`);return v?m(P,{x:0,y:0},{width:f,height:f}):P}async _open(e){const{customFetchParameters:i}=this.ioConfig,n=e?.signal,s=await a(this.url,{version:i?.version??this.version,customParameters:i,signal:n});if(this.capabilities=s,!this.version){let e=s.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.version:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:o}=this;if(!C.has(o))throw new t("wcsraster-open",`unsupported WCS version ${o}`);const{gridCoverages:r}=s;if(!r.length)throw new t("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:c}=this,d=r.find((e=>e.id===c));if(null==d)throw new t("wcsraster-open",`the coverageId ${c} does not exist in capabilities`);const f=await l(this.url,{coverageIds:[c],version:o,customParameters:i,signal:n});if(this.coverageInfo=f[0],"2.0"===o.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=d.lonLatEnvelope,e.supportedInterpolations=p(s.supportedInterpolations),this._patchDimensionValues201(c,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:u}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(u,512,512),this._set("rasterInfo",u),null==u.spatialReference)throw new t("wcsraster-open",`coverage without spatial reference is not supported: ${c}`);const{pixelType:h,bandCount:m}=await this._getPixelTypeAndBandCount(n);u.pixelType=h,1===u.bandCount&&m>1&&(u.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:i}=this,n=i.rasterInfo.multidimensionalInfo?.variables,s=C.has("1.1.2")?"1.1.2":C.has("1.1.1")?"1.1.1":C.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(n&&s)try{const i=this.url.includes("/ImageServer/"),r=e.length>8&&e.startsWith("Coverage")&&i?e.slice(8):e,a=await l(this.url,{coverageIds:[r??e],version:s,customParameters:o,signal:t}).catch((()=>{if(r)return l(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),c=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(c)for(const e of n){const t=c.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let n=e.dimensions.length-1;n>=0;n--){const s=e.dimensions[n],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[n]={...s,values:o.values}):i&&e.dimensions.splice(n,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:n,extent:s,multidimensionalInfo:r}=this.rasterInfo,a=s.center,l=new o({xmin:a.x-n.x,xmax:a.x+n.x,ymin:a.y-n.y,ymax:a.y+n.y,spatialReference:s.spatialReference});let d=[];if(null!=r){const e=r.variables[0];d=[],e.dimensions.forEach((t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:f}=this.coverageInfo,p={interpolation:"nearest",multidimensionalDefinition:d,signal:e},{version:u}=f,{ioConfig:h}=this,m="2.0"===u&&null==h.allowAnyMediaType||"1.1"===u&&null==h.use2GridOffsets;let g;try{g=await this._getCoverage(l,2,2,1,p,!0)}catch(y){if(!m)throw y;if("1.1"===u){if(!y.details?.isResolutionMismatch)throw y;h.use2GridOffsets=!0}}if(!g&&m&&("2.0"===u&&(h.allowAnyMediaType=!0),g=await this._getCoverage(l,2,2,1,p),g&&i.getLogger(this).warn("wcsraster:getcoverage",v)),!g)throw new t("wcsraster-open","unable to determine pixel type");const w=await this.decodePixelBlock(g,{width:2,height:2,planes:null,pixelType:null});if(null==w)throw new t("wcsraster-open","unable to determine pixel type");return{pixelType:w.pixelType,bandCount:w.getPlaneCount()??0}}async _getCoverage(e,n,s,o,r,a=!1){const{coverageDescription:l}=this.coverageInfo,{version:c}=l,d="2.0"===c?this._getCoverage201Parameters(e,n,s,o,r,l):"1.1"===c?this._getCoverage110Parameters(e,n,s,r,l):this._getCoverage100Parameters(e,n,s,r),p="2.0"===c?await this.request(this._constructWCS201Url(d),{signal:r.signal,responseType:"array-buffer"}):await this.request(this.url,{query:d,signal:r.signal,responseType:"array-buffer"});if("1.0"===c)return p.data;if("2.0"===c&&!1!==this.ioConfig.allowAnyMediaType){if("tiff"===h(p.data))return a&&(this.ioConfig.allowAnyMediaType=!0,i.getLogger(this).warn("wcsraster:getcoverage",v)),p.data}const u=f(p);if(u.isMultipart&&u.data){const e=u.data.find((e=>e.isValidImage));return a&&"base64"===e?.contentTransferEncoding&&i.getLogger(this).warn("wcsraster:getcoverage",x),e?.contentData}const m=new Uint8Array(p.data,0,Math.min(p.data.byteLength,2e3)),g=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),w=g&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(g)throw new t("wcsraster:getcoverage",I,{isResolutionMismatch:w});throw new t("wcsraster:getcoverage",y)}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,n){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=n,c=this._getInterpolationIndex(l),d=a?a.map((e=>this.coverageInfo.bandNames[e])):null,f=g[c],{multidimensionalDefinition:p}=n;let u;if(null!=p&&null!=this.rasterInfo.multidimensionalInfo){const e=p.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),u=t.map((e=>$(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:s,width:t,height:i,time:u,interpolation:f,band:d?.join(",")}}_getCoverage110Parameters(e,t,i,n,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:l}=n,c=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${c}`,f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(l),u=w[p],h=null==l||0===this.coverageInfo.supportedInterpolations?.indexOf(l),m=s.domain.spatialDomain,g=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,v=e.width/t,y=e.height/i*(g?1:-1),x=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],I=m.useEPSGAxis&&r(c),C=I?`${x[1]},${x[0]}`:`${x[0]},${x[1]}`,b=this.ioConfig.use2GridOffsets,S=I?b?`${y},${v}`:`${y},0,0,${v}`:b?`${v},${y}`:`${v},0,0,${y}`,j=v/2,T=e.xmin+j,L=e.xmax-j,P=Math.abs(y)/2,R=e.ymin+P,_=e.ymax-P,D=I?`${R},${T},${_},${L},${d}`:`${T},${R},${L},${_},${d}`,E=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let A,G=E&&u&&a?h?`${E.identifier}[${E.axis[0].identifier}[${a.join(",")}]]`:`${E.identifier}:${u}[${E.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let r=0;r<o.length;r++){let e=o[r].values;const t=o[r].dimensionName?.toLowerCase(),i=o[r].variableName?.toLowerCase(),n=s.range.find((e=>e.identifier.toLowerCase()===i));if(e.length>0)if(Array.isArray(e[0])&&(e=e[0]),"stdtime"===t)A=e.map((e=>$(e))).join(",");else if(n){const i=n.axis.find((e=>e.identifier.toLowerCase()===t));i&&(G=h?n.identifier+"["+i.identifier+"["+e.join(",")+"]]":n.identifier+":"+u+"["+i.identifier+"["+e.join(",")+"]]")}r===o.length-1&&n&&!G&&(G=h?n.identifier:n.identifier+":"+u)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:f,crs:`EPSG:${c}`,boundingbox:D,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:S,gridBaseCRS:d,timeSequence:A,rangeSubset:G}}_getCoverage201Parameters(e,t,i,n,s,o){const{multidimensionalDefinition:r,interpolation:a}=s,l=this._getInterpolationIndex(a);let c=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(l){case 0:c=d.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=d.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=d.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:p}=this.coverageInfo,{boundedBy:u,domainSet:h,rangeType:m}=o,g=u.isEastFirst?0:1,w=1-g,{axisLabels:v}=u,y=v[g],x=v[w],I=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=I,b=[];b.push(`${y}(${e.xmin},${e.xmax})`),b.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(v.length>2)for(let _=2;_<v.length;_++){const e=h.origin[_];if(v[_].toLowerCase().includes("time")){let t=e.toString();u.uomLabels?.[_].toLowerCase().includes("ole")&&(S.push(v[_]),t=$(e,!0)),b.push(v[_]+",http://www.opengis.net("+t+")")}else b.push(v[_]+",http://www.opengis.net("+e+")")}let j=null;if(null!=r&&r.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<r.length;i++){const n=v.find((e=>e===r[i].dimensionName)),s=e.find((e=>e===r[i].variableName));if(t.includes(s)||t.push(s),n){let e=r[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=n.toLowerCase().includes("time")?e.map((e=>$(e))).join(","):e.join(",");const i=b.findIndex((e=>0===e.indexOf(n+",http://www.opengis.net")));-1===i&&b.push(n+",http://www.opengis.net("+t+")"),-1===i||b[i].includes("("+t+")")||b.splice(i,1,n+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(p?.length>=2){j=(s.bandIds?s.bandIds.map((e=>p[e])):p).join(",")}const T=b.join("&subset="),L=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,P=L?null:`${y}(${t}),${x}(${i})`,R=L?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:c,scaleSize:P,scaleFactor:R,subset:T,format:f,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:I,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const n=t[e];null!=n&&("subset"===e?"string"==typeof n&&n.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(n)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};function $(e,t=!1){return(t?new Date(u(e)):new Date(e)).toISOString()}e([n({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),e([n({readOnly:!0})],b.prototype,"tileType",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"version",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"coverageId",void 0),b=e([s("esri.layers.support.rasterDatasets.WCSRaster")],b);const S=b;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
function t(t){const r=e(t);return r?{isMultipart:!0,data:r.boundary?n(t.data,r,0):null}:{isMultipart:!1,data:null}}function n(t,n,e=0){const o="--"+n.boundary,i=[];for(let r=0;r<o.length;r++)i.push(o.charCodeAt(r));const a=[],s="\n--"+n.boundary+"--";for(let r=0;r<s.length;r++)a.push(s.charCodeAt(r));const l=[10],c=[13,10],f=[],u=i.length,h=new Uint8Array(t,e),g=h.length-u;let p=0,d=0;for(let b=0;b<g;b++){for(d=0;d<u&&h[b+d]===i[d];d++);if(d!==u)continue;let t=!1;if(p){const e=r(h.subarray(p,b),n);f.push(e),t=!!e.isValidImage}if(b+=u-1,h[b+1]===l[0]?b+=1:h[b+1]===c[0]&&h[b+2]===c[1]&&(b+=2),p=b+1,t)break}const y=a.length;for(let b=h.length-y-10;b<h.length-y;b++){for(d=0;d<y&&h[b+d]===a[d];d++);if(d===y){f.push(r(h.subarray(p,b),n));break}}return f}function e(t){const n=t.getHeader?.("Content-Type")?.split(";");if(!n)return null;if(!(n[0].trim()??"").startsWith("multipart/"))return null;const e={boundary:"",start:"",type:""};for(let r=1;r<n.length;r++){const t=n[r].indexOf("=");if(t>0){const o=n[r].slice(0,t).trim(),i=n[r].slice(t+1).trim();e[o]=i.startsWith('"')?i.slice(1,-1):i}}return e}function r(t,n){const e=String.fromCharCode.apply(null,t.subarray(0,Math.min(300,t.length))).split("\n"),r=Math.min(e.length,7),o={contentDisposition:"inline"};let i=0;for(let a=0;a<r;a++)if(e[a].length<4)i=i+e[a].length+1;else if("content"===e[a].slice(0,7).toLowerCase()){i=i+e[a].length+1;const t=e[a].indexOf(":");if(-1===t)continue;const n=e[a].slice(0,t).trim(),r=e[a].slice(t+1).trim();switch(n.toLowerCase()){case"content-type":o.contentType=r;break;case"content-description":o.contentDescription=r;break;case"content-transfer-encoding":o.contentTransferEncoding=r;break;case"content-id":o.contentID=r;break;case"content-disposition":o.contentDisposition=r;break;case"content-location":o.contentLocation=r}}else{if(o.contentDisposition.toLowerCase().includes("inline")&&e[a].length>=4&&o.contentType?.toLowerCase().indexOf("image")>-1){let n=!0,e=t.subarray(i,t.length);if(o.contentType.toLowerCase().indexOf("tif")>0){if("base64"===o.contentTransferEncoding){let t="";const n=e;for(let e=0;e<n.length;e+=65535){const r=n.subarray(e,e+65535>n.length-1?n.length-1:e+65535);t+=String.fromCharCode.apply(null,r)}const r=atob(t);e=new Uint8Array(r.length);for(let o=0;o<e.length;o++)e[o]=r.charCodeAt(o)}n=73===e[0]&&73===e[1]||77===e[0]&&77===e[1]}if(n){let n=e.buffer;"base64"!==o.contentTransferEncoding&&(n=new ArrayBuffer(t.length-i),e=new Uint8Array(n),e.set(t.subarray(i,t.length))),o.contentData=n,o.isValidImage=!0}break}if((""===n.start||o.contentID===n.start)&&o.contentType){if(o.contentType.includes("text")||o.contentType.includes("xml")){o.contentData=String.fromCharCode.apply(null,t.subarray(i,t.length));break}o.contentData=t.subarray(i,t.length)}}return o}export{t as parse};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Error.js";import t from"../../../geometry/Extent.js";import{getElementValue as r,getElement as o,getElements as i,getSpaceDelimitedNumericValues as n,getElementValues as a,isSameTagIgnoreNS as s,getNodeNameIgnoreNS as c}from"./xmlUtilities.js";function l(e){return e.endsWith("?")?e.slice(0,-1):e}function u(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function p(e){const a=r(e,"Service/name"),s=o(e,"Capability"),c=o(s,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",p=o(s,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",m=o(s,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",g={getCapabilities:l(c),describeCoverage:l(p),getCoverage:l(m)},v=i(e,"CoverageOfferingBrief"),d=[];for(let o=0;o<v.length;o++){const e=v[o],a=r(e,"name"),s=i(e,"pos"),c=n(s[0]),l=n(s[1]),u=new t({xmin:c[0],ymin:c[1],xmax:l[0],ymax:l[1],spatialReference:{wkid:4326}});d.push({id:a,lonLatEnvelope:u})}return{name:a,onlineResources:g,coverages:d,gridCoverages:u(d),supportedVersions:["1.0.0"],version:"1.0.0"}}function m(e){const o={};for(let i=0;i<e.childNodes.length;i++){const a=e.childNodes[i];if(1!==a.nodeType)continue;const s=c(a).toLowerCase();switch(s){case"title":case"abstract":o[s]=r(a);break;case"identifier":o.id=r(a);break;case"wgs84boundingbox":{const e=n(a,"LowerCorner"),r=n(a,"UpperCorner");o.lonLatEnvelope=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":o.coverageSummaries=o.coverageSummaries||[],o.coverageSummaries.push(m(a))}}return o}function g(e,t){if(e.coverageSummaries)for(let r=0;r<e.coverageSummaries.length;r++)e.coverageSummaries[r].abstract=e.coverageSummaries[r].abstract||e.abstract,e.coverageSummaries[r].lonLatEnvelope=e.coverageSummaries[r].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[r].title=e.coverageSummaries[r].title||e.title,g(e.coverageSummaries[r],t);null!=e.id&&t.push(e)}function v(e){const t=o(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",r=o(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=o(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:l(t),describeCoverage:l(r),getCoverage:l(i)}}function d(e){const t=r(e,"ServiceIdentification/Title"),i=a(e,"ServiceIdentification/ServiceTypeVersion"),n=v(o(e,"OperationsMetadata")),c=[],l=o(e,"Contents");for(let r=0;r<l.childNodes.length;r++){const e=l.childNodes[r];1===e.nodeType&&(s(e,"CoverageSummary")&&g(m(e),c))}const p=a(l,"SupportedFormat");return{name:t,onlineResources:n,coverages:c,gridCoverages:u(c),supportedVersions:i,supportedFormats:p,version:"1.1.0"}}function f(e){const s=o(e,"ServiceIdentification"),c=r(s,"Title"),l=a(s,"ServiceTypeVersion"),p=a(s,"Profile"),m=v(o(e,"OperationsMetadata")),g=i(e,"Contents/CoverageSummary"),d=[];for(let i=0;i<g.length;i++){const e=g[i],a=r(e,"CoverageId"),s=o(e,"WGS84BoundingBox");let c;if(s){const e=n(s,"LowerCorner"),r=n(s,"UpperCorner");c=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}const l=r(e,"CoverageSubtype")||"RectifiedGridCoverage";d.push({id:a,lonLatEnvelope:c,coverageSubType:l})}const f=o(e,"ServiceMetadata");return{name:c,supportedVersions:l,supportedFormats:a(f,"formatSupported"),supportedInterpolations:a(f,"interpolationSupported").concat(a(f,"InterpolationSupported")),onlineResources:m,profiles:p,coverages:d,gridCoverages:u(d),version:"2.0.1"}}function S(t,r=null){let o=null;if("string"==typeof t){o=(new DOMParser).parseFromString(t,"text/xml")}else o=t;let i=o.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const n=i||r||"1.0.0",a=n.slice(0,3);let s;if("2.0"===a)s=f(o);else if("1.1"===a)s=d(o);else{if("1.0"!==a)throw new e("wcsraster:parsecapabilities","the capabilities version is not supported");s=p(o)}return s.version=n,s}export{S as parseCapabilities};
|
|
5
|
+
import e from"../../../core/Error.js";import t from"../../../geometry/Extent.js";import{getElementValue as r,getElement as o,getElements as i,getSpaceDelimitedNumericValues as n,getElementValues as a,isSameTagIgnoreNS as s,getNodeNameIgnoreNS as c}from"./xmlUtilities.js";function l(e){return e.endsWith("?")?e.slice(0,-1):e}function u(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function p(e){const a=r(e,"Service/name"),s=o(e,"Capability"),c=o(s,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",p=o(s,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",m=o(s,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",g={getCapabilities:l(c),describeCoverage:l(p),getCoverage:l(m)},v=i(e,"CoverageOfferingBrief"),d=[];for(let o=0;o<v.length;o++){const e=v[o],a=r(e,"name"),s=i(e,"pos"),c=n(s[0]),l=n(s[1]),u=new t({xmin:c[0],ymin:c[1],xmax:l[0],ymax:l[1],spatialReference:{wkid:4326}});d.push({id:a,lonLatEnvelope:u})}return{name:a,onlineResources:g,coverages:d,gridCoverages:u(d),supportedVersions:["1.0.0"],version:"1.0.0"}}function m(e){const o={};for(let i=0;i<e.childNodes.length;i++){const a=e.childNodes[i];if(1!==a.nodeType)continue;const s=c(a).toLowerCase();switch(s){case"title":case"abstract":o[s]=r(a);break;case"identifier":o.id=r(a);break;case"wgs84boundingbox":{const e=n(a,"LowerCorner"),r=n(a,"UpperCorner");o.lonLatEnvelope=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":o.coverageSummaries=o.coverageSummaries||[],o.coverageSummaries.push(m(a))}}return o}function g(e,t){if(e.coverageSummaries)for(let r=0;r<e.coverageSummaries.length;r++)e.coverageSummaries[r].abstract=e.coverageSummaries[r].abstract||e.abstract,e.coverageSummaries[r].lonLatEnvelope=e.coverageSummaries[r].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[r].title=e.coverageSummaries[r].title||e.title,g(e.coverageSummaries[r],t);null!=e.id&&t.push(e)}function v(e){const t=o(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",r=o(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=o(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:l(t),describeCoverage:l(r),getCoverage:l(i)}}function d(e){const t=r(e,"ServiceIdentification/Title"),i=a(e,"ServiceIdentification/ServiceTypeVersion"),n=v(o(e,"OperationsMetadata")),c=[],l=o(e,"Contents");for(let r=0;r<l.childNodes.length;r++){const e=l.childNodes[r];1===e.nodeType&&(s(e,"CoverageSummary")&&g(m(e),c))}const p=a(l,"SupportedFormat");return{name:t,onlineResources:n,coverages:c,gridCoverages:u(c),supportedVersions:i,supportedFormats:p,version:"1.1.0"}}function f(e){const s=o(e,"ServiceIdentification"),c=r(s,"Title"),l=a(s,"ServiceTypeVersion"),p=a(s,"Profile"),m=v(o(e,"OperationsMetadata")),g=i(e,"Contents/CoverageSummary"),d=[];for(let i=0;i<g.length;i++){const e=g[i],a=r(e,"CoverageId"),s=o(e,"WGS84BoundingBox");let c;if(s){const e=n(s,"LowerCorner"),r=n(s,"UpperCorner");c=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}const l=r(e,"CoverageSubtype")||"RectifiedGridCoverage";d.push({id:a,lonLatEnvelope:c,coverageSubType:l})}const f=o(e,"ServiceMetadata");return{name:c,supportedVersions:l,supportedFormats:a(f,"formatSupported"),supportedInterpolations:a(f,"interpolationSupported").concat(a(f,"InterpolationSupported")),onlineResources:m,profiles:p,coverages:d,gridCoverages:u(d),version:"2.0.1"}}function S(e){let t=null;if("string"==typeof e){t=(new DOMParser).parseFromString(e,"text/xml")}else t=e;const r=t.documentElement.getAttribute("version"),o=r?.slice(0,3);return null!=o&&o<"2.1"}function b(t,r=null){let o=null;if("string"==typeof t){o=(new DOMParser).parseFromString(t,"text/xml")}else o=t;let i=o.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const n=i||r||"1.0.0",a=n.slice(0,3);let s;if("2.0"===a)s=f(o);else if("1.1"===a)s=d(o);else{if("1.0"!==a)throw new e("wcsraster:parsecapabilities","the capabilities version is not supported");s=p(o)}return s.version=n,s}export{S as isSupportedVersion,b as parseCapabilities};
|
|
@@ -54,7 +54,7 @@ export const cellStatistics: __esri.rasterFunctionUtils["cellStatistics"];
|
|
|
54
54
|
export const clip: __esri.rasterFunctionUtils["clip"];
|
|
55
55
|
export const colormap: __esri.rasterFunctionUtils["colormap"];
|
|
56
56
|
export const colormapToRGB: __esri.rasterFunctionUtils["colormapToRGB"];
|
|
57
|
-
export const
|
|
57
|
+
export const compositeBand: __esri.rasterFunctionUtils["compositeBand"];
|
|
58
58
|
export const conditional: __esri.rasterFunctionUtils["conditional"];
|
|
59
59
|
export const contrastBrightness: __esri.rasterFunctionUtils["contrastBrightness"];
|
|
60
60
|
export const convolution: __esri.rasterFunctionUtils["convolution"];
|
|
@@ -99,6 +99,7 @@ export const square: __esri.rasterFunctionUtils["square"];
|
|
|
99
99
|
export const statistics: __esri.rasterFunctionUtils["statistics"];
|
|
100
100
|
export const statisticsHistogram: __esri.rasterFunctionUtils["statisticsHistogram"];
|
|
101
101
|
export const stretchMinMax: __esri.rasterFunctionUtils["stretchMinMax"];
|
|
102
|
+
export const stretchNone: __esri.rasterFunctionUtils["stretchNone"];
|
|
102
103
|
export const stretchPercentClip: __esri.rasterFunctionUtils["stretchPercentClip"];
|
|
103
104
|
export const stretchStandardDeviation: __esri.rasterFunctionUtils["stretchStandardDeviation"];
|
|
104
105
|
export const table: __esri.rasterFunctionUtils["table"];
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,
|
|
5
|
+
export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,compositeBand,createColorComposite,extractBand,mask,remap,statisticsHistogram,table,transposeBits}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,calculate,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{weightedOverlay,weightedSum}from"./rasterFunctions/creators/createMultiRasterAnalysisFunctions.js";export{aspect,curvature,hillshade,shadedRelief,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{argStatistics,statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as
|
|
5
|
+
import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as compositeBand,d as createColorComposite,m as extractBand,x as mask,g as remap,p as statisticsHistogram,c as table,b as transposeBits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.20250207",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
29
|
-
"@esri/calcite-components": "~3.0.0-next.
|
|
29
|
+
"@esri/calcite-components": "~3.0.0-next.132",
|
|
30
30
|
"@vaadin/grid": "~24.6.3",
|
|
31
31
|
"@zip.js/zip.js": "~2.7.57",
|
|
32
32
|
"luxon": "~3.5.0",
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import o from"../Portal.js";import{createForItemRead as n}from"./jsonContext.js";import{getFirstLayerOrTable as s,preprocessFSItemData as
|
|
5
|
+
import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import o from"../Portal.js";import{createForItemRead as n}from"./jsonContext.js";import{getFirstLayerOrTable as s,preprocessFSItemData as l,populateSceneServiceItemData as i,getNumLayersAndTables as u,createSublayerData as p,instanceTypeToLayerTypes as c,getSublayersByLayerType as y,layerTypeToLayerModuleType as m}from"./loadUtils.js";import{hasTypeKeyword as d}from"./portalItemUtils.js";import{loadStyleRenderer as f}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as w}from"../../support/requestPresets.js";async function h(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),g(e),e.validateItem&&e.validateItem(r),I(e,t)}function g(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function I(e,t){const r=e.instance,o=r.portalItem;if(!o)return;const{url:s,title:l}=o,i=n(o,"portal-item");if("group"===r.type)return b(r,i,e);s&&"media"!==r.type&&r.read({url:s},i);const u=new a,p=await F(e,u,t);return p&&r.read(p,i),r.resourceReferences={portalItem:o,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:l},i),f(r,i)}async function b(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!d(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return L(t,a)}return t.read({title:n},r),S(t,a)}async function L(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const s=n(a,"web-map");t.read(o,s),await r.populateGroupLayer(t,o,{context:s}),t.resourceReferences={portalItem:a,paths:s.readResourcePaths??[]}}async function S(t,r){let o;const{portalItem:n}=t;if(!n)return;const p=n.type,c=r.layerModuleTypeMap;if(!c)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(p){case"Feature Service":case"Feature Collection":o=c.FeatureLayer;break;case"Stream Service":o=c.StreamLayer;break;case"Scene Service":o=c.SceneLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${p}' is not supported as a 'IGroupLayer'`)}const y=new a;let[m,d]=await Promise.all([o(),F(r,y)]),f=()=>m;if("Feature Service"===p){const e=s(d)?.customParameters;d=n.url?await l(d,n.url,y):{},f=await D(d,c)||f;const r=await C(n.url,{customParameters:e,loadContext:y});return await v(t,f,f,d,c,r)}return"Scene Service"===p&&n.url&&(d=await i(n,d,y)),u(d)>0?await v(t,f,null,d,c):await T(t,f,c)}async function T(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await w(a.url);o&&v(e,t,null,{layers:o.layers?.map(p),tables:o.tables?.map(p)},r)}async function v(e,t,r,a,o,n){let s=a.layers||[];const l=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)})),s=s.filter((e=>"Table"!==e?.layerDefinition?.type))):(s.reverse(),l.reverse()),s.forEach((r=>{const o=n?.(r);if(o||!n){const n=j(e,t(r),a,r,o);e.add(n)}})),l.length){const t=r?null:await o.FeatureLayer();l.forEach((o=>{const s=n?.(o);if(s||!n){const n=j(e,r?r(o):t,a,o,s);e.tables.add(n)}}))}}function j(e,t,r,a,n){const s=e.portalItem,l={portalItem:s.clone(),layerId:a.id};null!=a.url&&(l.url=a.url);const i=new t(l);if("sourceJSON"in i&&(i.sourceJSON=n),"subtype-group"!==i.type&&"catalog"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===s.type){const e={origin:"portal-item",portal:s.portal||o.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function F(e,t,r){if(!1===e.supportsData)return;const a=e.instance,o=a.portalItem;if(!o)return;let n=null;try{n=await o.fetchData("json",r)}catch(l){}if(x(a)){let e=null;const r=await M(o,n,t);if((n?.layers||n?.tables)&&r>0){if(null==a.layerId){const e=c(a.type),t=e?.length?y(n,e)[0]:s(n);t&&(a.layerId=t.id)}e=P(n,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=n.showLegend&&(e.showLegend=n.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),e}return n}async function M(e,r,a){if(r?.layers&&r?.tables)return u(r);const o=t(e.url);if(!o)return 1;const n=await a.fetchServiceMetadata(o.url.path,{customParameters:s(r)?.customParameters}).catch((()=>null));return(r?.layers?.length??n?.layers?.length??0)+(r?.tables?.length??n?.tables?.length??0)}function P(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&G(a,t)?a:null}function x(e){return"stream"!==e.type&&"layerId"in e}function G(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function C(e,t){const{layersJSON:a}=await r(e,t);if(!a)return null;const o=[...a.layers,...a.tables];return e=>o.find((t=>t.id===e.id))}async function D(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:u}of o){const e=u??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const l=await Promise.all(s),i=new Map;return Array.from(n).forEach(((e,t)=>{i.set(e,l[t])})),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return i.get(t)}}export{h as load};
|