@arcgis/core 4.34.0-next.55 → 4.34.0-next.57
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/WebScene.js +1 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +4 -0
- package/analysis/VolumeMeasurement/{CutFillOptions.js → VolumeMeasurementCutFillOptions.js} +1 -1
- package/analysis/VolumeMeasurementAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02a31483e09652a1a1a2.js +1 -0
- package/assets/esri/core/workers/chunks/0390f3aa624e3f380ce2.js +1 -0
- package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +1 -0
- package/assets/esri/core/workers/chunks/04e652df94790f5ca08a.js +1 -0
- package/assets/esri/core/workers/chunks/{9f178cf73c63caaea190.js → 06d2251d6f6b3e44800a.js} +1 -1
- package/assets/esri/core/workers/chunks/07d5e0633cc2f765037f.js +1 -0
- package/assets/esri/core/workers/chunks/{fe5c37c69da3ec1e56ac.js → 08393d9cc2ed846dd5b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{18ceea59e469a0f2721b.js → 094c741fa8139c3f40cf.js} +1 -1
- package/assets/esri/core/workers/chunks/0d946a226b846b3c0849.js +1 -0
- package/assets/esri/core/workers/chunks/{6530449cd1975deb61f1.js → 184d3c88ac2fc1d7e2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/2ded2446700f89155ccd.js +1 -0
- package/assets/esri/core/workers/chunks/{19391d60c76a1dc7c262.js → 2f7e192ee2066f863e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b11476b2004b4db576e.js → 3445ffd752262673fb13.js} +1 -1
- package/assets/esri/core/workers/chunks/38f09e36e174792646bd.js +1 -0
- package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +1 -0
- package/assets/esri/core/workers/chunks/{65e1f5b20a585e04655a.js → 44dc7ec52c4abb700783.js} +1 -1
- package/assets/esri/core/workers/chunks/4558f2e3e77831758fdc.js +1 -0
- package/assets/esri/core/workers/chunks/4753793daf0b7ff8b5ff.js +1 -0
- package/assets/esri/core/workers/chunks/52917b753c5ceab0c1f7.js +353 -0
- package/assets/esri/core/workers/chunks/{6940bb6524938894a246.js → 53873f26a2c24cd75e4a.js} +1 -1
- package/assets/esri/core/workers/chunks/561a2078458bc0339f83.js +1 -0
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +1 -0
- package/assets/esri/core/workers/chunks/{d0bf1fc6e3c198bc565d.js → 57486b18421a3c9690d0.js} +1 -1
- package/assets/esri/core/workers/chunks/5f079be7f322768aef21.js +1 -0
- package/assets/esri/core/workers/chunks/61a294f9411bf884f2ab.js +1 -0
- package/assets/esri/core/workers/chunks/{ad93a2621f75270f06cb.js → 69fbe363bb130fdd8146.js} +1 -1
- package/assets/esri/core/workers/chunks/{722931d1a60be461e521.js → 70cf81ec5a901782d2db.js} +1 -1
- package/assets/esri/core/workers/chunks/{24ac204d8a045aa821be.js → 7388e8c905d93dea1c05.js} +1 -1
- package/assets/esri/core/workers/chunks/749c7159e0902388e828.js +1 -0
- package/assets/esri/core/workers/chunks/76ff7ccfe583927918f3.js +969 -0
- package/assets/esri/core/workers/chunks/{ae73ac81bd10614c2b53.js → 7714228825fb44d506df.js} +1 -1
- package/assets/esri/core/workers/chunks/{6130bc641aa7c1bcaaa8.js → 7c23be93d394f1bee941.js} +1 -1
- package/assets/esri/core/workers/chunks/7c86af4f60cea383ed96.js +1 -0
- package/assets/esri/core/workers/chunks/7eda1c400658b6a99be8.js +1 -0
- package/assets/esri/core/workers/chunks/{97ae2fdb6cb98249f5fa.js → 7f80bbbd0897082c1af3.js} +1 -1
- package/assets/esri/core/workers/chunks/80a69897fa3ce1eaa6e7.js +1 -0
- package/assets/esri/core/workers/chunks/80bd5988180f4618fd61.js +1 -0
- package/assets/esri/core/workers/chunks/{62ade6f18b375795ddfd.js → 8257352421f453a669e9.js} +1 -1
- package/assets/esri/core/workers/chunks/8762928d10c3821738ad.js +1 -0
- package/assets/esri/core/workers/chunks/88a5e7415f8858c454f7.js +1 -0
- package/assets/esri/core/workers/chunks/893e5eb5c028c4704317.js +1 -0
- package/assets/esri/core/workers/chunks/8ead467a5af0d9bba804.js +1 -0
- package/assets/esri/core/workers/chunks/91e04d03b0013bcaad82.js +1 -0
- package/assets/esri/core/workers/chunks/{c7d4c296011c5393bcaa.js → 9275313e0f1f521b2658.js} +1 -1
- package/assets/esri/core/workers/chunks/{e666ca4d14b6490485d6.js → 92b60d4fb09711919601.js} +1 -1
- package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +1 -0
- package/assets/esri/core/workers/chunks/{5c556468e2a598ab793a.js → 9940e59033a8a1eff2a9.js} +1 -1
- package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +1 -0
- package/assets/esri/core/workers/chunks/{9928e432b884c75c3436.js → 9d920f3488d59e7f276c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a778a72456fefdf40115.js → a249e56a0be8cef33ba8.js} +1 -1
- package/assets/esri/core/workers/chunks/a3ee76b7e46d3fba7cf7.js +1 -0
- package/assets/esri/core/workers/chunks/{2cda605c302176905e84.js → a96ac5c68d84122e7751.js} +1 -1
- package/assets/esri/core/workers/chunks/acf13a64df2991a4cb6b.js +1 -0
- package/assets/esri/core/workers/chunks/{7a8d740d1226719a578a.js → b457b7dd907f06278bee.js} +1 -1
- package/assets/esri/core/workers/chunks/b5640f9623a9c9ded92a.js +1 -0
- package/assets/esri/core/workers/chunks/bb67d491f62a5cce96cd.js +1 -0
- package/assets/esri/core/workers/chunks/{71acded1b3c0057917a1.js → bbdbb618a18542f7a4a2.js} +1 -1
- package/assets/esri/core/workers/chunks/bc9f54a6b577c43189fd.js +1 -0
- package/assets/esri/core/workers/chunks/{6fe738748ce837811ff4.js → bd4125d163f372a7e978.js} +1 -1
- package/assets/esri/core/workers/chunks/bead38898c3f4d4d3569.js +1 -0
- package/assets/esri/core/workers/chunks/{22334a464f798b5279b2.js → c80c032c5b7a11db177a.js} +1 -1
- package/assets/esri/core/workers/chunks/cc748d4f4adb9c584aa4.js +1 -0
- package/assets/esri/core/workers/chunks/cf699b9bb530b87be14c.js +1 -0
- package/assets/esri/core/workers/chunks/{5d331f7628514a572f82.js → d6ab4d55f1023ee6ec6a.js} +1 -1
- package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +1 -0
- package/assets/esri/core/workers/chunks/{4874aabdb5c60ca66216.js → db2b8d8cf7131554cf7e.js} +1 -1
- package/assets/esri/core/workers/chunks/de4da985c398c8bcf2e7.js +1 -0
- package/assets/esri/core/workers/chunks/ef85cd0e82d59db8a26f.js +33 -0
- package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +1 -0
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/support/boundsUtils.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/rotate.js +5 -0
- package/geometry/support/extentUtils.js +1 -1
- package/geometry/support/rotate.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +5 -0
- package/graphic/ImageryTileGraphicOrigin.js +5 -0
- package/graphic/KMLGraphicOrigin.js +5 -0
- package/graphic/WCSGraphicOrigin.js +5 -0
- package/graphic/isImageryGraphicOrigin.js +5 -0
- package/graphic/isImageryTileGraphicOrigin.js +5 -0
- package/graphic/isKMLGraphicOrigin.js +5 -0
- package/graphic/isWCSGraphicOrigin.js +5 -0
- package/interfaces.d.ts +10 -10
- package/kernel.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GroundLayer.js +5 -0
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/Viewshed/{ArrowManipulator.js → ViewshedArrowManipulator.js} +1 -1
- package/views/3d/analysis/Viewshed/{FieldOfViewManipulation.js → ViewshedFieldOfViewManipulation.js} +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementComputation.js → VolumeMeasurementCutFillComputation.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementController.js → VolumeMeasurementCutFillController.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementVisualization.js → VolumeMeasurementCutFillVisualization.js} +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/MultipointDrawAction.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawUtils.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
- package/views/interactive/tooltip/infos/SelectedVertexTooltipInfo.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/ElevationProfile/support/profileUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/analysis/VolumeMeasurement/CutFillOptions.d.ts +0 -4
- package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +0 -1
- package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +0 -1
- package/assets/esri/core/workers/chunks/03ee4d63aa8de44958ab.js +0 -1
- package/assets/esri/core/workers/chunks/0445de3a8968c0734c91.js +0 -1
- package/assets/esri/core/workers/chunks/09268dc856c3d5ce178f.js +0 -1
- package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +0 -1
- package/assets/esri/core/workers/chunks/17776d9d3558d45ea7b5.js +0 -1
- package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +0 -1
- package/assets/esri/core/workers/chunks/1e01aaebdeffdfc0c6bd.js +0 -1
- package/assets/esri/core/workers/chunks/222f981e876f60ae282f.js +0 -1
- package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +0 -1
- package/assets/esri/core/workers/chunks/277941bec15525dbd3a0.js +0 -1
- package/assets/esri/core/workers/chunks/2cb14d040e67a261b31c.js +0 -1
- package/assets/esri/core/workers/chunks/31c088966ccfff2ea1db.js +0 -1
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +0 -1
- package/assets/esri/core/workers/chunks/3800764932a1c32cb29f.js +0 -1
- package/assets/esri/core/workers/chunks/46a470bea2a3601182dc.js +0 -1
- package/assets/esri/core/workers/chunks/4f8dab492331c9a2d67a.js +0 -1
- package/assets/esri/core/workers/chunks/5900dde7a201a7d47469.js +0 -1
- package/assets/esri/core/workers/chunks/5b2ff220aebe464dac23.js +0 -1
- package/assets/esri/core/workers/chunks/6801b92bce7a918fda6f.js +0 -1
- package/assets/esri/core/workers/chunks/772e81e9162e2240a7a6.js +0 -1
- package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +0 -1
- package/assets/esri/core/workers/chunks/7bdfc7c7ce1d94c00745.js +0 -353
- package/assets/esri/core/workers/chunks/83737d86584bf1b32368.js +0 -1
- package/assets/esri/core/workers/chunks/854bfda25bb406814929.js +0 -1
- package/assets/esri/core/workers/chunks/87f68c2b9361bd3f8cac.js +0 -1
- package/assets/esri/core/workers/chunks/8c81156b1605a16acc29.js +0 -1
- package/assets/esri/core/workers/chunks/8f6ff09e7d2f01b79faf.js +0 -1
- package/assets/esri/core/workers/chunks/97a38d700f2cb8807d51.js +0 -1
- package/assets/esri/core/workers/chunks/9e9be7f6ea32957f1088.js +0 -33
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +0 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +0 -1
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +0 -1
- package/assets/esri/core/workers/chunks/de499e33035b56b6697d.js +0 -1
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +0 -1
- package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +0 -1
- package/assets/esri/core/workers/chunks/e10c5405f956b2cc59e4.js +0 -1
- package/assets/esri/core/workers/chunks/ead1acf95c3385630da8.js +0 -1001
- package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +0 -1
- package/assets/esri/core/workers/chunks/f4d7cbd33ef8710d7316.js +0 -1
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +0 -5
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +0 -5
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +0 -5
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 h}from"../core/accessorSupport/decorators/property.js";import{cast as f}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 T from"../form/FormTemplate.js";import j from"../geometry/SpatialReference.js";import F 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 _}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as C}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 V}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as U}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 he,queryFeatureCount as fe,queryExtent as be,queryRelatedFeatures as ge,queryRelatedFeaturesCount as we,validateBinsQuery as ve,hasDataChanged as Te,geometryTypeKebabDict as je}from"./support/featureLayerUtils.js";import Fe from"./support/FeatureTemplate.js";import Se from"./support/FeatureType.js";import{defineFieldProperties as Ie}from"./support/fieldProperties.js";import{fixRendererFields as Ee,fixTimeInfoFields as Le}from"./support/fieldUtils.js";import De from"./support/LabelClass.js";import{reader as _e}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as xe}from"./support/serviceCapabilitiesUtils.js";import Ce from"./support/TimeInfo.js";import Pe from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Oe}from"./support/versionUtils.js";import{DataLayerSource as qe}from"./support/source/DataLayerSource.js";import{read as Me}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ae}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Re,rendererTypes as Qe}from"../renderers/support/typeUtils.js";import Ve from"../rest/support/FeatureSet.js";import Ue from"../rest/support/Query.js";import{isNumber as Be}from"../support/guards.js";import{createPopupTemplate as Ge}from"../support/popupUtils.js";import{symbolTypes as Ne}from"../symbols/support/typeUtils.js";import{opacityToTransparency as $e}from"../webdoc/support/opacityUtils.js";const Je="FeatureLayer";function We(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ze(e){return e&&e instanceof o}const He=Ie();function ze(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let ke=class extends(O(q(P(Q(C(x(D(A(B(G(U(V(L(M(R(p(_(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 F(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 Pe({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,xe(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]}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){Ee(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Me(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&&(Ze(t)&&this._resetMemorySource(t),Ze(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=Ve.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=>Fe.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,Je);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ae(this,e,t,r,Je);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 Ge(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,Je);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return de(this,e,Je)}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)}getFieldDomain(e,t){return ce(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return me(this,e,t,Je)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Ue.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return await he(this,e,t,Je)}async queryFeatureCount(e,t){return fe(this,e,t,Je)}async queryExtent(e,t){return be(this,e,t,Je)}async queryRelatedFeatures(e,t){return ge(this,e,t,Je)}async queryRelatedFeaturesCount(e,t){return we(this,e,t,Je)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Je,"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(Je,"Layer source does not support queryAttributeBins capability");ve(e,i,Je);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(Je,"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(Be)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Je,"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(Je,"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(We(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(We(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(We(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(We(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(Je,`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||Oe(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(),Ee(this.renderer,this.fieldsIndex),Le(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ae(this,{origin:"service"})}async hasDataChanged(){return Te(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([h({clonable:!1,readOnly:!0})],ke.prototype,"_titleCreator",null),e([h(W)],ke.prototype,"attributeTableTemplate",void 0),e([b("service","capabilities")],ke.prototype,"readCapabilities",null),e([h({json:{origins:{"web-scene":{write:!1}},write:!0}})],ke.prototype,"charts",void 0),e([h({readOnly:!0})],ke.prototype,"createQueryVersion",null),e([h({json:{read:{source:"layerDefinition.copyrightText"}}})],ke.prototype,"copyright",void 0),e([h({json:{read:{source:"layerDefinition.displayField"}}})],ke.prototype,"displayField",void 0),e([h({types:Ne,readOnly:!0})],ke.prototype,"defaultSymbol",void 0),e([h({type:qe})],ke.prototype,"dynamicDataSource",void 0),e([h({type:Boolean})],ke.prototype,"editingEnabled",null),e([b(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],ke.prototype,"readEditingEnabled",null),e([b("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],ke.prototype,"readEditingEnabledFromWebMap",null),e([w(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabled",null),e([w("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabledToWebMap",null),e([h({readOnly:!0})],ke.prototype,"effectiveEditingEnabled",null),e([h({clonable:!1,readOnly:!0})],ke.prototype,"featureTitleFields",null),e([h({...He.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:ze}}}}})],ke.prototype,"fields",void 0),e([h(He.fieldsIndex)],ke.prototype,"fieldsIndex",void 0),e([h({type:T,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],ke.prototype,"formTemplate",void 0),e([h({json:{read:{source:"layerDefinition.extent"}}})],ke.prototype,"fullExtent",void 0),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:ze,writer(e,t,r){const i=e?je.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:je.read}}})],ke.prototype,"geometryType",void 0),e([h({readOnly:!0,clonable:!1})],ke.prototype,"graphicOrigin",void 0),e([h({json:{read:{source:"layerDefinition.hasM"}}})],ke.prototype,"hasM",void 0),e([h({json:{read:{source:"layerDefinition.hasZ"}}})],ke.prototype,"hasZ",void 0),e([h(Z)],ke.prototype,"id",void 0),e([h({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ke.prototype,"infoFor3D",void 0),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],ke.prototype,"isTable",void 0),e([b("service","isTable",["type","geometryType"]),b("isTable",["layerDefinition.type","layerDefinition.geometryType"])],ke.prototype,"readIsTable",null),e([w("web-map","isTable")],ke.prototype,"writeIsTable",null),e([h(H)],ke.prototype,"labelsVisible",void 0),e([h({type:[De],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:_e,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:_e,write:{layerContainerTypes:v}}})],ke.prototype,"labelingInfo",void 0),e([h((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,$e(e),t)}}},e})())],ke.prototype,"opacity",void 0),e([h(k)],ke.prototype,"legendEnabled",void 0),e([h({type:["show","hide"],json:(()=>{const e=a(K.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],ke.prototype,"listMode",void 0),e([b("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ke.prototype,"readGlobalIdField",null),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:ze}}}}})],ke.prototype,"objectIdField",void 0),e([b("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ke.prototype,"readObjectIdField",null),e([h({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:v}}})],ke.prototype,"operationalLayerType",void 0),e([h(He.outFields)],ke.prototype,"outFields",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ke.prototype,"path",void 0),e([h(X)],ke.prototype,"popupEnabled",void 0),e([h({type:t,json:{name:"popupInfo",write:!0}})],ke.prototype,"popupTemplate",void 0),e([h({readOnly:!0})],ke.prototype,"defaultPopupTemplate",null),e([h({types:Qe,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Re,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})}}})],ke.prototype,"renderer",null),e([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],ke.prototype,"readRenderer",null),e([h()],ke.prototype,"resourceInfo",void 0),e([h((()=>{const e=a(Y);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],ke.prototype,"screenSizePerspectiveEnabled",void 0),e([h({clonable:!1})],ke.prototype,"source",null),e([f("source")],ke.prototype,"castSource",null),e([b("portal-item","source",["featureSet"]),b("web-map","source",["featureSet"])],ke.prototype,"readSource",null),e([h({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],ke.prototype,"spatialReference",void 0),e([h({type:Number})],ke.prototype,"subtypeCode",void 0),e([h({type:[Fe]})],ke.prototype,"templates",void 0),e([b("templates",["editFieldsInfo","creatorField","editorField","templates"])],ke.prototype,"readTemplates",null),e([h({type:Ce})],ke.prototype,"timeInfo",void 0),e([h()],ke.prototype,"title",void 0),e([b("service","title",["name"]),b("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],ke.prototype,"readTitle",null),e([b("web-map","title",["layerDefinition.name","title"])],ke.prototype,"readTitleFromWebMap",null),e([h({type:String})],ke.prototype,"sublayerTitleMode",void 0),e([h({json:{read:!1}})],ke.prototype,"type",void 0),e([h({type:String})],ke.prototype,"typeIdField",void 0),e([b("service","typeIdField"),b("typeIdField",["layerDefinition.typeIdField"])],ke.prototype,"readTypeIdField",null),e([h({type:[Se]})],ke.prototype,"types",void 0),e([b("service","types",["types"]),b("types",["layerDefinition.types"])],ke.prototype,"readTypes",null),e([h({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:v}}}}})],ke.prototype,"visible",void 0),e([b("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],ke.prototype,"readVisible",null),ke=e([g("esri.layers.FeatureLayer")],ke);export{ke 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 h}from"../core/accessorSupport/decorators/property.js";import{cast as f}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 T from"../form/FormTemplate.js";import j from"../geometry/SpatialReference.js";import F 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 _}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as C}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 V}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as U}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 he,queryFeatureCount as fe,queryExtent as be,queryRelatedFeatures as ge,queryRelatedFeaturesCount as we,validateBinsQuery as ve,hasDataChanged as Te,geometryTypeKebabDict as je}from"./support/featureLayerUtils.js";import Fe from"./support/FeatureTemplate.js";import Se from"./support/FeatureType.js";import{defineFieldProperties as Ie}from"./support/fieldProperties.js";import{fixRendererFields as Ee,fixTimeInfoFields as Le}from"./support/fieldUtils.js";import De from"./support/LabelClass.js";import{reader as _e}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as xe}from"./support/serviceCapabilitiesUtils.js";import Ce from"./support/TimeInfo.js";import Pe from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Oe}from"./support/versionUtils.js";import{DataLayerSource as qe}from"./support/source/DataLayerSource.js";import{read as Me}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ae}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Re,rendererTypes as Qe}from"../renderers/support/typeUtils.js";import Ve from"../rest/support/FeatureSet.js";import Ue from"../rest/support/Query.js";import{isNumber as Be}from"../support/guards.js";import{createPopupTemplate as Ge}from"../support/popupUtils.js";import{symbolTypes as Ne}from"../symbols/support/typeUtils.js";import{opacityToTransparency as $e}from"../webdoc/support/opacityUtils.js";const Je="FeatureLayer";function We(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ze(e){return e&&e instanceof o}const He=Ie();function ze(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let ke=class extends(O(q(P(Q(C(x(D(A(B(G(U(V(L(M(R(p(_(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 F(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 Pe({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,xe(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]}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){Ee(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Me(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&&(Ze(t)&&this._resetMemorySource(t),Ze(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=Ve.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=>Fe.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,Je);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ae(this,e,t,r,Je);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 Ge(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,Je);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return de(this,e,Je)}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)}getFieldDomain(e,t){return ce(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return me(this,e,t,Je)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Ue.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r,o.origin=this.graphicOrigin;return i}async queryObjectIds(e,t){return await he(this,e,t,Je)}async queryFeatureCount(e,t){return fe(this,e,t,Je)}async queryExtent(e,t){return be(this,e,t,Je)}async queryRelatedFeatures(e,t){return ge(this,e,t,Je)}async queryRelatedFeaturesCount(e,t){return we(this,e,t,Je)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Je,"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(Je,"Layer source does not support queryAttributeBins capability");ve(e,i,Je);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(Je,"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(Be)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Je,"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(Je,"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(We(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(We(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(We(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(We(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(Je,`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||Oe(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(),Ee(this.renderer,this.fieldsIndex),Le(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ae(this,{origin:"service"})}async hasDataChanged(){return Te(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([h({clonable:!1,readOnly:!0})],ke.prototype,"_titleCreator",null),e([h(W)],ke.prototype,"attributeTableTemplate",void 0),e([b("service","capabilities")],ke.prototype,"readCapabilities",null),e([h({json:{origins:{"web-scene":{write:!1}},write:!0}})],ke.prototype,"charts",void 0),e([h({readOnly:!0})],ke.prototype,"createQueryVersion",null),e([h({json:{read:{source:"layerDefinition.copyrightText"}}})],ke.prototype,"copyright",void 0),e([h({json:{read:{source:"layerDefinition.displayField"}}})],ke.prototype,"displayField",void 0),e([h({types:Ne,readOnly:!0})],ke.prototype,"defaultSymbol",void 0),e([h({type:qe})],ke.prototype,"dynamicDataSource",void 0),e([h({type:Boolean})],ke.prototype,"editingEnabled",null),e([b(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],ke.prototype,"readEditingEnabled",null),e([b("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],ke.prototype,"readEditingEnabledFromWebMap",null),e([w(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabled",null),e([w("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],ke.prototype,"writeEditingEnabledToWebMap",null),e([h({readOnly:!0})],ke.prototype,"effectiveEditingEnabled",null),e([h({clonable:!1,readOnly:!0})],ke.prototype,"featureTitleFields",null),e([h({...He.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:ze}}}}})],ke.prototype,"fields",void 0),e([h(He.fieldsIndex)],ke.prototype,"fieldsIndex",void 0),e([h({type:T,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],ke.prototype,"formTemplate",void 0),e([h({json:{read:{source:"layerDefinition.extent"}}})],ke.prototype,"fullExtent",void 0),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:ze,writer(e,t,r){const i=e?je.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:je.read}}})],ke.prototype,"geometryType",void 0),e([h({readOnly:!0,clonable:!1})],ke.prototype,"graphicOrigin",void 0),e([h({json:{read:{source:"layerDefinition.hasM"}}})],ke.prototype,"hasM",void 0),e([h({json:{read:{source:"layerDefinition.hasZ"}}})],ke.prototype,"hasZ",void 0),e([h(Z)],ke.prototype,"id",void 0),e([h({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ke.prototype,"infoFor3D",void 0),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],ke.prototype,"isTable",void 0),e([b("service","isTable",["type","geometryType"]),b("isTable",["layerDefinition.type","layerDefinition.geometryType"])],ke.prototype,"readIsTable",null),e([w("web-map","isTable")],ke.prototype,"writeIsTable",null),e([h(H)],ke.prototype,"labelsVisible",void 0),e([h({type:[De],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:_e,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:_e,write:{layerContainerTypes:v}}})],ke.prototype,"labelingInfo",void 0),e([h((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,$e(e),t)}}},e})())],ke.prototype,"opacity",void 0),e([h(k)],ke.prototype,"legendEnabled",void 0),e([h({type:["show","hide"],json:(()=>{const e=a(K.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],ke.prototype,"listMode",void 0),e([b("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ke.prototype,"readGlobalIdField",null),e([h({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:ze}}}}})],ke.prototype,"objectIdField",void 0),e([b("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ke.prototype,"readObjectIdField",null),e([h({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:v}}})],ke.prototype,"operationalLayerType",void 0),e([h(He.outFields)],ke.prototype,"outFields",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ke.prototype,"path",void 0),e([h(X)],ke.prototype,"popupEnabled",void 0),e([h({type:t,json:{name:"popupInfo",write:!0}})],ke.prototype,"popupTemplate",void 0),e([h({readOnly:!0})],ke.prototype,"defaultPopupTemplate",null),e([h({types:Qe,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Re,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})}}})],ke.prototype,"renderer",null),e([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],ke.prototype,"readRenderer",null),e([h()],ke.prototype,"resourceInfo",void 0),e([h((()=>{const e=a(Y);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],ke.prototype,"screenSizePerspectiveEnabled",void 0),e([h({clonable:!1})],ke.prototype,"source",null),e([f("source")],ke.prototype,"castSource",null),e([b("portal-item","source",["featureSet"]),b("web-map","source",["featureSet"])],ke.prototype,"readSource",null),e([h({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],ke.prototype,"spatialReference",void 0),e([h({type:Number})],ke.prototype,"subtypeCode",void 0),e([h({type:[Fe]})],ke.prototype,"templates",void 0),e([b("templates",["editFieldsInfo","creatorField","editorField","templates"])],ke.prototype,"readTemplates",null),e([h({type:Ce})],ke.prototype,"timeInfo",void 0),e([h()],ke.prototype,"title",void 0),e([b("service","title",["name"]),b("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],ke.prototype,"readTitle",null),e([b("web-map","title",["layerDefinition.name","title"])],ke.prototype,"readTitleFromWebMap",null),e([h({type:String})],ke.prototype,"sublayerTitleMode",void 0),e([h({json:{read:!1}})],ke.prototype,"type",void 0),e([h({type:String})],ke.prototype,"typeIdField",void 0),e([b("service","typeIdField"),b("typeIdField",["layerDefinition.typeIdField"])],ke.prototype,"readTypeIdField",null),e([h({type:[Se]})],ke.prototype,"types",void 0),e([b("service","types",["types"]),b("types",["layerDefinition.types"])],ke.prototype,"readTypes",null),e([h({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:v}}}}})],ke.prototype,"visible",void 0),e([b("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],ke.prototype,"readVisible",null),ke=e([g("esri.layers.FeatureLayer")],ke);export{ke as default};
|
package/layers/ImageryLayer.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 r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as p}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"../graphic/ImageryGraphicOrigin.js";import y from"./Layer.js";import{ArcGISImageService as u}from"./mixins/ArcGISImageService.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as j}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as I}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as L}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as w}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as b,popupEnabled as P}from"./support/commonProperties.js";import{commonRasterFieldNames as x,rasterDimensionFieldPrefix as T,setDefaultRasterFieldFormats as O}from"./support/rasterFieldUtils.js";import{serviceSupportsSpatialReference as _}from"./support/versionUtils.js";import{logInvalidElevationInfoWarning as C,elevationModeUnsupportedMessage as R,featureExpressionUnsupportedMessage as A}from"../support/elevationInfoUtils.js";import{createPopupTemplate as E}from"../support/popupUtils.js";import G from"../symbols/support/ElevationInfo.js";let M=class extends(f(S(w(g(v(I(u(j(L(h(d(s(t(y)))))))))))))){constructor(...e){super(...e),this.graphicOrigin=new c(this),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=a(async(e,r,t)=>{const{save:o,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return o(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(p).then(()=>this._fetchService(r))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,r,t){const o="vector-field"===this.renderer?.type;r[t]=o?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const{rasterFields:r}=this,t=new Set,o=x.itemPixelValue.toLowerCase(),i="raster-dataset"===this.sourceType,s=T.toLowerCase(),a=`${x.servicePixelValue.toLowerCase()}.`;for(const l of r){const e=l.name.toLowerCase();e===o||e.startsWith(a)||i&&e.startsWith(s)||t.add(l.name)}const p=E({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:n}=this;return p?.fieldInfos&&n&&O(p.fieldInfos,n),p}queryFeatures(e,r){return this.queryRasters(e,r).then(e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e})}queryFeatureCount(e,r){return this.queryRasterCount(e,r)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return _(this,e)}write(e,r){if(!this._isPreviewLayer)return super.write(e,r);if(r?.messages){const e=`${r.origin}/${r.layerContainerType||"operational-layers"}`;r.messages.push(new o("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}_validateElevationInfo(){const e=this.elevationInfo;C(i.getLogger(this),R("Imagery layers","relative-to-scene",e)),C(i.getLogger(this),A("Imagery layers",e))}};e([n({type:G,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],M.prototype,"elevationInfo",null),e([n({readOnly:!0,clonable:!1})],M.prototype,"graphicOrigin",void 0),e([n(b)],M.prototype,"legendEnabled",null),e([n({type:["show","hide"]})],M.prototype,"listMode",null),e([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],M.prototype,"isReference",void 0),e([n({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],M.prototype,"operationalLayerType",void 0),e([m("web-map","operationalLayerType")],M.prototype,"writeOperationalLayerType",null),e([n(P)],M.prototype,"popupEnabled",void 0),e([n({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],M.prototype,"popupTemplate",void 0),e([n({readOnly:!0})],M.prototype,"defaultPopupTemplate",null),e([n({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),e([n({readOnly:!0})],M.prototype,"_isPreviewLayer",null),M=e([l("esri.layers.ImageryLayer")],M);const $=M;export{$ 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"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import u from"./Layer.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as f}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as w}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as _}from"./support/commonProperties.js";import I from"./support/Field.js";import{getServicePixelValueField as O,getRawServicePixelValueField as b,getRasterAttributeTableFields as P,getMagnitudeField as x,getDirectionField as T,getMultidimensionalFields as N,commonRasterFieldNames as L,setDefaultRasterFieldFormats as J}from"./support/rasterFieldUtils.js";import C from"./support/RasterFunction.js";import{isFunctionRaster as M,getPrimaryRasters as E}from"./support/rasterDatasets/datasetUtils.js";import U from"./support/rasterDatasets/FunctionRaster.js";import $ from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as D,create as B}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as A,elevationModeUnsupportedMessage as W,featureExpressionUnsupportedMessage as z}from"../support/elevationInfoUtils.js";import{createPopupTemplate as k}from"../support/popupUtils.js";import G from"../symbols/support/ElevationInfo.js";let V=class extends(d(F(g(v(w(y(f(R(S(h(j(o(r(u)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[O("Pixel Value"),b("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=P(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=x(t),s=T();e.push(r,s)}if(i){const t=N(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==L.rawServicePixelValue)),s=k({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&J(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=m(C,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=M(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=E(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&D(t.toJSON(),i);const o=await Promise.all(i.map(e=>$.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await $.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await $.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=B(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new U({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(){const e=this.elevationInfo;A(i.getLogger(this),W("ImageryTile layers","relative-to-scene",e)),A(i.getLogger(this),z("ImageryTile layers",e))}};e([l({clonable:!1})],V.prototype,"_primaryRasters",void 0),e([l({type:G,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],V.prototype,"elevationInfo",null),e([l(_)],V.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],V.prototype,"isReference",void 0),e([l({type:["show","hide"]})],V.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],V.prototype,"blendMode",void 0),e([l({type:C,json:{name:"renderingRule",write:!0}})],V.prototype,"rasterFunction",void 0),e([l()],V.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],V.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],V.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],V.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],V.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],V.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({readOnly:!0,type:[I]})],V.prototype,"fields",void 0),e([l({readOnly:!0,type:[I]})],V.prototype,"rasterFields",null),e([l({constructOnly:!0})],V.prototype,"source",void 0),V=e([c("esri.layers.ImageryTileLayer")],V);const H=V;export{H as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import u from"../graphic/ImageryTileGraphicOrigin.js";import h from"./Layer.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as g}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as j}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{legendEnabled as _}from"./support/commonProperties.js";import O from"./support/Field.js";import{getServicePixelValueField as b,getRawServicePixelValueField as P,getRasterAttributeTableFields as x,getMagnitudeField as T,getDirectionField as N,getMultidimensionalFields as L,commonRasterFieldNames as J,setDefaultRasterFieldFormats as C}from"./support/rasterFieldUtils.js";import M from"./support/RasterFunction.js";import{isFunctionRaster as E,getPrimaryRasters as U}from"./support/rasterDatasets/datasetUtils.js";import $ from"./support/rasterDatasets/FunctionRaster.js";import D from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as B,create as A}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as W,elevationModeUnsupportedMessage as z,featureExpressionUnsupportedMessage as G}from"../support/elevationInfoUtils.js";import{createPopupTemplate as k}from"../support/popupUtils.js";import V from"../symbols/support/ElevationInfo.js";let H=class extends(y(S(v(w(j(f(g(R(I(d(F(o(r(h)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new u(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[b("Pixel Value"),P("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=x(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=T(t),s=N();e.push(r,s)}if(i){const t=L(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==J.rawServicePixelValue)),s=k({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&C(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=m(M,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=E(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=U(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&B(t.toJSON(),i);const o=await Promise.all(i.map(e=>D.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await D.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await D.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=A(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new $({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(){const e=this.elevationInfo;W(i.getLogger(this),z("ImageryTile layers","relative-to-scene",e)),W(i.getLogger(this),G("ImageryTile layers",e))}};e([l({clonable:!1})],H.prototype,"_primaryRasters",void 0),e([l({type:V,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],H.prototype,"elevationInfo",null),e([l({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),e([l(_)],H.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],H.prototype,"isReference",void 0),e([l({type:["show","hide"]})],H.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],H.prototype,"blendMode",void 0),e([l({type:M,json:{name:"renderingRule",write:!0}})],H.prototype,"rasterFunction",void 0),e([l()],H.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],H.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],H.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],H.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],H.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),e([l({readOnly:!0,type:[O]})],H.prototype,"fields",void 0),e([l({readOnly:!0,type:[O]})],H.prototype,"rasterFields",null),e([l({constructOnly:!0})],H.prototype,"source",void 0),H=e([c("esri.layers.ImageryTileLayer")],H);const Y=H;export{Y as default};
|
package/layers/KMLLayer.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 r from"../core/Collection.js";import t from"../core/CollectionFlattener.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{watch as i,sync as l}from"../core/reactiveUtils.js";import{getFilename as a}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import d from"./Layer.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as v}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{url as j}from"./support/commonProperties.js";import S from"./support/KMLSublayer.js";import{sublayersFromJSON as x,fetchService as L,parseKML as
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../core/Collection.js";import t from"../core/CollectionFlattener.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{watch as i,sync as l}from"../core/reactiveUtils.js";import{getFilename as a}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import d from"./Layer.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as v}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{url as j}from"./support/commonProperties.js";import S from"./support/KMLSublayer.js";import{sublayersFromJSON as x,fetchService as L,parseKML as w}from"./support/kmlUtils.js";const E=["kml","xml"];let F=class extends(h(v(g(f(b(o(d))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new t({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=c.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([i(()=>this.sublayers,(e,r)=>{r&&r.forEach(e=>{e.parent=null,e.layer=null}),e&&e.forEach(e=>{e.parent=this,e.layer=this})},l),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}get sublayerById(){const e=new Map;for(const r of this.allSublayers)e.set(r.id,r);return e}readSublayersFromItemOrWebMap(e,r){this._visibleFolders=r.visibleFolders}readSublayers(e,r,t){return x(S,r,t,this._visibleFolders)}writeSublayers(e,r){const t=[],o=e.toArray();for(;o.length;){const e=o[0];e.networkLink||(e.visible&&t.push(e.id),e.sublayers&&o.push(...e.sublayers.toArray())),o.shift()}r.visibleFolders=t}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?a(this.url,E)||"KML":e}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,r=[],t=e=>{e.visible&&(r.push(e),e.sublayers&&e.sublayers.forEach(t))};return e?.forEach(t),r}get fullExtent(){return this._recomputeFullExtent()}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(s).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const r=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:L(this.url??"",this.outSpatialReference,this.refreshInterval,e)),t=w(r.data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const r=t=>{if(t.sublayers)for(const o of t.sublayers.items)r(o),o.visible&&o.fullExtent&&(null!=e?e.union(o.fullExtent):e=o.fullExtent.clone())};return r(this),e}};e([n({readOnly:!0})],F.prototype,"allSublayers",void 0),e([n({readOnly:!0})],F.prototype,"sublayerById",null),e([n({type:c})],F.prototype,"outSpatialReference",void 0),e([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],F.prototype,"path",void 0),e([n({readOnly:!0,json:{read:!1,write:!1}})],F.prototype,"legendEnabled",void 0),e([n({type:["show","hide","hide-children"]})],F.prototype,"listMode",void 0),e([n({type:["KML"]})],F.prototype,"operationalLayerType",void 0),e([n({})],F.prototype,"resourceInfo",void 0),e([n({type:r.ofType(S),json:{write:{ignoreOrigin:!0}}})],F.prototype,"sublayers",void 0),e([p(["web-map","portal-item"],"sublayers",["visibleFolders"])],F.prototype,"readSublayersFromItemOrWebMap",null),e([p("service","sublayers",["sublayers"])],F.prototype,"readSublayers",null),e([y("sublayers")],F.prototype,"writeSublayers",null),e([n({readOnly:!0,json:{read:!1}})],F.prototype,"type",void 0),e([n({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],F.prototype,"title",null),e([n(j)],F.prototype,"url",void 0),e([n({readOnly:!0})],F.prototype,"visibleSublayers",null),e([n({type:m})],F.prototype,"extent",void 0),e([n()],F.prototype,"fullExtent",null),F=e([u("esri.layers.KMLLayer")],F);const O=F;export{O as default};
|
package/layers/SceneLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as T}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as E}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as q,legendEnabled as C,popupEnabled as G,attributeTableTemplate as N,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{getFieldDomain as V,computeEffectiveEditingEnabled as M,getGlobalIdToObjectIdMap as k}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as Z}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ae}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ne}from"./support/RangeInfo.js";import le from"./support/SceneFilter.js";import{cacheIsOutOfSync as pe}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as de}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ye}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ue}from"../renderers/support/typeUtils.js";import ce from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as he,elevationModeUnsupportedMessage as fe,featureExpressionUnsupportedMessage as me}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ge}from"../support/popupUtils.js";import{extractZipFiles as ve}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as be}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as we,getFetchPopupTemplate as Ie}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Le}from"../webdoc/support/opacityUtils.js";const je=new Set(["3DObject","Point"]),Fe=H();let Se=class extends(x(S(A(j(_(O(P(p(F(L(i(b)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?V(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:B.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&M(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:U;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ye(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ce;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Z(this.fieldsIndex,await we(this,Ie(this)));return be(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ge(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return E(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>ee(this.infoFor3D,t)?e+1:e,0);0===s&&r(new w),s>1&&r(new I);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ae(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await ve(e)).filter(e=>te(t,e))}validateLayer(e){if(e.layerType&&!je.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!E(this.associatedLayer?.url)||!pe(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await D(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&he(n.getLogger(this),fe("Mesh scene layers","relative-to-scene",e)),he(n.getLogger(this),me("Scene layers",e))}async fetchStatistics(e,t){return await de({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Se.prototype,"featureReduction",void 0),e([h({type:[ne],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Se.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Se.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Se.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Se.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Se.prototype,"type",void 0),e([h({...Fe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"fields",void 0),e([h()],Se.prototype,"types",null),e([h()],Se.prototype,"typeIdField",null),e([h()],Se.prototype,"templates",null),e([h()],Se.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Se.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Se.prototype,"floorInfo",void 0),e([h(Fe.outFields)],Se.prototype,"outFields",void 0),e([h({type:B,readOnly:!0,json:{read:!1},clonable:!1})],Se.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Se.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0,clonable:!1})],Se.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0,clonable:!1})],Se.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Se.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Se.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Se.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Se.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Se.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Se.prototype,"definitionExpression",void 0),e([h({type:le,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Se.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Se.prototype,"path",void 0),e([h(R)],Se.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Se.prototype,"geometryType",null),e([h(q)],Se.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Se.prototype,"labelingInfo",void 0),e([h(C)],Se.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Le(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Se.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"semantic",void 0),e([h({types:ue,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Se.prototype,"renderer",null),e([h({json:{read:!1}})],Se.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Se.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Se.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"relationships",null),e([h(G)],Se.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"defaultPopupTemplate",null),e([h(N)],Se.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Se.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Se.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Se.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Se.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Se.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Se.prototype,"normalReferenceFrame",void 0),e([h(Q)],Se.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"serviceItemId",void 0),e([h(T)],Se.prototype,"useViewTime",null),Se=e([g("esri.layers.SceneLayer")],Se);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Oe={"mesh-pyramids":"mesh",points:"point"},Pe=Se;export{Pe as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as T}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as E}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as q,legendEnabled as C,popupEnabled as N,attributeTableTemplate as G,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{getFieldDomain as V,computeEffectiveEditingEnabled as M,getGlobalIdToObjectIdMap as k}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as Z}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ae}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ne}from"./support/RangeInfo.js";import le from"./support/SceneFilter.js";import{cacheIsOutOfSync as pe}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as de}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ye}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ue}from"../renderers/support/typeUtils.js";import ce from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as he,elevationModeUnsupportedMessage as fe,featureExpressionUnsupportedMessage as me}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ge}from"../support/popupUtils.js";import{extractZipFiles as ve}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as be}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as we,getFetchPopupTemplate as Ie}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Le}from"../webdoc/support/opacityUtils.js";const je=new Set(["3DObject","Point"]),Fe=H();let Se=class extends(x(S(A(j(_(O(P(p(F(L(i(b)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?V(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:B.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&M(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:U;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ye(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ce;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Z(this.fieldsIndex,await we(this,Ie(this)));return be(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ge(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return E(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>ee(this.infoFor3D,t)?e+1:e,0);0===s&&r(new w),s>1&&r(new I);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ae(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await ve(e)).filter(e=>te(t,e))}validateLayer(e){if(e.layerType&&!je.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!E(this.associatedLayer?.url)||!pe(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await D(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&he(n.getLogger(this),fe("Mesh scene layers","relative-to-scene",e)),he(n.getLogger(this),me("Scene layers",e))}async fetchStatistics(e,t){return await de({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Se.prototype,"featureReduction",void 0),e([h({type:[ne],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Se.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Se.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Se.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Se.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Se.prototype,"type",void 0),e([h({...Fe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"fields",void 0),e([h()],Se.prototype,"types",null),e([h()],Se.prototype,"typeIdField",null),e([h()],Se.prototype,"templates",null),e([h()],Se.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Se.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Se.prototype,"floorInfo",void 0),e([h(Fe.outFields)],Se.prototype,"outFields",void 0),e([h({type:B,readOnly:!0,json:{read:!1},clonable:!1})],Se.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Se.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0,clonable:!1})],Se.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0,clonable:!1})],Se.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Se.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Se.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Se.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Se.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Se.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Se.prototype,"definitionExpression",void 0),e([h({type:le,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Se.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Se.prototype,"path",void 0),e([h(R)],Se.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Se.prototype,"geometryType",null),e([h(q)],Se.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Se.prototype,"labelingInfo",void 0),e([h(C)],Se.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Le(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Se.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"semantic",void 0),e([h({types:ue,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Se.prototype,"renderer",null),e([h({json:{read:!1}})],Se.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Se.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Se.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"relationships",null),e([h(N)],Se.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"defaultPopupTemplate",null),e([h(G)],Se.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Se.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Se.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Se.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Se.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Se.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Se.prototype,"normalReferenceFrame",void 0),e([h(Q)],Se.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"serviceItemId",void 0),e([h(T)],Se.prototype,"useViewTime",null),Se=e([g("esri.layers.SceneLayer")],Se);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Oe={"mesh-pyramids":"mesh",points:"point"},Pe=Se;export{Pe as default};
|
package/layers/WCSLayer.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
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as i,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import m from"../graphic/WCSGraphicOrigin.js";import d from"./Layer.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as h}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as y}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as v}from"./mixins/RasterJobHandlerMixin.js";import{RefreshableLayer as g}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{legendEnabled as w,popupEnabled as O}from"./support/commonProperties.js";import b from"./support/Field.js";import{getServicePixelValueField as S,getMultidimensionalFields as x}from"./support/rasterFieldUtils.js";import P from"./support/rasterDatasets/WCSRaster.js";import{createPopupTemplate as R}from"../support/popupUtils.js";const C=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let T=class extends(c(j(f(y(u(h(v(I(g(s(t(d)))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,this.graphicOrigin=new m(this),this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=i(async(e,r,t)=>{const{save:o,saveAs:s}=await import("./save/imageryUtils.js");switch(e){case 0:return o(this,r);case 1:return s(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WCS"]},e).catch(n).then(()=>this._openRaster(r))),Promise.resolve(this)}get renderer(){return super.renderer}set renderer(e){super.renderer=e}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[S("Pixel Value")],r=this.raster?.rasterInfo??this.serviceRasterInfo,t=r?.multidimensionalInfo;if(t){const r=x(t);e.push(...r)}return e}createPopupTemplate(e){return R({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}async _openRaster(e){const r=new P({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await r.open({signal:e}),!r.rasterInfo)throw r.destroy(),new o("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:t}=r;null==t.noDataValue&&(t.noDataValue=this.noData),this._set("serviceRasterInfo",t),this._set("spatialReference",t.spatialReference),null==this.title&&this.setAtOrigin("title",r.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",r.coverageInfo.id,"service"),null==this.version&&r.version&&this.setAtOrigin("version",r.version,"service"),this.setAtOrigin("tileInfo",r.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:s}=t;if(null!=s){const e=s.variables[0].dimensions.find(({name:e})=>"StdTime"===e);if(e){let r=e.extent?.[0]??e.values[0];Array.isArray(r)&&(r=r[0]);let t=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(t)&&(t=t[1]);const o=C.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:r,end:t},timeZone:null,interval:o?{value:e.interval,unit:o}:null})}}this.raster=r,this._configDefaultSettings(),this.addHandles(a(()=>this.customParameters,e=>this.raster.ioConfig.customFetchParameters=e))}};e([p({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0,ignoreOrigin:!0}}})],T.prototype,"coverageId",void 0),e([p()],T.prototype,"coverageInfo",null),e([p({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0,ignoreOrigin:!0}}})],T.prototype,"version",void 0),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],T.prototype,"isReference",void 0),e([p({json:{read:!0,write:!0}})],T.prototype,"blendMode",void 0),e([p({readOnly:!0,clonable:!1})],T.prototype,"graphicOrigin",void 0),e([p(w)],T.prototype,"legendEnabled",void 0),e([p({type:["show","hide"]})],T.prototype,"listMode",void 0),e([p()],T.prototype,"noData",void 0),e([p({type:["WCS"]})],T.prototype,"operationalLayerType",void 0),e([p()],T.prototype,"raster",void 0),e([p({readOnly:!0})],T.prototype,"type",void 0),e([p(O)],T.prototype,"popupEnabled",void 0),e([p({type:r,json:{name:"popupInfo",write:!0}})],T.prototype,"popupTemplate",void 0),e([p({readOnly:!0})],T.prototype,"defaultPopupTemplate",null),e([p({readOnly:!0,type:[b]})],T.prototype,"fields",void 0),e([p({readOnly:!0,type:[b]})],T.prototype,"rasterFields",null),T=e([l("esri.layers.WCSLayer")],T);const L=T;export{L 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"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../form/FormTemplate.js";import p from"../Layer.js";import{BlendLayer as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../form/FormTemplate.js";import p from"../../graphic/CatalogGraphicOrigin.js";import s from"../Layer.js";import{BlendLayer as a}from"../mixins/BlendLayer.js";import{FeatureEffectLayer as d}from"../mixins/FeatureEffectLayer.js";import{ScaleRangeLayer as u}from"../mixins/ScaleRangeLayer.js";import{attributeTableTemplate as y,elevationInfo as m,labelsVisible as h,legendEnabled as g,maxScale as f,minScale as c,opacity as b,popupEnabled as O}from"../support/commonProperties.js";import{fixRendererFields as I}from"../support/fieldUtils.js";import j from"../support/LabelClass.js";import{reader as F}from"../support/labelingInfo.js";import v from"../../renderers/SimpleRenderer.js";import{webSceneRendererTypes as w,rendererTypes as T}from"../../renderers/support/typeUtils.js";import{createPopupTemplate as E}from"../../support/popupUtils.js";import x from"../../symbols/SimpleFillSymbol.js";function S(){const e=new x({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new v({symbol:e})}let q=class extends(u(d(a(i(s))))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.graphicOrigin=new p(this),this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),I(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",e=>this.emit("apply-edits",e)),this.parent.on("edits",e=>this.emit("edits",e)),this.parent.on("refresh",e=>this.emit("refresh",e))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get displayFilterEnabled(){return this.parent?.displayFilterEnabled??!0}get displayFilterInfo(){return this.parent?.displayFilterInfo??null}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){I(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):S()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,t){return await this.load(),this.parent.applyEdits(e,t)}createPopupTemplate(e){const t={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return E(t,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,t){return this.parent?.getFieldDomain(e,t)}async queryExtent(e,t){return await this.load(),this.parent.queryExtent(e,t)}async queryFeatures(e,t){return await this.load(),this.parent.queryFeatures(e,t)}async queryFeatureCount(e,t){return await this.load(),this.parent.queryFeatureCount(e,t)}async queryObjectIds(e,t){return await this.load(),this.parent.queryObjectIds(e,t)}async queryAttributeBins(e,t){return await this.load(),this.parent.queryAttributeBins(e,t)}};e([n(y)],q.prototype,"attributeTableTemplate",void 0),e([n({readOnly:!0})],q.prototype,"apiKey",null),e([n({readOnly:!0})],q.prototype,"capabilities",null),e([n({readOnly:!0})],q.prototype,"customParameters",null),e([n()],q.prototype,"dateFieldsTimeZone",null),e([n({readOnly:!0})],q.prototype,"datesInUnknownTimezone",null),e([n({readOnly:!0})],q.prototype,"definitionExpression",null),e([n({readOnly:!0})],q.prototype,"editingInfo",null),e([n({readOnly:!0})],q.prototype,"effectiveCapabilities",null),e([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],q.prototype,"charts",void 0),e([n({readOnly:!0})],q.prototype,"createQueryVersion",null),e([n({readOnly:!0})],q.prototype,"defaultPopupTemplate",null),e([n({readOnly:!0})],q.prototype,"displayField",null),e([n({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],q.prototype,"editingEnabled",void 0),e([n({readOnly:!0})],q.prototype,"effectiveEditingEnabled",null),e([n((()=>{const e=r(m);return e.json.origins["web-map"]={read:!1,write:!1},e})())],q.prototype,"elevationInfo",void 0),e([n({readOnly:!0})],q.prototype,"fields",null),e([n({readOnly:!0})],q.prototype,"fieldsIndex",null),e([n({type:l,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],q.prototype,"formTemplate",void 0),e([n({readOnly:!0})],q.prototype,"fullExtent",null),e([n({readOnly:!0})],q.prototype,"geometryFieldsInfo",null),e([n({readOnly:!0})],q.prototype,"geometryType",null),e([n({readOnly:!0})],q.prototype,"globalIdField",null),e([n({readOnly:!0,clonable:!1})],q.prototype,"graphicOrigin",void 0),e([n({readOnly:!0})],q.prototype,"hasM",null),e([n({readOnly:!0})],q.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0,isRequired:!0}}})],q.prototype,"id",void 0),e([n({type:[j],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:F,write:!0}})],q.prototype,"labelingInfo",void 0),e([n(h)],q.prototype,"labelsVisible",void 0),e([n(g)],q.prototype,"legendEnabled",void 0),e([n({type:["show","hide"],json:{write:!0}})],q.prototype,"listMode",void 0),e([n((()=>{const e=r(f);return e.json.origins.service.read=!1,e})())],q.prototype,"maxScale",void 0),e([n((()=>{const e=r(c);return e.json.origins.service.read=!1,e})())],q.prototype,"minScale",void 0),e([n({readOnly:!0})],q.prototype,"objectIdField",null),e([n(b)],q.prototype,"opacity",void 0),e([n({readOnly:!0})],q.prototype,"orderBy",null),e([n({readOnly:!0})],q.prototype,"outFields",null),e([n({clonable:!1})],q.prototype,"parent",void 0),e([n({readOnly:!0})],q.prototype,"parsedUrl",null),e([n(O)],q.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:!0}})],q.prototype,"popupTemplate",void 0),e([n({readOnly:!0})],q.prototype,"preferredTimeZone",null),e([n({types:T,json:{origins:{"web-scene":{types:w}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}}}})],q.prototype,"renderer",null),e([n({readOnly:!0})],q.prototype,"returnM",null),e([n({readOnly:!0})],q.prototype,"returnZ",null),e([n({readOnly:!0})],q.prototype,"source",null),e([n({readOnly:!0})],q.prototype,"timeExtent",null),e([n({readOnly:!0})],q.prototype,"timeInfo",null),e([n({readOnly:!0})],q.prototype,"timeOffset",null),e([n({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],q.prototype,"title",void 0),e([n({json:{read:!1}})],q.prototype,"type",void 0),e([n({readOnly:!0})],q.prototype,"typeIdField",null),e([n({readOnly:!0})],q.prototype,"types",null),e([n({readOnly:!0})],q.prototype,"useViewTime",null),e([n({type:Boolean,json:{name:"visibility",write:!0}})],q.prototype,"visible",void 0),q=e([o("esri.layers.catalog.CatalogFootprintLayer")],q);export{q as default};
|