@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/FeatureLayer.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 t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import r from"../renderers/SimpleRenderer.js";import i from"../renderers/UniqueValueRenderer.js";import{read as o}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as a}from"../renderers/support/types.js";import n from"../request.js";import{symbolTypes as p,symbolTypesRenderer as l}from"../symbols.js";import{ClonableMixin as u}from"../core/Clonable.js";import d from"../core/Collection.js";import c from"../core/Error.js";import y from"../core/Handles.js";import h from"../core/has.js";import{JSONMap as m}from"../core/jsonMap.js";import{clone as f}from"../core/lang.js";import g from"../core/Logger.js";import{destroyMaybe as b,isSome as w}from"../core/maybe.js";import{MultiOriginJSONMixin as v}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as S}from"../core/object.js";import{throwIfAbortError as I,whenOrAbort as F}from"../core/promiseUtils.js";import{parseWhereClause as j}from"../core/sql.js";import{urlToObject as E,join as T}from"../core/urlUtils.js";import{property as x}from"../core/accessorSupport/decorators/property.js";import{cast as D}from"../core/accessorSupport/decorators/cast.js";import{reader as C}from"../core/accessorSupport/decorators/reader.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{writer as L}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as A}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import R from"../form/FormTemplate.js";import O from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import _ from"../geometry/SpatialReference.js";import q from"./Layer.js";import{MemorySource as Q}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as U}from"./mixins/APIKeyMixin.js";import{ArcGISService as G}from"./mixins/ArcGISService.js";import{BlendLayer as V}from"./mixins/BlendLayer.js";import{CustomParametersMixin as z}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as B}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{OrderedLayer as N}from"./mixins/OrderedLayer.js";import{PortalLayer as W}from"./mixins/PortalLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as Z}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as H}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as $,parse as K,cleanTitle as X,sanitizeUrlWithLayerId as Y,writeUrlWithLayerId as ee,isHostedAgolService as te}from"./support/arcgisLayerUrl.js";import{id as re,labelsVisible as ie,legendEnabled as oe,minScale as se,maxScale as ae,popupEnabled as ne,url as pe,elevationInfo as le,opacityDrawingInfo as ue,listMode as de,screenSizePerspectiveEnabled as ce}from"./support/commonProperties.js";import{FeatureIndex as ye}from"./support/FeatureIndex.js";import{featureReductionProperty as he}from"./support/featureReductionUtils.js";import me from"./support/FeatureTemplate.js";import fe from"./support/FeatureType.js";import{defineFieldProperties as ge}from"./support/fieldProperties.js";import{fixRendererFields as be,fixTimeInfoFields as we}from"./support/fieldUtils.js";import ve from"./support/GeometryFieldsInfo.js";import Se from"./support/LabelClass.js";import{reader as Ie}from"./support/labelingInfo.js";import Fe from"./support/LayerFloorInfo.js";import je from"./support/Relationship.js";import Ee from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as Te}from"./support/versionUtils.js";import{DataLayerSource as xe}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as De}from"../renderers/support/styleUtils.js";import Ce from"../rest/support/AttachmentQuery.js";import Me from"../rest/support/FeatureSet.js";import Le from"../rest/support/Query.js";import Ae from"../rest/support/RelationshipQuery.js";import Re from"../rest/support/TopFeaturesQuery.js";import{createPopupTemplate as Oe}from"../support/popupUtils.js";import{opacityToTransparency as Pe}from"../webdoc/support/opacityUtils.js";const _e=new m({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),qe={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},Qe="FeatureLayer",Ue=g.getLogger("esri.layers.FeatureLayer");function Ge(e,t){return new c("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ve(e){return e&&e instanceof d}function ze(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Be(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function ke(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}const Ne=ge();function We(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Je=class extends(B(V(N(H(Z(J(G(k(W(v(z(U(u(q)))))))))))))){constructor(...e){super(...e),this._handles=new y,this.capabilities=null,this.charts=null,this.copyright=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,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.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,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.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=_.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="feature",this.typeIdField=null,this.types=null,this.indexes=new(d.ofType(ye)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0}destroy(){this.source?.destroy(),this._handles=b(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=w(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(I).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 c("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}get editingEnabled(){return!(this.loaded&&!this.capabilities.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}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?E(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=T(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=T(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){be(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,s){const a=(t=t.layerDefinition||t).drawingInfo&&t.drawingInfo.renderer||void 0;if(a){const e=o(a,t,s)||void 0;return e||Ue.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:s}),e}if(t.defaultSymbol)return t.types&&t.types.length?new i({defaultSymbol:Ze(t.defaultSymbol,t,s),field:t.typeIdField,uniqueValueInfos:t.types.map((e=>({id:e.id,symbol:Ze(e.symbol,e,s)})))}):new r({symbol:Ze(t.defaultSymbol,t,s)})}set source(e){const t=this._get("source");t!==e&&(Ve(t)&&this._resetMemorySource(t),Ve(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof d?new Q({layer:this,items:e}):e:null}readSource(e,t){const r=Me.fromJSON(t.featureSet);return new Q({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTemplates(e,t){const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e=e&&e.map((e=>me.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}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?$(this.url,r):r;let t=r;if(!t&&this.url){const e=K(this.url);w(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),X(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}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e&&e.map((e=>(e=fe.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}set url(e){const t=Y({layer:this,url:e,nonStandardUrlAllowed:!0,logger:Ue});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){ee(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 c(Qe,"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 c(Qe,"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)}createPopupTemplate(e){return Oe(this,e)}async createGraphicsSource(e){if(this._hasMemorySource())return this.source.load({signal:e});const{default:t}=await F(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=new Le,t=this.get("capabilities.data"),r=this.get("capabilities.query");e.dynamicDataSource=this.dynamicDataSource,e.historicMoment=this.historicMoment,e.gdbVersion=this.gdbVersion,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.definitionExpression||"1=1";const{timeOffset:i,timeExtent:o}=this;return e.timeExtent=null!=i&&null!=o?o.offset(-i.value,i.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 c(Qe,"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 c(Qe,"Layer source does not support fetchUpdates capability")}))}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let o=null;return r.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,t){const r=t&&t.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=Ce.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new c(Qe,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:o,size:s,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const p=r&&r.length>1,l=t&&t.length,u=i&&i.length,d=s&&s.length;if(p||l||u||d||o||a||n)throw new c(Qe,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new c(Qe,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new c(Qe,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(Le.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(Ae.from(e),t);throw new c(Qe,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(Ae.from(e),t);throw new c(Qe,"Layer source does not support queryRelatedFeaturesCount capability")}))}queryTopFeatures(e,t){return this.load().then((()=>{if("queryTopFeatures"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopFeatures(Re.from(e),t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}));throw new c(Qe,"Layer source does not support queryTopFeatures capability")}))}queryTopObjectIds(e,t){return this.load().then((()=>{if("queryTopObjectIds"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopObjectIds(Re.from(e),t);throw new c(Qe,"Layer source does not support queryTopObjectIds capability")}))}queryTopFeaturesExtent(e,t){return this.load().then((()=>{if("queryTopExtents"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopExtents(Re.from(e),t);throw new c(Qe,"Layer source does not support queryTopExtents capability")}))}queryTopFeatureCount(e,t){return this.load().then((()=>{if("queryTopCount"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopCount(Re.from(e),t);throw new c(Qe,"Layer source does not support queryFeatureCount 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){t={...t,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(Ge(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(Ge(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return o?.push(Ge(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(Ge(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new c(Qe,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source.type||Te(this,e))}async save(e){return(await import("./save/featureLayerUtils.js")).save(this,e)}async saveAs(e,t){return(await import("./save/featureLayerUtils.js")).saveAs(this,e,t)}_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):void 0)}_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 c(Qe,`feature is missing the identifying attribute ${r}`)):Promise.reject(new c(Qe,"'attributes' are required on a feature to query attachments")):Promise.reject(new c(Qe,"A feature is required to add/delete/update attachments")):Promise.reject(new c(Qe,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return n(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},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(),be(this.renderer,this.fieldsIndex),we(this.timeInfo,this.fieldsIndex),De(this,{origin:"service"})}async hasDataChanged(){if(this.source?.refresh)try{const{dataChanged:e,updates:t}=await(this.source?.refresh());if(w(t)&&(this.sourceJSON={...this.sourceJSON,...t},this.read(t,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await j(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("FeatureLayer: '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("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype&&e.prototype.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new c("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new c("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._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=qe[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:ze(e,"isDataVersioned",!1),supportsAttachment:ze(e,"hasAttachments",!1),supportsM:ze(e,"hasM",!1),supportsZ:ze(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:ze(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=this.url?K(this.url):null,o=r.includes(w(i)&&"MapServer"===i.serverType?"data":"query"),s=r.includes("editing")&&!t.datesInUnknownTimezone;let a=s&&r.includes("create"),n=s&&r.includes("delete"),p=s&&r.includes("update");const l=r.includes("changetracking");return s&&!(a||n||p)&&(a=n=p=!0),{supportsCalculate:ze(t,"supportsCalculate",!1),supportsTruncate:ze(t,"supportsTruncate",!1),supportsValidateSql:ze(t,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:n,supportsEditing:s,supportsChangeTracking:l,supportsQuery:o,supportsQueryAttachments:ze(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:ze(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:p,supportsExceedsLimitStatistics:ze(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){const t=e.advancedQueryCapabilities,r=e.ownershipBasedAccessControlForFeatures,i=e.archivingInfo,o=this.url?.includes("MapServer"),s=!h("mapserver-pbf-enabled")&&o&&this.version<10.81,a=te(this.url),n=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:ze(t,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:ze(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:ze(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:ke(t),supportsCentroid:ze(t,"supportsReturningGeometryCentroid",!1),supportsDistance:ze(t,"supportsQueryWithDistance",!1),supportsDistinct:ze(t,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:ze(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:ze(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:ze(t,"supportsHavingClause",!1),supportsOrderBy:ze(t,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:ze(t,"supportsPagination",!1),supportsQuantization:ze(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:ze(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:ze(e,"supportsReturningQueryGeometry",!1),supportsResultType:ze(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:ze(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:ze(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:ze(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:ze(t,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:ze(r,"allowOthersToQuery",!0),supportsHistoricMoment:ze(i,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!s&&n.has("pbf"),supportsDisjointSpatialRelationship:ze(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:ze(t,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:ze(t,"supportsDefaultSR",!1),supportsCompactGeometry:a,maxRecordCountFactor:Be(e,"maxRecordCountFactor",void 0),maxRecordCount:Be(e,"maxRecordCount",void 0),standardMaxRecordCount:Be(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Be(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=ze(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:ze(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:ze(e,"allowGeometryUpdates",!0),supportsGlobalId:ze(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:ze(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:ze(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:ze(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:ze(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:ze(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:ze(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:ze(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:ze(t,"allowOthersToUpdate",!0)}}};e([x({readOnly:!0,json:{read:!1}})],Je.prototype,"capabilities",void 0),e([C("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],Je.prototype,"readCapabilities",null),e([x({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Je.prototype,"charts",void 0),e([x({readOnly:!0})],Je.prototype,"createQueryVersion",null),e([x({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],Je.prototype,"copyright",void 0),e([x({type:Boolean})],Je.prototype,"datesInUnknownTimezone",void 0),e([x({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],Je.prototype,"displayField",void 0),e([x({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Je.prototype,"definitionExpression",void 0),e([x({types:p,readOnly:!0})],Je.prototype,"defaultSymbol",void 0),e([x({type:xe})],Je.prototype,"dynamicDataSource",void 0),e([x({readOnly:!0})],Je.prototype,"editFieldsInfo",void 0),e([x({type:Boolean})],Je.prototype,"editingEnabled",null),e([C(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Je.prototype,"readEditingEnabled",null),e([C("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Je.prototype,"readEditingEnabledFromWebMap",null),e([L(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Je.prototype,"writeEditingEnabled",null),e([L("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Je.prototype,"writeEditingEnabledToWebMap",null),e([x({readOnly:!0})],Je.prototype,"editingInfo",void 0),e([C("editingInfo")],Je.prototype,"readEditingInfo",null),e([x((()=>{const e=f(le),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],Je.prototype,"elevationInfo",void 0),e([x(he)],Je.prototype,"featureReduction",void 0),e([x({...Ne.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:We}}}}})],Je.prototype,"fields",void 0),e([x(Ne.fieldsIndex)],Je.prototype,"fieldsIndex",void 0),e([x({type:Fe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Je.prototype,"floorInfo",void 0),e([x({type:R,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Je.prototype,"formTemplate",void 0),e([x({type:O,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],Je.prototype,"fullExtent",void 0),e([x()],Je.prototype,"gdbVersion",void 0),e([x({readOnly:!0,type:ve,json:{read:{source:"geometryProperties"}}})],Je.prototype,"geometryFieldsInfo",void 0),e([x({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:_e.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:We,writer(e,t,r){const i=e?_e.toJSON(e):null;i&&S(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:_e.read}}})],Je.prototype,"geometryType",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],Je.prototype,"hasM",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],Je.prototype,"hasZ",void 0),e([x({readOnly:!0,type:P})],Je.prototype,"heightModelInfo",void 0),e([x({type:Date})],Je.prototype,"historicMoment",void 0),e([x(re)],Je.prototype,"id",void 0),e([x({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Je.prototype,"infoFor3D",void 0),e([x({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Je.prototype,"isTable",void 0),e([C("service","isTable",["type","geometryType"]),C("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Je.prototype,"readIsTable",null),e([L("web-map","isTable")],Je.prototype,"writeIsTable",null),e([x(ie)],Je.prototype,"labelsVisible",void 0),e([x({type:[Se],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:Ie},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:Ie},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],Je.prototype,"labelingInfo",void 0),e([x((()=>{const e=f(ue);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){S(r,Pe(e),t)}}},e})())],Je.prototype,"opacity",void 0),e([x({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],Je.prototype,"layerId",void 0),e([x(oe)],Je.prototype,"legendEnabled",void 0),e([x({type:["show","hide"],json:(()=>{const e=f(de.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Je.prototype,"listMode",void 0),e([x(se)],Je.prototype,"minScale",void 0),e([C("service","minScale",["minScale","effectiveMinScale"])],Je.prototype,"readMinScale",null),e([x(ae)],Je.prototype,"maxScale",void 0),e([C("service","maxScale",["maxScale","effectiveMaxScale"])],Je.prototype,"readMaxScale",null),e([x({type:String})],Je.prototype,"globalIdField",void 0),e([C("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),C("service","globalIdField",["globalIdField","fields"])],Je.prototype,"readGlobalIdFieldFromService",null),e([x({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:We}}}}})],Je.prototype,"objectIdField",void 0),e([C("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),C("service","objectIdField",["objectIdField","fields"])],Je.prototype,"readObjectIdFieldFromService",null),e([x({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],Je.prototype,"operationalLayerType",void 0),e([x(Ne.outFields)],Je.prototype,"outFields",void 0),e([x({readOnly:!0})],Je.prototype,"parsedUrl",null),e([x({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Je.prototype,"path",void 0),e([x(ne)],Je.prototype,"popupEnabled",void 0),e([x({type:t,json:{name:"popupInfo",write:!0}})],Je.prototype,"popupTemplate",void 0),e([x({readOnly:!0})],Je.prototype,"defaultPopupTemplate",null),e([x({type:[je],readOnly:!0})],Je.prototype,"relationships",void 0),e([x({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:a,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],Je.prototype,"renderer",null),e([C("service","renderer",["drawingInfo.renderer","defaultSymbol"]),C("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Je.prototype,"readRenderer",null),e([x()],Je.prototype,"sourceJSON",void 0),e([x({type:Boolean})],Je.prototype,"returnM",void 0),e([x({type:Boolean})],Je.prototype,"returnZ",void 0),e([x((()=>{const e=f(ce);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Je.prototype,"screenSizePerspectiveEnabled",void 0),e([x({clonable:!1})],Je.prototype,"source",null),e([D("source")],Je.prototype,"castSource",null),e([C("portal-item","source",["featureSet"]),C("web-map","source",["featureSet"])],Je.prototype,"readSource",null),e([x({readOnly:!0})],Je.prototype,"serviceDefinitionExpression",void 0),e([C("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Je.prototype,"readServiceDefinitionExpression",null),e([x({type:_,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],Je.prototype,"spatialReference",void 0),e([x({type:Number})],Je.prototype,"subtypeCode",void 0),e([x({type:[me]})],Je.prototype,"templates",void 0),e([C("templates",["editFieldsInfo","creatorField","editorField","templates"])],Je.prototype,"readTemplates",null),e([x({type:Ee})],Je.prototype,"timeInfo",void 0),e([x()],Je.prototype,"title",void 0),e([C("service","title",["name"]),C("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Je.prototype,"readTitle",null),e([C("web-map","title",["layerDefinition.name","title"])],Je.prototype,"readTitleFromWebMap",null),e([x({type:String})],Je.prototype,"sublayerTitleMode",void 0),e([x({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Je.prototype,"trackIdField",void 0),e([x({json:{read:!1}})],Je.prototype,"type",void 0),e([x({type:String})],Je.prototype,"typeIdField",void 0),e([C("service","typeIdField"),C("typeIdField",["layerDefinition.typeIdField"])],Je.prototype,"readTypeIdField",null),e([x({type:[fe]})],Je.prototype,"types",void 0),e([C("service","types",["types"]),C("types",["layerDefinition.types"])],Je.prototype,"readTypes",null),e([x({readOnly:!0,json:{write:!1}})],Je.prototype,"serverGens",void 0),e([x({type:d.ofType(ye),readOnly:!0})],Je.prototype,"indexes",void 0),e([x(pe)],Je.prototype,"url",null),e([L("url")],Je.prototype,"writeUrl",null),e([x({readOnly:!0})],Je.prototype,"userIsAdmin",void 0),e([x({json:{origins:{service:{read:!0}},read:!1}})],Je.prototype,"version",void 0),e([C("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Je.prototype,"readVersion",null),e([x({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Je.prototype,"visible",void 0),e([C("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Je.prototype,"readVisible",null),Je=e([M("esri.layers.FeatureLayer")],Je);const Ze=A({types:l}),He=Je;export{He as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t 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 r from"../renderers/SimpleRenderer.js";import i from"../renderers/UniqueValueRenderer.js";import{read as o}from"../renderers/support/jsonUtils.js";import{rendererTypes as s,webSceneRendererTypes as a}from"../renderers/support/types.js";import n from"../request.js";import{symbolTypes as p,symbolTypesRenderer as l}from"../symbols.js";import{ClonableMixin as u}from"../core/Clonable.js";import d from"../core/Collection.js";import c from"../core/Error.js";import y from"../core/Handles.js";import h from"../core/has.js";import{JSONMap as m}from"../core/jsonMap.js";import{clone as f}from"../core/lang.js";import g from"../core/Logger.js";import{destroyMaybe as b,isSome as w}from"../core/maybe.js";import{MultiOriginJSONMixin as v}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as S}from"../core/object.js";import{throwIfAbortError as I,whenOrAbort as F}from"../core/promiseUtils.js";import{parseWhereClause as j}from"../core/sql.js";import{urlToObject as E,join as T}from"../core/urlUtils.js";import{property as x}from"../core/accessorSupport/decorators/property.js";import{cast as D}from"../core/accessorSupport/decorators/cast.js";import{reader as C}from"../core/accessorSupport/decorators/reader.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{writer as L}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as R}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import A from"../form/FormTemplate.js";import O from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import _ from"../geometry/SpatialReference.js";import q from"./Layer.js";import{MemorySource as Q}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as U}from"./mixins/APIKeyMixin.js";import{ArcGISService as G}from"./mixins/ArcGISService.js";import{BlendLayer as V}from"./mixins/BlendLayer.js";import{CustomParametersMixin as z}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as B}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{OrderedLayer as N}from"./mixins/OrderedLayer.js";import{PortalLayer as W}from"./mixins/PortalLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as Z}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as H}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as $,parse as K,cleanTitle as X,sanitizeUrlWithLayerId as Y,writeUrlWithLayerId as ee,isHostedAgolService as te}from"./support/arcgisLayerUrl.js";import{id as re,labelsVisible as ie,legendEnabled as oe,minScale as se,maxScale as ae,popupEnabled as ne,url as pe,elevationInfo as le,opacityDrawingInfo as ue,listMode as de,screenSizePerspectiveEnabled as ce}from"./support/commonProperties.js";import{FeatureIndex as ye}from"./support/FeatureIndex.js";import{featureReductionProperty as he}from"./support/featureReductionUtils.js";import me from"./support/FeatureTemplate.js";import fe from"./support/FeatureType.js";import{defineFieldProperties as ge}from"./support/fieldProperties.js";import{fixRendererFields as be,fixTimeInfoFields as we}from"./support/fieldUtils.js";import ve from"./support/GeometryFieldsInfo.js";import Se from"./support/LabelClass.js";import{reader as Ie}from"./support/labelingInfo.js";import Fe from"./support/LayerFloorInfo.js";import je from"./support/Relationship.js";import Ee from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as Te}from"./support/versionUtils.js";import{DataLayerSource as xe}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as De}from"../renderers/support/styleUtils.js";import Ce from"../rest/support/AttachmentQuery.js";import Me from"../rest/support/FeatureSet.js";import Le from"../rest/support/Query.js";import Re from"../rest/support/RelationshipQuery.js";import Ae from"../rest/support/TopFeaturesQuery.js";import{createPopupTemplate as Oe}from"../support/popupUtils.js";import{opacityToTransparency as Pe}from"../webdoc/support/opacityUtils.js";const _e=new m({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),qe={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},Qe="FeatureLayer",Ue=g.getLogger("esri.layers.FeatureLayer");function Ge(e,t){return new c("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ve(e){return e&&e instanceof d}function ze(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Be(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function ke(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}const Ne=ge();function We(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Je=class extends(B(V(N(H(Z(J(G(k(W(v(z(U(u(q)))))))))))))){constructor(...e){super(...e),this._handles=new y,this.capabilities=null,this.charts=null,this.copyright=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,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.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,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.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=_.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="feature",this.typeIdField=null,this.types=null,this.indexes=new(d.ofType(ye)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0}destroy(){this.source?.destroy(),this._handles=b(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=w(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(I).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 c("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}get editingEnabled(){return!(this.loaded&&!this.capabilities.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}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?E(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=T(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=T(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){be(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,s){const a=(t=t.layerDefinition||t).drawingInfo&&t.drawingInfo.renderer||void 0;if(a){const e=o(a,t,s)||void 0;return e||Ue.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:s}),e}if(t.defaultSymbol)return t.types&&t.types.length?new i({defaultSymbol:Ze(t.defaultSymbol,t,s),field:t.typeIdField,uniqueValueInfos:t.types.map((e=>({id:e.id,symbol:Ze(e.symbol,e,s)})))}):new r({symbol:Ze(t.defaultSymbol,t,s)})}set source(e){const t=this._get("source");t!==e&&(Ve(t)&&this._resetMemorySource(t),Ve(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof d?new Q({layer:this,items:e}):e:null}readSource(e,t){const r=Me.fromJSON(t.featureSet);return new Q({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTemplates(e,t){const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e=e&&e.map((e=>me.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}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?$(this.url,r):r;let t=r;if(!t&&this.url){const e=K(this.url);w(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),X(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}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e&&e.map((e=>(e=fe.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}set url(e){const t=Y({layer:this,url:e,nonStandardUrlAllowed:!0,logger:Ue});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){ee(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 c(Qe,"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 c(Qe,"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)}createPopupTemplate(e){return Oe(this,e)}async createGraphicsSource(e){if(this._hasMemorySource())return this.source.load({signal:e});const{default:t}=await F(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=new Le,t=this.get("capabilities.data"),r=this.get("capabilities.query");e.dynamicDataSource=this.dynamicDataSource,e.historicMoment=this.historicMoment,e.gdbVersion=this.gdbVersion,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.definitionExpression||"1=1";const{timeOffset:i,timeExtent:o}=this;return e.timeExtent=null!=i&&null!=o?o.offset(-i.value,i.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 c(Qe,"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 c(Qe,"Layer source does not support fetchUpdates capability")}))}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let o=null;return r.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,t){const r=t&&t.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=Ce.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new c(Qe,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:o,size:s,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const p=r&&r.length>1,l=t&&t.length,u=i&&i.length,d=s&&s.length;if(p||l||u||d||o||a||n)throw new c(Qe,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new c(Qe,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new c(Qe,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(Le.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Le.from(e)||this.createQuery(),t);throw new c(Qe,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(Re.from(e),t);throw new c(Qe,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(Re.from(e),t);throw new c(Qe,"Layer source does not support queryRelatedFeaturesCount capability")}))}queryTopFeatures(e,t){return this.load().then((()=>{if("queryTopFeatures"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopFeatures(Ae.from(e),t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}));throw new c(Qe,"Layer source does not support queryTopFeatures capability")}))}queryTopObjectIds(e,t){return this.load().then((()=>{if("queryTopObjectIds"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopObjectIds(Ae.from(e),t);throw new c(Qe,"Layer source does not support queryTopObjectIds capability")}))}queryTopFeaturesExtent(e,t){return this.load().then((()=>{if("queryTopExtents"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopExtents(Ae.from(e),t);throw new c(Qe,"Layer source does not support queryTopExtents capability")}))}queryTopFeatureCount(e,t){return this.load().then((()=>{if("queryTopCount"in this.source&&this.get("capabilities.query.supportsTopFeaturesQuery"))return this.source.queryTopCount(Ae.from(e),t);throw new c(Qe,"Layer source does not support queryFeatureCount 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){t={...t,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(Ge(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(Ge(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return o?.push(Ge(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(Ge(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new c(Qe,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source.type||Te(this,e))}async save(e){return(await import("./save/featureLayerUtils.js")).save(this,e)}async saveAs(e,t){return(await import("./save/featureLayerUtils.js")).saveAs(this,e,t)}_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):void 0)}_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 c(Qe,`feature is missing the identifying attribute ${r}`)):Promise.reject(new c(Qe,"'attributes' are required on a feature to query attachments")):Promise.reject(new c(Qe,"A feature is required to add/delete/update attachments")):Promise.reject(new c(Qe,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return n(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},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(),be(this.renderer,this.fieldsIndex),we(this.timeInfo,this.fieldsIndex),De(this,{origin:"service"})}async hasDataChanged(){if(this.source?.refresh)try{const{dataChanged:e,updates:t}=await(this.source?.refresh());if(w(t)&&(this.sourceJSON={...this.sourceJSON,...t},this.read(t,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await j(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("FeatureLayer: '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("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype&&e.prototype.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new c("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new c("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._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=qe[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:ze(e,"isDataVersioned",!1),supportsAttachment:ze(e,"hasAttachments",!1),supportsM:ze(e,"hasM",!1),supportsZ:ze(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:ze(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=this.url?K(this.url):null,o=r.includes(w(i)&&"MapServer"===i.serverType?"data":"query"),s=r.includes("editing")&&!t.datesInUnknownTimezone;let a=s&&r.includes("create"),n=s&&r.includes("delete"),p=s&&r.includes("update");const l=r.includes("changetracking");return s&&!(a||n||p)&&(a=n=p=!0),{supportsCalculate:ze(t,"supportsCalculate",!1),supportsTruncate:ze(t,"supportsTruncate",!1),supportsValidateSql:ze(t,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:n,supportsEditing:s,supportsChangeTracking:l,supportsQuery:o,supportsQueryAttachments:ze(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:ze(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:p,supportsExceedsLimitStatistics:ze(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){const t=e.advancedQueryCapabilities,r=e.ownershipBasedAccessControlForFeatures,i=e.archivingInfo,o=this.url?.includes("MapServer"),s=!h("mapserver-pbf-enabled")&&o&&this.version<10.81,a=te(this.url),n=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:ze(t,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:ze(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:ze(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:ke(t),supportsCentroid:ze(t,"supportsReturningGeometryCentroid",!1),supportsDistance:ze(t,"supportsQueryWithDistance",!1),supportsDistinct:ze(t,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:ze(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:ze(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:ze(t,"supportsHavingClause",!1),supportsOrderBy:ze(t,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:ze(t,"supportsPagination",!1),supportsQuantization:ze(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:ze(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:ze(e,"supportsReturningQueryGeometry",!1),supportsResultType:ze(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:ze(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:ze(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:ze(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:ze(t,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:ze(r,"allowOthersToQuery",!0),supportsHistoricMoment:ze(i,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!s&&n.has("pbf"),supportsDisjointSpatialRelationship:ze(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:ze(t,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:ze(t,"supportsDefaultSR",!1),supportsCompactGeometry:a,maxRecordCountFactor:Be(e,"maxRecordCountFactor",void 0),maxRecordCount:Be(e,"maxRecordCount",void 0),standardMaxRecordCount:Be(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Be(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=ze(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:ze(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:ze(e,"allowGeometryUpdates",!0),supportsGlobalId:ze(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:ze(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:ze(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:ze(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:ze(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:ze(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:ze(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:ze(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:ze(t,"allowOthersToUpdate",!0)}}};e([x({readOnly:!0,json:{read:!1}})],Je.prototype,"capabilities",void 0),e([C("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],Je.prototype,"readCapabilities",null),e([x({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Je.prototype,"charts",void 0),e([x({readOnly:!0})],Je.prototype,"createQueryVersion",null),e([x({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],Je.prototype,"copyright",void 0),e([x({type:Boolean})],Je.prototype,"datesInUnknownTimezone",void 0),e([x({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],Je.prototype,"displayField",void 0),e([x({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Je.prototype,"definitionExpression",void 0),e([x({types:p,readOnly:!0})],Je.prototype,"defaultSymbol",void 0),e([x({type:xe})],Je.prototype,"dynamicDataSource",void 0),e([x({readOnly:!0})],Je.prototype,"editFieldsInfo",void 0),e([x({type:Boolean})],Je.prototype,"editingEnabled",null),e([C(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Je.prototype,"readEditingEnabled",null),e([C("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Je.prototype,"readEditingEnabledFromWebMap",null),e([L(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Je.prototype,"writeEditingEnabled",null),e([L("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Je.prototype,"writeEditingEnabledToWebMap",null),e([x({readOnly:!0})],Je.prototype,"editingInfo",void 0),e([C("editingInfo")],Je.prototype,"readEditingInfo",null),e([x((()=>{const e=f(le),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],Je.prototype,"elevationInfo",void 0),e([x(he)],Je.prototype,"featureReduction",void 0),e([x({...Ne.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:We}}}}})],Je.prototype,"fields",void 0),e([x(Ne.fieldsIndex)],Je.prototype,"fieldsIndex",void 0),e([x({type:Fe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Je.prototype,"floorInfo",void 0),e([x({type:A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Je.prototype,"formTemplate",void 0),e([x({type:O,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],Je.prototype,"fullExtent",void 0),e([x()],Je.prototype,"gdbVersion",void 0),e([x({readOnly:!0,type:ve,json:{read:{source:"geometryProperties"}}})],Je.prototype,"geometryFieldsInfo",void 0),e([x({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:_e.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:We,writer(e,t,r){const i=e?_e.toJSON(e):null;i&&S(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:_e.read}}})],Je.prototype,"geometryType",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],Je.prototype,"hasM",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],Je.prototype,"hasZ",void 0),e([x({readOnly:!0,type:P})],Je.prototype,"heightModelInfo",void 0),e([x({type:Date})],Je.prototype,"historicMoment",void 0),e([x(re)],Je.prototype,"id",void 0),e([x({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Je.prototype,"infoFor3D",void 0),e([x({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Je.prototype,"isTable",void 0),e([C("service","isTable",["type","geometryType"]),C("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Je.prototype,"readIsTable",null),e([L("web-map","isTable")],Je.prototype,"writeIsTable",null),e([x(ie)],Je.prototype,"labelsVisible",void 0),e([x({type:[Se],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:Ie},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:Ie},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],Je.prototype,"labelingInfo",void 0),e([x((()=>{const e=f(ue);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){S(r,Pe(e),t)}}},e})())],Je.prototype,"opacity",void 0),e([x({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],Je.prototype,"layerId",void 0),e([x(oe)],Je.prototype,"legendEnabled",void 0),e([x({type:["show","hide"],json:(()=>{const e=f(de.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Je.prototype,"listMode",void 0),e([x(se)],Je.prototype,"minScale",void 0),e([C("service","minScale",["minScale","effectiveMinScale"])],Je.prototype,"readMinScale",null),e([x(ae)],Je.prototype,"maxScale",void 0),e([C("service","maxScale",["maxScale","effectiveMaxScale"])],Je.prototype,"readMaxScale",null),e([x({type:String})],Je.prototype,"globalIdField",void 0),e([C("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),C("service","globalIdField",["globalIdField","fields"])],Je.prototype,"readGlobalIdFieldFromService",null),e([x({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:We}}}}})],Je.prototype,"objectIdField",void 0),e([C("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),C("service","objectIdField",["objectIdField","fields"])],Je.prototype,"readObjectIdFieldFromService",null),e([x({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],Je.prototype,"operationalLayerType",void 0),e([x(Ne.outFields)],Je.prototype,"outFields",void 0),e([x({readOnly:!0})],Je.prototype,"parsedUrl",null),e([x({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Je.prototype,"path",void 0),e([x(ne)],Je.prototype,"popupEnabled",void 0),e([x({type:t,json:{name:"popupInfo",write:!0}})],Je.prototype,"popupTemplate",void 0),e([x({readOnly:!0})],Je.prototype,"defaultPopupTemplate",null),e([x({type:[je],readOnly:!0})],Je.prototype,"relationships",void 0),e([x({types:s,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:a,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],Je.prototype,"renderer",null),e([C("service","renderer",["drawingInfo.renderer","defaultSymbol"]),C("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Je.prototype,"readRenderer",null),e([x()],Je.prototype,"sourceJSON",void 0),e([x({type:Boolean})],Je.prototype,"returnM",void 0),e([x({type:Boolean})],Je.prototype,"returnZ",void 0),e([x((()=>{const e=f(ce);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Je.prototype,"screenSizePerspectiveEnabled",void 0),e([x({clonable:!1})],Je.prototype,"source",null),e([D("source")],Je.prototype,"castSource",null),e([C("portal-item","source",["featureSet"]),C("web-map","source",["featureSet"])],Je.prototype,"readSource",null),e([x({readOnly:!0})],Je.prototype,"serviceDefinitionExpression",void 0),e([C("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Je.prototype,"readServiceDefinitionExpression",null),e([x({type:_,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],Je.prototype,"spatialReference",void 0),e([x({type:Number})],Je.prototype,"subtypeCode",void 0),e([x({type:[me]})],Je.prototype,"templates",void 0),e([C("templates",["editFieldsInfo","creatorField","editorField","templates"])],Je.prototype,"readTemplates",null),e([x({type:Ee})],Je.prototype,"timeInfo",void 0),e([x()],Je.prototype,"title",void 0),e([C("service","title",["name"]),C("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Je.prototype,"readTitle",null),e([C("web-map","title",["layerDefinition.name","title"])],Je.prototype,"readTitleFromWebMap",null),e([x({type:String})],Je.prototype,"sublayerTitleMode",void 0),e([x({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Je.prototype,"trackIdField",void 0),e([x({json:{read:!1}})],Je.prototype,"type",void 0),e([x({type:String})],Je.prototype,"typeIdField",void 0),e([C("service","typeIdField"),C("typeIdField",["layerDefinition.typeIdField"])],Je.prototype,"readTypeIdField",null),e([x({type:[fe]})],Je.prototype,"types",void 0),e([C("service","types",["types"]),C("types",["layerDefinition.types"])],Je.prototype,"readTypes",null),e([x({readOnly:!0,json:{write:!1}})],Je.prototype,"serverGens",void 0),e([x({type:d.ofType(ye),readOnly:!0})],Je.prototype,"indexes",void 0),e([x(pe)],Je.prototype,"url",null),e([L("url")],Je.prototype,"writeUrl",null),e([x({readOnly:!0})],Je.prototype,"userIsAdmin",void 0),e([x({json:{origins:{service:{read:!0}},read:!1}})],Je.prototype,"version",void 0),e([C("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Je.prototype,"readVersion",null),e([x({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Je.prototype,"visible",void 0),e([C("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Je.prototype,"readVisible",null),Je=e([M("esri.layers.FeatureLayer")],Je);const Ze=R({types:l}),He=Je;export{He as default};
|
package/layers/GeoJSONLayer.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 t 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 r,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{urlToObject as p}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as a}from"../geometry/support/typeUtils.js";import d from"./Layer.js";import{GeoJSONSource as u}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as h}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as c}from"./mixins/OperationalLayer.js";import{OrderedLayer as f}from"./mixins/OrderedLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{elevationInfo as b,id as x,labelsVisible as I,legendEnabled as O,opacity as S,popupEnabled as E,screenSizePerspectiveEnabled as F,url as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t 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 r,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{urlToObject as p}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as a}from"../geometry/support/typeUtils.js";import d from"./Layer.js";import{GeoJSONSource as u}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as h}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as c}from"./mixins/OperationalLayer.js";import{OrderedLayer as f}from"./mixins/OrderedLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{elevationInfo as b,id as x,labelsVisible as I,legendEnabled as O,opacity as S,popupEnabled as E,screenSizePerspectiveEnabled as F,url as P}from"./support/commonProperties.js";import{featureReductionProperty as w}from"./support/featureReductionUtils.js";import R from"./support/FeatureTemplate.js";import T from"./support/FeatureType.js";import L from"./support/Field.js";import{defineFieldProperties as D}from"./support/fieldProperties.js";import{fixRendererFields as q,fixTimeInfoFields as U}from"./support/fieldUtils.js";import N from"./support/LabelClass.js";import{reader as J}from"./support/labelingInfo.js";import Q from"../rest/support/Query.js";import{createPopupTemplate as C}from"../support/popupUtils.js";import _ from"../geometry/SpatialReference.js";import G from"../geometry/Extent.js";const V=D();let B=class extends(f(y(h(m(v(g(j(c(s(d)))))))))){constructor(e){super(e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new u({layer:this}),this.spatialReference=_.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson",this.typeIdField=null,this.types=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.source.load(e).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),q(this.renderer,this.fieldsIndex),U(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}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()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return this.url?p(this.url):null}set renderer(e){q(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=p(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");await this.load();const i=await r.applyEdits(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),i}on(e,t){return super.on(e,t)}createPopupTemplate(e){return C(this,e)}createQuery(){const e=new Q,t=this.get("capabilities.data");e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e}getFieldDomain(e,t){let r,i=!1;const o=t&&t.feature,s=o&&o.attributes,p=this.typeIdField&&s&&s[this.typeIdField];return null!=p&&this.types&&(i=this.types.some((t=>t.id==p&&(r=t.domains&&t.domains[e],r&&"inherited"===r.type&&(r=this._getLayerDomain(e)),!0)))),i||r||(r=this._getLayerDomain(e)),r}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(Q.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(Q.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(Q.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(Q.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return o(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some((r=>(r.name===e&&(t=r.domain),!!t))),t}};e([n({readOnly:!0,json:{read:!1,write:!1}})],B.prototype,"capabilities",null),e([n({type:String})],B.prototype,"copyright",void 0),e([n({readOnly:!0})],B.prototype,"createQueryVersion",null),e([n({readOnly:!0})],B.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],B.prototype,"definitionExpression",void 0),e([n({type:String})],B.prototype,"displayField",void 0),e([n({type:Boolean})],B.prototype,"editingEnabled",void 0),e([n(b)],B.prototype,"elevationInfo",void 0),e([n(w)],B.prototype,"featureReduction",void 0),e([n({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],B.prototype,"fields",void 0),e([n(V.fieldsIndex)],B.prototype,"fieldsIndex",void 0),e([n({type:G,json:{name:"extent"}})],B.prototype,"fullExtent",void 0),e([n({type:["point","polygon","polyline","multipoint"],json:{read:{reader:a.read}}})],B.prototype,"geometryType",void 0),e([n({type:Boolean})],B.prototype,"hasZ",void 0),e([n(x)],B.prototype,"id",void 0),e([n({type:Boolean,readOnly:!0})],B.prototype,"isTable",null),e([n(I)],B.prototype,"labelsVisible",void 0),e([n({type:[N],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:J},write:!0}})],B.prototype,"labelingInfo",void 0),e([n(O)],B.prototype,"legendEnabled",void 0),e([n({type:["show","hide"]})],B.prototype,"listMode",void 0),e([n({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],B.prototype,"objectIdField",void 0),e([n(S)],B.prototype,"opacity",void 0),e([n({type:["GeoJSON"]})],B.prototype,"operationalLayerType",void 0),e([n({readOnly:!0})],B.prototype,"parsedUrl",null),e([n(E)],B.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:!0}})],B.prototype,"popupTemplate",void 0),e([n({types:r,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:i}}}})],B.prototype,"renderer",null),e([n(F)],B.prototype,"screenSizePerspectiveEnabled",void 0),e([n({readOnly:!0})],B.prototype,"source",void 0),e([n({type:_})],B.prototype,"spatialReference",void 0),e([n({type:[R]})],B.prototype,"templates",void 0),e([n()],B.prototype,"title",void 0),e([n({json:{read:!1},readOnly:!0})],B.prototype,"type",void 0),e([n({type:String,readOnly:!0})],B.prototype,"typeIdField",void 0),e([n({type:[T]})],B.prototype,"types",void 0),e([n(P)],B.prototype,"url",null),B=e([l("esri.layers.GeoJSONLayer")],B);const Z=B;export{Z 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"../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{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as p}from"../geometry/support/typeUtils.js";import l from"./Layer.js";import{OGCFeatureSource as a}from"./graphics/sources/OGCFeatureSource.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as m}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as u}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{OrderedLayer as c}from"./mixins/OrderedLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{elevationInfo as I,labelsVisible as b,legendEnabled as x,popupEnabled as S,screenSizePerspectiveEnabled as F,url as
|
|
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{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as p}from"../geometry/support/typeUtils.js";import l from"./Layer.js";import{OGCFeatureSource as a}from"./graphics/sources/OGCFeatureSource.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as m}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as u}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{OrderedLayer as c}from"./mixins/OrderedLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{elevationInfo as I,labelsVisible as b,legendEnabled as x,popupEnabled as S,screenSizePerspectiveEnabled as F,url as R}from"./support/commonProperties.js";import{featureReductionProperty as L}from"./support/featureReductionUtils.js";import O from"./support/FeatureType.js";import T from"./support/Field.js";import{defineFieldProperties as w}from"./support/fieldProperties.js";import{fixRendererFields as D,fixTimeInfoFields as P}from"./support/fieldUtils.js";import E from"./support/LabelClass.js";import{reader as C}from"./support/labelingInfo.js";import U from"../rest/support/Query.js";import{createPopupTemplate as _}from"../support/popupUtils.js";import G from"../geometry/Extent.js";import q from"../geometry/SpatialReference.js";const B=w();let V=class extends(d(m(u(y(c(v(g(f(h(j(o(l)))))))))))){constructor(e){super(e),this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new a({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then((()=>this._fetchService(e)))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}set renderer(e){D(e,this.fieldsIndex),this._set("renderer",e)}on(e,r){return super.on(e,r)}createPopupTemplate(e){return _(this,e)}createQuery(){return new U}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){let t,i=!1;const o=r?.feature?.attributes,s=this.typeIdField&&o?.[this.typeIdField];return null!=s&&this.types&&(i=this.types.some((r=>r.id==s&&(t=r.domains?.[e],"inherited"===t?.type&&(t=this._getLayerDomain(e)),!0)))),i||t||(t=this._getLayerDomain(e)),t}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(U.from(e)||this.createQuery(),r))).then((e=>(e?.features?.forEach((e=>{e.layer=e.sourceLayer=this})),e)))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),D(this.renderer,this.fieldsIndex),P(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const r of this.fields)if(r.name===e&&r.domain)return r.domain;return null}};e([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],V.prototype,"capabilities",void 0),e([s({type:String,json:{write:!0}})],V.prototype,"collectionId",void 0),e([s({type:String})],V.prototype,"copyright",void 0),e([s({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([s({type:String})],V.prototype,"definitionExpression",void 0),e([s({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],V.prototype,"description",void 0),e([s({type:String})],V.prototype,"displayField",void 0),e([s(I)],V.prototype,"elevationInfo",void 0),e([s(L)],V.prototype,"featureReduction",void 0),e([s({type:[T],json:{origins:{service:{name:"layerDefinition.fields"}}}})],V.prototype,"fields",void 0),e([s(B.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([s({readOnly:!0,type:G,json:{origins:{service:{name:"layerDefinition.extent"}}}})],V.prototype,"fullExtent",void 0),e([s({type:p.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:p.read}}}}})],V.prototype,"geometryType",void 0),e([s({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],V.prototype,"hasZ",void 0),e([s({type:Boolean,readOnly:!0})],V.prototype,"isTable",null),e([s({type:[E],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:C},write:!0}}}})],V.prototype,"labelingInfo",void 0),e([s(b)],V.prototype,"labelsVisible",void 0),e([s(x)],V.prototype,"legendEnabled",void 0),e([s({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],V.prototype,"objectIdField",void 0),e([s({type:["OGCFeatureLayer"]})],V.prototype,"operationalLayerType",void 0),e([s(S)],V.prototype,"popupEnabled",void 0),e([s({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([s({types:t,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],V.prototype,"renderer",null),e([s(F)],V.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],V.prototype,"source",void 0),e([s({readOnly:!0,type:q,json:{origins:{service:{read:!0}}}})],V.prototype,"spatialReference",void 0),e([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],V.prototype,"title",void 0),e([s({readOnly:!0,json:{read:!1}})],V.prototype,"type",void 0),e([s({type:String,readOnly:!0})],V.prototype,"typeIdField",void 0),e([s({type:[O]})],V.prototype,"types",void 0),e([s(R)],V.prototype,"url",void 0),V=e([n("esri.layers.OGCFeatureLayer")],V);const M=V;export{M as default};
|
package/layers/RouteLayer.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 t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o 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{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{HandleOwnerMixin as a}from"../core/HandleOwner.js";import l from"../core/Logger.js";import{isSome as p,isNone as u,unwrapOrValue as m,applySome as y,unwrap as c}from"../core/maybe.js";import{MultiOriginJSONMixin as f}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as d}from"../core/object.js";import{isAbortError as h}from"../core/promiseUtils.js";import{on as g}from"../core/reactiveUtils.js";import{convertUnit as S}from"../core/unitUtils.js";import{urlToObject as w}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as v}from"../core/accessorSupport/decorators/reader.js";import{subclass as B}from"../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as P}from"../core/accessorSupport/originUtils.js";import j from"../geometry/Extent.js";import{initializeProjection as D,project as _}from"../geometry/projection.js";import{WGS84 as L}from"../geometry/support/spatialReferenceUtils.js";import N from"./Layer.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as A}from"./support/arcgisLayerUrl.js";import x from"./support/RouteSymbols.js";import J from"../portal/Portal.js";import F from"../portal/PortalItem.js";import{TypeKeyword as G}from"../portal/support/portalItemUtils.js";import{fetchServiceDescription as k}from"../rest/networkService.js";import{solve as U}from"../rest/route.js";import M from"../rest/support/DirectionLine.js";import q from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as E,directionsLengthUnitJsonMap as W}from"../rest/support/networkEnums.js";import V from"../rest/support/PointBarrier.js";import H from"../rest/support/PolygonBarrier.js";import K from"../rest/support/PolylineBarrier.js";import Y from"../rest/support/RouteInfo.js";import Q from"../rest/support/RouteParameters.js";import Z from"../rest/support/RouteSettings.js";import $ from"../rest/support/Stop.js";import z from"../geometry/SpatialReference.js";import X from"../geometry/Multipoint.js";function ee(e){return e.length?e:null}function te(e){const{defaultTravelMode:t,supportedTravelModes:r}=e;return r.find((e=>e.id===t))}function re(e){return"layers"in e}function oe(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function ie(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function se(e,t,r){const o=t.networkDataset.networkAttributes.filter((e=>"cost"===e.usageType)),i=te(t),s=r.travelMode??i;if(u(s))return void he.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:a,distanceAttributeName:l}=s,m=o.find((e=>e.name===a)),y=o.find((e=>e.name===l)),f=c(r.travelMode)?.impedanceAttributeName??c(r.impedanceAttribute)??t.impedance,d=E.fromJSON(m?.units),h=W.fromJSON(y?.units);if(!d||!h)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const g=r.directionsLanguage??t.directionsLanguage,S=c(r.accumulateAttributes)??t.accumulateAttributeNames??[],w=new Set(o.filter((({name:e})=>e===a||e===l||e===f||S.includes(e))).map((({name:e})=>e))),b=e=>{for(const t in e)w.has(t)||delete e[t]};for(const n of e.pointBarriers)p(n.costs)&&(n.addedCost=n.costs[f]??0,b(n.costs));for(const n of e.polygonBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));for(const n of e.polylineBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));const{routeInfo:v}=e,{findBestSequence:B,preserveFirstStop:I,preserveLastStop:P,startTimeIsUTC:j,timeWindowsAreUTC:D}=r;v.analysisSettings=new Z({accumulateAttributes:S,directionsLanguage:g,findBestSequence:B,preserveFirstStop:I,preserveLastStop:P,startTimeIsUTC:j,timeWindowsAreUTC:D,travelMode:s}),v.totalDuration=ae(v.totalCosts[a]??0,d),v.totalDistance=le(v.totalCosts[l]??0,h),v.totalLateDuration=ae(v.totalViolations[a]??0,d),v.totalWaitDuration=ae(v.totalWait[a]??0,d),p(v.totalCosts)&&b(v.totalCosts),p(v.totalViolations)&&b(v.totalViolations),p(v.totalWait)&&b(v.totalWait);for(const n of e.stops)p(n.serviceCosts)&&(n.serviceDuration=ae(n.serviceCosts[a]??0,d),n.serviceDistance=le(n.serviceCosts[l]??0,h),b(n.serviceCosts)),p(n.cumulativeCosts)&&(n.cumulativeDuration=ae(n.cumulativeCosts[a]??0,d),n.cumulativeDistance=le(n.cumulativeCosts[l]??0,h),b(n.cumulativeCosts)),p(n.violations)&&(n.lateDuration=ae(n.violations[a]??0,d),b(n.violations)),p(n.wait)&&(n.waitDuration=ae(n.wait[a]??0,d),b(n.wait))}async function ne(e){const t=z.WGS84;return await D(e.spatialReference,t),_(e,t)}function ae(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function le(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:S(e,t,"meters")}function pe(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const ue=s.ofType(M),me=s.ofType(q),ye=s.ofType(V),ce=s.ofType(H),fe=s.ofType(K),de=s.ofType($),he=l.getLogger("esri.layers.RouteLayer");let ge=class extends(C(T(O(R(f(a(N))))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new x,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new ye,this.polygonBarriers=new ce,this.polylineBarriers=new fe,this.routeInfo=null,this.spatialReference=z.WGS84,this.stops=new de,this.type="route";const t=()=>{u(this.routeInfo)&&this._setStopSymbol(this.stops)};this.own([g((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t})])}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";d(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>M.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>q.fromGraphic(e)))}get fullExtent(){if(p(this.routeInfo)&&p(this.routeInfo.geometry))return this.routeInfo.geometry.extent;const e=new j({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:z.WGS84}),t=this.stops.filter((e=>p(e.geometry)));if(t.length<2)return e;const{spatialReference:r}=t.getItemAt(0).geometry;if(u(r))return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new X({points:o,spatialReference:r}).extent}readMaxScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.maxScale)))?.layerDefinition.maxScale??0}readMinScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.minScale)))?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>V.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>H.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>K.fromGraphic(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>Y.fromGraphic(e)));return r.length>0?r.getItemAt(0):null}readSpatialReference(e,t){const r=re(t)?t.layers:t.featureCollection.layers;if(!r.length)return z.WGS84;const{layerDefinition:o}=r[0],i=o.spatialReference??o.extent.spatialReference??L;return z.fromJSON(i)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>$.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return p(this.routeInfo)&&p(this.routeInfo.name)?this.routeInfo.name:"Route"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",A(e,he)):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){p(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),p(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),p(this.routeInfo)&&this._set("routeInfo",null),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new n("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new n("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new n("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(u(this.routeInfo))throw new n("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;if(await r._signIn(),r.user||await t.reload(),r.user.username!==t.owner)throw new n("routelayer:not-portal-item-owner","You can only overwrite your portal items");const{itemUrl:o}=t,i={messages:[],origin:"portal-item",portal:r,url:o&&w(o),writtenProperties:[]},s=this.write(null,i);return t.extent=await ne(e),t.title=this.title,await t.update({data:s}),t}async saveAs(e,t={}){if(await this.load(),u(this.routeInfo))throw new n("routelayer:route-unsolved","saveAs() requires a solved route");const r=F.from(e).clone();r.extent??(r.extent=await ne(this.fullExtent)),r.id=null,r.portal??(r.portal=J.getDefault()),r.title??(r.title=this.title),r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",G.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o._signIn();const s=t?.folder,a=this.write(null,i);return await o.user.addItem({item:r,folder:s,data:a}),this.portalItem=r,P(i),i.portalItem=r,r}async solve(e,t){const r=e?.stops??this.stops,o=e?.pointBarriers??ee(this.pointBarriers),i=e?.polylineBarriers??ee(this.polylineBarriers),a=e?.polygonBarriers??ee(this.polygonBarriers);if(u(r))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((oe(r)||ie(r))&&r.features.length<2||s.isCollection(r)&&r.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const l=e?.apiKey,y=this.url,c=await this._getServiceDescription(y,l,t),f=te(c),d=e?.travelMode??f,g=m(e?.accumulateAttributes,[]);p(d)&&g.push(d.distanceAttributeName);const S={startTime:new Date},w={accumulateAttributes:g,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:a,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},b=e?Q.from(e):new Q;for(const s in S)null==b[s]&&(b[s]=S[s]);let v;b.set(w);try{v=await U(y,b,t)}catch(I){throw h(I)?I:new n("routelayer:failed-route-request","the routing request failed",{error:I})}const B=this._toRouteLayerSolution(v);return this._isOverridden("title")||(this.title=m(B.routeInfo.name,"Route")),se(B,c,b),B}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:a}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,a){const l=(re(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(u(l))return new s;const{layerDefinition:p,popupInfo:m,featureSet:y}=l,c=p.drawingInfo.renderer,{features:f}=y,d=c&&i(c),h=f.map((e=>{const i=r.fromJSON(e),s=n(i);return s.symbol??(s.symbol=d?.getSymbol(i)??this._getNetworkSymbol(t)),s.popupTemplate??(s.popupTemplate=m&&o.fromJSON(m)),s}));return a&&h.some((e=>!e.symbol))&&a(h),new s(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(p(this._cachedServiceDescription)&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await k(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length)return;if(u(this.defaultSymbols.stops))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(u(this.routeInfo)||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const a=e.map((e=>e.sequence)).filter((e=>p(e))),l=Math.min(...a),m=Math.max(...a);for(const p of e)p.sequence!==l?p.sequence!==m?"ok"===p.status||"not-located-on-closest"===p.status?"waypoint"!==p.locationType?"break"!==p.locationType?p.symbol=o:p.symbol=n:p.symbol=s:p.symbol=i:p.symbol=r:p.symbol=t}_toRouteLayerSolution(e){const t=e.routeResults[0].stops.map((e=>$.fromJSON(e.toJSON())));this._setStopSymbol(t);const r=new de(t),o=new ce(e.polygonBarriers?.map((e=>{const t=H.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),i=new fe(e.polylineBarriers?.map((e=>{const t=K.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),s=new ye(e.pointBarriers?.map((e=>{const t=V.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),n=Y.fromJSON(e.routeResults[0].route.toJSON());n.symbol=this.defaultSymbols.routeInfo;const a=new me(e.routeResults[0].directionPoints?.features.map((e=>{const t=q.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new ue(e.routeResults[0].directionLines?.features.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:n,stops:r}}_writeDirectionLines(){return u(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.directionLines,(e=>e.toJSON()))}},fields:M.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:M.popupInfo}}_writeDirectionPoints(){return u(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.directionPoints,(e=>e.toJSON()))}},fields:q.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:q.popupInfo}}_writePointBarriers(){return u(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.pointBarriers,(e=>e.toJSON()))}},fields:V.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:V.popupInfo}}_writePolygonBarriers(){return u(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.polygonBarriers,(e=>e.toJSON()))}},fields:H.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:H.popupInfo}}_writePolylineBarriers(){return u(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.polylineBarriers,(e=>e.toJSON()))}},fields:K.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:K.popupInfo}}_writeRouteInfo(){return u(this.routeInfo)?null:{featureSet:{features:[pe(this.routeInfo)],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.routeInfo,(e=>e.toJSON()))}},fields:Y.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:Y.popupInfo}}_writeStops(){if(u(this.stops)||!this.stops.length)return null;const{stops:e}=this.defaultSymbols,t=p(e)&&p(e.first)&&e.first.toJSON(),r=p(e)&&p(e.middle)&&e.middle.toJSON(),o=p(e)&&p(e.last)&&e.last.toJSON();return{featureSet:{features:this.stops.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:r,uniqueValueInfos:[{value:"1",symbol:t,label:"First Stop"},{value:`${this.stops.length}`,symbol:o,label:"Last Stop"}]}},fields:$.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:$.popupInfo}}};e([b({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],ge.prototype,"_featureCollection",void 0),e([I(["web-map","portal-item"],"_featureCollection")],ge.prototype,"writeFeatureCollectionWebmap",null),e([b({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],ge.prototype,"_type",void 0),e([b({nonNullable:!0,type:x})],ge.prototype,"defaultSymbols",void 0),e([b({readOnly:!0})],ge.prototype,"directionLines",void 0),e([v(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],ge.prototype,"readDirectionLines",null),e([b({readOnly:!0})],ge.prototype,"directionPoints",void 0),e([v(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],ge.prototype,"readDirectionPoints",null),e([b({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],ge.prototype,"featureCollectionType",void 0),e([b({readOnly:!0})],ge.prototype,"fullExtent",null),e([b({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],ge.prototype,"legendEnabled",void 0),e([b({type:["show","hide"]})],ge.prototype,"listMode",void 0),e([b({type:Number,nonNullable:!0,json:{write:!1}})],ge.prototype,"maxScale",void 0),e([v(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],ge.prototype,"readMaxScale",null),e([b({type:Number,nonNullable:!0,json:{write:!1}})],ge.prototype,"minScale",void 0),e([v(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],ge.prototype,"readMinScale",null),e([b({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],ge.prototype,"operationalLayerType",void 0),e([b({nonNullable:!0,type:s.ofType(V)})],ge.prototype,"pointBarriers",void 0),e([v(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPointBarriers",null),e([b({nonNullable:!0,type:s.ofType(H)})],ge.prototype,"polygonBarriers",void 0),e([v(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPolygonBarriers",null),e([b({nonNullable:!0,type:s.ofType(K)})],ge.prototype,"polylineBarriers",void 0),e([v(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPolylineBarriers",null),e([b({readOnly:!0})],ge.prototype,"routeInfo",void 0),e([v(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],ge.prototype,"readRouteInfo",null),e([b({type:z})],ge.prototype,"spatialReference",void 0),e([v(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],ge.prototype,"readSpatialReference",null),e([b({nonNullable:!0,type:s.ofType($)})],ge.prototype,"stops",void 0),e([v(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],ge.prototype,"readStops",null),e([b()],ge.prototype,"title",null),e([b({readOnly:!0,json:{read:!1}})],ge.prototype,"type",void 0),e([b()],ge.prototype,"url",null),ge=e([B("esri.layers.RouteLayer")],ge);const Se=ge;export{Se as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import"../geometry.js";import r from"../Graphic.js";import o 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{read as i}from"../renderers/support/jsonUtils.js";import s from"../core/Collection.js";import n from"../core/Error.js";import{HandleOwnerMixin as a}from"../core/HandleOwner.js";import l from"../core/Logger.js";import{isSome as p,isNone as u,unwrapOrValue as m,applySome as y,unwrap as c}from"../core/maybe.js";import{MultiOriginJSONMixin as f}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as d}from"../core/object.js";import{isAbortError as h}from"../core/promiseUtils.js";import{on as g}from"../core/reactiveUtils.js";import{convertUnit as S}from"../core/unitUtils.js";import{urlToObject as w}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as v}from"../core/accessorSupport/decorators/reader.js";import{subclass as B}from"../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as P}from"../core/accessorSupport/originUtils.js";import j from"../geometry/Extent.js";import{initializeProjection as D,project as _}from"../geometry/projection.js";import{WGS84 as L}from"../geometry/support/spatialReferenceUtils.js";import N from"./Layer.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as A}from"./support/arcgisLayerUrl.js";import x from"./support/RouteSymbols.js";import J from"../portal/Portal.js";import F from"../portal/PortalItem.js";import{TypeKeyword as G}from"../portal/support/portalItemUtils.js";import{fetchServiceDescription as k}from"../rest/networkService.js";import{solve as U}from"../rest/route.js";import M from"../rest/support/DirectionLine.js";import q from"../rest/support/DirectionPoint.js";import{directionsTimeUnitJsonMap as E,directionsLengthUnitJsonMap as W}from"../rest/support/networkEnums.js";import V from"../rest/support/PointBarrier.js";import H from"../rest/support/PolygonBarrier.js";import K from"../rest/support/PolylineBarrier.js";import Y from"../rest/support/RouteInfo.js";import Q from"../rest/support/RouteParameters.js";import Z from"../rest/support/RouteSettings.js";import $ from"../rest/support/Stop.js";import z from"../geometry/SpatialReference.js";import X from"../geometry/Multipoint.js";function ee(e){return e.length?e:null}function te(e){const{defaultTravelMode:t,supportedTravelModes:r}=e;return r.find((e=>e.id===t))}function re(e){return"layers"in e}function oe(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function ie(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function se(e,t,r){const o=t.networkDataset.networkAttributes.filter((e=>"cost"===e.usageType)),i=te(t),s=r.travelMode??i;if(u(s))return void he.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:a,distanceAttributeName:l}=s,m=o.find((e=>e.name===a)),y=o.find((e=>e.name===l)),f=c(r.travelMode)?.impedanceAttributeName??c(r.impedanceAttribute)??t.impedance,d=E.fromJSON(m?.units),h=W.fromJSON(y?.units);if(!d||!h)throw new n("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const g=r.directionsLanguage??t.directionsLanguage,S=c(r.accumulateAttributes)??t.accumulateAttributeNames??[],w=new Set(o.filter((({name:e})=>e===a||e===l||e===f||S.includes(e))).map((({name:e})=>e))),b=e=>{for(const t in e)w.has(t)||delete e[t]};for(const n of e.pointBarriers)p(n.costs)&&(n.addedCost=n.costs[f]??0,b(n.costs));for(const n of e.polygonBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));for(const n of e.polylineBarriers)p(n.costs)&&(n.scaleFactor=n.costs[f]??1,b(n.costs));const{routeInfo:v}=e,{findBestSequence:B,preserveFirstStop:I,preserveLastStop:P,startTimeIsUTC:j,timeWindowsAreUTC:D}=r;v.analysisSettings=new Z({accumulateAttributes:S,directionsLanguage:g,findBestSequence:B,preserveFirstStop:I,preserveLastStop:P,startTimeIsUTC:j,timeWindowsAreUTC:D,travelMode:s}),v.totalDuration=ae(v.totalCosts[a]??0,d),v.totalDistance=le(v.totalCosts[l]??0,h),v.totalLateDuration=ae(v.totalViolations[a]??0,d),v.totalWaitDuration=ae(v.totalWait[a]??0,d),p(v.totalCosts)&&b(v.totalCosts),p(v.totalViolations)&&b(v.totalViolations),p(v.totalWait)&&b(v.totalWait);for(const n of e.stops)p(n.serviceCosts)&&(n.serviceDuration=ae(n.serviceCosts[a]??0,d),n.serviceDistance=le(n.serviceCosts[l]??0,h),b(n.serviceCosts)),p(n.cumulativeCosts)&&(n.cumulativeDuration=ae(n.cumulativeCosts[a]??0,d),n.cumulativeDistance=le(n.cumulativeCosts[l]??0,h),b(n.cumulativeCosts)),p(n.violations)&&(n.lateDuration=ae(n.violations[a]??0,d),b(n.violations)),p(n.wait)&&(n.waitDuration=ae(n.wait[a]??0,d),b(n.wait))}async function ne(e){const t=z.WGS84;return await D(e.spatialReference,t),_(e,t)}function ae(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function le(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:S(e,t,"meters")}function pe(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const ue=s.ofType(M),me=s.ofType(q),ye=s.ofType(V),ce=s.ofType(H),fe=s.ofType(K),de=s.ofType($),he=l.getLogger("esri.layers.RouteLayer");let ge=class extends(C(T(O(R(f(a(N))))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new x,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new ye,this.polygonBarriers=new ce,this.polylineBarriers=new fe,this.routeInfo=null,this.spatialReference=z.WGS84,this.stops=new de,this.type="route";const t=()=>{u(this.routeInfo)&&this._setStopSymbol(this.stops)};this.own([g((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t})])}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";d(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>M.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>q.fromGraphic(e)))}get fullExtent(){if(p(this.routeInfo)&&p(this.routeInfo.geometry))return this.routeInfo.geometry.extent;const e=new j({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:z.WGS84}),t=this.stops.filter((e=>p(e.geometry)));if(t.length<2)return e;const{spatialReference:r}=t.getItemAt(0).geometry;if(u(r))return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new X({points:o,spatialReference:r}).extent}readMaxScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.maxScale)))?.layerDefinition.maxScale??0}readMinScale(e,t){return(re(t)?t.layers:t.featureCollection.layers).find((e=>p(e.layerDefinition.minScale)))?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>V.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>H.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>K.fromGraphic(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>Y.fromGraphic(e)));return r.length>0?r.getItemAt(0):null}readSpatialReference(e,t){const r=re(t)?t.layers:t.featureCollection.layers;if(!r.length)return z.WGS84;const{layerDefinition:o}=r[0],i=o.spatialReference??o.extent.spatialReference??L;return z.fromJSON(i)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>$.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return p(this.routeInfo)&&p(this.routeInfo.name)?this.routeInfo.name:"Route"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",A(e,he)):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){p(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),p(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),p(this.routeInfo)&&this._set("routeInfo",null),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new n("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new n("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new n("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(u(this.routeInfo))throw new n("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;if(await r._signIn(),r.user||await t.reload(),r.user.username!==t.owner)throw new n("routelayer:not-portal-item-owner","You can only overwrite your portal items");const{itemUrl:o}=t,i={messages:[],origin:"portal-item",portal:r,url:o&&w(o),writtenProperties:[]},s=this.write(null,i);return t.extent=await ne(e),t.title=this.title,await t.update({data:s}),t}async saveAs(e,t={}){if(await this.load(),u(this.routeInfo))throw new n("routelayer:route-unsolved","saveAs() requires a solved route");const r=F.from(e).clone();r.extent??(r.extent=await ne(this.fullExtent)),r.id=null,r.portal??(r.portal=J.getDefault()),r.title??(r.title=this.title),r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",G.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o._signIn();const s=t?.folder,a=this.write(null,i);return await o.user.addItem({item:r,folder:s,data:a}),this.portalItem=r,P(i),i.portalItem=r,r}async solve(e,t){const r=e?.stops??this.stops,o=e?.pointBarriers??ee(this.pointBarriers),i=e?.polylineBarriers??ee(this.polylineBarriers),a=e?.polygonBarriers??ee(this.polygonBarriers);if(u(r))throw new n("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((oe(r)||ie(r))&&r.features.length<2||s.isCollection(r)&&r.length<2)throw new n("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const l=e?.apiKey,y=this.url,c=await this._getServiceDescription(y,l,t),f=te(c),d=e?.travelMode??f,g=m(e?.accumulateAttributes,[]);p(d)&&g.push(d.distanceAttributeName);const S={startTime:new Date},w={accumulateAttributes:g,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:a,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},b=e?Q.from(e):new Q;for(const s in S)null==b[s]&&(b[s]=S[s]);let v;b.set(w);try{v=await U(y,b,t)}catch(I){throw h(I)?I:new n("routelayer:failed-route-request","the routing request failed",{error:I})}const B=this._toRouteLayerSolution(v);return this._isOverridden("title")||(this.title=m(B.routeInfo.name,"Route")),se(B,c,b),B}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:a}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,n,a){const l=(re(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if(u(l))return new s;const{layerDefinition:p,popupInfo:m,featureSet:y}=l,c=p.drawingInfo.renderer,{features:f}=y,d=c&&i(c),h=f.map((e=>{const i=r.fromJSON(e),s=n(i);return s.symbol??(s.symbol=d?.getSymbol(i)??this._getNetworkSymbol(t)),s.popupTemplate??(s.popupTemplate=m&&o.fromJSON(m)),s}));return a&&h.some((e=>!e.symbol))&&a(h),new s(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(p(this._cachedServiceDescription)&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await k(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length)return;if(u(this.defaultSymbols.stops))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(u(this.routeInfo)||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const a=e.map((e=>e.sequence)).filter((e=>p(e))),l=Math.min(...a),m=Math.max(...a);for(const p of e)p.sequence!==l?p.sequence!==m?"ok"===p.status||"not-located-on-closest"===p.status?"waypoint"!==p.locationType?"break"!==p.locationType?p.symbol=o:p.symbol=n:p.symbol=s:p.symbol=i:p.symbol=r:p.symbol=t}_toRouteLayerSolution(e){const t=e.routeResults[0].stops.map((e=>$.fromJSON(e.toJSON())));this._setStopSymbol(t);const r=new de(t),o=new ce(e.polygonBarriers?.map((e=>{const t=H.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),i=new fe(e.polylineBarriers?.map((e=>{const t=K.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),s=new ye(e.pointBarriers?.map((e=>{const t=V.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),n=Y.fromJSON(e.routeResults[0].route.toJSON());n.symbol=this.defaultSymbols.routeInfo;const a=new me(e.routeResults[0].directionPoints?.features.map((e=>{const t=q.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new ue(e.routeResults[0].directionLines?.features.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:n,stops:r}}_writeDirectionLines(){return u(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.directionLines,(e=>e.toJSON()))}},fields:M.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:M.popupInfo}}_writeDirectionPoints(){return u(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.directionPoints,(e=>e.toJSON()))}},fields:q.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:q.popupInfo}}_writePointBarriers(){return u(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.pointBarriers,(e=>e.toJSON()))}},fields:V.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:V.popupInfo}}_writePolygonBarriers(){return u(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.polygonBarriers,(e=>e.toJSON()))}},fields:H.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:H.popupInfo}}_writePolylineBarriers(){return u(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>pe(e))),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.polylineBarriers,(e=>e.toJSON()))}},fields:K.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:K.popupInfo}}_writeRouteInfo(){return u(this.routeInfo)?null:{featureSet:{features:[pe(this.routeInfo)],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:y(this.defaultSymbols.routeInfo,(e=>e.toJSON()))}},fields:Y.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:Y.popupInfo}}_writeStops(){if(u(this.stops)||!this.stops.length)return null;const{stops:e}=this.defaultSymbols,t=p(e)&&p(e.first)&&e.first.toJSON(),r=p(e)&&p(e.middle)&&e.middle.toJSON(),o=p(e)&&p(e.last)&&e.last.toJSON();return{featureSet:{features:this.stops.toArray().map((e=>pe(e))),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:r,uniqueValueInfos:[{value:"1",symbol:t,label:"First Stop"},{value:`${this.stops.length}`,symbol:o,label:"Last Stop"}]}},fields:$.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:$.popupInfo}}};e([b({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],ge.prototype,"_featureCollection",void 0),e([I(["web-map","portal-item"],"_featureCollection")],ge.prototype,"writeFeatureCollectionWebmap",null),e([b({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],ge.prototype,"_type",void 0),e([b({nonNullable:!0,type:x})],ge.prototype,"defaultSymbols",void 0),e([b({readOnly:!0})],ge.prototype,"directionLines",void 0),e([v(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],ge.prototype,"readDirectionLines",null),e([b({readOnly:!0})],ge.prototype,"directionPoints",void 0),e([v(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],ge.prototype,"readDirectionPoints",null),e([b({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],ge.prototype,"featureCollectionType",void 0),e([b({readOnly:!0})],ge.prototype,"fullExtent",null),e([b({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],ge.prototype,"legendEnabled",void 0),e([b({type:["show","hide"]})],ge.prototype,"listMode",void 0),e([b({type:Number,nonNullable:!0,json:{write:!1}})],ge.prototype,"maxScale",void 0),e([v(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],ge.prototype,"readMaxScale",null),e([b({type:Number,nonNullable:!0,json:{write:!1}})],ge.prototype,"minScale",void 0),e([v(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],ge.prototype,"readMinScale",null),e([b({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],ge.prototype,"operationalLayerType",void 0),e([b({nonNullable:!0,type:s.ofType(V)})],ge.prototype,"pointBarriers",void 0),e([v(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPointBarriers",null),e([b({nonNullable:!0,type:s.ofType(H)})],ge.prototype,"polygonBarriers",void 0),e([v(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPolygonBarriers",null),e([b({nonNullable:!0,type:s.ofType(K)})],ge.prototype,"polylineBarriers",void 0),e([v(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],ge.prototype,"readPolylineBarriers",null),e([b({readOnly:!0})],ge.prototype,"routeInfo",void 0),e([v(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],ge.prototype,"readRouteInfo",null),e([b({type:z})],ge.prototype,"spatialReference",void 0),e([v(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],ge.prototype,"readSpatialReference",null),e([b({nonNullable:!0,type:s.ofType($)})],ge.prototype,"stops",void 0),e([v(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],ge.prototype,"readStops",null),e([b()],ge.prototype,"title",null),e([b({readOnly:!0,json:{read:!1}})],ge.prototype,"type",void 0),e([b()],ge.prototype,"url",null),ge=e([B("esri.layers.RouteLayer")],ge);const Se=ge;export{Se as default};
|
package/layers/SceneLayer.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 t 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 r}from"../renderers/support/types.js";import s from"../request.js";import o from"../core/Collection.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{isSome as n,isNone as p}from"../core/maybe.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"./Layer.js";import{APIKeyMixin as I}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as F,SaveOperationType as O}from"./mixins/SceneService.js";import{zeroCapabilities as T}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as _,legendEnabled as P,popupEnabled as x,screenSizePerspectiveEnabled as A}from"./support/commonProperties.js";import{FeatureReduction as D}from"./support/FeatureReduction.js";import R from"./support/FeatureReductionSelection.js";import{FetchAssociatedFeatureLayer as U}from"./support/FetchAssociatedFeatureLayer.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import Q from"./support/FieldsIndex.js";import{fixRendererFields as N}from"./support/fieldUtils.js";import{I3SNodePageDefinition as k,I3SMaterialDefinition as C,I3STextureSetDefinition as V,I3SGeometryDefinition as G}from"./support/I3SLayerDefinitions.js";import K from"./support/LabelClass.js";import{reader as M}from"./support/labelingInfo.js";import $ from"./support/LayerFloorInfo.js";import{RangeInfo as W}from"./support/RangeInfo.js";import{loadStyleRenderer as z}from"../renderers/support/styleUtils.js";import Z from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{transparencyToOpacity as H}from"../webdoc/support/opacityUtils.js";const J=["3DObject","Point"],X=a.getLogger("esri.layers.SceneLayer"),Y=q();let ee=class extends(F(j(w(L(S(l(I(b)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&n(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return n(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return n(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return n(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new Q(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:k.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return re[this.profile]||"mesh"}set renderer(e){N(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=n(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:T,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsReturnServiceEditsInSourceSpatialReference:i},data:{supportsZ:a,supportsM:p,isVersioned:l,supportsAttachment:d},operations:{supportsEditing:y,supportsUpdate:u,supportsQuery:c,supportsQueryAttachments:f}}=e,h=e.operations.supportsChangeTracking;return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:i,supportsRollbackOnFailure:s,supportsGeometryUpdate:!1,supportsUploadWithItemId:o},data:{supportsAttachment:d,supportsZ:a,supportsM:p,isVersioned:l},operations:{supportsQuery:c,supportsQueryAttachments:f,supportsEditing:y&&h,supportsAdd:!1,supportsDelete:!1,supportsUpdate:u&&h}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}get defaultPopupTemplate(){return n(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return n(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&te[r]?te[r]:(X.error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=n(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t)]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>z(this,{origin:"service"},t))).then((()=>N(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}createQuery(){const e=new Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(X.error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return B(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return n(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),p(this.associatedLayer))throw new i("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new i("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new i("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const o of this.statisticsInfo)if(o.name===r.name){const e=c(this.parsedUrl.path,o.href);return s(e,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new i("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(O.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(O.SAVE,e)}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");if(await this.load(),p(this.associatedLayer))throw new i(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),r.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!J.includes(e.layerType))throw new i("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,s=!1;if(null==e)r=!0,s=!0;else{const o=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,s=o;break;case"vertex-reference-frame":r=!0,s=!o;break;default:r=!1}}if(!r)throw new i("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!s)throw new i("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new i("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!(n(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),s={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=s}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(p(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(p(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=h(this);for(let r=0;r<e.length;r++){const s=e[r],o=this.originIdOf(s),i=this.associatedLayer.originIdOf(s);o<i&&(i===v.SERVICE||i===v.PORTAL_ITEM)&&t.setAtOrigin(s,this.associatedLayer[s],i)}}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new U(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(r){y(r)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?X.warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):X.info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"absolute-height"!==e.mode&&X.warn(".elevationInfo=","Mesh scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&X.warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};e([f({types:{key:"type",base:D,typeMap:{selection:R}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ee.prototype,"featureReduction",void 0),e([f({type:[W],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ee.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],ee.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],ee.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],ee.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),e([f({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ee.prototype,"fields",void 0),e([f()],ee.prototype,"types",null),e([f()],ee.prototype,"typeIdField",null),e([f()],ee.prototype,"formTemplate",null),e([f({readOnly:!0})],ee.prototype,"fieldsIndex",null),e([f({type:$,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ee.prototype,"floorInfo",void 0),e([f(Y.outFields)],ee.prototype,"outFields",void 0),e([f({type:k,readOnly:!0,json:{read:!1}})],ee.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],ee.prototype,"readNodePages",null),e([f({type:[C],readOnly:!0})],ee.prototype,"materialDefinitions",void 0),e([f({type:[V],readOnly:!0})],ee.prototype,"textureSetDefinitions",void 0),e([f({type:[G],readOnly:!0})],ee.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],ee.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],ee.prototype,"statisticsInfo",void 0),e([f({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ee.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ee.prototype,"definitionExpression",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),e([f(E)],ee.prototype,"elevationInfo",null),e([f({type:String})],ee.prototype,"geometryType",null),e([f(_)],ee.prototype,"labelsVisible",void 0),e([f({type:[K],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:M},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:M},write:!0}})],ee.prototype,"labelingInfo",void 0),e([f(P)],ee.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?H(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ee.prototype,"opacity",void 0),e([f({types:r,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ee.prototype,"renderer",null),e([f({json:{read:!1}})],ee.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],ee.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],ee.prototype,"editingEnabled",null),e([f(x)],ee.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),e([f({type:String,json:{read:!1}})],ee.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],ee.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],ee.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],ee.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],ee.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ee.prototype,"normalReferenceFrame",void 0),e([f(A)],ee.prototype,"screenSizePerspectiveEnabled",void 0),ee=e([g("esri.layers.SceneLayer")],ee);const te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},re={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},se=ee;export{se as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t 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 r}from"../renderers/support/types.js";import s from"../request.js";import o from"../core/Collection.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{isSome as n,isNone as p}from"../core/maybe.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"./Layer.js";import{APIKeyMixin as I}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as F,SaveOperationType as O}from"./mixins/SceneService.js";import{zeroCapabilities as T}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as _,legendEnabled as P,popupEnabled as x,screenSizePerspectiveEnabled as A}from"./support/commonProperties.js";import{FeatureReduction as D}from"./support/FeatureReduction.js";import R from"./support/FeatureReductionSelection.js";import{FetchAssociatedFeatureLayer as U}from"./support/FetchAssociatedFeatureLayer.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import Q from"./support/FieldsIndex.js";import{fixRendererFields as N}from"./support/fieldUtils.js";import{I3SNodePageDefinition as C,I3SMaterialDefinition as k,I3STextureSetDefinition as V,I3SGeometryDefinition as G}from"./support/I3SLayerDefinitions.js";import K from"./support/LabelClass.js";import{reader as M}from"./support/labelingInfo.js";import $ from"./support/LayerFloorInfo.js";import{RangeInfo as W}from"./support/RangeInfo.js";import{loadStyleRenderer as z}from"../renderers/support/styleUtils.js";import Z from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{transparencyToOpacity as H}from"../webdoc/support/opacityUtils.js";const J=["3DObject","Point"],X=a.getLogger("esri.layers.SceneLayer"),Y=q();let ee=class extends(F(j(w(L(S(l(I(b)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&n(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return n(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return n(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return n(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new Q(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:C.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return re[this.profile]||"mesh"}set renderer(e){N(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=n(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:T,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsReturnServiceEditsInSourceSpatialReference:i},data:{supportsZ:a,supportsM:p,isVersioned:l,supportsAttachment:d},operations:{supportsEditing:y,supportsUpdate:u,supportsQuery:c,supportsQueryAttachments:f}}=e,h=e.operations.supportsChangeTracking;return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:i,supportsRollbackOnFailure:s,supportsGeometryUpdate:!1,supportsUploadWithItemId:o},data:{supportsAttachment:d,supportsZ:a,supportsM:p,isVersioned:l},operations:{supportsQuery:c,supportsQueryAttachments:f,supportsEditing:y&&h,supportsAdd:!1,supportsDelete:!1,supportsUpdate:u&&h}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}get defaultPopupTemplate(){return n(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return n(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&te[r]?te[r]:(X.error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=n(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t)]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>z(this,{origin:"service"},t))).then((()=>N(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}createQuery(){const e=new Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(X.error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return B(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return n(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),p(this.associatedLayer))throw new i("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new i("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new i("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const o of this.statisticsInfo)if(o.name===r.name){const e=c(this.parsedUrl.path,o.href);return s(e,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new i("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(O.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(O.SAVE,e)}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");if(await this.load(),p(this.associatedLayer))throw new i(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),r.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!J.includes(e.layerType))throw new i("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,s=!1;if(null==e)r=!0,s=!0;else{const o=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,s=o;break;case"vertex-reference-frame":r=!0,s=!o;break;default:r=!1}}if(!r)throw new i("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!s)throw new i("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new i("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!(n(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),s={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=s}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(p(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(p(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=h(this);for(let r=0;r<e.length;r++){const s=e[r],o=this.originIdOf(s),i=this.associatedLayer.originIdOf(s);o<i&&(i===v.SERVICE||i===v.PORTAL_ITEM)&&t.setAtOrigin(s,this.associatedLayer[s],i)}}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new U(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(r){y(r)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?X.warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):X.info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"relative-to-scene"===e.mode&&X.warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&X.warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};e([f({types:{key:"type",base:D,typeMap:{selection:R}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ee.prototype,"featureReduction",void 0),e([f({type:[W],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ee.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],ee.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],ee.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],ee.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),e([f({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ee.prototype,"fields",void 0),e([f()],ee.prototype,"types",null),e([f()],ee.prototype,"typeIdField",null),e([f()],ee.prototype,"formTemplate",null),e([f({readOnly:!0})],ee.prototype,"fieldsIndex",null),e([f({type:$,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ee.prototype,"floorInfo",void 0),e([f(Y.outFields)],ee.prototype,"outFields",void 0),e([f({type:C,readOnly:!0,json:{read:!1}})],ee.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],ee.prototype,"readNodePages",null),e([f({type:[k],readOnly:!0})],ee.prototype,"materialDefinitions",void 0),e([f({type:[V],readOnly:!0})],ee.prototype,"textureSetDefinitions",void 0),e([f({type:[G],readOnly:!0})],ee.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],ee.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],ee.prototype,"statisticsInfo",void 0),e([f({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ee.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ee.prototype,"definitionExpression",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),e([f(E)],ee.prototype,"elevationInfo",null),e([f({type:String})],ee.prototype,"geometryType",null),e([f(_)],ee.prototype,"labelsVisible",void 0),e([f({type:[K],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:M},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:M},write:!0}})],ee.prototype,"labelingInfo",void 0),e([f(P)],ee.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?H(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ee.prototype,"opacity",void 0),e([f({types:r,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ee.prototype,"renderer",null),e([f({json:{read:!1}})],ee.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],ee.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],ee.prototype,"editingEnabled",null),e([f(x)],ee.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),e([f({type:String,json:{read:!1}})],ee.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],ee.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],ee.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],ee.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],ee.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ee.prototype,"normalReferenceFrame",void 0),e([f(A)],ee.prototype,"screenSizePerspectiveEnabled",void 0),ee=e([g("esri.layers.SceneLayer")],ee);const te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},re={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},se=ee;export{se as default};
|