@arcgis/core 4.33.0-next.20250528 → 4.33.0-next.20250529
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{feaf79b69d2e2a1f2aa2.js → 06877ea5b9df7de89aff.js} +1 -1
- package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
- package/assets/esri/core/workers/chunks/{0716b21b1cfb8df066fa.js → 0dbb350ce651bc236ec8.js} +1 -1
- package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
- package/assets/esri/core/workers/chunks/109e5635c1b9a0929d16.js +1 -0
- package/assets/esri/core/workers/chunks/1573c017fd9fc0fe7527.js +1 -0
- package/assets/esri/core/workers/chunks/{0624ae07d3af8d5f1ac8.js → 15b3eb60f86954783fab.js} +1 -1
- package/assets/esri/core/workers/chunks/{b845586219f284a215b2.js → 1db026cc25338dbc208e.js} +1 -1
- package/assets/esri/core/workers/chunks/21de4516bf5c9630edfd.js +1 -0
- package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
- package/assets/esri/core/workers/chunks/2dbd18df5c691c8d0a61.js +1 -0
- package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
- package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
- package/assets/esri/core/workers/chunks/3025e420e13e2bc8c0a1.js +1 -0
- package/assets/esri/core/workers/chunks/32537e2b014bc3d82f5c.js +346 -0
- package/assets/esri/core/workers/chunks/34f55bb89ddf26b10260.js +1 -0
- package/assets/esri/core/workers/chunks/355ab428a04ee9fcf888.js +1 -0
- package/assets/esri/core/workers/chunks/3a6ddff13bd47ed11798.js +1 -0
- package/assets/esri/core/workers/chunks/3a74654fa539f78ceb86.js +1 -0
- package/assets/esri/core/workers/chunks/3bec10a4f01757590c1c.js +1 -0
- package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
- package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
- package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
- package/assets/esri/core/workers/chunks/5222523fff30d07f88de.js +1 -0
- package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
- package/assets/esri/core/workers/chunks/53e8c061f36516c3c3e4.js +1 -0
- package/assets/esri/core/workers/chunks/{ca76950d81ab4ebb65e1.js → 58f403f956b7b3467344.js} +1 -1
- package/assets/esri/core/workers/chunks/5a01bd7a9ee24be7bac4.js +1 -0
- package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
- package/assets/esri/core/workers/chunks/{4dd0a5f327fa5fc7249d.js → 5ef1095842e21090f1f4.js} +1 -1
- package/assets/esri/core/workers/chunks/604d7250ed5e1edd59ac.js +1 -0
- package/assets/esri/core/workers/chunks/614bc3f05873b37af091.js +1 -0
- package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
- package/assets/esri/core/workers/chunks/66e4cb2479bed1384ed5.js +1 -0
- package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
- package/assets/esri/core/workers/chunks/7112b092d98172b7db8b.js +1 -0
- package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
- package/assets/esri/core/workers/chunks/74d18c22fa1c178bd9df.js +1 -0
- package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
- package/assets/esri/core/workers/chunks/{cdb022ffffc6554de83a.js → 77dbb1d5d5e1a6ced932.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
- package/assets/esri/core/workers/chunks/7a55e9cf27089ee1ef1f.js +1 -0
- package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
- package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
- package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
- package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
- package/assets/esri/core/workers/chunks/8249b5de5c15461a6787.js +1 -0
- package/assets/esri/core/workers/chunks/8385c13ac10e595374cb.js +1 -0
- package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
- package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
- package/assets/esri/core/workers/chunks/8b86c75426c55b29ebed.js +1 -0
- package/assets/esri/core/workers/chunks/8c4b26d86483646c70d2.js +1 -0
- package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
- package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
- package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +1 -0
- package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
- package/assets/esri/core/workers/chunks/b534a8d70018ce16400b.js +1 -0
- package/assets/esri/core/workers/chunks/b763292829aa4d3fab60.js +1 -0
- package/assets/esri/core/workers/chunks/{54ea93f416ab52b413c1.js → b9f93c233c55bb528412.js} +1 -1
- package/assets/esri/core/workers/chunks/c3d95f7f4370486eed2c.js +1 -0
- package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
- package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
- package/assets/esri/core/workers/chunks/c9fbada1e84981784f6c.js +1 -0
- package/assets/esri/core/workers/chunks/cefcecbeef4f0a46f58c.js +1 -0
- package/assets/esri/core/workers/chunks/d2317b87aa2ac3ad97a6.js +1 -0
- package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
- package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
- package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
- package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
- package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
- package/assets/esri/core/workers/chunks/f0e7ca92f6d4d994337f.js +1 -0
- package/assets/esri/core/workers/chunks/f1e87720b425d7fb348a.js +1 -0
- package/assets/esri/core/workers/chunks/fd207a40faf882d3b2a3.js +1 -0
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/chunks/aiServices.js +1 -1
- package/interfaces.d.ts +33 -42
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/support/BuildingSummaryStatistics.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/featurePopupQueryUtils.js +5 -0
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/multiLayerServiceUtils.js +5 -0
- package/package.json +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
- package/views/SelectionManager.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/webdoc/support/writeUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/03db109e9b695528c35d.js +0 -1
- package/assets/esri/core/workers/chunks/09da6b3085fc84cd69d5.js +0 -1
- package/assets/esri/core/workers/chunks/09f76ca9b47b465c934f.js +0 -1
- package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
- package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
- package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
- package/assets/esri/core/workers/chunks/0d78fc2c2bc1152f84db.js +0 -1
- package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +0 -1
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
- package/assets/esri/core/workers/chunks/1ee6e9a88f0676032e91.js +0 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
- package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
- package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
- package/assets/esri/core/workers/chunks/3027eb0c20e996ad374a.js +0 -1
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
- package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
- package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
- package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
- package/assets/esri/core/workers/chunks/42bb9bb6fe44a47d9b81.js +0 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
- package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
- package/assets/esri/core/workers/chunks/51ba7345c31e6eb79060.js +0 -1
- package/assets/esri/core/workers/chunks/52a57106a41b8c9483d7.js +0 -1
- package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
- package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
- package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
- package/assets/esri/core/workers/chunks/61f9747c960d959b571b.js +0 -346
- package/assets/esri/core/workers/chunks/6408b7845858cf18102f.js +0 -1
- package/assets/esri/core/workers/chunks/74c0db9e3a62e9839b23.js +0 -1
- package/assets/esri/core/workers/chunks/7b12607633bbdc318936.js +0 -1
- package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
- package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
- package/assets/esri/core/workers/chunks/8aa8f9986b966ccb64e2.js +0 -1
- package/assets/esri/core/workers/chunks/8d14e957219364a81d5f.js +0 -66
- package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
- package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
- package/assets/esri/core/workers/chunks/a32dcd5bc4680374d30c.js +0 -1
- package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
- package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +0 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
- package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
- package/assets/esri/core/workers/chunks/cc4fe89e4f604e3c52ae.js +0 -1
- package/assets/esri/core/workers/chunks/cc9dd8924bfeb8bcd278.js +0 -1
- package/assets/esri/core/workers/chunks/d3c0d7799c92c6f0e7d3.js +0 -1
- package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
- package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
- package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
- package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
- package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
- package/assets/esri/core/workers/chunks/f00f8609bf0d14b488b8.js +0 -1
- package/assets/esri/core/workers/chunks/f1c6df5cf2ccb6ac47a1.js +0 -1
- package/assets/esri/core/workers/chunks/f3d97a4c4f433adbdab5.js +0 -1
- package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
package/layers/VideoLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import l from"../core/Error.js";import i from"../core/Logger.js";import{clamp as s}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{watch as a,initial as p,whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import c from"../geometry/Extent.js";import h from"../geometry/Polyline.js";import f from"../geometry/SpatialReference.js";import v from"./Layer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{parse as j}from"./support/arcgisLayerUrl.js";import{url as b}from"./support/commonProperties.js";import T from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as C}from"./support/serviceCapabilitiesUtils.js";import w from"./support/TelemetryData.js";import x from"./support/TelemetryDisplay.js";import I from"./support/VideoFrame.js";import L from"./support/VideoTimeExtent.js";import U from"./video/VideoController.js";import{getFrameHorizonPoints as E,getGroundControlPoints as N,getTelemetryData as P,getServiceLayersInfo as J,getSensorTrailPoints as M,readVideoTimeExtent as R}from"./video/videoUtils.js";import k from"../symbols/SimpleFillSymbol.js";import H from"../symbols/SimpleLineSymbol.js";import V from"../symbols/SimpleMarkerSymbol.js";let z=[];const F=new t([255,127,0]),q=new t([0,0,0,.05]),D=new V({angle:0,color:F,size:10,style:"cross"}),G=new k({color:q,outline:new H({color:F,width:2})}),_=new H({color:F,width:1}),B=new V({angle:0,color:F,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),W=new H({color:F,width:1});let A=class extends(g(O(n(S(v))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new U,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=D.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=G.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=B.clone(),this.sensorSightLineSymbol=_.clone(),this.sensorTrailSymbol=W.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=f.WGS84,this.start=0,this.telemetryDisplay=null,this.telemetryColor=F,this.title=null,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.telemetryDisplay=new x({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),p)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return C(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return E(this.metadata)}get groundControlPoints(){return N(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return P(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return J(t)}get videoTimeExtent(){return o(i.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=s(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const t=j(this.parsedUrl?.path);if(null==t)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let o=null;const{data:i,ssl:s}=await r(t.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e}),n=i;if(this.url=t.url.path,s&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=t?.sublayer;if(null==a&&n.layers?.length&&(a=n.layers[0].id),null==a)throw new l("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${t.url.path}/${a}`,o=await r(this.url,{query:{f:"json",...this.customParameters},signal:e});const p={...n,...o.data};this.sourceJSON=p,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=M(e,z);z=[...t];const r=z.map((e=>e.toArray())),o=new h({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([y()],A.prototype,"autoplay",null),e([y({readOnly:!0})],A.prototype,"buffered",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"capabilities",void 0),e([m("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],A.prototype,"readCapabilitiesFromService",null),e([y({readOnly:!0})],A.prototype,"codecs",void 0),e([y({readOnly:!0})],A.prototype,"connectionInfo",void 0),e([m("connectionInfo",["connectionUrl"])],A.prototype,"readConnectionInfo",null),e([y()],A.prototype,"controller",void 0),e([y({type:String})],A.prototype,"copyright",void 0),e([y({readOnly:!0,type:Date})],A.prototype,"created",void 0),e([y({type:Number})],A.prototype,"currentTime",null),e([y({type:String})],A.prototype,"description",void 0),e([y({type:Number})],A.prototype,"duration",null),e([y({readOnly:!0})],A.prototype,"elevationSource",void 0),e([y({type:Boolean})],A.prototype,"ended",null),e([y({type:I})],A.prototype,"frame",void 0),e([y()],A.prototype,"frameCenterSymbol",void 0),e([y({readOnly:!0,type:Number})],A.prototype,"frameCount",void 0),e([y()],A.prototype,"frameEffect",void 0),e([y()],A.prototype,"frameOpacity",void 0),e([y()],A.prototype,"frameOutlineSymbol",void 0),e([y({type:c})],A.prototype,"fullExtent",void 0),e([y({readOnly:!0})],A.prototype,"frameHorizonPoints",null),e([y({readOnly:!0,nonNullable:!1,json:{read:{reader:R,source:"time"}},type:L})],A.prototype,"fullTimeExtent",void 0),e([y({readOnly:!0})],A.prototype,"groundControlPoints",null),e([y({type:c})],A.prototype,"initialExtent",void 0),e([y({readOnly:!0})],A.prototype,"isLive",null),e([y({readOnly:!0,json:{read:{source:"id"}}})],A.prototype,"layerId",void 0),e([y({readOnly:!0})],A.prototype,"livestreamStatus",null),e([y({type:Boolean})],A.prototype,"loop",null),e([y({readOnly:!0})],A.prototype,"metadata",null),e([y({readOnly:!0})],A.prototype,"mimeType",null),e([y({type:Boolean})],A.prototype,"muted",null),e([y({type:T})],A.prototype,"playbackInfo",void 0),e([y({type:Number})],A.prototype,"playbackRate",null),e([y({readOnly:!0,type:String})],A.prototype,"playerUrl",null),e([y({readOnly:!0})],A.prototype,"playing",null),e([y({readOnly:!0,json:{read:{source:"poster"}}})],A.prototype,"posterUrl",void 0),e([y({readOnly:!0})],A.prototype,"qualities",void 0),e([y()],A.prototype,"sensorSymbol",void 0),e([y()],A.prototype,"sensorSightLineSymbol",void 0),e([y()],A.prototype,"sensorTrailSymbol",void 0),e([y({readOnly:!0})],A.prototype,"serviceItemId",void 0),e([y()],A.prototype,"sourceJSON",void 0),e([y({readOnly:!0})],A.prototype,"sourceQuality",void 0),e([y({readOnly:!0,json:{name:"serviceType"}})],A.prototype,"sourceType",void 0),e([y()],A.prototype,"spatialReference",void 0),e([y()],A.prototype,"start",void 0),e([y({readOnly:!0})],A.prototype,"started",null),e([y({readOnly:!0,type:String})],A.prototype,"state",null),e([y({readOnly:!0,type:w})],A.prototype,"telemetry",null),e([y({type:x})],A.prototype,"telemetryDisplay",void 0),e([y({type:t})],A.prototype,"telemetryColor",void 0),e([y({readOnly:!1,json:{read:{source:"name"}}})],A.prototype,"title",void 0),e([y({readOnly:!0})],A.prototype,"type",void 0),e([y(b)],A.prototype,"url",void 0),e([y({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],A.prototype,"version",void 0),e([y({readOnly:!0})],A.prototype,"videoElement",null),e([y({readOnly:!0})],A.prototype,"videoHeight",null),e([y({readOnly:!0,json:{read:!1}})],A.prototype,"videoLayersInfo",void 0),e([m("service","videoLayersInfo",["id","name","poster","serviceType","type"])],A.prototype,"readLayerInfosFromService",null),e([y({type:L,nonNullable:!1,readOnly:!0})],A.prototype,"videoTimeExtent",null),e([y({readOnly:!0})],A.prototype,"videoWidth",null),e([y()],A.prototype,"volume",null),e([y({readOnly:!0})],A.prototype,"waiting",null),A=e([d("esri.layers.VideoLayer")],A);const Q=A;export{Q as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as a,initial as y,whenOnce as m}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import v from"../geometry/Polyline.js";import g from"../geometry/SpatialReference.js";import S from"./Layer.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as O,effectProperty as b}from"./mixins/BlendLayer.js";import{CustomParametersMixin as T}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{opacity as x,id as U}from"./support/commonProperties.js";import{normalizeParsedUrlObject as P,urlProperty as E}from"./support/multiLayerServiceUtils.js";import N from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as M}from"./support/serviceCapabilitiesUtils.js";import k from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import F from"./support/VideoFrame.js";import R from"./support/VideoTimeExtent.js";import J from"./video/VideoController.js";import{getFrameHorizonPoints as G,getGroundControlPoints as H,getTelemetryData as z,getServiceLayersInfo as A,getSensorTrailPoints as q,readVideoTimeExtent as D}from"./video/videoUtils.js";import _ from"../symbols/CIMSymbol.js";import B from"../symbols/PictureMarkerSymbol.js";import W from"../symbols/SimpleFillSymbol.js";import Q from"../symbols/SimpleLineSymbol.js";import Z from"../symbols/SimpleMarkerSymbol.js";import K from"../symbols/Symbol.js";import{write as X}from"../symbols/support/jsonUtils.js";function Y(e,t){return{ignoreOrigin:this.originIdOf(t)<h.PORTAL_ITEM}}let $=[];const ee=new t([255,127,0]),te=new t([0,0,0,.05]),re=new Z({angle:0,color:ee,size:10,style:"cross"}),oe=new W({color:te,outline:new Q({color:ee,width:2})}),ie=new Q({color:ee,width:1}),se=new Z({angle:0,color:ee,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),le=new Q({color:ee,width:1}),ne={types:{base:K,key:"type",typeMap:{"simple-marker":Z,"picture-marker":B,cim:_}},json:{write:{writer:X,overridePolicy:Y}}};let pe=class extends(O(L(j(w(I(n(T(S)))))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new J,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=re.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=oe.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=se.clone(),this.sensorSightLineSymbol=ie.clone(),this.sensorTrailSymbol=le.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=g.WGS84,this.start=0,this.telemetryDisplay=new V,this.telemetryColor=ee,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),y)]),m((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!1},e).catch(p).then((()=>this._fetchService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return M(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return G(this.metadata)}get groundControlPoints(){return H(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return P(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return A(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=q(e,$);$=[...t];const r=$.map((e=>e.toArray())),o=new v({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"autoplay",null),e([u({readOnly:!0})],pe.prototype,"buffered",null),e([u({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),e([d("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],pe.prototype,"codecs",void 0),e([u({readOnly:!0})],pe.prototype,"connectionInfo",void 0),e([d("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),e([u()],pe.prototype,"controller",void 0),e([u({type:String})],pe.prototype,"copyright",void 0),e([u({readOnly:!0,type:Date})],pe.prototype,"created",void 0),e([u({type:Number})],pe.prototype,"currentTime",null),e([u({type:String})],pe.prototype,"description",void 0),e([u({type:Number})],pe.prototype,"duration",null),e([u({readOnly:!0})],pe.prototype,"elevationSource",void 0),e([u({type:Boolean})],pe.prototype,"ended",null),e([u({type:F})],pe.prototype,"frame",void 0),e([u()],pe.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),e([u(b)],pe.prototype,"frameEffect",void 0),e([u(x)],pe.prototype,"frameOpacity",void 0),e([u()],pe.prototype,"frameOutlineSymbol",void 0),e([u({type:f})],pe.prototype,"fullExtent",void 0),e([u({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:D,source:"time"}},type:R})],pe.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],pe.prototype,"groundControlPoints",null),e([u(U)],pe.prototype,"id",void 0),e([u({type:f})],pe.prototype,"initialExtent",void 0),e([u({readOnly:!0})],pe.prototype,"isLive",null),e([u({type:Number,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],pe.prototype,"layerId",void 0),e([u({readOnly:!0})],pe.prototype,"livestreamStatus",null),e([u({type:Boolean})],pe.prototype,"loop",null),e([u({readOnly:!0})],pe.prototype,"metadata",null),e([u({readOnly:!0})],pe.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],pe.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],pe.prototype,"parsedUrl",null),e([u({type:N})],pe.prototype,"playbackInfo",void 0),e([u({type:Number})],pe.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],pe.prototype,"playerUrl",null),e([u({readOnly:!0})],pe.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),e([u({readOnly:!0})],pe.prototype,"qualities",void 0),e([u(ne)],pe.prototype,"sensorSymbol",void 0),e([u()],pe.prototype,"sensorSightLineSymbol",void 0),e([u()],pe.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],pe.prototype,"serviceItemId",void 0),e([u()],pe.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],pe.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),e([u()],pe.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],pe.prototype,"start",void 0),e([u({readOnly:!0})],pe.prototype,"started",null),e([u({readOnly:!0,type:String})],pe.prototype,"state",null),e([u({readOnly:!0,type:k})],pe.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"telemetryDisplay",void 0),e([u({type:t,json:{write:{overridePolicy:Y}}})],pe.prototype,"telemetryColor",void 0),e([d("service","title",["name"])],pe.prototype,"readTitleFromService",null),e([u({readOnly:!0})],pe.prototype,"type",void 0),e([u(E())],pe.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],pe.prototype,"version",void 0),e([u({readOnly:!0})],pe.prototype,"videoElement",null),e([u({readOnly:!0})],pe.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),e([d("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),e([u({type:R,readOnly:!0})],pe.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],pe.prototype,"videoWidth",null),e([u()],pe.prototype,"volume",null),e([u({readOnly:!0})],pe.prototype,"waiting",null),pe=e([c("esri.layers.VideoLayer")],pe);const ae=pe;export{ae as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../request.js";import s from"../../core/Error.js";import{JSONMap as i}from"../../core/jsonMap.js";import a from"../../core/Loadable.js";import n from"../../core/Logger.js";import p from"../../core/Promise.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as u}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as y}from"../../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../geometry/Extent.js";import m from"../../geometry/SpatialReference.js";import h from"../FeatureLayer.js";import f from"./BuildingSublayer.js";import{zeroCapabilities as g}from"../support/capabilities.js";import{popupEnabled as j}from"../support/commonProperties.js";import{getFieldDomain as v}from"../support/featureLayerUtils.js";import{defineFieldProperties as L}from"../support/fieldProperties.js";import b from"../support/FieldsIndex.js";import{unpackFieldNames as I}from"../support/fieldUtils.js";import{fetchIndexInfo as S}from"../support/I3SIndexInfo.js";import{I3SNodePageDefinition as F,I3SMaterialDefinition as w,I3STextureSetDefinition as O,I3SGeometryDefinition as x}from"../support/I3SLayerDefinitions.js";import{webSceneRendererTypes as P}from"../../renderers/support/typeUtils.js";import q from"../../rest/support/Query.js";import{isNumber as T}from"../../support/guards.js";import{createPopupTemplate as Q}from"../../support/popupUtils.js";import U from"../../symbols/support/ElevationInfo.js";import{queryAttributesFromCachedAttributesId as E}from"../../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as D,getFetchPopupTemplate as R}from"../../views/layers/support/popupUtils.js";const A=L();let _=class extends(a.LoadableMixin(p.EsriPromiseMixin(f))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new b(this.fields)}readAssociatedLayer(e,t){const r=this.layer.associatedFeatureServiceItem,o=t.associatedLayerID;return null!=r&&"number"==typeof o?new h({portalItem:r,customParameters:this.customParameters,layerId:o}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return""}get displayField(){return null!=this.associatedLayer?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const t=null!=e?e.signal:null,r=this._fetchService(t).then((()=>{this.indexInfo=S(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,n.getLogger(this),t)}));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){return Q(this,e)}async _fetchService(e){const t=(await o(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl})}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&&null!=this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return null!=this.associatedLayer?this.associatedLayer.types??[]:[]}get typeIdField(){return null!=this.associatedLayer?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=null!=this.associatedLayer&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:g,{query:t,operations:{supportsQuery:r},data:{supportsZ:o,supportsM:s,isVersioned:i}}=e;return{query:t,operations:{supportsQuery:r},data:{supportsZ:o,supportsM:s,isVersioned:i}}}createQuery(){const e=new q;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this.layer,t.sourceLayer=this;return e}))}async queryObjectIds(e,t){const r=await this._getAssociatedLayerForQuery();return(await r.queryObjectIds(e||this.createQuery(),t)).filter(T)}async queryCachedAttributes(e,t){const r=I(this.fieldsIndex,await D(this,R(this)));return E(this.parsedUrl.path,this.attributeStorageInfo,e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||0===o.length)throw new s("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new t({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:null!=this.associatedLayer}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return null!=e&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),null==this.associatedLayer)throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};e([l({readOnly:!0})],_.prototype,"parsedUrl",null),e([l({type:F,readOnly:!0})],_.prototype,"nodePages",void 0),e([l({type:[w],readOnly:!0})],_.prototype,"materialDefinitions",void 0),e([l({type:[O],readOnly:!0})],_.prototype,"textureSetDefinitions",void 0),e([l({type:[x],readOnly:!0})],_.prototype,"geometryDefinitions",void 0),e([l({readOnly:!0})],_.prototype,"serviceUpdateTimeStamp",void 0),e([l({readOnly:!0})],_.prototype,"store",void 0),e([l({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],_.prototype,"rootNode",void 0),e([l({readOnly:!0})],_.prototype,"attributeStorageInfo",void 0),e([l(A.fields)],_.prototype,"fields",void 0),e([l({readOnly:!0})],_.prototype,"fieldsIndex",null),e([l({readOnly:!0,type:h})],_.prototype,"associatedLayer",void 0),e([y("service","associatedLayer",["associatedLayerID"])],_.prototype,"readAssociatedLayer",null),e([l(A.outFields)],_.prototype,"outFields",void 0),e([l({type:String,readOnly:!0})],_.prototype,"objectIdField",null),e([l({readOnly:!0,type:String,json:{read:!1}})],_.prototype,"displayField",null),e([l({readOnly:!0,type:String})],_.prototype,"apiKey",null),e([l({readOnly:!0,type:String})],_.prototype,"customParameters",null),e([l({readOnly:!0,type:c})],_.prototype,"fullExtent",null),e([l({readOnly:!0,type:m})],_.prototype,"spatialReference",null),e([l({readOnly:!0})],_.prototype,"version",null),e([l({readOnly:!0,type:U})],_.prototype,"elevationInfo",null),e([l({readOnly:!0,type:Number})],_.prototype,"minScale",null),e([l({readOnly:!0,type:Number})],_.prototype,"maxScale",null),e([l({readOnly:!0,type:Number})],_.prototype,"effectiveScaleRange",null),e([l({type:["hide","show"],json:{write:!0}})],_.prototype,"listMode",void 0),e([l({types:P,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_.prototype,"renderer",void 0),e([l({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([l(j)],_.prototype,"popupEnabled",void 0),e([l({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],_.prototype,"popupTemplate",void 0),e([l({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_.prototype,"normalReferenceFrame",void 0),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"defaultPopupTemplate",null),e([l()],_.prototype,"types",null),e([l()],_.prototype,"typeIdField",null),e([l({json:{write:!1}}),u(new i({"3DObject":"3d-object",Point:"point"}))],_.prototype,"layerType",void 0),e([l()],_.prototype,"geometryType",null),e([l()],_.prototype,"profile",null),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"capabilities",null),e([l({readOnly:!0})],_.prototype,"statisticsInfo",void 0),_=e([d("esri.layers.buildingSublayers.BuildingComponentSublayer")],_);const C=_;export{C as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../request.js";import s from"../../core/Error.js";import{JSONMap as i}from"../../core/jsonMap.js";import a from"../../core/Loadable.js";import n from"../../core/Logger.js";import p from"../../core/Promise.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as u}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as y}from"../../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../geometry/Extent.js";import m from"../../geometry/SpatialReference.js";import h from"../FeatureLayer.js";import f from"./BuildingSublayer.js";import{zeroCapabilities as g}from"../support/capabilities.js";import{popupEnabled as j}from"../support/commonProperties.js";import{getFieldDomain as b}from"../support/featureLayerUtils.js";import{defineFieldProperties as v}from"../support/fieldProperties.js";import L from"../support/FieldsIndex.js";import{unpackFieldNames as I}from"../support/fieldUtils.js";import{fetchIndexInfo as S}from"../support/I3SIndexInfo.js";import{I3SNodePageDefinition as F,I3SMaterialDefinition as w,I3STextureSetDefinition as O,I3SGeometryDefinition as x}from"../support/I3SLayerDefinitions.js";import{webSceneRendererTypes as P}from"../../renderers/support/typeUtils.js";import q from"../../rest/support/Query.js";import{isNumber as T}from"../../support/guards.js";import{createPopupTemplate as Q}from"../../support/popupUtils.js";import U from"../../symbols/support/ElevationInfo.js";import{queryAttributesFromCachedAttributesId as E}from"../../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as D,getFetchPopupTemplate as R}from"../../views/layers/support/popupUtils.js";const A=v();let _=class extends(a.LoadableMixin(p.EsriPromiseMixin(f))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new L(this.fields)}readAssociatedLayer(e,t){const r=this.layer.associatedFeatureServiceItem,o=t.associatedLayerID;return null!=r&&"number"==typeof o?new h({portalItem:r,customParameters:this.customParameters,layerId:o}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return""}get globalIdField(){if(null!=this.fields)for(const e of this.fields)if("global-id"===e.type)return e.name;return""}get displayField(){return null!=this.associatedLayer?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const t=null!=e?e.signal:null,r=this._fetchService(t).then((()=>{this.indexInfo=S(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,n.getLogger(this),t)}));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){return Q(this,e)}async _fetchService(e){const t=(await o(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?b(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&null!=this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return null!=this.associatedLayer?this.associatedLayer.types??[]:[]}get typeIdField(){return null!=this.associatedLayer?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=null!=this.associatedLayer&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:g,{query:t,operations:{supportsQuery:r},data:{supportsZ:o,supportsM:s,isVersioned:i}}=e;return{query:t,operations:{supportsQuery:r},data:{supportsZ:o,supportsM:s,isVersioned:i}}}createQuery(){const e=new q;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this.layer,t.sourceLayer=this;return e}))}async queryObjectIds(e,t){const r=await this._getAssociatedLayerForQuery();return(await r.queryObjectIds(e||this.createQuery(),t)).filter(T)}async queryCachedAttributes(e,t){const r=I(this.fieldsIndex,await D(this,R(this)));return E(this.parsedUrl.path,this.attributeStorageInfo,e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||0===o.length)throw new s("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new t({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:null!=this.associatedLayer}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return null!=e&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),null==this.associatedLayer)throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new s("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};e([l({readOnly:!0})],_.prototype,"parsedUrl",null),e([l({type:F,readOnly:!0})],_.prototype,"nodePages",void 0),e([l({type:[w],readOnly:!0})],_.prototype,"materialDefinitions",void 0),e([l({type:[O],readOnly:!0})],_.prototype,"textureSetDefinitions",void 0),e([l({type:[x],readOnly:!0})],_.prototype,"geometryDefinitions",void 0),e([l({readOnly:!0})],_.prototype,"serviceUpdateTimeStamp",void 0),e([l({readOnly:!0})],_.prototype,"store",void 0),e([l({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],_.prototype,"rootNode",void 0),e([l({readOnly:!0})],_.prototype,"attributeStorageInfo",void 0),e([l(A.fields)],_.prototype,"fields",void 0),e([l({readOnly:!0})],_.prototype,"fieldsIndex",null),e([l({readOnly:!0,type:h})],_.prototype,"associatedLayer",void 0),e([y("service","associatedLayer",["associatedLayerID"])],_.prototype,"readAssociatedLayer",null),e([l(A.outFields)],_.prototype,"outFields",void 0),e([l({type:String,readOnly:!0})],_.prototype,"objectIdField",null),e([l({type:String,readOnly:!0})],_.prototype,"globalIdField",null),e([l({readOnly:!0,type:String,json:{read:!1}})],_.prototype,"displayField",null),e([l({readOnly:!0,type:String})],_.prototype,"apiKey",null),e([l({readOnly:!0,type:String})],_.prototype,"customParameters",null),e([l({readOnly:!0,type:c})],_.prototype,"fullExtent",null),e([l({readOnly:!0,type:m})],_.prototype,"spatialReference",null),e([l({readOnly:!0})],_.prototype,"version",null),e([l({readOnly:!0,type:U})],_.prototype,"elevationInfo",null),e([l({readOnly:!0,type:Number})],_.prototype,"minScale",null),e([l({readOnly:!0,type:Number})],_.prototype,"maxScale",null),e([l({readOnly:!0,type:Number})],_.prototype,"effectiveScaleRange",null),e([l({type:["hide","show"],json:{write:!0}})],_.prototype,"listMode",void 0),e([l({types:P,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_.prototype,"renderer",void 0),e([l({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([l(j)],_.prototype,"popupEnabled",void 0),e([l({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],_.prototype,"popupTemplate",void 0),e([l({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_.prototype,"normalReferenceFrame",void 0),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"defaultPopupTemplate",null),e([l()],_.prototype,"types",null),e([l()],_.prototype,"typeIdField",null),e([l({json:{write:!1}}),u(new i({"3DObject":"3d-object",Point:"point"}))],_.prototype,"layerType",void 0),e([l()],_.prototype,"geometryType",null),e([l()],_.prototype,"profile",null),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"capabilities",null),e([l({readOnly:!0})],_.prototype,"statisticsInfo",void 0),_=e([d("esri.layers.buildingSublayers.BuildingComponentSublayer")],_);const C=_;export{C as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};function Se(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Se,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONMixin as o}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as ie,fixTimeInfoFields as oe}from"../support/fieldUtils.js";import se from"../support/LabelClass.js";import{reader as ne}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...o,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Te.call(this,e,t)}),i}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(o(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){ie(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const i=le(I(g.toJSON(this.geometryType)).renderer);return he(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=ue.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return o.features.forEach((e=>{e.sourceLayer=this})),o}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),s=await o.executeQueryForExtent(i.toJSON(),t?.signal);let n;return n=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new l(s.extent):new l,{count:s.count,extent:n}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>oe(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await d(i.spatialReference,f),r.geometry=h(i instanceof u||i instanceof m||i instanceof y?i:i.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function Se(e,t,r){const o=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of o)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(s){i.getLogger(this).warn("Error updating labelingInfo",s)}return ne(e,t,r)}e([s(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([s()],Ie.prototype,"capabilities",void 0),e([s({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([s({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([s()],Ie.prototype,"displayField",void 0),e([s(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([s(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([s(fe(r(J)))],Ie.prototype,"effect",void 0),e([s()],Ie.prototype,"elevationInfo",void 0),e([s(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([s(fe(r(te)))],Ie.prototype,"featureReduction",null),e([s()],Ie.prototype,"fields",null),e([s()],Ie.prototype,"geometryType",null),e([s()],Ie.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([s()],Ie.prototype,"hasM",null),e([s()],Ie.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([s({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Se,write:be()}})],Ie.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([s(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([s(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([s(fe(r(X)))],Ie.prototype,"minScale",void 0),e([s()],Ie.prototype,"objectIdField",void 0),e([s()],Ie.prototype,"objectType",void 0),e([s(fe(r($)))],Ie.prototype,"opacity",void 0),e([s(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([s({clonable:!1})],Ie.prototype,"parent",void 0),e([s()],Ie.prototype,"parentCompositeLayer",void 0),e([s(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([s({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([s()],Ie.prototype,"source",void 0),e([s()],Ie.prototype,"spatialReference",null),e([s({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([s({json:{read:!1}})],Ie.prototype,"type",void 0),e([s(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([n("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import b from"../support/RasterFunction.js";import R from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as w,isMultiSliceOrRangeDefinition as v,convertOleDateTimeToEpoch as F,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as q,normalizeRendererJSON as L}from"../../renderers/support/rasterRendererHelper.js";import k from"../../renderers/support/RasterSymbolizer.js";import{websceneRasterRendererTypes as B,rasterRendererTypes as A,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;if(!s.spatialReference.equals(a)){await T();const e="extent"===s.type?O(s,a):z(s,a);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new u({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:m,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(m,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=w(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return R.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(v(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");const o=this.serviceRasterInfo?.storageInfo.isBsqTile&&this.bandIds?.length?this.bandIds:void 0;return r.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(F(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new u({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new u({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,m=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<m;e++){const r=new u({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=w(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??q(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=L({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new k({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=q(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:b})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:R})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([m("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import b from"../support/RasterFunction.js";import R from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as v,isMultiSliceOrRangeDefinition as w,convertOleDateTimeToEpoch as F,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as q,normalizeRendererJSON as L}from"../../renderers/support/rasterRendererHelper.js";import k from"../../renderers/support/RasterSymbolizer.js";import{websceneRasterRendererTypes as B,rasterRendererTypes as A,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;if(!s.spatialReference.equals(a)){await T();const e="extent"===s.type?O(s,a):z(s,a);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new u({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:m,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(m,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=v(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return R.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!(!w(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");const o=this.serviceRasterInfo?.storageInfo.isBsqTile&&this.bandIds?.length?this.bandIds:void 0;return r.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(F(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new u({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new u({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,m=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<m;e++){const r=new u({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=v(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??q(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=L({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new k({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=q(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:b})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:R})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([m("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WCS:async()=>(await import("../WCSLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,SubtypeGroupTable:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default,Object3DTilesLayer:()=>Promise.resolve(null)};export{a as typeModuleMap};
|
|
5
|
+
const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,ArcGISVideoLayer:async()=>(await import("../VideoLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WCS:async()=>(await import("../WCSLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,SubtypeGroupTable:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default,Object3DTilesLayer:()=>Promise.resolve(null)};export{a as typeModuleMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},a={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},S={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,Object3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0,WCS:!0},"portal-item/tables":{ArcGISFeatureLayer:!0,SubtypeGroupTable:!0}};export{S as supportedTypes};
|
|
5
|
+
const e={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,ArcGISVideoLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},r={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},a={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},S={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,Object3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WCS:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WCS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":e,"web-map/basemap":r,"web-map/tables":a,"link-chart/operational-layers":{...e,LinkChartLayer:!0},"link-chart/basemap":r,"link-chart/tables":a,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0,WCS:!0},"portal-item/tables":{ArcGISFeatureLayer:!0,SubtypeGroupTable:!0}};export{S as supportedTypes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../request.js";import r from"../../core/JSONSupport.js";import s from"../../core/Loadable.js";import o from"../../core/Logger.js";import i from"../../core/Promise.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends r{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([l({type:String})],p.prototype,"fieldName",void 0),t([l({type:String})],p.prototype,"modelName",void 0),t([l({type:String})],p.prototype,"label",void 0),t([l({type:Number})],p.prototype,"min",void 0),t([l({type:Number})],p.prototype,"max",void 0),t([l({json:{read:t=>Array.isArray(t)&&(t.every((t=>"string"==typeof t))||t.every((t=>"number"==typeof t)))?t.slice():null}})],p.prototype,"mostFrequentValues",void 0),t([l({type:[Number]})],p.prototype,"subLayerIds",void 0),p=t([a("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],p);let n=class extends(s.LoadableMixin(i.EsriPromiseMixin(r))){constructor(t){super(t),this.url=null,this.customParameters=null}get fields(){return this.loaded||"loading"===this.loadStatus?this._get("fields"):(o.getLogger(this).error("building summary statistics are not loaded"),null)}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._fetchService(e)),Promise.resolve(this)}async _fetchService(t){const r=(await e(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(r,{origin:"service"})}};t([l({constructOnly:!0,type:String})],n.prototype,"url",void 0),t([l({constructOnly:!0})],n.prototype,"customParameters",void 0),t([l({constructOnly:!0})],n.prototype,"apiKey",void 0),t([l({readOnly:!0,type:[p],json:{read:{source:"summary"}}})],n.prototype,"fields",null),n=t([a("esri.layers.support.BuildingSummaryStatistics")],n);export{n as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Clonable.js";import e from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";const i={type:Boolean,json:{write:!0}};let p=class extends(r.ClonableMixin(e)){constructor(o){super(o),this.frame=!1,this.frameCenter=!1,this.frameOutline=!0,this.lineOfSight=!0,this.sensorLocation=!0,this.sensorTrail=!0}};o([t(i)],p.prototype,"frame",void 0),o([t(i)],p.prototype,"frameCenter",void 0),o([t(i)],p.prototype,"frameOutline",void 0),o([t(i)],p.prototype,"lineOfSight",void 0),o([t(i)],p.prototype,"sensorLocation",void 0),o([t(i)],p.prototype,"sensorTrail",void 0),p=o([s("esri.layers.support.TelemetryDisplay")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{featureHasFields as o,extractSubstitutionTemplatesFromString as n}from"./fieldUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";const p="relationships/",c="expression/";let d=class extends t{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){if(this.expressionsUsedInTitle.length>0){return this._get("_arcadeTask")||s((()=>l()))}return null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??import("../../widgets/Feature/support/featureUtils.js").then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new i;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const s=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(s.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:s,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(s,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const s of this.calculatedExpressions?.toArray()??[])try{const t=this._arcadeTask.value.arcade.extractFieldLiterals(s.syntax);for(const s of t){const t=s.split("."),i=this.fieldsIndex.get(t.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const s of t){const t=this.fieldsIndex.get(s);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,s){try{const{attributes:i}=t,r=s?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:a}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(s.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const s=this._createFormattedAttributes(e,t,r).global;return a({attributes:i,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:s,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const s=t.getObjectId();if(null==s)return t;if(!o(this.requiredFields
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{featureHasFields as o,extractSubstitutionTemplatesFromString as n}from"./fieldUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";const p="relationships/",c="expression/";let d=class extends t{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){if(this.expressionsUsedInTitle.length>0){return this._get("_arcadeTask")||s((()=>l()))}return null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??import("../../widgets/Feature/support/featureUtils.js").then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new i;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const s=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(s.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:s,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(s,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const s of this.calculatedExpressions?.toArray()??[])try{const t=this._arcadeTask.value.arcade.extractFieldLiterals(s.syntax);for(const s of t){const t=s.split("."),i=this.fieldsIndex.get(t.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const s of t){const t=this.fieldsIndex.get(s);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,s){try{const{attributes:i}=t,r=s?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:a}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(s.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const s=this._createFormattedAttributes(e,t,r).global;return a({attributes:i,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:s,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const s=t.getObjectId();if(null==s)return t;if(!o(t,this.requiredFields)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[s];const i=await e.queryFeatures(t);if(1===i?.features.length)return i.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const s of e){if(!s.fieldName)continue;const e=this.fieldsIndex.get(s.fieldName),i=e?.name??s.fieldName;s.fieldName=i,t.set(i.toLowerCase(),s)}return t}_createFormattedAttributes(e,t,s="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],r={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const s=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{r[`expression/${e.name}`]=e.func({vars:{$feature:s}})}catch{}}const a={...t.attributes,...r};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:a,graphic:t,timeZone:s,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return n(e).filter((e=>!(0===e.indexOf(p)||0===e.indexOf(c))))}};e([r({readOnly:!0})],d.prototype,"_arcadeTask",null),e([r()],d.prototype,"_featureUtils",void 0),e([r({readOnly:!0})],d.prototype,"featureUtilsPromise",null),e([r({readOnly:!0})],d.prototype,"calculatedExpressions",null),e([r()],d.prototype,"displayField",void 0),e([r()],d.prototype,"effectivePopupTemplate",void 0),e([r()],d.prototype,"expressionsUsedInTitle",null),e([r()],d.prototype,"fieldsIndex",void 0),e([r()],d.prototype,"fieldInfoMap",null),e([r()],d.prototype,"fields",void 0),e([r()],d.prototype,"objectIdField",void 0),e([r()],d.prototype,"requiredFields",null),d=e([a("esri.layers.support.TitleCreator")],d);export{d as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{sqlAnd as t}from"../../core/sql.js";import{unpackFieldNames as o,featureHasFields as i}from"./fieldUtils.js";import{loadArcade as n}from"../../support/loadArcade.js";async function s(n,s,l,u){const c=new Array(s.length),a=new Map,d=new Map,p=o(n.fieldsIndex,l.outFields),f=u?.hasRequiredFields??i;for(let t=0;t<s.length;t++){const o=s[t];if(o.isAggregate){c[t]=o;continue}let i=!1;if(u?.getPopupTemplate){const t=o.origin?.layer??o.sourceLayer??o.layer,n=u.getPopupTemplate(t);if(null==n)continue;const s=await r(n);e(u),i=s&&s.arcadeUtils.hasGeometryOperations(n)}if(i||!f(o,p)){const e=o.getObjectId();if(null!=e){a.set(e,{graphic:o,index:t});continue}const i=o.getGlobalId();if(null!=i){d.set(i,{graphic:o,index:t});continue}}c[t]=o}if(!n.queryFeatures||0===a.size&&0===d.size)return c.filter(Boolean);const g=[],y=(e,t)=>{t&&(e.outFields??=[],e.outFields.includes(t)||e.outFields.push(t))};if(a.size>0){const e=l.clone();y(e,n.objectIdField),"uniqueIdFields"in n&&n.uniqueIdFields?.length&&(e.outFields??=[],e.outFields.push(...n.uniqueIdFields)),e.objectIds=Array.from(a.keys()),g.push({type:"object-id",query:e,map:a})}const m="globalIdField"in n?n.globalIdField:null;if(null!=m&&d.size>0){const e=l.clone();y(e,m);const o=Array.from(d.keys());e.where=t(l.where,`${m} IN (${o.map((e=>`'${e}'`)).join(",")})`),g.push({type:"global-id",query:e,map:d})}const b=u?.updateSourceAttributes??!1;for(const{type:e,query:t,map:o}of g)try{const i=await n.queryFeatures(t,u);for(const t of i.features){const i="object-id"===e?t.getObjectId():t.getGlobalId();if(null==i)continue;const n=o.get(i);if(!n)continue;const{graphic:s,index:r}=n;if(b&&t.attributes){s.attributes??={};for(const e of p)e in t.attributes&&(s.attributes[e]=t.attributes[e])}const{geometry:l,origin:u}=s;t.geometry||=l,t.origin=u,c[r]=t}}catch{}return c.filter(Boolean)}async function r(e){if(e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type)))return n()}export{s as fetchFeaturePopupFeatures,r as loadFeaturePopupArcadeModules};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{DomainValidationError as l,getDomainRange as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as s}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as a,isString as u}from"../../support/guards.js";import{loadArcade as f}from"../../support/loadArcade.js";const c=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function p(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(c,"F$1")||null}const m=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],y=["field","normalizationField"];function g(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(F(m,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)F(y,e,n)}function F(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function I(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function w(e,n){return e&&n?(b.clear(),T(b,e,n),Array.from(b).sort()):[]}function T(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function h(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map((e=>e.name)):n}function E(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=w(e,n);return t.length/e.fields.length>=i?["*"]:t}async function A(e,n,i){if(!i)return;let t;const r=s(i);if(r)t=[r];else{const{arcadeUtils:e}=await f();t=e.extractFieldNames(i,n?.fields?.map((e=>e.name)))}for(const l of t)x(e,n,l)}async function _(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});T(n,i,l.fieldNames)}}function v({displayField:e,fields:n}){return e||(n?.length?N(n,"name-or-title")||N(n,"unique-identifier")||N(n,"type-or-category")||S(n):null)}function S(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function N(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function $(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function O(e,n,i){i.onStatisticExpression?A(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function D(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(V(e,n,r)),i.fields&&t.push(...i.fields.map((async i=>O(e,n.fieldsIndex,i)))),await Promise.all(t)}async function M(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(V(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(Z(e,i,n));await Promise.all(r)}async function V(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map((i=>A(e,n.fieldsIndex,i.expression))));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(A(e,n.fieldsIndex,l.expressionInfo.expression));await Promise.all(t)}async function R(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&T(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&T(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await _(e,n.fieldsIndex,i.where))}async function j(e,n,i){n&&i&&await Promise.all(i.map((i=>U(e,n,i))))}async function U(e,n,i){n&&i&&(i.valueExpression?await A(e,n.fieldsIndex,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?w(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?w(e.fieldsIndex,Y(e)):[]}function G(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?w(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function P(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map((n=>_(e,t,n.where))))}const q=new Set(["oid","global-id","guid"]),X=new Set(["oid","global-id"]),z=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function B(e){const n=new Set;J(e).forEach((e=>n.add(e))),G(e).forEach((e=>n.add(e.toLowerCase())));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach((e=>n.add(e.toLowerCase()))),Object.values(i.transformFieldRoles).forEach((e=>n.add(e.toLowerCase())))),Array.from(n)}function Y(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function J(e){return Y(e).map((e=>e.toLowerCase()))}function W(e,n){return e.editable&&!q.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||X.has(e.type)||z.some((e=>e.test(i))))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map((n=>Z(e,t,n))))}async function Z(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await A(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach((i=>{x(e,n,i.slice(1,-1))}))}await _(e,n,r)}function ee(e){const n=e.defaultValue;return void 0!==n&&oe(e,n)?n:e.nullable?null:void 0}function ne(e){const n="string"==typeof e?{type:e}:e;return Fe(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ie(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function te(e){return null===e||ie(e)}function re(e){return null===e||Number.isInteger(e)}function le(){return!0}function oe(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?re:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?te:ie;break;case"string":case"esriFieldTypeString":i=e.nullable?a:u;break;default:i=le}return 1===arguments.length?i:i(n)}const se=["integer","small-integer","big-integer","long"],ae=["single","double"],ue=[...se,...ae],fe=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],ce=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...se,...fe]),pe=new Set([...ae,...ce]),me=t(de,pe);function ye(e){return null!=e&&de.has(e.type)}function ge(e){return null!=e&&me.has(e.type)}function Fe(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function be(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function we(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function Te(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function xe(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function he(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===Se(e,n)}var Ae,_e;function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:oe(e,n)?ge(e)&&!Ne(e.type,Number(n))?Ae.OUT_OF_RANGE:null:_e.INVALID_TYPE}function Ne(e,n){const i="string"==typeof e?Le(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function $e(e,n){const i=o(e,n);return i||(ge(e)?Le(e.type):void 0)}function Le(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Me;case"esriFieldTypeBigInteger":case"big-integer":return Ve;case"esriFieldTypeSingle":case"single":return Re;case"esriFieldTypeDouble":case"double":return je}}function Oe(e){if(!ie(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeInteger";if(e>=Ve.min&&e<=Ve.max)return"esriFieldTypeBigInteger"}return e>=Re.min&&e<=Re.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}!function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"}(Ae||(Ae={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(_e||(_e={}));const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Me={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Ve={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},je={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case l.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case l.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case _e.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case Ae.OUT_OF_RANGE:{const{min:e,max:t}=Le(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function ke(e,n){return!Ce(e,n,null)}function Ce(e,n,i){if(!n?.attributes||!e){if(null!=i)for(const n of e??[])i.add(n);return!0}const t=new Set(Object.keys(n.attributes));let r=!1;for(const l of e)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Ge(e,n){const i=new Set;for(const t of n)await A(i,e.fieldsIndex,t);return Array.from(i).sort()}function Pe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some((n=>e.toLowerCase().startsWith(n)))}async function qe(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Xe(e){const n=e?.match(/{[^}]+}/g);return n?n.map((e=>e.slice(1,-1).split(":")[0].trim())):[]}export{Ae as NumericRangeValidationError,_e as TypeValidationError,Ve as bigIntegerRange,A as collectArcadeFieldNames,P as collectDisplayFilterFields,L as collectElevationFields,D as collectFeatureReductionFields,x as collectField,T as collectFields,R as collectFilterFields,Q as collectLabelingFields,j as collectOrderByInfos,V as collectPopupTemplateFields,M as collectTrackInfoFields,je as doubleRange,Xe as extractSubstitutionTemplatesFromString,ke as featureHasFields,w as fixFields,g as fixRendererFields,I as fixTimeInfoFields,ce as floatJSONTypes,ae as floatTypes,v as getDisplayFieldName,Y as getEditTrackingFields,$ as getElevationFields,Ge as getExpressionFields,C as getFeatureEditFields,G as getFeatureGeometryFields,ne as getFieldDefaultLength,ee as getFieldDefaultValue,$e as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,Oe as getNumericTypeForValue,qe as getRendererFields,k as getTimeFields,fe as integerJSONTypes,Me as integerRange,se as integerTypes,Ie as isDateField,be as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,he as isGlobalIDField,ye as isIntegerField,Ne as isNumberInRange,ge as isNumericField,xe as isObjectIDField,Pe as isRasterPixelValueField,Fe as isStringField,Te as isTimeOnlyField,we as isTimestampOffsetField,Ee as isValidFieldValue,oe as isValueMatchingFieldType,p as normalizeFieldName,ue as numericTypes,E as packFields,Ce as populateMissingFields,m as rendererFields,ve as sanitizeNullFieldValue,Re as singleRange,De as smallIntegerRange,h as unpackFieldNames,Se as validateFieldValue,Ue as validationErrorToString,y as visualVariableFields};
|
|
5
|
+
import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{DomainValidationError as l,getDomainRange as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as s}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as a,isString as u}from"../../support/guards.js";import{loadArcade as f}from"../../support/loadArcade.js";const c=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function p(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(c,"F$1")||null}const m=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],y=["field","normalizationField"];function g(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(F(m,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)F(y,e,n)}function F(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function I(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function w(e,n){return e&&n?(b.clear(),T(b,e,n),Array.from(b).sort()):[]}function T(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function h(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map((e=>e.name)):n}function E(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=w(e,n);return t.length/e.fields.length>=i?["*"]:t}async function A(e,n,i){if(!i)return;let t;const r=s(i);if(r)t=[r];else{const{arcadeUtils:e}=await f();t=e.extractFieldNames(i,n?.fields?.map((e=>e.name)))}for(const l of t)x(e,n,l)}async function _(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});T(n,i,l.fieldNames)}}function v({displayField:e,fields:n}){return e||(n?.length?N(n,"name-or-title")||N(n,"unique-identifier")||N(n,"type-or-category")||S(n):null)}function S(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function N(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function $(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function O(e,n,i){i.onStatisticExpression?A(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function D(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(V(e,n,r)),i.fields&&t.push(...i.fields.map((async i=>O(e,n.fieldsIndex,i)))),await Promise.all(t)}async function M(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(V(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(Z(e,i,n));await Promise.all(r)}async function V(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map((i=>A(e,n.fieldsIndex,i.expression))));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(A(e,n.fieldsIndex,l.expressionInfo.expression));await Promise.all(t)}async function R(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&T(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&T(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await _(e,n.fieldsIndex,i.where))}async function j(e,n,i){n&&i&&await Promise.all(i.map((i=>U(e,n,i))))}async function U(e,n,i){n&&i&&(i.valueExpression?await A(e,n.fieldsIndex,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?w(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?w(e.fieldsIndex,Y(e)):[]}function G(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?w(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function P(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map((n=>_(e,t,n.where))))}const q=new Set(["oid","global-id","guid"]),X=new Set(["oid","global-id"]),z=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function B(e){const n=new Set;J(e).forEach((e=>n.add(e))),G(e).forEach((e=>n.add(e.toLowerCase())));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach((e=>n.add(e.toLowerCase()))),Object.values(i.transformFieldRoles).forEach((e=>n.add(e.toLowerCase())))),Array.from(n)}function Y(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function J(e){return Y(e).map((e=>e.toLowerCase()))}function W(e,n){return e.editable&&!q.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||X.has(e.type)||z.some((e=>e.test(i))))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map((n=>Z(e,t,n))))}async function Z(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await A(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach((i=>{x(e,n,i.slice(1,-1))}))}await _(e,n,r)}function ee(e){const n=e.defaultValue;return void 0!==n&&oe(e,n)?n:e.nullable?null:void 0}function ne(e){const n="string"==typeof e?{type:e}:e;return Fe(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ie(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function te(e){return null===e||ie(e)}function re(e){return null===e||Number.isInteger(e)}function le(){return!0}function oe(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?re:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?te:ie;break;case"string":case"esriFieldTypeString":i=e.nullable?a:u;break;default:i=le}return 1===arguments.length?i:i(n)}const se=["integer","small-integer","big-integer","long"],ae=["single","double"],ue=[...se,...ae],fe=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],ce=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...se,...fe]),pe=new Set([...ae,...ce]),me=t(de,pe);function ye(e){return null!=e&&de.has(e.type)}function ge(e){return null!=e&&me.has(e.type)}function Fe(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function be(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function we(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function Te(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function xe(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function he(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===Se(e,n)}var Ae,_e;function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:oe(e,n)?ge(e)&&!Ne(e.type,Number(n))?Ae.OUT_OF_RANGE:null:_e.INVALID_TYPE}function Ne(e,n){const i="string"==typeof e?Le(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function $e(e,n){const i=o(e,n);return i||(ge(e)?Le(e.type):void 0)}function Le(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Me;case"esriFieldTypeBigInteger":case"big-integer":return Ve;case"esriFieldTypeSingle":case"single":return Re;case"esriFieldTypeDouble":case"double":return je}}function Oe(e){if(!ie(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeInteger";if(e>=Ve.min&&e<=Ve.max)return"esriFieldTypeBigInteger"}return e>=Re.min&&e<=Re.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}!function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"}(Ae||(Ae={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(_e||(_e={}));const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Me={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Ve={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},je={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case l.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case l.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case _e.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case Ae.OUT_OF_RANGE:{const{min:e,max:t}=Le(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function ke(e,n){return!Ce(e,n,null)}function Ce(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Ge(e,n){const i=new Set;for(const t of n)await A(i,e.fieldsIndex,t);return Array.from(i).sort()}function Pe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some((n=>e.toLowerCase().startsWith(n)))}async function qe(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Xe(e){const n=e?.match(/{[^}]+}/g);return n?n.map((e=>e.slice(1,-1).split(":")[0].trim())):[]}export{Ae as NumericRangeValidationError,_e as TypeValidationError,Ve as bigIntegerRange,A as collectArcadeFieldNames,P as collectDisplayFilterFields,L as collectElevationFields,D as collectFeatureReductionFields,x as collectField,T as collectFields,R as collectFilterFields,Q as collectLabelingFields,j as collectOrderByInfos,V as collectPopupTemplateFields,M as collectTrackInfoFields,je as doubleRange,Xe as extractSubstitutionTemplatesFromString,ke as featureHasFields,w as fixFields,g as fixRendererFields,I as fixTimeInfoFields,ce as floatJSONTypes,ae as floatTypes,v as getDisplayFieldName,Y as getEditTrackingFields,$ as getElevationFields,Ge as getExpressionFields,C as getFeatureEditFields,G as getFeatureGeometryFields,ne as getFieldDefaultLength,ee as getFieldDefaultValue,$e as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,Oe as getNumericTypeForValue,qe as getRendererFields,k as getTimeFields,fe as integerJSONTypes,Me as integerRange,se as integerTypes,Ie as isDateField,be as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,he as isGlobalIDField,ye as isIntegerField,Ne as isNumberInRange,ge as isNumericField,xe as isObjectIDField,Pe as isRasterPixelValueField,Fe as isStringField,Te as isTimeOnlyField,we as isTimestampOffsetField,Ee as isValidFieldValue,oe as isValueMatchingFieldType,p as normalizeFieldName,ue as numericTypes,E as packFields,Ce as populateMissingFields,m as rendererFields,ve as sanitizeNullFieldValue,Re as singleRange,De as smallIntegerRange,h as unpackFieldNames,Se as validateFieldValue,Ue as validationErrorToString,y as visualVariableFields};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as o}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as n}from"../../renderers/support/styleUtils.js";async function l(e,r,a){if(!r)return;const y=r.map((e=>G(e,a))),t=await Promise.allSettled(y);for(const i of t)"rejected"===i.status||i.value&&e.add(i.value)}const c={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},s={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},u={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},I={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},m={...u,LinkChartLayer:"LinkChartLayer"},g={...d},T={...I};async function G(e,r){return f(await M(e,r),e,r)}async function f(e,r,a){const y=new e;return y.read(r,a.context),"group"===y.type&&("GroupLayer"===r.layerType?await v(y,r,a):b(r)?C(y,r,a.context):A(r)&&await h(y,r,a.context)),await n(y,a.context),y}async function M(e,n){const l=n.context,c=w(l);let s=e.layerType||e.type;!s&&n?.defaultLayerType&&(s=n.defaultLayerType);const p=c[s];let S=p?a[p]:a.UnknownLayer;if(b(e)){const t=l?.portal;if(e.itemId){const i=new y({id:e.itemId,portal:t});await i.load();const L=(await o(i,new r)).className||"UnknownLayer";S=a[L]}}else"ArcGISFeatureLayer"===s?t(e)||i(e)?S=a.MapNotesLayer:L(e)?S=a.RouteLayer:A(e)&&(S=a.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?S=a.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(S=a.UnsupportedLayer);return S()}function A(e){if("ArcGISFeatureLayer"!==e.layerType||b(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function b(e){return"Feature Collection"===e.type}function w(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=S;break;case"ground":r=s;break;case"tables":r=p;break;default:r=c}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=T;break;case"tables":r=g;break;default:r=m}break;default:switch(e.layerContainerType){case"basemap":r=I;break;case"tables":r=d;break;default:r=u}}return r}async function v(r,a,y){const t=new e,i=l(t,Array.isArray(a.layers)?a.layers:[],y);try{try{if(await i,"group"===r.type)return r.layers.addMany(t),r}catch(L){r.destroy();for(const e of t)e.destroy();throw L}}catch(L){throw L}}function C(e,r,a){r.itemId&&(e.portalItem=new y({id:r.itemId,portal:a?.portal}),e.when((()=>{const y=y=>{const t=y.layerId;W(y,e,r,t,a);const i=r.featureCollection?.layers?.[t];i&&y.read(i,a)};e.layers?.forEach(y),e.tables?.forEach(y)})))}async function h(e,r,y){const t=a.FeatureLayer,i=await t(),L=r.featureCollection,o=L?.showLegend,n=L?.layers?.map(((a,t)=>{const L=new i;L.read(a,y);const n={...y,ignoreDefaults:!0};return W(L,e,r,t,n),null!=o&&L.read({showLegend:o},n),L}));e.layers.addMany(n??[])}function W(e,r,a,y,t){e.read({id:`${r.id}-sublayer-${y}`,visibility:a.visibleLayers?.includes(y)??!0},t)}export{v as populateGroupLayer,l as populateOperationalLayers};
|
|
5
|
+
import e from"../../core/Collection.js";import"../../core/has.js";import{LayerLoadContext as r}from"./LayerLoadContext.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isMarkupLayer as i,isRouteLayer as L}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as o}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as n}from"../../renderers/support/styleUtils.js";async function l(e,r,a){if(!r)return;const y=r.map((e=>G(e,a))),t=await Promise.allSettled(y);for(const i of t)"rejected"===i.status||i.value&&e.add(i.value)}const c={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},s={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},u={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},I={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},m={...u,LinkChartLayer:"LinkChartLayer"},g={...d},T={...I};async function G(e,r){return f(await M(e,r),e,r)}async function f(e,r,a){const y=new e;return y.read(r,a.context),"group"===y.type&&("GroupLayer"===r.layerType?await v(y,r,a):b(r)?C(y,r,a.context):A(r)&&await h(y,r,a.context)),await n(y,a.context),y}async function M(e,n){const l=n.context,c=w(l);let s=e.layerType||e.type;!s&&n?.defaultLayerType&&(s=n.defaultLayerType);const p=c[s];let S=p?a[p]:a.UnknownLayer;if(b(e)){const t=l?.portal;if(e.itemId){const i=new y({id:e.itemId,portal:t});await i.load();const L=(await o(i,new r)).className||"UnknownLayer";S=a[L]}}else"ArcGISFeatureLayer"===s?t(e)||i(e)?S=a.MapNotesLayer:L(e)?S=a.RouteLayer:A(e)&&(S=a.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?S=a.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(S=a.UnsupportedLayer);return S()}function A(e){if("ArcGISFeatureLayer"!==e.layerType||b(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function b(e){return"Feature Collection"===e.type}function w(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=S;break;case"ground":r=s;break;case"tables":r=p;break;default:r=c}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=T;break;case"tables":r=g;break;default:r=m}break;default:switch(e.layerContainerType){case"basemap":r=I;break;case"tables":r=d;break;default:r=u}}return r}async function v(r,a,y){const t=new e,i=l(t,Array.isArray(a.layers)?a.layers:[],y);try{try{if(await i,"group"===r.type)return r.layers.addMany(t),r}catch(L){r.destroy();for(const e of t)e.destroy();throw L}}catch(L){throw L}}function C(e,r,a){r.itemId&&(e.portalItem=new y({id:r.itemId,portal:a?.portal}),e.when((()=>{const y=y=>{const t=y.layerId;W(y,e,r,t,a);const i=r.featureCollection?.layers?.[t];i&&y.read(i,a)};e.layers?.forEach(y),e.tables?.forEach(y)})))}async function h(e,r,y){const t=a.FeatureLayer,i=await t(),L=r.featureCollection,o=L?.showLegend,n=L?.layers?.map(((a,t)=>{const L=new i;L.read(a,y);const n={...y,ignoreDefaults:!0};return W(L,e,r,t,n),null!=o&&L.read({showLegend:o},n),L}));e.layers.addMany(n??[])}function W(e,r,a,y,t){e.read({id:`${r.id}-sublayer-${y}`,visibility:a.visibleLayers?.includes(y)??!0},t)}export{v as populateGroupLayer,l as populateOperationalLayers};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{clone as r}from"../../core/lang.js";import t from"../../core/Logger.js";import{urlToObject as o,join as e}from"../../core/urlUtils.js";import{writeUrlWithLayerId as l,sanitizeUrlWithLayerId as n}from"./arcgisLayerUrl.js";import{url as i}from"./commonProperties.js";function s(){const o=r(i),e=o.json?.write;return"object"==typeof e&&e&&(e.writer=function(r,t,o,e){l(this,r,null,t,e)}),{...o,set:function(r){if(null==r)return void this._set("url",r);const o=n({layer:this,url:r,nonStandardUrlAllowed:!0,logger:t.getLogger(this)});this._set("url",o.url),null!=o.layerId&&this._set("layerId",o.layerId)}}}function u(r){const t=o(r.url);return null!=t&&null!=r.layerId&&(t.path=e(t.path,r.layerId.toString())),t}export{u as normalizeParsedUrlObject,s as urlProperty};
|
package/package.json
CHANGED