@arcgis/core 4.34.0-next.88 → 4.34.0-next.89
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/PopupTemplate.js +1 -1
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{ed8863c3d334f438b625.js → 0037abf0a82d1ed32e91.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7fc8ea2ff527a09f4b9.js → 0296ebe8e37e30af771c.js} +1 -1
- package/assets/esri/core/workers/chunks/{39a1f361bb69073af765.js → 04dbdaa63c950f32b8f0.js} +1 -1
- package/assets/esri/core/workers/chunks/05aac984cbbadb5f6aa0.js +1 -0
- package/assets/esri/core/workers/chunks/0fadd1defbb6743dacdc.js +1 -0
- package/assets/esri/core/workers/chunks/{0f05425954578ac796ec.js → 135142f3cbfaf24949bc.js} +1 -1
- package/assets/esri/core/workers/chunks/2b2f1fcd50dea017d891.js +1 -0
- package/assets/esri/core/workers/chunks/{9ca55d33ae4bf25e8edd.js → 2e1cc11462846febb3b2.js} +1 -1
- package/assets/esri/core/workers/chunks/300b96f0f8e34b4a5d8b.js +1 -0
- package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +1 -0
- package/assets/esri/core/workers/chunks/{2dc88379ee94fabdaf52.js → 39a5863355cccaabd2d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3ee035fa7bf638c8e60.js → 3d68a650a1f944ec5171.js} +1 -1
- package/assets/esri/core/workers/chunks/47c0c16c1e995a441ec2.js +1 -0
- package/assets/esri/core/workers/chunks/48913b944c28343816ac.js +1 -0
- package/assets/esri/core/workers/chunks/{4d4db6854aff7656f6e1.js → 4dd4b19c410026233999.js} +1 -1
- package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +1 -0
- package/assets/esri/core/workers/chunks/58e2652810143f509fe1.js +1 -0
- package/assets/esri/core/workers/chunks/{97489bf16a1d327992b2.js → 595593dd03bcfba795c8.js} +11 -16
- package/assets/esri/core/workers/chunks/59e27818cb68f0285d54.js +1 -0
- package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +1 -0
- package/assets/esri/core/workers/chunks/6f29951f5a2da068b257.js +1 -0
- package/assets/esri/core/workers/chunks/71c6c0b26253c4ca1b68.js +1 -0
- package/assets/esri/core/workers/chunks/{1c1b0cc91fe9cb3fec61.js → 71df48968d6cdc736458.js} +1 -1
- package/assets/esri/core/workers/chunks/779ee975efebb838b5d6.js +1 -0
- package/assets/esri/core/workers/chunks/7a240ab31d9ff2d2c5af.js +1 -0
- package/assets/esri/core/workers/chunks/834985ec601623df34a1.js +1 -0
- package/assets/esri/core/workers/chunks/{5dee8c0c60ced791e57f.js → 84a556dafd583635ad5e.js} +1 -1
- package/assets/esri/core/workers/chunks/8be9fa12e854a83062c3.js +1 -0
- package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +1 -0
- package/assets/esri/core/workers/chunks/{65ec21d29e8563fdbc55.js → 94c9d3094c93f7760433.js} +1 -1
- package/assets/esri/core/workers/chunks/{177840d5f0076c0de46b.js → 96de78f9994207aa7201.js} +1 -1
- package/assets/esri/core/workers/chunks/{366db86914a63e6d0c68.js → 978ffde9ebebf5c83aea.js} +1 -1
- package/assets/esri/core/workers/chunks/a1abe9865d66789bd5af.js +1 -0
- package/assets/esri/core/workers/chunks/{257fd65786feb5951b90.js → a96e58ed9a4a2329ee53.js} +1 -1
- package/assets/esri/core/workers/chunks/{0074f1836d7ff69ff6ec.js → aa778e5d7db40d9b9b4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c78de6dd6c10280cee69.js → baa48614d9567d5f240d.js} +1 -1
- package/assets/esri/core/workers/chunks/c3010d783506f8410f99.js +1 -0
- package/assets/esri/core/workers/chunks/c55c096669677321a227.js +1 -0
- package/assets/esri/core/workers/chunks/c86ca87959f04075e834.js +1 -0
- package/assets/esri/core/workers/chunks/c954d281038f6bf80232.js +1 -0
- package/assets/esri/core/workers/chunks/{a48f980c1531805db73b.js → d1fc2c6e95fe2572d297.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc5ac54aab66562c8463.js → d51aabb9b950f49df183.js} +1 -1
- package/assets/esri/core/workers/chunks/{639d856cd217914dfe1f.js → de34c21d3e6913befe5a.js} +1 -1
- package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +1 -0
- package/assets/esri/core/workers/chunks/f6806780ca2aa591475a.js +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -0
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -0
- package/chunks/ComponentShader.glsl.js +15 -16
- package/chunks/DefaultMaterial.glsl.js +15 -16
- package/chunks/Path.glsl.js +12 -12
- package/chunks/RealisticTree.glsl.js +5 -6
- package/chunks/aiServices.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/TemplatePartBase.js +1 -1
- package/interfaces.d.ts +40 -25
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/support/DateTimeFieldFormat.js +1 -1
- package/layers/support/FieldConfiguration.js +1 -1
- package/layers/support/FieldFormat.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/fieldConfigUtils.js +1 -1
- package/layers/support/fieldFormatUtils.js +5 -0
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +1 -1
- package/popup/FieldInfo.js +1 -1
- package/popup/content/FieldsContent.js +1 -1
- package/portal/Portal.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/sharedTemplates/addSharedTemplates.js +5 -0
- package/rest/sharedTemplates/querySharedTemplates.js +1 -1
- package/rest/sharedTemplates/utils.js +5 -0
- package/support/ArcadeExpression.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +5 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/{ComponentObjectElevationAgnosticComponentBVH.js → ComponentObjectElevationAgnosticBVH.js} +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +5 -0
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ObjectParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +0 -3
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/assets/esri/core/workers/chunks/09c2004126f4a5242b85.js +0 -1
- package/assets/esri/core/workers/chunks/0dfc2ca36014910457ef.js +0 -1
- package/assets/esri/core/workers/chunks/1c7fffb496af6f2540dd.js +0 -1
- package/assets/esri/core/workers/chunks/1fc6311d4f0d27e88737.js +0 -1
- package/assets/esri/core/workers/chunks/2fe96bf7dedef11a3b63.js +0 -1
- package/assets/esri/core/workers/chunks/36a006c55766f9540bfc.js +0 -1
- package/assets/esri/core/workers/chunks/5f0a50ebd2a08b9b9de2.js +0 -1
- package/assets/esri/core/workers/chunks/637a5293e36f4f7f2853.js +0 -1
- package/assets/esri/core/workers/chunks/7540b34e743a23e67729.js +0 -1
- package/assets/esri/core/workers/chunks/7be11a3ef1f49245089f.js +0 -1
- package/assets/esri/core/workers/chunks/819a8bc1f0a694017ee6.js +0 -1
- package/assets/esri/core/workers/chunks/88d8ff0140f5ea97c6b7.js +0 -1
- package/assets/esri/core/workers/chunks/8de11aab65d91e7f1a4d.js +0 -1
- package/assets/esri/core/workers/chunks/96740c75ad65d651cc43.js +0 -1
- package/assets/esri/core/workers/chunks/9971de3f38a55735cec9.js +0 -1
- package/assets/esri/core/workers/chunks/9e47f680b66320dcfd34.js +0 -1
- package/assets/esri/core/workers/chunks/a7fcb60d5a9d2d9560e4.js +0 -1
- package/assets/esri/core/workers/chunks/a9e133166e9200fe135e.js +0 -1
- package/assets/esri/core/workers/chunks/aa84775399420e35c6a5.js +0 -1
- package/assets/esri/core/workers/chunks/acb1c5dd987c801d7b31.js +0 -1
- package/assets/esri/core/workers/chunks/b0508c96338d7cf296c1.js +0 -1
- package/assets/esri/core/workers/chunks/b09b34f64a6bc2b49e0a.js +0 -1
- package/assets/esri/core/workers/chunks/c0ae186620b68d43b338.js +0 -1
- package/assets/esri/core/workers/chunks/cc579c94438f48a0dbab.js +0 -1
- package/assets/esri/core/workers/chunks/ce0bf0d0cd9e9a90093b.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import r from"../request.js";import{ClonableMixin as i}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{reader as b}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{writer as w}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as v}from"../core/accessorSupport/layerContainerType.js";import F from"../form/FormTemplate.js";import j from"../geometry/SpatialReference.js";import T from"../graphic/FeatureGraphicOrigin.js";import S from"./Layer.js";import{MemorySource as I}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as E}from"./mixins/APIKeyMixin.js";import{ArcGISService as L}from"./mixins/ArcGISService.js";import{BlendLayer as D}from"./mixins/BlendLayer.js";import{CustomParametersMixin as C}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as x}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as P}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as O}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as M}from"./mixins/OperationalLayer.js";import{OrderedLayer as A}from"./mixins/OrderedLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{PublishableLayer as Q}from"./mixins/PublishableLayer.js";import{RefreshableLayer as U}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as V}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as B}from"./mixins/TemporalLayer.js";import{TrackableLayer as G}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as N,parse as $,cleanTitle as J}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as W,id as Z,labelsVisible as H,opacityDrawingInfo as z,legendEnabled as k,listMode as K,popupEnabled as X,screenSizePerspectiveEnabled as Y}from"./support/commonProperties.js";import{ensureLayerCredential as ee,computeEffectiveEditingEnabled as te,readGlobalIdField as re,readObjectIdField as ie,createDefaultRenderer as oe,addAttachment as se,updateAttachment as ae,applyEdits as ne,uploadAssets as le,createQuery as pe,deleteAttachments as ue,fetchRecomputedExtents as de,getFeatureType as ye,getFieldDomain as ce,queryAttachments as me,queryObjectIds as fe,queryFeatureCount as he,queryExtent as be,queryRelatedFeatures as ge,queryRelatedFeaturesCount as we,validateBinsQuery as ve,hasDataChanged as Fe,geometryTypeKebabDict as je}from"./support/featureLayerUtils.js";import Te from"./support/FeatureTemplate.js";import Se from"./support/FeatureType.js";import Ie from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ee,fieldConfigurationsFromPopupTemplate as Le,fieldConfigurationsFromFields as De}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ce}from"./support/fieldProperties.js";import{fixRendererFields as _e,fixTimeInfoFields as xe}from"./support/fieldUtils.js";import Pe from"./support/LabelClass.js";import{reader as Oe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as qe}from"./support/serviceCapabilitiesUtils.js";import Me from"./support/TimeInfo.js";import Ae from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Re}from"./support/versionUtils.js";import{DataLayerSource as Qe}from"./support/source/DataLayerSource.js";import{read as Ue}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Be,rendererTypes as Ge}from"../renderers/support/typeUtils.js";import Ne from"../rest/support/FeatureSet.js";import $e from"../rest/support/Query.js";import{isNumber as Je}from"../support/guards.js";import{createPopupTemplate as We}from"../support/popupUtils.js";import{symbolTypes as Ze}from"../symbols/support/typeUtils.js";import{opacityToTransparency as He}from"../webdoc/support/opacityUtils.js";const ze="FeatureLayer";function ke(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ke(e){return e&&e instanceof o}const Xe=Ce();function Ye(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let et=class extends(O(q(P(Q(x(_(D(A(B(G(V(U(L(M(R(p(C(E(i(S)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new T(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=j.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ee(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new Ae({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,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)}get effectiveEditingEnabled(){return te(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ee(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Le(this)||null}get defaultFieldConfigurations(){return De(this)}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return re(t.layerDefinition||t)}readObjectIdField(e,t){return ie(t.layerDefinition||t)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){_e(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ue(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return oe(t,r)}set source(e){const t=this._get("source");t!==e&&(Ke(t)&&this._resetMemorySource(t),Ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new I({layer:this,items:e}):e:null}readSource(e,t){const r=Ne.fromJSON(t.featureSet);return new I({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Te.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?N(this.url,r):r;let t=r;if(!t&&this.url){const e=$(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),J(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.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?.creatorField,o=r?.editorField;return e?.map(e=>(e=Se.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await se(this,e,t,ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ae(this,e,t,r,ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ne(this,e,t)}async uploadAssets(e,t){return le(this,e,t)}createPopupTemplate(e){return We(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=pe(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ue(this,e,t,ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return de(this,e,ze)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return ye(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return ce(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return me(this,e,t,ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures($e.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await fe(this,e,t,ze)}async queryFeatureCount(e,t){return he(this,e,t,ze)}async queryExtent(e,t){return be(this,e,t,ze)}async queryRelatedFeatures(e,t){return ge(this,e,t,ze)}async queryRelatedFeaturesCount(e,t){return we(this,e,t,ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new s(ze,"Layer source does not support queryAttributeBins capability");ve(e,i,ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Je)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(ke(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(ke(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(ke(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(ke(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(ze,`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||Re(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):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";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),_e(this.renderer,this.fieldsIndex),xe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return Fe(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=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?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([f({clonable:!1,readOnly:!0})],et.prototype,"_titleCreator",null),e([f(W)],et.prototype,"attributeTableTemplate",void 0),e([b("service","capabilities")],et.prototype,"readCapabilities",null),e([f({json:{origins:{"web-scene":{write:!1}},write:!0}})],et.prototype,"charts",void 0),e([f({readOnly:!0})],et.prototype,"createQueryVersion",null),e([f({json:{read:{source:"layerDefinition.copyrightText"}}})],et.prototype,"copyright",void 0),e([f({json:{read:{source:"layerDefinition.displayField"}}})],et.prototype,"displayField",void 0),e([f({types:Ze,readOnly:!0})],et.prototype,"defaultSymbol",void 0),e([f({type:Qe})],et.prototype,"dynamicDataSource",void 0),e([f({type:Boolean})],et.prototype,"editingEnabled",null),e([b(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],et.prototype,"readEditingEnabled",null),e([b("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],et.prototype,"readEditingEnabledFromWebMap",null),e([w(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],et.prototype,"writeEditingEnabled",null),e([w("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],et.prototype,"writeEditingEnabledToWebMap",null),e([f({readOnly:!0})],et.prototype,"effectiveEditingEnabled",null),e([f({clonable:!1,readOnly:!0})],et.prototype,"featureTitleFields",null),e([f({type:[Ie],json:{name:"layerDefinition.fieldConfigurations",write:!0}})],et.prototype,"fieldConfigurations",null),e([f({readOnly:!0})],et.prototype,"defaultFieldConfigurations",null),e([f({...Xe.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ye}}}}})],et.prototype,"fields",void 0),e([f(Xe.fieldsIndex)],et.prototype,"fieldsIndex",void 0),e([f({type:F,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],et.prototype,"formTemplate",void 0),e([f({json:{read:{source:"layerDefinition.extent"}}})],et.prototype,"fullExtent",void 0),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ye,writer(e,t,r){const i=e?je.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:je.read}}})],et.prototype,"geometryType",void 0),e([f({readOnly:!0,clonable:!1})],et.prototype,"graphicOrigin",void 0),e([f({json:{read:{source:"layerDefinition.hasM"}}})],et.prototype,"hasM",void 0),e([f({json:{read:{source:"layerDefinition.hasZ"}}})],et.prototype,"hasZ",void 0),e([f(Z)],et.prototype,"id",void 0),e([f({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],et.prototype,"infoFor3D",void 0),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],et.prototype,"isTable",void 0),e([b("service","isTable",["type","geometryType"]),b("isTable",["layerDefinition.type","layerDefinition.geometryType"])],et.prototype,"readIsTable",null),e([w("web-map","isTable")],et.prototype,"writeIsTable",null),e([f(H)],et.prototype,"labelsVisible",void 0),e([f({type:[Pe],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Oe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Oe,write:{layerContainerTypes:v}}})],et.prototype,"labelingInfo",void 0),e([f((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,He(e),t)}}},e})())],et.prototype,"opacity",void 0),e([f(k)],et.prototype,"legendEnabled",void 0),e([f({type:["show","hide"],json:(()=>{const e=a(K.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],et.prototype,"listMode",void 0),e([b("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],et.prototype,"readGlobalIdField",null),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ye}}}}})],et.prototype,"objectIdField",void 0),e([b("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],et.prototype,"readObjectIdField",null),e([f({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:v}}})],et.prototype,"operationalLayerType",void 0),e([f(Xe.outFields)],et.prototype,"outFields",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],et.prototype,"path",void 0),e([f(X)],et.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],et.prototype,"popupTemplate",void 0),e([f({readOnly:!0})],et.prototype,"defaultPopupTemplate",null),e([f({types:Ge,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Be,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:v,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:v})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:v})}}})],et.prototype,"renderer",null),e([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],et.prototype,"readRenderer",null),e([f()],et.prototype,"resourceInfo",void 0),e([f((()=>{const e=a(Y);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],et.prototype,"screenSizePerspectiveEnabled",void 0),e([f({clonable:!1})],et.prototype,"source",null),e([h("source")],et.prototype,"castSource",null),e([b("portal-item","source",["featureSet"]),b("web-map","source",["featureSet"])],et.prototype,"readSource",null),e([f({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],et.prototype,"spatialReference",void 0),e([f({type:Number})],et.prototype,"subtypeCode",void 0),e([f({type:[Te]})],et.prototype,"templates",void 0),e([b("templates",["editFieldsInfo","creatorField","editorField","templates"])],et.prototype,"readTemplates",null),e([f({type:Me})],et.prototype,"timeInfo",void 0),e([f()],et.prototype,"title",void 0),e([b("service","title",["name"]),b("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],et.prototype,"readTitle",null),e([b("web-map","title",["layerDefinition.name","title"])],et.prototype,"readTitleFromWebMap",null),e([f({type:String})],et.prototype,"sublayerTitleMode",void 0),e([f({json:{read:!1}})],et.prototype,"type",void 0),e([f({type:String})],et.prototype,"typeIdField",void 0),e([b("service","typeIdField"),b("typeIdField",["layerDefinition.typeIdField"])],et.prototype,"readTypeIdField",null),e([f({type:[Se]})],et.prototype,"types",void 0),e([b("service","types",["types"]),b("types",["layerDefinition.types"])],et.prototype,"readTypes",null),e([f({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:v}}}}})],et.prototype,"visible",void 0),e([b("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],et.prototype,"readVisible",null),et=e([g("esri.layers.FeatureLayer")],et);export{et as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import r from"../request.js";import{ClonableMixin as i}from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{reader as b}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{writer as w}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as F}from"../core/accessorSupport/layerContainerType.js";import v from"../form/FormTemplate.js";import T from"../geometry/SpatialReference.js";import j from"../graphic/FeatureGraphicOrigin.js";import S from"./Layer.js";import{MemorySource as I}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as E}from"./mixins/APIKeyMixin.js";import{ArcGISService as L}from"./mixins/ArcGISService.js";import{BlendLayer as D}from"./mixins/BlendLayer.js";import{CustomParametersMixin as C}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as _}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as x}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as P}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as O}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as M}from"./mixins/OperationalLayer.js";import{OrderedLayer as A}from"./mixins/OrderedLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{PublishableLayer as Q}from"./mixins/PublishableLayer.js";import{RefreshableLayer as U}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as V}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{TrackableLayer as B}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as G,parse as J,cleanTitle as $}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as W,id as Z,labelsVisible as H,opacityDrawingInfo as z,legendEnabled as k,listMode as K,popupEnabled as X,screenSizePerspectiveEnabled as Y}from"./support/commonProperties.js";import{ensureLayerCredential as ee,computeEffectiveEditingEnabled as te,readGlobalIdField as re,readObjectIdField as ie,createDefaultRenderer as oe,addAttachment as se,updateAttachment as ae,applyEdits as ne,uploadAssets as le,createQuery as pe,deleteAttachments as ue,fetchRecomputedExtents as de,getFeatureType as ye,getFieldDomain as ce,queryAttachments as me,queryObjectIds as fe,queryFeatureCount as he,queryExtent as be,queryRelatedFeatures as ge,queryRelatedFeaturesCount as we,validateBinsQuery as Fe,hasDataChanged as ve,geometryTypeKebabDict as Te}from"./support/featureLayerUtils.js";import je from"./support/FeatureTemplate.js";import Se from"./support/FeatureType.js";import Ie from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ee,fieldConfigurationsFromPopupTemplate as Le,fieldConfigurationsFromFields as De}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Ce}from"./support/fieldProperties.js";import{fixRendererFields as _e,fixTimeInfoFields as xe}from"./support/fieldUtils.js";import Pe from"./support/LabelClass.js";import{reader as Oe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as qe}from"./support/serviceCapabilitiesUtils.js";import Me from"./support/TimeInfo.js";import Ae from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Re}from"./support/versionUtils.js";import{DataLayerSource as Qe}from"./support/source/DataLayerSource.js";import{read as Ue}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Ne,rendererTypes as Be}from"../renderers/support/typeUtils.js";import Ge from"../rest/support/FeatureSet.js";import Je from"../rest/support/Query.js";import{isNumber as $e}from"../support/guards.js";import{createPopupTemplate as We}from"../support/popupUtils.js";import{symbolTypes as Ze}from"../symbols/support/typeUtils.js";import{opacityToTransparency as He}from"../webdoc/support/opacityUtils.js";const ze="FeatureLayer";function ke(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ke(e){return e&&e instanceof o}const Xe=Ce();function Ye(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let et=class extends(O(q(P(Q(x(_(D(A(N(B(V(U(L(M(R(p(C(E(i(S)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new j(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=T.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ee(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new Ae({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,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)}get effectiveEditingEnabled(){return te(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ee(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Le(this)||null}get defaultFieldConfigurations(){return De(this)}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return re(t.layerDefinition||t)}readObjectIdField(e,t){return ie(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!0}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){_e(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ue(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return oe(t,r)}set source(e){const t=this._get("source");t!==e&&(Ke(t)&&this._resetMemorySource(t),Ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new I({layer:this,items:e}):e:null}readSource(e,t){const r=Ge.fromJSON(t.featureSet);return new I({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>je.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?G(this.url,r):r;let t=r;if(!t&&this.url){const e=J(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),$(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||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?.creatorField,o=r?.editorField;return e?.map(e=>(e=Se.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await se(this,e,t,ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ae(this,e,t,r,ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ne(this,e,t)}async uploadAssets(e,t){return le(this,e,t)}createPopupTemplate(e){return We(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=pe(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ue(this,e,t,ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return de(this,e,ze)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return ye(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return ce(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return me(this,e,t,ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Je.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await fe(this,e,t,ze)}async queryFeatureCount(e,t){return he(this,e,t,ze)}async queryExtent(e,t){return be(this,e,t,ze)}async queryRelatedFeatures(e,t){return ge(this,e,t,ze)}async queryRelatedFeaturesCount(e,t){return we(this,e,t,ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new s(ze,"Layer source does not support queryAttributeBins capability");Fe(e,i,ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter($e)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(ke(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(ke(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(ke(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(ke(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(ze,`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||Re(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):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";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),_e(this.renderer,this.fieldsIndex),xe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return ve(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=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?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([f({clonable:!1,readOnly:!0})],et.prototype,"_titleCreator",null),e([f(W)],et.prototype,"attributeTableTemplate",void 0),e([b("service","capabilities")],et.prototype,"readCapabilities",null),e([f({json:{origins:{"web-scene":{write:!1}},write:!0}})],et.prototype,"charts",void 0),e([f({readOnly:!0})],et.prototype,"createQueryVersion",null),e([f({json:{read:{source:"layerDefinition.copyrightText"}}})],et.prototype,"copyright",void 0),e([f({json:{read:{source:"layerDefinition.displayField"}}})],et.prototype,"displayField",void 0),e([f({types:Ze,readOnly:!0})],et.prototype,"defaultSymbol",void 0),e([f({type:Qe})],et.prototype,"dynamicDataSource",void 0),e([f({type:Boolean})],et.prototype,"editingEnabled",null),e([b(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],et.prototype,"readEditingEnabled",null),e([b("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],et.prototype,"readEditingEnabledFromWebMap",null),e([w(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],et.prototype,"writeEditingEnabled",null),e([w("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],et.prototype,"writeEditingEnabledToWebMap",null),e([f({readOnly:!0})],et.prototype,"effectiveEditingEnabled",null),e([f({clonable:!1,readOnly:!0})],et.prototype,"featureTitleFields",null),e([f({type:[Ie],json:{name:"layerDefinition.fieldConfigurations",write:!0}})],et.prototype,"fieldConfigurations",null),e([f({readOnly:!0})],et.prototype,"defaultFieldConfigurations",null),e([f({...Xe.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ye}}}}})],et.prototype,"fields",void 0),e([f(Xe.fieldsIndex)],et.prototype,"fieldsIndex",void 0),e([f({type:v,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],et.prototype,"formTemplate",void 0),e([f({json:{read:{source:"layerDefinition.extent"}}})],et.prototype,"fullExtent",void 0),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ye,writer(e,t,r){const i=e?Te.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Te.read}}})],et.prototype,"geometryType",void 0),e([f({readOnly:!0,clonable:!1})],et.prototype,"graphicOrigin",void 0),e([f({json:{read:{source:"layerDefinition.hasM"}}})],et.prototype,"hasM",void 0),e([f({json:{read:{source:"layerDefinition.hasZ"}}})],et.prototype,"hasZ",void 0),e([f(Z)],et.prototype,"id",void 0),e([f({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],et.prototype,"infoFor3D",void 0),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],et.prototype,"isTable",void 0),e([b("service","isTable",["type","geometryType"]),b("isTable",["layerDefinition.type","layerDefinition.geometryType"])],et.prototype,"readIsTable",null),e([w("web-map","isTable")],et.prototype,"writeIsTable",null),e([f(H)],et.prototype,"labelsVisible",void 0),e([f({type:[Pe],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Oe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Oe,write:{layerContainerTypes:F}}})],et.prototype,"labelingInfo",void 0),e([f((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,He(e),t)}}},e})())],et.prototype,"opacity",void 0),e([f(k)],et.prototype,"legendEnabled",void 0),e([f({type:["show","hide"],json:(()=>{const e=a(K.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],et.prototype,"listMode",void 0),e([b("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],et.prototype,"readGlobalIdField",null),e([f({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ye}}}}})],et.prototype,"objectIdField",void 0),e([b("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],et.prototype,"readObjectIdField",null),e([f({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:F}}})],et.prototype,"operationalLayerType",void 0),e([f(Xe.outFields)],et.prototype,"outFields",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],et.prototype,"path",void 0),e([f(X)],et.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],et.prototype,"popupTemplate",void 0),e([w("popupTemplate")],et.prototype,"writePopupTemplate",null),e([f({readOnly:!0})],et.prototype,"defaultPopupTemplate",null),e([f({types:Be,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Ne,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:F,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:F})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:F})}}})],et.prototype,"renderer",null),e([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],et.prototype,"readRenderer",null),e([f()],et.prototype,"resourceInfo",void 0),e([f((()=>{const e=a(Y);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],et.prototype,"screenSizePerspectiveEnabled",void 0),e([f({clonable:!1})],et.prototype,"source",null),e([h("source")],et.prototype,"castSource",null),e([b("portal-item","source",["featureSet"]),b("web-map","source",["featureSet"])],et.prototype,"readSource",null),e([f({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],et.prototype,"spatialReference",void 0),e([f({type:Number})],et.prototype,"subtypeCode",void 0),e([f({type:[je]})],et.prototype,"templates",void 0),e([b("templates",["editFieldsInfo","creatorField","editorField","templates"])],et.prototype,"readTemplates",null),e([f({type:Me})],et.prototype,"timeInfo",void 0),e([f()],et.prototype,"title",void 0),e([b("service","title",["name"]),b("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],et.prototype,"readTitle",null),e([b("web-map","title",["layerDefinition.name","title"])],et.prototype,"readTitleFromWebMap",null),e([f({type:String})],et.prototype,"sublayerTitleMode",void 0),e([f({json:{read:!1}})],et.prototype,"type",void 0),e([f({type:String})],et.prototype,"typeIdField",void 0),e([b("service","typeIdField"),b("typeIdField",["layerDefinition.typeIdField"])],et.prototype,"readTypeIdField",null),e([f({type:[Se]})],et.prototype,"types",void 0),e([b("service","types",["types"]),b("types",["layerDefinition.types"])],et.prototype,"readTypes",null),e([f({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:F}}}}})],et.prototype,"visible",void 0),e([b("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],et.prototype,"readVisible",null),et=e([g("esri.layers.FeatureLayer")],et);export{et as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import c from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as T,url as v}from"./support/commonProperties.js";import L from"./support/SceneModifications.js";import{initFullExtent as b}from"./support/tiles3DUtils.js";import w from"../portal/Portal.js";import{logInvalidElevationInfoWarning as x,elevationModeRequiredMessage as P,featureExpressionUnsupportedMessage as I}from"../support/elevationInfoUtils.js";import{f as k}from"../chunks/persistableUrlUtils.js";import{isBasemap as R}from"../support/userTypeGuards/isBasemap.js";let D=class extends(y(_(S(j(i(g(f(h)))))))){readModifications(e,t,r){this._modificationsSource={url:k(e,r),context:r}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new u({wkid:4326,vcsWkid:115700}),this.fullExtent=new c(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[o,i]of Object.entries(e)){if("uri"===o)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(r){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new r("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((r,a)=>{this.url||a(i("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,r)=>{if(this.replacesTerrain&&!this._key){const o=this.portalItem?.portal||this.parent?.portalItem?.portal||w.getDefault();o.signIn().then(()=>{o.g3dTilesEnabled?t(o.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>r(i("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):r(i("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+o.url))},()=>r(i("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",authMode:"anonymous",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void a(i("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=b(this._rootTilesetJSON),r(),this._rootRequestPromise=null):a(i("root-is-null","Root tile is null."))},e=>{s(e),a(i("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>a(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this._isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new r("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){s(o)}if(null!=this._modificationsSource){const t=await L.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}get hasAttributionData(){return!1}async fetchAttributionData(){return{}}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";x(o.getLogger(this),P(t,"absolute-height",e)),x(o.getLogger(this),I(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return R(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],D.prototype,"operationalLayerType",void 0),e([l({type:L,clonable:e=>e.clone()}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],D.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],D.prototype,"readModifications",null),e([l({type:u})],D.prototype,"spatialReference",void 0),e([l({type:c})],D.prototype,"fullExtent",void 0),e([l(T)],D.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],D.prototype,"listMode",void 0),e([l(v)],D.prototype,"url",void 0),e([l({readOnly:!0})],D.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],D.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"maxScale",void 0),e([l()],D.prototype,"replacesTerrain",null),e([l()],D.prototype,"_isUsedAsGroundLayer",null),e([l()],D.prototype,"hasGoogleUrl",null),D=e([m("esri.layers.IntegratedMesh3DTilesLayer")],D);const U=D;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../graphic/OrientedImageryGraphicOrigin.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";import s from"../graphic/OrientedImageryGraphicOrigin.js";import p from"./FeatureLayer.js";import{useViewTimeProperty as l}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as m,orientedImageryTypeMap as d,timeIntervalUnitTypeMap as y,verticalMeasurementTypeMap as u,padAccuracyArray as c,isOrientationAccuracy as g}from"./orientedImagery/core/utils.js";import h from"../tables/AttributeTableTemplate.js";import f from"../time/TimeExtent.js";const v=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),j=(e,t)=>!v.has(t)&&e,P=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function S(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function x(e,t,i,r){const{name:o,write:a,read:n}=P(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:j(a,e),read:j(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let I=class extends p{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new s(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return m(e,t,i)}set fieldConfigurations(e){}get fieldConfigurations(){}writePopupTemplate(e,t,i,r){e&&(t[i]=e.toJSON(r))}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(e=>this.supportedSourceTypes.has(e.type))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:h,json:{write:!1,read:!1}})],I.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:x("cameraHeading")})],I.prototype,"cameraHeading",void 0),e([o({type:Number,json:x("cameraHeight")})],I.prototype,"cameraHeight",void 0),e([o({type:Number,json:x("cameraPitch")})],I.prototype,"cameraPitch",void 0),e([o({type:Number,json:x("cameraRoll")})],I.prototype,"cameraRoll",void 0),e([o({type:Number,json:x("coveragePercent")})],I.prototype,"coveragePercent",void 0),e([o({type:String,json:x("demPathPrefix")})],I.prototype,"demPathPrefix",void 0),e([o({type:String,json:x("demPathSuffix")})],I.prototype,"demPathSuffix",void 0),e([o({type:String,json:x("depthImagePathPrefix")})],I.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:x("depthImagePathSuffix")})],I.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:x("elevationSource")})],I.prototype,"elevationSource",void 0),e([o({readOnly:!0})],I.prototype,"effectiveElevationSource",null),e([o({type:Number,json:x("farDistance")})],I.prototype,"farDistance",void 0),e([o({json:{write:!1}})],I.prototype,"fieldConfigurations",null),e([o()],I.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],I.prototype,"graphicOrigin",void 0),e([o({type:Number,json:x("horizontalFieldOfView")})],I.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:x("horizontalMeasurementUnit")})],I.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...x("imageGeometryField"),default:"ImageGeometry"}})],I.prototype,"imageGeometryField",void 0),e([o({type:String,json:x("imagePathPrefix")})],I.prototype,"imagePathPrefix",void 0),e([o({type:String,json:x("imagePathSuffix")})],I.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...x("imageReferenceField"),default:"OIObjectID"}})],I.prototype,"imageReferenceField",void 0),e([o({type:Number,json:x("imageRotation")})],I.prototype,"imageRotation",void 0),e([o({type:Number,json:x("maximumDistance")})],I.prototype,"maximumDistance",void 0),e([o({type:Number,json:x("nearDistance")})],I.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],I.prototype,"operationalLayerType",void 0),e([o({json:{...x("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return g(t)?c(t):[0,0,0,0,0,0,0,0]},String)}})],I.prototype,"orientationAccuracy",void 0),e([o({json:{...x("orientedImageryType",d.write,d.read,d.jsonValues.slice(1))}})],I.prototype,"orientedImageryType",void 0),e([n("popupTemplate")],I.prototype,"writePopupTemplate",null),e([o({type:String,json:{...x("referenceIDField"),default:"OBJECTID"}})],I.prototype,"referenceIDField",void 0),e([o({type:String,json:{...x("sequenceOrderField"),default:"SequenceOrder"}})],I.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],I.prototype,"type",void 0),e([o({type:y.apiValues,json:{...x("timeIntervalUnit",y.write,y.read,y.jsonValues)}})],I.prototype,"timeIntervalUnit",void 0),e([o(S(i(l)))],I.prototype,"useViewTime",void 0),e([o({type:Number,json:x("verticalFieldOfView")})],I.prototype,"verticalFieldOfView",void 0),e([o({type:u.apiValues,json:{...x("verticalMeasurementUnit",u.write,u.read,u.jsonValues)}})],I.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:x("videoPathPrefix")})],I.prototype,"videoPathPrefix",void 0),e([o({type:String,json:x("videoPathSuffix")})],I.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],I.prototype,"virtualCacheDirectory",void 0),e([o({type:f,json:{origins:{"web-scene":{write:!1,read:!1}}}})],I.prototype,"visibilityTimeExtent",void 0),I=e([a("esri.layers.OrientedImageryLayer")],I);const O=I;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,sync as n,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import{projectBoundingRect as p}from"../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as m}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as y}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import N from"../../../views/3d/layers/i3s/I3SLodHandling.js";import b from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as V}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as I}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as S}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const F=100,P=2,O=1e4,q=1e-4,R=1.2,G=500,U=1.5;let Q=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new c,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new S,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new N(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),o(()=>r.quality,()=>this._setCameraDirty(),n),this._updatingHandles.add(()=>e.contentVisible,e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=d.scheduler.registerIdleStateCallbacks(t,i)},l),f(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,m(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new y(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(m(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._updatingHandles.destroy(),this._nodeLoader=null,H.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=k(e,i),r=k(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();j(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=g();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateRunning(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(p(e,t,E,this.crsIndex),e=E);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){const i=this._idleQueue.push(e,t);return this._evaluateRunning(),i}reschedule(e,t){const i=this._idleQueue.unshift(e,t);return this._evaluateRunning(),i}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>G){if(this._featureLOD<=q)return;this._featureLOD/=U,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?F:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<V&&!this.dataStreamController.busy)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-I)/(.5-I)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new b(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;H.clear(),this.layerView.getLoadedNodeIndices(H);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return H.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),H.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(H,e,0),!(i&&this._lodDropFactor<1)&&(0===H.length||(H.clear(),!1))}markNodeToRemove(e){H.push(e)}removeMarkedNodes(){this._removeNodes(H,M,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{const i=this.layerView.getLoadedAttributes(e.index),s=j(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&j(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule(()=>this._loadAttributes(e,o,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],Q.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],Q.prototype,"isGraphics3D",null),e([h({readOnly:!0})],Q.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],Q.prototype,"indexStreamController",null),e([h({readOnly:!0})],Q.prototype,"dataStreamController",null),e([h({readOnly:!0})],Q.prototype,"crsVertex",null),e([h({readOnly:!0})],Q.prototype,"crsIndex",null),e([h()],Q.prototype,"featureTarget",void 0),e([h()],Q.prototype,"fixedFeatureTarget",void 0),e([h()],Q.prototype,"layerView",void 0),e([h()],Q.prototype,"layer",null),e([h()],Q.prototype,"_updatingHandles",void 0),e([h()],Q.prototype,"updating",null),e([h()],Q.prototype,"running",void 0),e([h()],Q.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],Q.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],Q.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],Q.prototype,"rootNodeVisible",null),Q=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],Q);const H=new r({deallocator:null});function j(e,t){return null!=e&&e.length===t.length&&e.every(e=>k(t,e.name)>=0)}function k(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const T={distancePenalty:10},E=g();export{Q as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,sync as n,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import{projectBoundingRect as p}from"../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as m}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as y}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import N from"../../../views/3d/layers/i3s/I3SLodHandling.js";import w from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as v}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as b,getIndexCrs as L,findIntersectingNodes as C}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as V}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as I}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as M}from"../../../views/support/PromiseQueue.js";import{noBudget as F}from"../../../views/support/Scheduler.js";const S=100,P=2,O=1e4,q=1e-4,R=1.2,G=500,U=1.5;let H=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new v(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new v(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return b(this.layer)}get crsIndex(){return L(this.layer)}get layer(){return this.layerView.i3slayer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new c,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new M,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new N(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),o(()=>r.quality,()=>this._setCameraDirty(),n),this._updatingHandles.add(()=>2===r.state.mode,t=>{const i=e.contentVisible;i&&this._updateIdleState(t),t&&(this._index?.resetFailedNodes(),i&&this._updateViewData())},l),this._updatingHandles.add(()=>e.contentVisible,e=>{e&&this._index?.invalidateAllElevationRanges(),this.restartNodeLoading()},l),f(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,m(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new y(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(m(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._updatingHandles.destroy(),this._nodeLoader=null,Q.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=T(e,i),r=T(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();j(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=g();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=E.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateRunning(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(p(e,t,k,this.crsIndex),e=k);const s=this._elevationUpdateNodes;return s.clear(),C(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){const i=this._idleQueue.push(e,t);return this._evaluateRunning(),i}reschedule(e,t){const i=this._idleQueue.unshift(e,t);return this._evaluateRunning(),i}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>G){if(this._featureLOD<=q)return;this._featureLOD/=U,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?S:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<V&&!this.dataStreamController.busy)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=E.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-I)/(.5-I)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new w(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;Q.clear(),this.layerView.getLoadedNodeIndices(Q);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return Q.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),Q.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(Q,e,0),!(i&&this._lodDropFactor<1)&&(0===Q.length||(Q.clear(),!1))}markNodeToRemove(e){Q.push(e)}removeMarkedNodes(){this._removeNodes(Q,F,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{const i=this.layerView.getLoadedAttributes(e.index),s=j(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&j(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule(()=>this._loadAttributes(e,o,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],H.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],H.prototype,"isGraphics3D",null),e([h({readOnly:!0})],H.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],H.prototype,"indexStreamController",null),e([h({readOnly:!0})],H.prototype,"dataStreamController",null),e([h({readOnly:!0})],H.prototype,"crsVertex",null),e([h({readOnly:!0})],H.prototype,"crsIndex",null),e([h()],H.prototype,"featureTarget",void 0),e([h()],H.prototype,"fixedFeatureTarget",void 0),e([h()],H.prototype,"layerView",void 0),e([h()],H.prototype,"layer",null),e([h()],H.prototype,"_updatingHandles",void 0),e([h()],H.prototype,"updating",null),e([h()],H.prototype,"running",void 0),e([h()],H.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],H.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],H.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],H.prototype,"rootNodeVisible",null),H=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],H);const Q=new r({deallocator:null});function j(e,t){return null!=e&&e.length===t.length&&e.every(e=>T(t,e.name)>=0)}function T(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const E={distancePenalty:10},k=g();export{H as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as h}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as j,createDefaultAttributesFunction as F,createDrawingInfo as E}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as b,loadGeometryEngineForSimplify as T,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as O,getFieldDefaultLength as k}from"../../../support/fieldUtils.js";import{utc as Q}from"../../../../time/constants.js";const D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryBins:!0,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:b};class A{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const m=new R(o);let h=m.get(d);h?("esriFieldTypeString"!==h.type&&(h.type="esriFieldTypeOID"),h.editable=!1,h.nullable=!1,d=h.name):(h={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(h));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==h.name){const e=O(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=k(a))}if(c){if(c.startTimeField){const e=m.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=m.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=m.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?E(l):void 0,b=m.dateFields.length?{timeZoneIANA:Q}:null,T={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:I??void 0,templates:j(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}},w={type:"object-id",fieldName:d};this._queryEngine=new f({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:w,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(h);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(_,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,T.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:A,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=A,v){const{start:e,end:t}=v;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([T(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(h(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=w(i,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[s],r.push(n))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:o,spatialReference:u,featureStore:l,fieldsIndex:p}=this._queryEngine,c=[],y={type:"object-id",fieldName:o};for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(p,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[o];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??u;d.geometry=h(S(d.geometry,e),e,u)}c.push(d),s.push(q(d.attributes[o]))}}l.addMany(d([],c,i,a,r,y))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,d={type:"object-id",fieldName:a};for(const y of t){const{attributes:t,geometry:m}=y,f=t?.[a];if(null==f){e.push(x(`Identifier field ${a} missing`));continue}if(!u.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const g=p(u.getFeature(f),s,r,i);if(null!=m){if(s!==n(m)){e.push(x("Incorrect geometry type."));continue}const t=m.spatialReference??o;g.geometry=h(S(m,t),t,o)}if(t){const s=w(l,g.attributes,t);if(s){e.push(s);continue}}u.add(c(g,s,r,i,d)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{A as default};
|
|
5
|
+
import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as h}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as j,createDefaultAttributesFunction as F,createDrawingInfo as E}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as b,loadGeometryEngineForSimplify as T,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as O,getFieldDefaultLength as Q}from"../../../support/fieldUtils.js";import{utc as k}from"../../../../time/constants.js";const D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:b};class A{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const m=new R(o);let h=m.get(d);h?("esriFieldTypeString"!==h.type&&(h.type="esriFieldTypeOID"),h.editable=!1,h.nullable=!1,d=h.name):(h={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(h));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==h.name){const e=O(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=Q(a))}if(c){if(c.startTimeField){const e=m.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=m.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=m.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?E(l):void 0,b=m.dateFields.length?{timeZoneIANA:k}:null,T={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:I??void 0,templates:j(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}},w={type:"object-id",fieldName:d};this._queryEngine=new f({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:w,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(h);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(_,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,T.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:A,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=A,v){const{start:e,end:t}=v;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([T(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(h(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=w(i,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[s],r.push(n))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:o,spatialReference:u,featureStore:l,fieldsIndex:p}=this._queryEngine,c=[],y={type:"object-id",fieldName:o};for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(p,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[o];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??u;d.geometry=h(S(d.geometry,e),e,u)}c.push(d),s.push(q(d.attributes[o]))}}l.addMany(d([],c,i,a,r,y))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,d={type:"object-id",fieldName:a};for(const y of t){const{attributes:t,geometry:m}=y,f=t?.[a];if(null==f){e.push(x(`Identifier field ${a} missing`));continue}if(!u.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const g=p(u.getFeature(f),s,r,i);if(null!=m){if(s!==n(m)){e.push(x("Incorrect geometry type."));continue}const t=m.spatialReference??o;g.geometry=h(S(m,t),t,o)}if(t){const s=w(l,g.attributes,t);if(s){e.push(s);continue}}u.add(c(g,s,r,i,d)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import u from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import E from"../../../support/FieldsIndex.js";import{kebabDict as
|
|
5
|
+
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import u from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import E from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as _,getFieldDefaultValue as x}from"../../../support/fieldUtils.js";import{utc as R}from"../../../../time/constants.js";const q=s,O={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},D={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:h};function w(e){return i(e)?null!=e.z:!!e.hasZ}function Q(e){return i(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,r=this._inferLayerProperties(s,t.fields),n=t.fields||[],a=null!=t.hasM?t.hasM:!!r.hasM,p=null!=t.hasZ?t.hasZ:!!r.hasZ,h=!t.spatialReference&&!r.spatialReference,g=h?q:t.spatialReference||r.spatialReference,I=h?O:null,b=t.geometryType||r.geometryType,F=!b;let j=t.objectIdField||r.objectIdField,w=t.timeInfo;const Q=new E(n);if(!F&&(h&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!j)throw new e("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(r.objectIdField&&j!==r.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${j}" doesn't match the field name "${r.objectIdField}", found in the provided fields`}),j=r.objectIdField),j&&!r.objectIdField){const e=Q.get(j);e?(j=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):n.unshift({alias:j,name:j,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of n){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===j&&(o.type="esriFieldTypeOID"),!T.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=_(o))}const S={};for(const e of n)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=x(e);void 0!==t&&(S[e.name]=t)}if(w){if(w.startTimeField){const e=Q.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=Q.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=Q.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const v=Q.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??R}:null;this._createDefaultAttributes=c(S,j);const A={warnings:i,featureErrors:[],layerDefinition:{...D,drawingInfo:m(b),templates:y(S),extent:I,geometryType:b,objectIdField:j,fields:n,hasZ:p,hasM:a,timeInfo:w,dateFieldsTimeReference:v},assignedObjectIds:{}},M={type:"object-id",fieldName:j};if(this._queryEngine=new f({fieldsIndex:E.fromLayerJSON({fields:n,timeInfo:w,dateFieldsTimeReference:v}),geometryType:b,hasM:a,hasZ:p,featureIdInfo:M,spatialReference:g,featureStore:new u({geometryType:b,hasM:a,hasZ:p}),timeInfo:w}),!s?.length)return this._nextObjectId=o,A;const Z=l(j,s);return this._nextObjectId=Z+1,await d(s,g),this._loadInitialFeatures(A,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),d(e.adds,t),d(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,r,n=null,a=null,o=null;for(const l of e){const e=l.geometry;if(null!=e&&(n||(n=t(e)),a||(a=e.spatialReference),null==s&&(s=w(e)),null==r&&(r=Q(e)),n&&a&&null!=s&&null!=r))break}if(i&&i.length){let e=null;i.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:n,spatialReference:a,objectIdField:o,hasM:r,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:n,hasZ:a,objectIdField:o,spatialReference:l,featureStore:u,fieldsIndex:d}=this._queryEngine,f=[],c={type:"object-id",fieldName:o};for(const r of i){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==t(r.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),n=b(d,i,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(i,r.attributes,!0),r.attributes=i,null!=r.uid&&(e.assignedObjectIds[r.uid]=r.attributes[o]),null!=r.geometry&&(r.geometry=p(r.geometry,r.geometry.spatialReference,l)),f.push(r))}u.addMany(r([],f,s,a,n,c));const{fullExtent:y,timeExtent:m}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=y,m){const{start:t,end:i}=m;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),s?.length){for(const e of s)r.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,i){const{addResults:s}=e,{geometryType:n,hasM:a,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,featureIdInfo:f,fieldsIndex:c}=this._queryEngine,y=[];for(const r of i){if(r.geometry&&n!==t(r.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),a=b(c,i,r.attributes);if(a)s.push(a);else{if(this._assignObjectId(i,r.attributes),r.attributes=i,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??u;r.geometry=p(j(r.geometry,e),e,u)}y.push(r),s.push(F(r.attributes[l]))}}d.addMany(r([],y,n,o,a,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:r,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:f,featureIdInfo:c}=this._queryEngine;for(const y of i){const{attributes:i,geometry:m}=y,h=i?.[l];if(null==h){e.push(I(`Identifier field ${l} missing`));continue}if(!d.has(h)){e.push(I(`Feature with object id ${h} missing`));continue}const g=n(d.getFeature(h),s,o,r);if(null!=m){if(s!==t(m)){e.push(I("Incorrect geometry type."));continue}const i=m.spatialReference??u;g.geometry=p(j(m,i),i,u)}if(i){const t=b(f,g.attributes,i);if(t){e.push(t);continue}}d.add(a(g,s,o,r,c)),e.push(F(h))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import r from"./FieldFormat.js";const s="auto";let p=class extends r{constructor(t){super(t),this.dateStyle=null,this.hour12=s,this.month=null,this.timeStyle=null,this.type="date-time",this.year=null}};t([o({type:["full","long","medium","short"],json:{write:!0}})],p.prototype,"dateStyle",void 0),t([o({type:["always","auto","never"],nonNullable:!0,json:{default:s,write:!0}})],p.prototype,"hour12",void 0),t([o({type:["long","short"],json:{write:!0}})],p.prototype,"month",void 0),t([o({type:["full","long","medium","short"],json:{write:!0}})],p.prototype,"timeStyle",void 0),t([o({type:["date-time"]})],p.prototype,"type",void 0),t([o({type:["numeric"],json:{write:!0}})],p.prototype,"year",void 0),p=t([e("esri.layers.support.DateTimeFieldFormat")],p);export{
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import r from"./FieldFormat.js";const s="auto";let p=class extends r{constructor(t){super(t),this.dateStyle=null,this.hour12=s,this.month=null,this.timeStyle=null,this.type="date-time",this.year=null}};t([o({type:["full","long","medium","short"],json:{write:!0}})],p.prototype,"dateStyle",void 0),t([o({type:["always","auto","never"],nonNullable:!0,json:{default:s,write:!0}})],p.prototype,"hour12",void 0),t([o({type:["long","short"],json:{write:!0}})],p.prototype,"month",void 0),t([o({type:["full","long","medium","short"],json:{write:!0}})],p.prototype,"timeStyle",void 0),t([o({type:["date-time"]})],p.prototype,"type",void 0),t([o({type:["numeric"],json:{write:!0}})],p.prototype,"year",void 0),p=t([e("esri.layers.support.DateTimeFieldFormat")],p);const i=p;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{formatTypes as i}from"./fieldFormatUtils.js";let p=class extends(r(t)){constructor(o){super(o),this.alias=null,this.name=void 0,this.fieldFormat=null}};o([e({type:String,json:{write:!0}})],p.prototype,"alias",void 0),o([e({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],p.prototype,"name",void 0),o([e({types:i,json:{write:!0}})],p.prototype,"fieldFormat",void 0),p=o([s("esri.layers.support.FieldConfiguration")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as r}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends(o(e)){constructor(r){super(r),this.type=null}};r([t({type:["date-time","number"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],p.prototype,"type",void 0),p=r([s("esri.layers.support.FieldFormat")],p);export{
|
|
5
|
+
import{__decorate as r}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends(o(e)){constructor(r){super(r),this.type=null}};r([t({type:["date-time","number"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],p.prototype,"type",void 0),p=r([s("esri.layers.support.FieldFormat")],p);const a=p;export{a as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{Integer as o}from"../../core/accessorSupport/ensureType.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import i from"./FieldFormat.js";const s={min:0,max:20},p=3,a=0,m="decimal",n="auto";let u=class extends i{constructor(t){super(t),this.maximumFractionDigits=p,this.minimumFractionDigits=a,this.style=m,this.type="number",this.useGrouping=n}};t([e({type:o,nonNullable:!0,range:s,json:{default:p,write:!0}})],u.prototype,"maximumFractionDigits",void 0),t([e({type:o,nonNullable:!0,range:s,json:{default:a,write:!0}})],u.prototype,"minimumFractionDigits",void 0),t([e({type:["decimal"],nonNullable:!0,json:{default:m,write:!0}})],u.prototype,"style",void 0),t([e({type:["number"]})],u.prototype,"type",void 0),t([e({type:["always","auto","never"],nonNullable:!0,json:{default:n,write:!0}})],u.prototype,"useGrouping",void 0),u=t([r("esri.layers.support.NumberFieldFormat")],u);export{
|
|
5
|
+
import{__decorate as t}from"tslib";import{Integer as o}from"../../core/accessorSupport/ensureType.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import i from"./FieldFormat.js";const s={min:0,max:20},p=3,a=0,m="decimal",n="auto";let u=class extends i{constructor(t){super(t),this.maximumFractionDigits=p,this.minimumFractionDigits=a,this.style=m,this.type="number",this.useGrouping=n}};t([e({type:o,nonNullable:!0,range:s,json:{default:p,write:!0}})],u.prototype,"maximumFractionDigits",void 0),t([e({type:o,nonNullable:!0,range:s,json:{default:a,write:!0}})],u.prototype,"minimumFractionDigits",void 0),t([e({type:["decimal"],nonNullable:!0,json:{default:m,write:!0}})],u.prototype,"style",void 0),t([e({type:["number"]})],u.prototype,"type",void 0),t([e({type:["always","auto","never"],nonNullable:!0,json:{default:n,write:!0}})],u.prototype,"useGrouping",void 0),u=t([r("esri.layers.support.NumberFieldFormat")],u);const l=u;export{l as default};
|