@arcgis/core 4.24.0-next.20220511 → 4.24.0-next.20220512
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/components/assets/icon/compactness16.json +1 -0
- package/assets/components/assets/icon/compactness24.json +1 -0
- package/assets/components/assets/icon/compactness32.json +1 -0
- package/assets/components/assets/icon/configure16.json +1 -0
- package/assets/components/assets/icon/configure24.json +1 -0
- package/assets/components/assets/icon/configure32.json +1 -0
- package/assets/components/assets/icon/debugScript16.json +1 -0
- package/assets/components/assets/icon/debugScript24.json +1 -0
- package/assets/components/assets/icon/debugScript32.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures16.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures24.json +1 -0
- package/assets/components/assets/icon/dissolveFeatures32.json +1 -0
- package/assets/components/assets/icon/distanceType16.json +1 -0
- package/assets/components/assets/icon/distanceType24.json +1 -0
- package/assets/components/assets/icon/distanceType32.json +1 -0
- package/assets/components/assets/icon/gridDiamond16.json +1 -0
- package/assets/components/assets/icon/gridDiamond24.json +1 -0
- package/assets/components/assets/icon/gridDiamond32.json +1 -0
- package/assets/components/assets/icon/gridHexagon16.json +1 -0
- package/assets/components/assets/icon/gridHexagon24.json +1 -0
- package/assets/components/assets/icon/gridHexagon32.json +1 -0
- package/assets/components/assets/icon/gridTriangle16.json +1 -0
- package/assets/components/assets/icon/gridTriangle24.json +1 -0
- package/assets/components/assets/icon/gridTriangle32.json +1 -0
- package/assets/components/assets/icon/insets16.json +1 -0
- package/assets/components/assets/icon/insets24.json +1 -0
- package/assets/components/assets/icon/insets32.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance16.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance24.json +1 -0
- package/assets/components/assets/icon/maximumTerritoryDistance32.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters16.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters24.json +1 -0
- package/assets/components/assets/icon/minDistanceBetweenCenters32.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories16.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories24.json +1 -0
- package/assets/components/assets/icon/numberOfTerritories32.json +1 -0
- package/assets/components/assets/icon/overlapFeatures16.json +1 -0
- package/assets/components/assets/icon/overlapFeatures24.json +1 -0
- package/assets/components/assets/icon/overlapFeatures32.json +1 -0
- package/assets/components/assets/icon/profileVariables16.json +1 -0
- package/assets/components/assets/icon/profileVariables24.json +1 -0
- package/assets/components/assets/icon/profileVariables32.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis16.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis24.json +1 -0
- package/assets/components/assets/icon/rasterAnalysis32.json +1 -0
- package/assets/components/assets/icon/recurrence16.json +1 -0
- package/assets/components/assets/icon/recurrence24.json +1 -0
- package/assets/components/assets/icon/recurrence32.json +1 -0
- package/assets/components/assets/icon/splitFeatures16.json +1 -0
- package/assets/components/assets/icon/splitFeatures24.json +1 -0
- package/assets/components/assets/icon/splitFeatures32.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance16.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance24.json +1 -0
- package/assets/components/assets/icon/territoryBufferDistance32.json +1 -0
- package/assets/components/assets/icon/testData16.json +1 -0
- package/assets/components/assets/icon/testData24.json +1 -0
- package/assets/components/assets/icon/testData32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/07eda3e958d29f86b37e.js +1 -0
- package/assets/esri/core/workers/chunks/0ecaa28b8bff1d779d66.js +1 -0
- package/assets/esri/core/workers/chunks/{adae54f116f311d72d97.js → 1aba8c73c62a64e0658c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d109cd048170e2d529a.js +1 -0
- package/assets/esri/core/workers/chunks/366e5c1abd1ab6d3e548.js +1 -0
- package/assets/esri/core/workers/chunks/3e94e35f44aadbb332ff.js +1 -0
- package/assets/esri/core/workers/chunks/46411f32b29a0e783105.js +1 -0
- package/assets/esri/core/workers/chunks/4d1c87e3e0a02efcc082.js +1 -0
- package/assets/esri/core/workers/chunks/{b089058b64db3912478f.js → 5e46e60fab93ad034d3a.js} +1 -1
- package/assets/esri/core/workers/chunks/6281b15009712a5dee3c.js +1 -0
- package/assets/esri/core/workers/chunks/66f627d68dbb0fdb725f.js +1 -0
- package/assets/esri/core/workers/chunks/672da24bbf86718bf48d.js +1 -0
- package/assets/esri/core/workers/chunks/733625d85602127d62cd.js +1 -0
- package/assets/esri/core/workers/chunks/{c51c9b5da855f84b9a48.js → 7391422fc51acb96a25d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f435dc615fdc8917f6ca.js → 7cf3cff7b28ff007dbad.js} +1 -1
- package/assets/esri/core/workers/chunks/7ea06c86adfc827fda08.js +1 -0
- package/assets/esri/core/workers/chunks/{a054a52712a118c6d505.js → 82bc24bdc9c6ebaf58c0.js} +1 -1
- package/assets/esri/core/workers/chunks/8965ab74e03506e3475e.js +1 -0
- package/assets/esri/core/workers/chunks/{5405f478af3563580926.js → 8b497d9c37a8f577a467.js} +1 -1
- package/assets/esri/core/workers/chunks/919d0d8b1c2176760973.js +1 -0
- package/assets/esri/core/workers/chunks/ab2a0480dc2b608deda3.js +1 -0
- package/assets/esri/core/workers/chunks/ab97a35f7a7d5cf1da19.js +2 -0
- package/assets/esri/core/workers/chunks/{dcd0653191cd4a1ccaae.js.LICENSE.txt → ab97a35f7a7d5cf1da19.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ae554c88e862a5761f2e.js +1 -0
- package/assets/esri/core/workers/chunks/ae5ce55cd1a32525f101.js +1 -0
- package/assets/esri/core/workers/chunks/b597c04a4abb98e29d1c.js +1 -0
- package/assets/esri/core/workers/chunks/{287c484fd40eee643f3a.js → b78c3e9d31c4a562cdf0.js} +1 -1
- package/assets/esri/core/workers/chunks/be4bf1e4cbe2a593f8b3.js +1 -0
- package/assets/esri/core/workers/chunks/{b7572b0921b23aef8b9d.js → c40d9caf5189be2c698e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b28539c5a6bedb71b038.js → d63f736b3560c577a8a4.js} +1 -1
- package/assets/esri/core/workers/chunks/d869dabe937d3b60504e.js +1 -0
- package/assets/esri/core/workers/chunks/dd6c9a114ad38cf622ba.js +1 -0
- package/assets/esri/core/workers/chunks/e6b0f74226b9394bfa7a.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +3 -2
- 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/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -0
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -0
- package/chunks/EdgeShader.glsl.js +3 -4
- package/interfaces.d.ts +463 -30
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/AggregateField.d.ts +4 -0
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/FeatureReductionBinning.d.ts +4 -0
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/OutStatistic.d.ts +4 -0
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +3 -3
- package/portal/support/portalItemUtils.js +1 -1
- package/renderers/PieChartRenderer.d.ts +4 -0
- package/renderers/PieChartRenderer.js +5 -0
- package/renderers/Renderer.js +1 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/clickToleranceUtils.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/renderers/support/types.js +1 -1
- package/renderers/support/utils.js +1 -1
- package/renderers.js +1 -1
- package/request.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +5 -0
- package/rest/imageService/getCatalogItemRasterInfo.js +5 -0
- package/rest/print.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/location.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CurveHelper.js +1 -1
- package/symbols/cim/ExpandedCIM.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/GlyphSource.js +1 -1
- package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushPieChart.js +5 -0
- package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
- package/views/2d/engine/webgl/color.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/enums.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
- package/views/2d/engine/webgl/techniques/pieChart/TechniquePieChart.js +5 -0
- package/views/2d/engine/webgl/techniques/utils.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
- package/views/3d/environment/SnowyWeather.d.ts +4 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +5 -5
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +37 -31
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/SceneSnappingEngine.js +5 -0
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/snappingFactory.js +5 -0
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +0 -1
- package/assets/esri/core/workers/chunks/0806d5d706a864542bfb.js +0 -1
- package/assets/esri/core/workers/chunks/52478ee2d2a1354b6900.js +0 -1
- package/assets/esri/core/workers/chunks/5759af97f96f24c40105.js +0 -1
- package/assets/esri/core/workers/chunks/7bc828fbdd54c0b28aac.js +0 -1
- package/assets/esri/core/workers/chunks/875f26ee040f3d75c0db.js +0 -1
- package/assets/esri/core/workers/chunks/88384e7cafbfd2348598.js +0 -1
- package/assets/esri/core/workers/chunks/89acd5f888d6b8df4aad.js +0 -1
- package/assets/esri/core/workers/chunks/9d7533aaeac3b8d145c4.js +0 -1
- package/assets/esri/core/workers/chunks/a3bb600bfcb0282622f1.js +0 -1
- package/assets/esri/core/workers/chunks/b50ae3dc7e43ff452568.js +0 -1
- package/assets/esri/core/workers/chunks/b5b7bcbc19b3430903ee.js +0 -1
- package/assets/esri/core/workers/chunks/b758f3c419edc2306784.js +0 -1
- package/assets/esri/core/workers/chunks/cf47b605c31063e88357.js +0 -1
- package/assets/esri/core/workers/chunks/cfbb332d144e65a4a55d.js +0 -1
- package/assets/esri/core/workers/chunks/db937849b2c1af87b481.js +0 -1
- package/assets/esri/core/workers/chunks/dc3ed59f450283d97a19.js +0 -1
- package/assets/esri/core/workers/chunks/dcd0653191cd4a1ccaae.js +0 -2
- package/assets/esri/core/workers/chunks/dfb6a28039e5d5ce6fd4.js +0 -1
- package/assets/esri/core/workers/chunks/e4fdd1eaf987977d0a51.js +0 -1
- package/assets/esri/core/workers/chunks/f7e0bb11ba3677069c94.js +0 -1
- package/assets/esri/core/workers/chunks/f7f3dde4c8f9c687cc1e.js +0 -1
- package/assets/esri/core/workers/chunks/fc6beaf9466ea3898549.js +0 -1
package/layers/StreamLayer.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.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import o from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as p}from"../renderers/support/types.js";import n from"../request.js";import{symbolTypesRenderer as a}from"../symbols.js";import l from"../core/Error.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import o from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as p}from"../renderers/support/types.js";import n from"../request.js";import{symbolTypesRenderer as a}from"../symbols.js";import l from"../core/Error.js";import d from"../core/Logger.js";import{isSome as m}from"../core/maybe.js";import{MultiOriginJSONMixin as y}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as f}from"../core/promiseUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{createTypeReader as j}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import{featureGeometryTypeKebabDictionary as S}from"../geometry/support/typeUtils.js";import v from"./Layer.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as I}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as x}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as F}from"./mixins/TemporalLayer.js";import{labelsVisible as U,legendEnabled as D,maxScale as E,minScale as O,popupEnabled as k,screenSizePerspectiveEnabled as N,url as _}from"./support/commonProperties.js";import{featureReductionProperty as J}from"./support/featureReductionUtils.js";import{defineFieldProperties as A}from"./support/fieldProperties.js";import{fixRendererFields as G,fixTimeInfoFields as q}from"./support/fieldUtils.js";import C from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import z from"./support/PurgeOptions.js";import{loadStyleRenderer as M}from"../renderers/support/styleUtils.js";import W from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import Q from"../symbols/support/ElevationInfo.js";import H from"../geometry/SpatialReference.js";import K from"../geometry/Extent.js";const X=d.getLogger("esri.layers.StreamLayer"),Y=A();let Z=class extends(x(I(F(L(P(b(R(T(y(w(v))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new z,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=H.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.webSocketUrl=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const r=m(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(f).then((()=>this._fetchService(r)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){G(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,r,s){const p=(r=r.layerDefinition||r).drawingInfo&&r.drawingInfo.renderer||void 0;if(p){const e=i(p,r,s)||void 0;return e||X.error("Failed to create renderer",{rendererDefinition:r.drawingInfo.renderer,layer:this,context:s}),e}if(r.defaultSymbol)return r.types&&r.types.length?new o({defaultSymbol:$(r.defaultSymbol,r,s),field:r.typeIdField,uniqueValueInfos:r.types.map((e=>({id:e.id,symbol:$(e.symbol,e,s)})))}):new t({symbol:$(r.defaultSymbol,r,s)})}createPopupTemplate(e){return B(this,e)}createQuery(){const e=new W;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){if(!this.fields)return null;let t=null;return this.fields.some((r=>(r.name===e&&(t=r.domain),!!t))),t}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}async _fetchService(e){if(!!this.webSocketUrl){if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.url=this.webSocketUrl}else if(!this.sourceJSON){const{data:r}=await n(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=r}return this.sourceJSON={...this.sourceJSON??{},objectIdField:"__esri_stream_id__"},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl}),G(this.renderer,this.fieldsIndex),q(this.timeInfo,this.fieldsIndex),M(this,{origin:"service"})}};e([u({type:String})],Z.prototype,"copyright",void 0),e([u({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Z.prototype,"definitionExpression",void 0),e([u({type:String})],Z.prototype,"displayField",void 0),e([u({type:Q})],Z.prototype,"elevationInfo",void 0),e([u(J)],Z.prototype,"featureReduction",void 0),e([u(Y.fields)],Z.prototype,"fields",void 0),e([u(Y.fieldsIndex)],Z.prototype,"fieldsIndex",void 0),e([u({type:K})],Z.prototype,"geometryDefinition",void 0),e([u({type:S.apiValues,json:{read:{reader:S.read}}})],Z.prototype,"geometryType",void 0),e([u(U)],Z.prototype,"labelsVisible",void 0),e([u({type:[C],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:V},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],Z.prototype,"labelingInfo",void 0),e([u(D)],Z.prototype,"legendEnabled",void 0),e([u({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([u({type:c})],Z.prototype,"maxReconnectionAttempts",void 0),e([u({type:c})],Z.prototype,"maxReconnectionInterval",void 0),e([u(E)],Z.prototype,"maxScale",void 0),e([u(O)],Z.prototype,"minScale",void 0),e([u({type:String})],Z.prototype,"objectIdField",void 0),e([u({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],Z.prototype,"operationalLayerType",void 0),e([u(k)],Z.prototype,"popupEnabled",void 0),e([u({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Z.prototype,"popupTemplate",void 0),e([u({type:z})],Z.prototype,"purgeOptions",void 0),e([u({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:p,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],Z.prototype,"renderer",null),e([h("service","renderer",["drawingInfo.renderer","defaultSymbol"]),h("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Z.prototype,"readRenderer",null),e([u(N)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([u()],Z.prototype,"sourceJSON",void 0),e([u({type:H,json:{origins:{service:{read:{source:"spatialReference"}}}}})],Z.prototype,"spatialReference",void 0),e([u({json:{read:!1}})],Z.prototype,"type",void 0),e([u(_)],Z.prototype,"url",void 0),e([u({type:Number})],Z.prototype,"updateInterval",void 0),e([u({type:String})],Z.prototype,"webSocketUrl",void 0),Z=e([g("esri.layers.StreamLayer")],Z);const $=j({types:a}),ee=Z;export{ee 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.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import r from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as o}from"../renderers/support/types.js";import a from"../request.js";import{symbolTypes as n,symbolTypesRenderer as p}from"../symbols.js";import l from"../core/Collection.js";import u from"../core/Error.js";import{HandleOwnerMixin as d}from"../core/HandleOwner.js";import c from"../core/Handles.js";import y from"../core/has.js";import{JSONMap as h}from"../core/jsonMap.js";import m from"../core/Logger.js";import{destroyMaybe as f,isSome as b,unwrapOr as g}from"../core/maybe.js";import{MultiOriginJSONMixin as w}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as S}from"../core/object.js";import{throwIfAbortError as v,throwIfAborted as I}from"../core/promiseUtils.js";import{watch as F,sync as j}from"../core/reactiveUtils.js";import{parseWhereClause as E}from"../core/sql.js";import{urlToObject as D,join as x}from"../core/urlUtils.js";import{property as C}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as M}from"../core/accessorSupport/decorators/cast.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";import{subclass as A}from"../core/accessorSupport/decorators/subclass.js";import{writer as T}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as L}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import P from"../form/FormTemplate.js";import _ from"../geometry/Extent.js";import O from"../geometry/HeightModelInfo.js";import Q from"../geometry/SpatialReference.js";import q from"./Layer.js";import{MemorySource as G}from"./graphics/sources/MemorySource.js";import{ArcGISService as U}from"./mixins/ArcGISService.js";import{BlendLayer as V}from"./mixins/BlendLayer.js";import{CustomParametersMixin as B}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as z}from"./mixins/OperationalLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{RefreshableLayer as W}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as k}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as $}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as Z,parse as H,cleanTitle as J,sanitizeUrlWithLayerId as K,writeUrlWithLayerId as X,isHostedAgolService as Y}from"./support/arcgisLayerUrl.js";import{elevationInfo as ee,id as te,opacityDrawingInfo as re,legendEnabled as ie,minScale as se,maxScale as oe,screenSizePerspectiveEnabled as ae,url as ne}from"./support/commonProperties.js";import{FeatureIndex as pe}from"./support/FeatureIndex.js";import{featureReductionProperty as le}from"./support/featureReductionUtils.js";import{defineFieldProperties as ue}from"./support/fieldProperties.js";import{fixRendererFields as de,fixTimeInfoFields as ce}from"./support/fieldUtils.js";import ye from"./support/GeometryFieldsInfo.js";import he from"./support/LayerFloorInfo.js";import me from"./support/Relationship.js";import fe from"./support/SubtypeSublayer.js";import be from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as ge}from"./support/versionUtils.js";import{DataLayerSource as we}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import ve from"../rest/support/AttachmentQuery.js";import Ie from"../rest/support/FeatureSet.js";import Fe from"../rest/support/Query.js";import je from"../rest/support/RelationshipQuery.js";const Ee=new h({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),De={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},xe="SubtypeGroupLayer",Ce=m.getLogger("esri.layers.SubtypeGroupLayer");function Me(e){return e&&e instanceof l}function Re(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Ae(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function Te(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}const Le=ue();function Pe(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let _e=class extends(V($(k(W(U(z(N(w(B(d(q))))))))))){constructor(...e){super(...e),this._handles=new c,this.capabilities=null,this.charts=null,this.copyright=null,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,this.editingEnabled=!0,this.editingInfo=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.formTemplate=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.legendEnabled=!0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.outFields=null,this.path=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=Q.WGS84,this.subtypeField=null,this.sublayers=new(l.ofType(fe)),this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="subtype-group",this.typeIdField=null,this.indexes=new(l.ofType(pe)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0,this.own(F((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),j))}destroy(){this.source?.destroy(),this._handles=f(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=b(e)?e.signal:null;if(this.portalItem&&this.portalItem.loaded&&this.source)return void this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this._initLayerProperties(e))));const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(v).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new u("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,{attachment:this._readAttachmentCapabilities(t.attachmentProperties),data:this._readDataCapabilities(t),metadata:this._readMetadataCapabilities(t),operations:this._readOperationsCapabilities(t.capabilities||e,t),query:this._readQueryCapabilities(t),queryRelated:this._readQueryRelatedCapabilities(t),editing:this._readEditingCapabilities(t)}}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")||0)+1}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}readIsTable(e,t){return"Table"===(t=t&&t.layerDefinition||t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&S(r,e?"Table":"Feature Layer",t)}readMinScale(e,t){return t.effectiveMinScale||e||0}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeGlobalID"===r.type)return r.name}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeOID"===r.type)return r.name}get parsedUrl(){const e=this.url?D(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=x(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=x(e.path,this.layerId.toString()))),e}set renderer(e){de(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,s,o){const a=(s=s.layerDefinition||s).drawingInfo&&s.drawingInfo.renderer||void 0;if(a){const e=i(a,s,o)||void 0;return e||Ce.error("Failed to create renderer",{rendererDefinition:s.drawingInfo.renderer,layer:this,context:o}),e}if(s.defaultSymbol)return s.types&&s.types.length?new r({defaultSymbol:Oe(s.defaultSymbol,s,o),field:s.typeIdField,uniqueValueInfos:s.types.map((e=>({id:e.id,symbol:Oe(e.symbol,e,o)})))}):new t({symbol:Oe(s.defaultSymbol,s,o)})}set source(e){const t=this._get("source");t!==e&&(Me(t)&&this._resetMemorySource(t),Me(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof l?new G({layer:this,items:e}):e:null}readSource(e,t){const r=Ie.fromJSON(t.featureSet);return new G({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTitle(e,t){const r=t.layerDefinition&&t.layerDefinition.name||t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let t=r;if(!t&&this.url){const e=H(this.url);b(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),J(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}set url(e){const t=K({layer:this,url:e,nonStandardUrlAllowed:!0,logger:Ce});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){X(this,e,null,t,i)}readVersion(e,t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}addAttachment(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("addAttachment"in this.source))throw new u(xe,"Layer source does not support addAttachment capability");return this.source.addAttachment(e,t)}))}updateAttachment(e,t,r){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("updateAttachment"in this.source))throw new u(xe,"Layer source does not support updateAttachment capability");return this.source.updateAttachment(e,t,r)}))}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");return await this.load(),r.applyEdits(this,this.source,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){if(this._hasMemorySource())return this.emit("graphics-source-create",{graphicsSource:this.source}),this.source.load({signal:e});const t=await import("./graphics/sources/FeatureLayerSource.js");I(e);const r=await new t.default({layer:this}).load({signal:e});return this.emit("graphics-source-create",{graphicsSource:r}),r}createQuery(){const e=new Fe,t=this.get("capabilities.data"),r=this.get("capabilities.query"),i=this.sublayers.map((e=>e.subtypeCode));e.dynamicDataSource=this.dynamicDataSource,e.gdbVersion=this.gdbVersion,e.historicMoment=this.historicMoment,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&null!=this.returnZ&&(e.returnZ=this.returnZ),t.supportsM&&null!=this.returnM&&(e.returnM=this.returnM)),e.outFields=["*"],e.where=`${this.subtypeField} IN (${i.join(",")})`,this.definitionExpression&&(e.where+=` AND (${this.definitionExpression})`);const{timeOffset:s,timeExtent:o}=this;return e.timeExtent=null!=s&&null!=o?o.offset(-s.value,s.unit):o||null,e.multipatchOption="multipatch"===this.geometryType?"xyFootprint":null,e}deleteAttachments(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("deleteAttachments"in this.source))throw new u(xe,"Layer source does not support deleteAttachments capability");return this.source.deleteAttachments(e,t)}))}fetchRecomputedExtents(e){return this.load({signal:e?.signal}).then((()=>{if(this.source.fetchRecomputedExtents)return this.source.fetchRecomputedExtents(e);throw new u(xe,"Layer source does not support fetchUpdates capability")}))}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=ve.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new u(xe,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:s,size:o,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const p=r&&r.length>1,l=t&&t.length,d=i&&i.length,c=o&&o.length;if(p||l||d||c||s||a||n)throw new u(xe,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new u(xe,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new u(xe,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){const r=Fe.from(e)||this.createQuery(),i=g(r.outFields,[]);return i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i),this.load().then((()=>this.source.queryFeatures(r,t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this._findSublayerForFeature(t),t.sourceLayer=this;return e}))}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find((e=>e.subtypeCode===r))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(je.from(e),t);throw new u(xe,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(je.from(e),t);throw new u(xe,"Layer source does not support queryRelatedFeaturesCount capability")}))}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){const r=(t={...t,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()}).origin,i=t.layerContainerType,s=t.messages;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Table source cannot be written to web scenes and web maps`,{layer:this})),null;if(this._hasMemorySource())return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using an in-memory Table source cannot be written to web scenes and web maps`,{layer:this})),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a non-table source cannot be written to tables in web maps`,{layer:this})),null;return super.write(e,t)}serviceSupportsSpatialReference(e){return ge(this,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,!(t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i)||this._hasEditingCapability(i))}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";S("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_checkAttachmentSupport(e){const{attributes:t}=e,{objectIdField:r}=this;return this.get("capabilities.data.supportsAttachment")?e?t?t[r]?void 0:Promise.reject(new u(xe,`feature is missing the identifying attribute ${r}`)):Promise.reject(new u(xe,"'attributes' are required on a feature to query attachments")):Promise.reject(new u(xe,"A feature is required to add/delete/update attachments")):Promise.reject(new u(xe,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return a(this.url,{query:{f:"json",...this.customParameters},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async _initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),de(this.renderer,this.fieldsIndex),ce(this.timeInfo,this.fieldsIndex),Se(this,{origin:"service"})}async hasDataChanged(){if(this.source?.refresh)try{const{dataChanged:e,updates:t}=await(this.source?.refresh());if(b(t)&&(this.sourceJSON={...this.sourceJSON,...t},this.read(t,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await E(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new u("feature-layer:mixed-source-and-url","SubtypeGroupLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new u("feature-layer:source-or-url-required","SubtypeGroupLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}_readAttachmentCapabilities(e){const t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1};return e&&Array.isArray(e)&&e.forEach((e=>{const r=De[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:Re(e,"isDataVersioned",!1),supportsAttachment:Re(e,"hasAttachments",!1),supportsM:Re(e,"hasM",!1),supportsZ:Re(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:Re(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=r.includes("editing");let s=i&&r.includes("create"),o=i&&r.includes("delete"),a=i&&r.includes("update");const n=r.includes("changetracking");return i&&!(s||o||a)&&(s=o=a=!0),{supportsCalculate:Re(t,"supportsCalculate",!1),supportsTruncate:Re(t,"supportsTruncate",!1),supportsValidateSql:Re(t,"supportsValidateSql",!1),supportsAdd:s,supportsDelete:o,supportsEditing:i,supportsChangeTracking:n,supportsQuery:r.includes("query"),supportsQueryAttachments:Re(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:Re(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:a,supportsExceedsLimitStatistics:Re(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){const t=e.advancedQueryCapabilities,r=e.ownershipBasedAccessControlForFeatures,i=e.archivingInfo,s=this.url?.includes("MapServer"),o=!y("mapserver-pbf-enabled")&&s&&this.version<10.81,a=Y(this.url),n=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:Re(t,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:Re(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Re(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Te(t),supportsCentroid:Re(t,"supportsReturningGeometryCentroid",!1),supportsDistance:Re(t,"supportsQueryWithDistance",!1),supportsDistinct:Re(t,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:Re(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Re(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:Re(t,"supportsHavingClause",!1),supportsOrderBy:Re(t,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:Re(t,"supportsPagination",!1),supportsQuantization:Re(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Re(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Re(e,"supportsReturningQueryGeometry",!1),supportsResultType:Re(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Re(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Re(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Re(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Re(t,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:Re(r,"allowOthersToQuery",!0),supportsHistoricMoment:Re(i,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!o&&n.has("pbf"),supportsDisjointSpatialRelationship:Re(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:Re(t,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:Re(t,"supportsDefaultSR",!1),supportsCompactGeometry:a,maxRecordCountFactor:Ae(e,"maxRecordCountFactor",void 0),maxRecordCount:Ae(e,"maxRecordCount",void 0),standardMaxRecordCount:Ae(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Ae(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=Re(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Re(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:Re(e,"allowGeometryUpdates",!0),supportsGlobalId:Re(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Re(e,"supportsReturnServiceEditsInSourceSpatialReference",!1),supportsRollbackOnFailure:Re(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Re(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Re(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Re(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Re(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Re(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Re(t,"allowOthersToUpdate",!0)}}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}};e([C({readOnly:!0,json:{read:!1}})],_e.prototype,"capabilities",void 0),e([R("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],_e.prototype,"readCapabilities",null),e([C({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],_e.prototype,"charts",void 0),e([C({readOnly:!0})],_e.prototype,"createQueryVersion",null),e([C({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],_e.prototype,"copyright",void 0),e([C({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],_e.prototype,"displayField",void 0),e([C({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_e.prototype,"definitionExpression",void 0),e([C({types:n,readOnly:!0})],_e.prototype,"defaultSymbol",void 0),e([C({type:we})],_e.prototype,"dynamicDataSource",void 0),e([C({readOnly:!0})],_e.prototype,"editFieldsInfo",void 0),e([C({type:Boolean})],_e.prototype,"editingEnabled",void 0),e([R(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],_e.prototype,"readEditingEnabled",null),e([R("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],_e.prototype,"readEditingEnabledFromWebMap",null),e([T(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],_e.prototype,"writeEditingEnabled",null),e([T("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],_e.prototype,"writeEditingEnabledToWebMap",null),e([C({readOnly:!0})],_e.prototype,"editingInfo",void 0),e([R("editingInfo")],_e.prototype,"readEditingInfo",null),e([C(ee)],_e.prototype,"elevationInfo",void 0),e([C(le)],_e.prototype,"featureReduction",void 0),e([C({...Le.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{read:!0},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Pe}}}}})],_e.prototype,"fields",void 0),e([C(Le.fieldsIndex)],_e.prototype,"fieldsIndex",void 0),e([C({type:he,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"},origins:{"web-scene":{write:!1}}}})],_e.prototype,"floorInfo",void 0),e([C({type:P,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],_e.prototype,"formTemplate",void 0),e([C({type:_,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],_e.prototype,"fullExtent",void 0),e([C()],_e.prototype,"gdbVersion",void 0),e([C({readOnly:!0,type:ye,json:{read:{source:"geometryProperties"}}})],_e.prototype,"geometryFieldsInfo",void 0),e([C({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:Ee.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Pe,writer(e,t,r){const i=e?Ee.toJSON(e):null;i&&S(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ee.read}}})],_e.prototype,"geometryType",void 0),e([C({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],_e.prototype,"hasM",void 0),e([C({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],_e.prototype,"hasZ",void 0),e([C({readOnly:!0,type:O})],_e.prototype,"heightModelInfo",void 0),e([C({type:Date})],_e.prototype,"historicMoment",void 0),e([C(te)],_e.prototype,"id",void 0),e([C({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],_e.prototype,"isTable",void 0),e([R("service","isTable",["type","geometryType"]),R("isTable",["layerDefinition.type","layerDefinition.geometryType"])],_e.prototype,"readIsTable",null),e([T("web-map","isTable")],_e.prototype,"writeIsTable",null),e([C(re)],_e.prototype,"opacity",void 0),e([C({type:Number,json:{origins:{service:{read:{source:"id"}}},read:!1}})],_e.prototype,"layerId",void 0),e([C(ie)],_e.prototype,"legendEnabled",void 0),e([C({type:["show","hide"]})],_e.prototype,"listMode",void 0),e([C(se)],_e.prototype,"minScale",void 0),e([R("service","minScale",["minScale","effectiveMinScale"])],_e.prototype,"readMinScale",null),e([C(oe)],_e.prototype,"maxScale",void 0),e([R("service","maxScale",["maxScale","effectiveMaxScale"])],_e.prototype,"readMaxScale",null),e([C({type:String})],_e.prototype,"globalIdField",void 0),e([R("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),R("service","globalIdField",["globalIdField","fields"])],_e.prototype,"readGlobalIdFieldFromService",null),e([C({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Pe}}}}})],_e.prototype,"objectIdField",void 0),e([R("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),R("service","objectIdField",["objectIdField","fields"])],_e.prototype,"readObjectIdFieldFromService",null),e([C({value:"ArcGISSubtypeGroupLayer",type:["ArcGISSubtypeGroupLayer"]})],_e.prototype,"operationalLayerType",void 0),e([C(Le.outFields)],_e.prototype,"outFields",void 0),e([C({readOnly:!0})],_e.prototype,"parsedUrl",null),e([C({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_e.prototype,"path",void 0),e([C({type:[me],readOnly:!0})],_e.prototype,"relationships",void 0),e([C({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],_e.prototype,"renderer",null),e([R("service","renderer",["drawingInfo.renderer","defaultSymbol"]),R("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],_e.prototype,"readRenderer",null),e([C()],_e.prototype,"sourceJSON",void 0),e([C({type:Boolean})],_e.prototype,"returnM",void 0),e([C({type:Boolean})],_e.prototype,"returnZ",void 0),e([C(ae)],_e.prototype,"screenSizePerspectiveEnabled",void 0),e([C()],_e.prototype,"source",null),e([M("source")],_e.prototype,"castSource",null),e([R("portal-item","source",["featureSet"]),R("web-map","source",["featureSet"])],_e.prototype,"readSource",null),e([C({readOnly:!0})],_e.prototype,"serviceDefinitionExpression",void 0),e([R("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],_e.prototype,"readServiceDefinitionExpression",null),e([C({type:Q,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],_e.prototype,"spatialReference",void 0),e([C({type:String})],_e.prototype,"subtypeField",void 0),e([C({type:l.ofType(fe),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const s=e.map((e=>new fe({subtypeCode:e.code,renderer:i(t.drawingInfo.renderer,t,r),title:e.name})));return new(l.ofType(fe))(s)}}}}}})],_e.prototype,"sublayers",void 0),e([C({type:be})],_e.prototype,"timeInfo",void 0),e([C()],_e.prototype,"title",void 0),e([R("service","title",["name"]),R("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],_e.prototype,"readTitle",null),e([R("web-map","title",["layerDefinition.name","title"])],_e.prototype,"readTitleFromWebMap",null),e([C({type:String})],_e.prototype,"sublayerTitleMode",void 0),e([C({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],_e.prototype,"trackIdField",void 0),e([C({json:{read:!1}})],_e.prototype,"type",void 0),e([C({type:String})],_e.prototype,"typeIdField",void 0),e([R("service","typeIdField"),R("typeIdField",["layerDefinition.typeIdField"])],_e.prototype,"readTypeIdField",null),e([C({readOnly:!0,json:{write:!1}})],_e.prototype,"serverGens",void 0),e([C({type:l.ofType(pe),readOnly:!0})],_e.prototype,"indexes",void 0),e([C(ne)],_e.prototype,"url",null),e([T("url")],_e.prototype,"writeUrl",null),e([C({readOnly:!0})],_e.prototype,"userIsAdmin",void 0),e([C({json:{origins:{service:{read:!0}},read:!1}})],_e.prototype,"version",void 0),e([R("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],_e.prototype,"readVersion",null),e([C({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],_e.prototype,"visible",void 0),e([R("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],_e.prototype,"readVisible",null),_e=e([A("esri.layers.SubtypeGroupLayer")],_e);const Oe=L({types:p}),Qe=_e;export{Qe as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import r from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as o}from"../renderers/support/types.js";import a from"../request.js";import{symbolTypes as n,symbolTypesRenderer as p}from"../symbols.js";import l from"../core/Collection.js";import u from"../core/Error.js";import{HandleOwnerMixin as d}from"../core/HandleOwner.js";import c from"../core/Handles.js";import y from"../core/has.js";import{JSONMap as h}from"../core/jsonMap.js";import m from"../core/Logger.js";import{destroyMaybe as f,isSome as b,unwrapOr as g}from"../core/maybe.js";import{MultiOriginJSONMixin as w}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as S}from"../core/object.js";import{throwIfAbortError as v,throwIfAborted as I}from"../core/promiseUtils.js";import{watch as F,sync as j}from"../core/reactiveUtils.js";import{parseWhereClause as E}from"../core/sql.js";import{urlToObject as D,join as x}from"../core/urlUtils.js";import{property as C}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as M}from"../core/accessorSupport/decorators/cast.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";import{subclass as A}from"../core/accessorSupport/decorators/subclass.js";import{writer as T}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as L}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import P from"../form/FormTemplate.js";import _ from"../geometry/Extent.js";import O from"../geometry/HeightModelInfo.js";import Q from"../geometry/SpatialReference.js";import q from"./Layer.js";import{MemorySource as G}from"./graphics/sources/MemorySource.js";import{ArcGISService as U}from"./mixins/ArcGISService.js";import{BlendLayer as V}from"./mixins/BlendLayer.js";import{CustomParametersMixin as B}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as z}from"./mixins/OperationalLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{RefreshableLayer as W}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as k}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as $}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as Z,parse as H,cleanTitle as J,sanitizeUrlWithLayerId as K,writeUrlWithLayerId as X,isHostedAgolService as Y}from"./support/arcgisLayerUrl.js";import{elevationInfo as ee,id as te,opacityDrawingInfo as re,legendEnabled as ie,minScale as se,maxScale as oe,screenSizePerspectiveEnabled as ae,url as ne}from"./support/commonProperties.js";import{FeatureIndex as pe}from"./support/FeatureIndex.js";import{featureReductionProperty as le}from"./support/featureReductionUtils.js";import{defineFieldProperties as ue}from"./support/fieldProperties.js";import{fixRendererFields as de,fixTimeInfoFields as ce}from"./support/fieldUtils.js";import ye from"./support/GeometryFieldsInfo.js";import he from"./support/LayerFloorInfo.js";import me from"./support/Relationship.js";import fe from"./support/SubtypeSublayer.js";import be from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as ge}from"./support/versionUtils.js";import{DataLayerSource as we}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import ve from"../rest/support/AttachmentQuery.js";import Ie from"../rest/support/FeatureSet.js";import Fe from"../rest/support/Query.js";import je from"../rest/support/RelationshipQuery.js";const Ee=new h({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),De={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},xe="SubtypeGroupLayer",Ce=m.getLogger("esri.layers.SubtypeGroupLayer");function Me(e){return e&&e instanceof l}function Re(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Ae(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function Te(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}const Le=ue();function Pe(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let _e=class extends(V($(k(W(U(z(N(w(B(d(q))))))))))){constructor(...e){super(...e),this._handles=new c,this.capabilities=null,this.charts=null,this.copyright=null,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,this.editingEnabled=!0,this.editingInfo=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.formTemplate=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.legendEnabled=!0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.outFields=null,this.path=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=Q.WGS84,this.subtypeField=null,this.sublayers=new(l.ofType(fe)),this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="subtype-group",this.typeIdField=null,this.indexes=new(l.ofType(pe)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0,this.own(F((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),j))}destroy(){this.source?.destroy(),this._handles=f(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=b(e)?e.signal:null;if(this.portalItem&&this.portalItem.loaded&&this.source)return void this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this._initLayerProperties(e))));const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(v).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new u("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,{attachment:this._readAttachmentCapabilities(t.attachmentProperties),data:this._readDataCapabilities(t),metadata:this._readMetadataCapabilities(t),operations:this._readOperationsCapabilities(t.capabilities||e,t),query:this._readQueryCapabilities(t),queryRelated:this._readQueryRelatedCapabilities(t),editing:this._readEditingCapabilities(t)}}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")||0)+1}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}readIsTable(e,t){return"Table"===(t=t&&t.layerDefinition||t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&S(r,e?"Table":"Feature Layer",t)}readMinScale(e,t){return t.effectiveMinScale||e||0}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeGlobalID"===r.type)return r.name}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeOID"===r.type)return r.name}get parsedUrl(){const e=this.url?D(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=x(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=x(e.path,this.layerId.toString()))),e}set renderer(e){de(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,s,o){const a=(s=s.layerDefinition||s).drawingInfo&&s.drawingInfo.renderer||void 0;if(a){const e=i(a,s,o)||void 0;return e||Ce.error("Failed to create renderer",{rendererDefinition:s.drawingInfo.renderer,layer:this,context:o}),e}if(s.defaultSymbol)return s.types&&s.types.length?new r({defaultSymbol:Oe(s.defaultSymbol,s,o),field:s.typeIdField,uniqueValueInfos:s.types.map((e=>({id:e.id,symbol:Oe(e.symbol,e,o)})))}):new t({symbol:Oe(s.defaultSymbol,s,o)})}set source(e){const t=this._get("source");t!==e&&(Me(t)&&this._resetMemorySource(t),Me(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof l?new G({layer:this,items:e}):e:null}readSource(e,t){const r=Ie.fromJSON(t.featureSet);return new G({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTitle(e,t){const r=t.layerDefinition&&t.layerDefinition.name||t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let t=r;if(!t&&this.url){const e=H(this.url);b(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),J(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}set url(e){const t=K({layer:this,url:e,nonStandardUrlAllowed:!0,logger:Ce});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){X(this,e,null,t,i)}readVersion(e,t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}addAttachment(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("addAttachment"in this.source))throw new u(xe,"Layer source does not support addAttachment capability");return this.source.addAttachment(e,t)}))}updateAttachment(e,t,r){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("updateAttachment"in this.source))throw new u(xe,"Layer source does not support updateAttachment capability");return this.source.updateAttachment(e,t,r)}))}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");return await this.load(),r.applyEdits(this,this.source,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){if(this._hasMemorySource())return this.emit("graphics-source-create",{graphicsSource:this.source}),this.source.load({signal:e});const t=await import("./graphics/sources/FeatureLayerSource.js");I(e);const r=await new t.default({layer:this}).load({signal:e});return this.emit("graphics-source-create",{graphicsSource:r}),r}createQuery(){const e=new Fe,t=this.get("capabilities.data"),r=this.get("capabilities.query"),i=this.sublayers.map((e=>e.subtypeCode));e.dynamicDataSource=this.dynamicDataSource,e.gdbVersion=this.gdbVersion,e.historicMoment=this.historicMoment,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&null!=this.returnZ&&(e.returnZ=this.returnZ),t.supportsM&&null!=this.returnM&&(e.returnM=this.returnM)),e.outFields=["*"],e.where=`${this.subtypeField} IN (${i.join(",")})`,this.definitionExpression&&(e.where+=` AND (${this.definitionExpression})`);const{timeOffset:s,timeExtent:o}=this;return e.timeExtent=null!=s&&null!=o?o.offset(-s.value,s.unit):o||null,e.multipatchOption="multipatch"===this.geometryType?"xyFootprint":null,e}deleteAttachments(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("deleteAttachments"in this.source))throw new u(xe,"Layer source does not support deleteAttachments capability");return this.source.deleteAttachments(e,t)}))}fetchRecomputedExtents(e){return this.load({signal:e?.signal}).then((()=>{if(this.source.fetchRecomputedExtents)return this.source.fetchRecomputedExtents(e);throw new u(xe,"Layer source does not support fetchUpdates capability")}))}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=ve.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new u(xe,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:s,size:o,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const p=r&&r.length>1,l=t&&t.length,d=i&&i.length,c=o&&o.length;if(p||l||d||c||s||a||n)throw new u(xe,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new u(xe,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new u(xe,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){const r=Fe.from(e)||this.createQuery(),i=g(r.outFields,[]);return i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i),this.load().then((()=>this.source.queryFeatures(r,t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this._findSublayerForFeature(t),t.sourceLayer=this;return e}))}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find((e=>e.subtypeCode===r))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Fe.from(e)||this.createQuery(),t);throw new u(xe,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(je.from(e),t);throw new u(xe,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(je.from(e),t);throw new u(xe,"Layer source does not support queryRelatedFeaturesCount capability")}))}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){const r=(t={...t,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()}).origin,i=t.layerContainerType,s=t.messages;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Table source cannot be written to web scenes and web maps`,{layer:this})),null;if(this._hasMemorySource())return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using an in-memory Table source cannot be written to web scenes and web maps`,{layer:this})),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return s&&s.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a non-table source cannot be written to tables in web maps`,{layer:this})),null;return super.write(e,t)}serviceSupportsSpatialReference(e){return ge(this,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,!(t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i)||this._hasEditingCapability(i))}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";S("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_checkAttachmentSupport(e){const{attributes:t}=e,{objectIdField:r}=this;return this.get("capabilities.data.supportsAttachment")?e?t?t[r]?void 0:Promise.reject(new u(xe,`feature is missing the identifying attribute ${r}`)):Promise.reject(new u(xe,"'attributes' are required on a feature to query attachments")):Promise.reject(new u(xe,"A feature is required to add/delete/update attachments")):Promise.reject(new u(xe,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return a(this.url,{query:{f:"json",...this.customParameters},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async _initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),de(this.renderer,this.fieldsIndex),ce(this.timeInfo,this.fieldsIndex),Se(this,{origin:"service"})}async hasDataChanged(){if(this.source?.refresh)try{const{dataChanged:e,updates:t}=await(this.source?.refresh());if(b(t)&&(this.sourceJSON={...this.sourceJSON,...t},this.read(t,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await E(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new u("feature-layer:mixed-source-and-url","SubtypeGroupLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new u("feature-layer:source-or-url-required","SubtypeGroupLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}_readAttachmentCapabilities(e){const t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1};return e&&Array.isArray(e)&&e.forEach((e=>{const r=De[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:Re(e,"isDataVersioned",!1),supportsAttachment:Re(e,"hasAttachments",!1),supportsM:Re(e,"hasM",!1),supportsZ:Re(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:Re(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=r.includes("editing");let s=i&&r.includes("create"),o=i&&r.includes("delete"),a=i&&r.includes("update");const n=r.includes("changetracking");return i&&!(s||o||a)&&(s=o=a=!0),{supportsCalculate:Re(t,"supportsCalculate",!1),supportsTruncate:Re(t,"supportsTruncate",!1),supportsValidateSql:Re(t,"supportsValidateSql",!1),supportsAdd:s,supportsDelete:o,supportsEditing:i,supportsChangeTracking:n,supportsQuery:r.includes("query"),supportsQueryAttachments:Re(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:Re(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:a,supportsExceedsLimitStatistics:Re(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){const t=e.advancedQueryCapabilities,r=e.ownershipBasedAccessControlForFeatures,i=e.archivingInfo,s=this.url?.includes("MapServer"),o=!y("mapserver-pbf-enabled")&&s&&this.version<10.81,a=Y(this.url),n=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:Re(t,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:Re(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Re(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Te(t),supportsCentroid:Re(t,"supportsReturningGeometryCentroid",!1),supportsDistance:Re(t,"supportsQueryWithDistance",!1),supportsDistinct:Re(t,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:Re(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Re(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:Re(t,"supportsHavingClause",!1),supportsOrderBy:Re(t,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:Re(t,"supportsPagination",!1),supportsQuantization:Re(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Re(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Re(e,"supportsReturningQueryGeometry",!1),supportsResultType:Re(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Re(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Re(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Re(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Re(t,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:Re(r,"allowOthersToQuery",!0),supportsHistoricMoment:Re(i,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!o&&n.has("pbf"),supportsDisjointSpatialRelationship:Re(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:Re(t,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:Re(t,"supportsDefaultSR",!1),supportsCompactGeometry:a,maxRecordCountFactor:Ae(e,"maxRecordCountFactor",void 0),maxRecordCount:Ae(e,"maxRecordCount",void 0),standardMaxRecordCount:Ae(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Ae(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=Re(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Re(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:Re(e,"allowGeometryUpdates",!0),supportsGlobalId:Re(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Re(e,"supportsReturnServiceEditsInSourceSpatialReference",!1),supportsRollbackOnFailure:Re(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Re(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Re(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Re(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Re(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Re(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Re(t,"allowOthersToUpdate",!0)}}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}};e([C({readOnly:!0,json:{read:!1}})],_e.prototype,"capabilities",void 0),e([R("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],_e.prototype,"readCapabilities",null),e([C({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],_e.prototype,"charts",void 0),e([C({readOnly:!0})],_e.prototype,"createQueryVersion",null),e([C({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],_e.prototype,"copyright",void 0),e([C({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],_e.prototype,"displayField",void 0),e([C({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_e.prototype,"definitionExpression",void 0),e([C({types:n,readOnly:!0})],_e.prototype,"defaultSymbol",void 0),e([C({type:we})],_e.prototype,"dynamicDataSource",void 0),e([C({readOnly:!0})],_e.prototype,"editFieldsInfo",void 0),e([C({type:Boolean})],_e.prototype,"editingEnabled",void 0),e([R(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],_e.prototype,"readEditingEnabled",null),e([R("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],_e.prototype,"readEditingEnabledFromWebMap",null),e([T(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],_e.prototype,"writeEditingEnabled",null),e([T("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],_e.prototype,"writeEditingEnabledToWebMap",null),e([C({readOnly:!0})],_e.prototype,"editingInfo",void 0),e([R("editingInfo")],_e.prototype,"readEditingInfo",null),e([C(ee)],_e.prototype,"elevationInfo",void 0),e([C(le)],_e.prototype,"featureReduction",void 0),e([C({...Le.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{read:!0},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Pe}}}}})],_e.prototype,"fields",void 0),e([C(Le.fieldsIndex)],_e.prototype,"fieldsIndex",void 0),e([C({type:he,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"},origins:{"web-scene":{write:!1}}}})],_e.prototype,"floorInfo",void 0),e([C({type:P,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],_e.prototype,"formTemplate",void 0),e([C({type:_,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],_e.prototype,"fullExtent",void 0),e([C()],_e.prototype,"gdbVersion",void 0),e([C({readOnly:!0,type:ye,json:{read:{source:"geometryProperties"}}})],_e.prototype,"geometryFieldsInfo",void 0),e([C({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:Ee.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Pe,writer(e,t,r){const i=e?Ee.toJSON(e):null;i&&S(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ee.read}}})],_e.prototype,"geometryType",void 0),e([C({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],_e.prototype,"hasM",void 0),e([C({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],_e.prototype,"hasZ",void 0),e([C({readOnly:!0,type:O})],_e.prototype,"heightModelInfo",void 0),e([C({type:Date})],_e.prototype,"historicMoment",void 0),e([C(te)],_e.prototype,"id",void 0),e([C({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],_e.prototype,"isTable",void 0),e([R("service","isTable",["type","geometryType"]),R("isTable",["layerDefinition.type","layerDefinition.geometryType"])],_e.prototype,"readIsTable",null),e([T("web-map","isTable")],_e.prototype,"writeIsTable",null),e([C(re)],_e.prototype,"opacity",void 0),e([C({type:Number,json:{origins:{service:{read:{source:"id"}}},read:!1}})],_e.prototype,"layerId",void 0),e([C(ie)],_e.prototype,"legendEnabled",void 0),e([C({type:["show","hide"]})],_e.prototype,"listMode",void 0),e([C(se)],_e.prototype,"minScale",void 0),e([R("service","minScale",["minScale","effectiveMinScale"])],_e.prototype,"readMinScale",null),e([C(oe)],_e.prototype,"maxScale",void 0),e([R("service","maxScale",["maxScale","effectiveMaxScale"])],_e.prototype,"readMaxScale",null),e([C({type:String})],_e.prototype,"globalIdField",void 0),e([R("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),R("service","globalIdField",["globalIdField","fields"])],_e.prototype,"readGlobalIdFieldFromService",null),e([C({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Pe}}}}})],_e.prototype,"objectIdField",void 0),e([R("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),R("service","objectIdField",["objectIdField","fields"])],_e.prototype,"readObjectIdFieldFromService",null),e([C({value:"ArcGISSubtypeGroupLayer",type:["ArcGISSubtypeGroupLayer"]})],_e.prototype,"operationalLayerType",void 0),e([C(Le.outFields)],_e.prototype,"outFields",void 0),e([C({readOnly:!0})],_e.prototype,"parsedUrl",null),e([C({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_e.prototype,"path",void 0),e([C({type:[me],readOnly:!0})],_e.prototype,"relationships",void 0),e([C({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],_e.prototype,"renderer",null),e([R("service","renderer",["drawingInfo.renderer","defaultSymbol"]),R("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],_e.prototype,"readRenderer",null),e([C()],_e.prototype,"sourceJSON",void 0),e([C({type:Boolean})],_e.prototype,"returnM",void 0),e([C({type:Boolean})],_e.prototype,"returnZ",void 0),e([C(ae)],_e.prototype,"screenSizePerspectiveEnabled",void 0),e([C()],_e.prototype,"source",null),e([M("source")],_e.prototype,"castSource",null),e([R("portal-item","source",["featureSet"]),R("web-map","source",["featureSet"])],_e.prototype,"readSource",null),e([C({readOnly:!0})],_e.prototype,"serviceDefinitionExpression",void 0),e([R("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],_e.prototype,"readServiceDefinitionExpression",null),e([C({type:Q,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],_e.prototype,"spatialReference",void 0),e([C({type:String})],_e.prototype,"subtypeField",void 0),e([C({type:l.ofType(fe),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const s=e.map((e=>new fe({subtypeCode:e.code,renderer:i(t.drawingInfo.renderer,t,r),title:e.name})));return new(l.ofType(fe))(s)}}}}}})],_e.prototype,"sublayers",void 0),e([C({type:be})],_e.prototype,"timeInfo",void 0),e([C()],_e.prototype,"title",void 0),e([R("service","title",["name"]),R("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],_e.prototype,"readTitle",null),e([R("web-map","title",["layerDefinition.name","title"])],_e.prototype,"readTitleFromWebMap",null),e([C({type:String})],_e.prototype,"sublayerTitleMode",void 0),e([C({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],_e.prototype,"trackIdField",void 0),e([C({json:{read:!1}})],_e.prototype,"type",void 0),e([C({type:String})],_e.prototype,"typeIdField",void 0),e([R("service","typeIdField"),R("typeIdField",["layerDefinition.typeIdField"])],_e.prototype,"readTypeIdField",null),e([C({readOnly:!0,json:{write:!1}})],_e.prototype,"serverGens",void 0),e([C({type:l.ofType(pe),readOnly:!0})],_e.prototype,"indexes",void 0),e([C(ne)],_e.prototype,"url",null),e([T("url")],_e.prototype,"writeUrl",null),e([C({readOnly:!0})],_e.prototype,"userIsAdmin",void 0),e([C({json:{origins:{service:{read:!0}},read:!1}})],_e.prototype,"version",void 0),e([R("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],_e.prototype,"readVersion",null),e([C({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],_e.prototype,"visible",void 0),e([R("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],_e.prototype,"readVisible",null),_e=e([A("esri.layers.SubtypeGroupLayer")],_e);const Oe=L({types:p}),Qe=_e;export{Qe as default};
|
package/layers/WFSLayer.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.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{rendererTypes as t,webSceneRendererTypes as i}from"../renderers/support/types.js";import{isSome as o}from"../core/maybe.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{urlToObject as p}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{Integer as l}from"../core/accessorSupport/ensureType.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import{featureGeometryTypeKebabDictionary as u}from"../geometry/support/typeUtils.js";import y from"./Layer.js";import{WFSSource as f}from"./graphics/sources/WFSSource.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as x}from"./mixins/TemporalLayer.js";import{WFS_OID_FIELD_NAME as I}from"./ogc/wfsUtils.js";import{elevationInfo as O,labelsVisible as R,legendEnabled as S,opacityDrawingInfo as P,popupEnabled as U,screenSizePerspectiveEnabled as q,url as E}from"./support/commonProperties.js";import{featureReductionProperty as T}from"./support/featureReductionUtils.js";import L from"./support/Field.js";import{defineFieldProperties as D}from"./support/fieldProperties.js";import{fixRendererFields as C,fixTimeInfoFields as Q}from"./support/fieldUtils.js";import W from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import N from"../rest/support/Query.js";import{createPopupTemplate as X}from"../support/popupUtils.js";import Y from"../geometry/SpatialReference.js";import B from"../geometry/Extent.js";var J;const M=D();let _=J=class extends(v(h(g(c(x(F(b(j(w(s(y))))))))))){constructor(e){super(e),this.capabilities=null,this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new f({layer:this}),this.spatialReference=Y.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m}=e;return new J({customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m})}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),C(this.renderer,this.fieldsIndex),Q(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t){const i=e.filter((e=>e.name!==I));this.geometryField&&i.unshift(new L({name:this.geometryField,alias:this.geometryField,type:"geometry"})),n(t,i.map((e=>e.toJSON())),r)}get parsedUrl(){return this.url?p(this.url):null}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return X(this,e)}createQuery(){const e=new N;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:t}=this;return e.timeExtent=null!=r&&null!=t?t.offset(-r.value,r.unit):t||null,e}getFieldDomain(e,r){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(N.from(e)||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this.load().then((()=>this.source.queryObjectIds(N.from(e)||this.createQuery(),r)))}queryFeatureCount(e,r){return this.load().then((()=>this.source.queryFeatureCount(N.from(e)||this.createQuery(),r)))}queryExtent(e,r){return this.load().then((()=>this.source.queryExtent(N.from(e)||this.createQuery(),r)))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh(this.customParameters);return o(r)&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([a({readOnly:!0,aliasOf:"source.capabilities"})],_.prototype,"capabilities",void 0),e([a({type:String})],_.prototype,"copyright",void 0),e([a({readOnly:!0})],_.prototype,"createQueryVersion",null),e([a({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],_.prototype,"customParameters",void 0),e([a({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([a({type:String})],_.prototype,"displayField",void 0),e([a(O)],_.prototype,"elevationInfo",void 0),e([a(T)],_.prototype,"featureReduction",void 0),e([a({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"featureUrl",void 0),e([a({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([m("fields")],_.prototype,"writeFields",null),e([a(M.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([a({type:B,json:{name:"extent"}})],_.prototype,"fullExtent",void 0),e([a()],_.prototype,"geometryField",void 0),e([a({type:String,json:{read:{source:"layerDefinition.geometryType",reader:u.read},write:{target:"layerDefinition.geometryType",writer:u.write,ignoreOrigin:!0},origins:{service:{read:u.read}}}})],_.prototype,"geometryType",void 0),e([a({type:String})],_.prototype,"id",void 0),e([a(R)],_.prototype,"labelsVisible",void 0),e([a({type:[W],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V},write:!0}})],_.prototype,"labelingInfo",void 0),e([a(S)],_.prototype,"legendEnabled",void 0),e([a({type:["show","hide"]})],_.prototype,"listMode",void 0),e([a({type:String})],_.prototype,"objectIdField",void 0),e([a({type:["WFS"]})],_.prototype,"operationalLayerType",void 0),e([a({type:l,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"maxFeatures",void 0),e([a({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],_.prototype,"mode",void 0),e([a({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"name",void 0),e([a({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"namespaceUri",void 0),e([a(P)],_.prototype,"opacity",void 0),e([a(M.outFields)],_.prototype,"outFields",void 0),e([a({readOnly:!0})],_.prototype,"parsedUrl",null),e([a(U)],_.prototype,"popupEnabled",void 0),e([a({type:r,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([a({types:t,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],_.prototype,"renderer",null),e([a(q)],_.prototype,"screenSizePerspectiveEnabled",void 0),e([a({readOnly:!0})],_.prototype,"source",void 0),e([a({type:Y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],_.prototype,"spatialReference",void 0),e([a({readOnly:!0,type:[l],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"spatialReferences",void 0),e([a({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"swapXY",void 0),e([a({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],_.prototype,"title",void 0),e([a({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([a(E)],_.prototype,"url",void 0),e([a({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"version",void 0),e([a({aliasOf:"source.wfsCapabilities"})],_.prototype,"wfsCapabilities",void 0),_=J=e([d("esri.layers.WFSLayer")],_);const k=_;export{k as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{rendererTypes as t,webSceneRendererTypes as i}from"../renderers/support/types.js";import{isSome as o}from"../core/maybe.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{urlToObject as p}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{Integer as l}from"../core/accessorSupport/ensureType.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import{featureGeometryTypeKebabDictionary as u}from"../geometry/support/typeUtils.js";import y from"./Layer.js";import{WFSSource as f}from"./graphics/sources/WFSSource.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as x}from"./mixins/TemporalLayer.js";import{WFS_OID_FIELD_NAME as I}from"./ogc/wfsUtils.js";import{elevationInfo as O,labelsVisible as R,legendEnabled as S,opacityDrawingInfo as P,popupEnabled as U,screenSizePerspectiveEnabled as q,url as E}from"./support/commonProperties.js";import{featureReductionProperty as T}from"./support/featureReductionUtils.js";import L from"./support/Field.js";import{defineFieldProperties as D}from"./support/fieldProperties.js";import{fixRendererFields as C,fixTimeInfoFields as Q}from"./support/fieldUtils.js";import W from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import N from"../rest/support/Query.js";import{createPopupTemplate as X}from"../support/popupUtils.js";import Y from"../geometry/SpatialReference.js";import B from"../geometry/Extent.js";var J;const M=D();let _=J=class extends(v(h(g(c(x(F(b(j(w(s(y))))))))))){constructor(e){super(e),this.capabilities=null,this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new f({layer:this}),this.spatialReference=Y.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m}=e;return new J({customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m})}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),C(this.renderer,this.fieldsIndex),Q(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t){const i=e.filter((e=>e.name!==I));this.geometryField&&i.unshift(new L({name:this.geometryField,alias:this.geometryField,type:"geometry"})),n(t,i.map((e=>e.toJSON())),r)}get parsedUrl(){return this.url?p(this.url):null}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return X(this,e)}createQuery(){const e=new N;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:t}=this;return e.timeExtent=null!=r&&null!=t?t.offset(-r.value,r.unit):t||null,e}getFieldDomain(e,r){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(N.from(e)||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this.load().then((()=>this.source.queryObjectIds(N.from(e)||this.createQuery(),r)))}queryFeatureCount(e,r){return this.load().then((()=>this.source.queryFeatureCount(N.from(e)||this.createQuery(),r)))}queryExtent(e,r){return this.load().then((()=>this.source.queryExtent(N.from(e)||this.createQuery(),r)))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh(this.customParameters);return o(r)&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([a({readOnly:!0,aliasOf:"source.capabilities"})],_.prototype,"capabilities",void 0),e([a({type:String})],_.prototype,"copyright",void 0),e([a({readOnly:!0})],_.prototype,"createQueryVersion",null),e([a({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],_.prototype,"customParameters",void 0),e([a({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([a({type:String})],_.prototype,"displayField",void 0),e([a(O)],_.prototype,"elevationInfo",void 0),e([a(T)],_.prototype,"featureReduction",void 0),e([a({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"featureUrl",void 0),e([a({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([m("fields")],_.prototype,"writeFields",null),e([a(M.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([a({type:B,json:{name:"extent"}})],_.prototype,"fullExtent",void 0),e([a()],_.prototype,"geometryField",void 0),e([a({type:String,json:{read:{source:"layerDefinition.geometryType",reader:u.read},write:{target:"layerDefinition.geometryType",writer:u.write,ignoreOrigin:!0},origins:{service:{read:u.read}}}})],_.prototype,"geometryType",void 0),e([a({type:String})],_.prototype,"id",void 0),e([a(R)],_.prototype,"labelsVisible",void 0),e([a({type:[W],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V},write:!0}})],_.prototype,"labelingInfo",void 0),e([a(S)],_.prototype,"legendEnabled",void 0),e([a({type:["show","hide"]})],_.prototype,"listMode",void 0),e([a({type:String})],_.prototype,"objectIdField",void 0),e([a({type:["WFS"]})],_.prototype,"operationalLayerType",void 0),e([a({type:l,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"maxFeatures",void 0),e([a({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],_.prototype,"mode",void 0),e([a({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"name",void 0),e([a({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"namespaceUri",void 0),e([a(P)],_.prototype,"opacity",void 0),e([a(M.outFields)],_.prototype,"outFields",void 0),e([a({readOnly:!0})],_.prototype,"parsedUrl",null),e([a(U)],_.prototype,"popupEnabled",void 0),e([a({type:r,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([a({types:t,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],_.prototype,"renderer",null),e([a(q)],_.prototype,"screenSizePerspectiveEnabled",void 0),e([a({readOnly:!0})],_.prototype,"source",void 0),e([a({type:Y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],_.prototype,"spatialReference",void 0),e([a({readOnly:!0,type:[l],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"spatialReferences",void 0),e([a({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"swapXY",void 0),e([a({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],_.prototype,"title",void 0),e([a({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([a(E)],_.prototype,"url",void 0),e([a({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"version",void 0),e([a({aliasOf:"source.wfsCapabilities"})],_.prototype,"wfsCapabilities",void 0),_=J=e([d("esri.layers.WFSLayer")],_);const k=_;export{k 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.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import{webSceneRendererTypes as t}from"../../renderers/support/types.js";import o from"../../request.js";import s from"../../core/Error.js";import{JSONMap as i}from"../../core/jsonMap.js";import a from"../../core/Loadable.js";import n from"../../core/Logger.js";import{isSome as p,isNone as l}from"../../core/maybe.js";import{EsriPromiseMixin as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import{webSceneRendererTypes as t}from"../../renderers/support/types.js";import o from"../../request.js";import s from"../../core/Error.js";import{JSONMap as i}from"../../core/jsonMap.js";import a from"../../core/Loadable.js";import n from"../../core/Logger.js";import{isSome as p,isNone as l}from"../../core/maybe.js";import{EsriPromiseMixin as d}from"../../core/Promise.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as u}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../geometry/Extent.js";import f from"../../geometry/SpatialReference.js";import g from"../FeatureLayer.js";import j from"./BuildingSublayer.js";import{zeroCapabilities as b}from"../support/capabilities.js";import{popupEnabled as v}from"../support/commonProperties.js";import{defineFieldProperties as L}from"../support/fieldProperties.js";import S from"../support/FieldsIndex.js";import{fetchIndexInfo as F}from"../support/I3SIndexInfo.js";import{I3SNodePageDefinition as I,I3SMaterialDefinition as O,I3STextureSetDefinition as x,I3SGeometryDefinition as w}from"../support/I3SLayerDefinitions.js";import T from"../../rest/support/Query.js";import{createPopupTemplate as R}from"../../support/popupUtils.js";import q from"../../symbols/support/ElevationInfo.js";const P=n.getLogger("esri.layers.buildingSublayers.BuildingComponentSublayer"),D=L();let Q=class extends(a.LoadableMixin(d(j))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.fields=null,this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl.path}/sublayers/${this.id}`,query:this.layer.parsedUrl.query}:null}get fieldsIndex(){return new S(this.fields)}readAssociatedLayer(e,r){const t=this.layer.associatedFeatureServiceItem,o=r.associatedLayerID;return p(t)&&"number"==typeof o?new g({portalItem:t,layerId:o}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return null}get displayField(){return p(this.associatedLayer)?this.associatedLayer.displayField:null}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=p(e)?e.signal:null,t=this._fetchService(r).then((()=>{this.indexInfo=F(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,P,r)}));return this.addResolvingPromise(t),Promise.resolve(this)}createPopupTemplate(e){return R(this,e)}async _fetchService(e){const r=(await o(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const t=this.getFeatureType(r?.feature)?.domains?.[e];return t&&"inherited"!==t.type?t:this.getField(e)?.domain??null}getFeatureType(e){return e&&p(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return p(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return p(this.associatedLayer)?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=p(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:b,{query:r,data:{supportsZ:t,supportsM:o,isVersioned:s}}=e;return{query:r,data:{supportsZ:t,supportsM:o,isVersioned:s}}}createQuery(){const e=new T;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryExtent(e||this.createQuery(),r)))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryFeatureCount(e||this.createQuery(),r)))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryFeatures(e||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=this.layer,r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryObjectIds(e||this.createQuery(),r)))}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:p(this.associatedLayer)}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return p(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),l(this.associatedLayer))throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};e([y({readOnly:!0})],Q.prototype,"parsedUrl",null),e([y({type:I,readOnly:!0})],Q.prototype,"nodePages",void 0),e([y({type:[O],readOnly:!0})],Q.prototype,"materialDefinitions",void 0),e([y({type:[x],readOnly:!0})],Q.prototype,"textureSetDefinitions",void 0),e([y({type:[w],readOnly:!0})],Q.prototype,"geometryDefinitions",void 0),e([y({readOnly:!0})],Q.prototype,"serviceUpdateTimeStamp",void 0),e([y({readOnly:!0})],Q.prototype,"store",void 0),e([y({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],Q.prototype,"rootNode",void 0),e([y({readOnly:!0})],Q.prototype,"attributeStorageInfo",void 0),e([y(D.fields)],Q.prototype,"fields",void 0),e([y({readOnly:!0})],Q.prototype,"fieldsIndex",null),e([y({readOnly:!0,type:g})],Q.prototype,"associatedLayer",void 0),e([c("service","associatedLayer",["associatedLayerID"])],Q.prototype,"readAssociatedLayer",null),e([y(D.outFields)],Q.prototype,"outFields",void 0),e([y({type:String,readOnly:!0})],Q.prototype,"objectIdField",null),e([y({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,"displayField",null),e([y({readOnly:!0,type:String})],Q.prototype,"apiKey",null),e([y({readOnly:!0,type:h})],Q.prototype,"fullExtent",null),e([y({readOnly:!0,type:f})],Q.prototype,"spatialReference",null),e([y({readOnly:!0})],Q.prototype,"version",null),e([y({readOnly:!0,type:q})],Q.prototype,"elevationInfo",null),e([y({readOnly:!0,type:Number})],Q.prototype,"minScale",null),e([y({readOnly:!0,type:Number})],Q.prototype,"maxScale",null),e([y({readOnly:!0,type:Number})],Q.prototype,"effectiveScaleRange",null),e([y({type:["hide","show"],json:{write:!0}})],Q.prototype,"listMode",void 0),e([y({types:t,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Q.prototype,"renderer",void 0),e([y({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),e([y(v)],Q.prototype,"popupEnabled",void 0),e([y({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Q.prototype,"popupTemplate",void 0),e([y({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Q.prototype,"normalReferenceFrame",void 0),e([y({readOnly:!0,json:{read:!1}})],Q.prototype,"defaultPopupTemplate",null),e([y()],Q.prototype,"types",null),e([y()],Q.prototype,"typeIdField",null),e([y({json:{write:!1}}),u(new i({"3DObject":"3d-object",Point:"point"}))],Q.prototype,"layerType",void 0),e([y()],Q.prototype,"geometryType",null),e([y()],Q.prototype,"profile",null),e([y({readOnly:!0,json:{read:!1}})],Q.prototype,"capabilities",null),Q=e([m("esri.layers.buildingSublayers.BuildingComponentSublayer")],Q);const E=Q;export{E as default};
|