@arcgis/core 4.32.0-next.20241218 → 4.32.0-next.20241220
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/Basemap.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/text-area/t9n/messages.en.json +1 -1
- package/assets/components/assets/text-area/t9n/messages.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6ceafd4420d21110d820.js → 015285436ca965f94e17.js} +1 -1
- package/assets/esri/core/workers/chunks/{57aa1fcef6587305b347.js → 0191142d5f55cc8cf37a.js} +93 -93
- package/assets/esri/core/workers/chunks/{7a0ddaf2c279a2d24c86.js → 0837a630e12a21fc2e50.js} +1 -1
- package/assets/esri/core/workers/chunks/0b3e1e903120da297641.js +1 -0
- package/assets/esri/core/workers/chunks/0f1a7aeec18db5323365.js +1 -0
- package/assets/esri/core/workers/chunks/{cca47dab8c1b8ae49fab.js → 11052103efe3d53a784e.js} +1 -1
- package/assets/esri/core/workers/chunks/19d72185d50ba1ebff50.js +1 -0
- package/assets/esri/core/workers/chunks/{b99de19b6930ba6dad98.js → 1d8609ba413e8a172719.js} +1 -1
- package/assets/esri/core/workers/chunks/{d05fab1af651b7e92442.js → 23fe65988dbc9e5d7842.js} +1 -1
- package/assets/esri/core/workers/chunks/2427a01678f3d9fbf30b.js +1 -0
- package/assets/esri/core/workers/chunks/2c084c0c324e3af56424.js +1 -0
- package/assets/esri/core/workers/chunks/3a90163b76b0bc7f21d2.js +1 -0
- package/assets/esri/core/workers/chunks/48266c87363e7dcaefb3.js +1 -0
- package/assets/esri/core/workers/chunks/{d3790bd1a644eae1005b.js → 48f6eb3b63fec1d3312d.js} +4 -5
- package/assets/esri/core/workers/chunks/5a0eb9dfe668cf290462.js +1 -0
- package/assets/esri/core/workers/chunks/668679baf519ada9ae28.js +1 -0
- package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +1 -0
- package/assets/esri/core/workers/chunks/7156d2ae914e1add0109.js +1 -0
- package/assets/esri/core/workers/chunks/737f381f2cfeddb96d15.js +1 -0
- package/assets/esri/core/workers/chunks/{b77d294ad7064734d015.js → 741d5dadfab2a7689054.js} +1 -1
- package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{1cee35ea0a80737730d5.js → 770d233254419b741616.js} +1 -1
- package/assets/esri/core/workers/chunks/8249351daa45ca82ca0c.js +1 -0
- package/assets/esri/core/workers/chunks/9372d08ba8bf3342c48f.js +1 -0
- package/assets/esri/core/workers/chunks/{fb43c44a7d6b61f31e75.js → 94432e04de01ee7adc0e.js} +1 -1
- package/assets/esri/core/workers/chunks/95af4dee29eb196b8ada.js +1 -0
- package/assets/esri/core/workers/chunks/{80ac74da0b0e45e74beb.js → 9a498f2c007f4d78d4dd.js} +1 -1
- package/assets/esri/core/workers/chunks/9cc9bac6e02ab241e852.js +1 -0
- package/assets/esri/core/workers/chunks/{d347dd19a37ba2f19970.js → 9fc49968dea8e2b64f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/a776f71b4c7b8728a973.js +1 -0
- package/assets/esri/core/workers/chunks/a77aa86896bbb0e088df.js +1 -0
- package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js → b1e4813f0c73fc2a483c.js} +2 -2
- package/assets/esri/core/workers/chunks/{7c9e4d479d740723304b.js.LICENSE.txt → b1e4813f0c73fc2a483c.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/bd37c9cc720587665fd3.js +1 -0
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{eddab4dc706e75c6637f.js → bff74200a0df0950cf08.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f2ffb6944c9028d3bea.js → c08cb75c3eef6c45f604.js} +1 -1
- package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +1 -0
- package/assets/esri/core/workers/chunks/cc427e8f1b17744b6ea4.js +1 -0
- package/assets/esri/core/workers/chunks/cfe4b8101ea96d6996d3.js +2 -0
- package/assets/esri/core/workers/chunks/{f3f5c5138de8428bd30f.js.LICENSE.txt → cfe4b8101ea96d6996d3.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d7b76bc7bff34abc2253.js +1 -0
- package/assets/esri/core/workers/chunks/dce55e7f76adecc055c3.js +1 -0
- package/assets/esri/core/workers/chunks/dd34df14eb4940e2497b.js +1 -0
- package/assets/esri/core/workers/chunks/dfd9432ba01881d0a4d9.js +2 -0
- package/assets/esri/core/workers/chunks/{ed2ebe42d6483470939a.js.LICENSE.txt → dfd9432ba01881d0a4d9.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e1913990f30d285b3b15.js +2 -0
- package/assets/esri/core/workers/chunks/{aff820b27ca9585e297e.js.LICENSE.txt → e1913990f30d285b3b15.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e6490fe7c87c1d649ea6.js → e5d55a35dace70239902.js} +1 -1
- package/assets/esri/core/workers/chunks/ebf9caf2dc8af89afec2.js +2 -0
- package/assets/esri/core/workers/chunks/{2eb36a16de1a823513cd.js.LICENSE.txt → ebf9caf2dc8af89afec2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +1 -0
- package/assets/esri/core/workers/chunks/f2cdb7be3fd65f65c30b.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +3 -3
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/HUDMaterial.glsl.js +41 -42
- package/chunks/OITBlend.glsl.js +3 -3
- package/chunks/OperatorProject.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/core/number.js +1 -1
- package/geometry/operators/affineTransformOperator.js +1 -1
- package/geometry/operators/alphaShapeOperator.js +1 -1
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/autoCompleteOperator.js +1 -1
- package/geometry/operators/boundaryOperator.js +1 -1
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodesicProximityOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticDistanceOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/graphicBufferOperator.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/labelPointOperator.js +1 -1
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/linesToPolygonsOperator.js +1 -1
- package/geometry/operators/locateBetweenOperator.js +1 -1
- package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/polygonOverlayOperator.js +1 -1
- package/geometry/operators/polygonSlicerOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.js +1 -1
- package/interfaces.d.ts +1020 -735
- package/intl/messages.js +1 -1
- package/layers/graphics/OptimizedFeature.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/domainUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +2 -2
- package/renderers/support/RendererLegendOptions.js +1 -1
- package/rest/featureService/utils.js +1 -1
- package/rest/query/operations/pbfOptimizedFeatureSet.js +1 -1
- package/rest/support/AddressToLocationsParameters.js +1 -1
- package/rest/support/LocationToAddressParameters.js +1 -1
- package/smartMapping/popup/classBreaks.js +1 -1
- package/smartMapping/popup/clusters.js +1 -1
- package/smartMapping/popup/dotDensity.js +1 -1
- package/smartMapping/popup/heatmap.js +1 -1
- package/smartMapping/popup/predominance.js +1 -1
- package/smartMapping/popup/relationship.js +1 -1
- package/smartMapping/popup/simple.js +1 -1
- package/smartMapping/popup/support/utils.js +1 -1
- package/smartMapping/popup/templates.js +1 -1
- package/smartMapping/popup/uniqueValues.js +1 -1
- package/smartMapping/raster/renderers/flow.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/symbology/support/utils.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/revision.js +1 -1
- package/versionManagement/versionAdapters/utils.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/KeyRotate.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +5 -0
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/support/DebouncedFeatureOverride.js +5 -0
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +2 -2
- package/views/3d/webgl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/digitizationUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/applications/Components/CollectionFlattener.d.ts +0 -4
- package/applications/Components/CollectionFlattener.js +0 -5
- package/assets/esri/core/workers/chunks/062da071fd27022f6cb1.js +0 -1
- package/assets/esri/core/workers/chunks/0f0cc8150326ca7bcd6f.js +0 -1
- package/assets/esri/core/workers/chunks/1808a2b023fa04c6ee6c.js +0 -1
- package/assets/esri/core/workers/chunks/1d31b07805af85a4ba7b.js +0 -1
- package/assets/esri/core/workers/chunks/1fb142a533e4ee492a50.js +0 -1
- package/assets/esri/core/workers/chunks/28f3e139a4e3b70d84a4.js +0 -1
- package/assets/esri/core/workers/chunks/2daf5f46e4b137d33f12.js +0 -1
- package/assets/esri/core/workers/chunks/2eb36a16de1a823513cd.js +0 -2
- package/assets/esri/core/workers/chunks/382c3da5ce9b3231f57c.js +0 -1
- package/assets/esri/core/workers/chunks/433798a25dd688cef327.js +0 -1
- package/assets/esri/core/workers/chunks/56a04f5976b926de448e.js +0 -1
- package/assets/esri/core/workers/chunks/5786b190ad3e2d933245.js +0 -1
- package/assets/esri/core/workers/chunks/6bd6c280c741f8917cc8.js +0 -1
- package/assets/esri/core/workers/chunks/70153bb44fd5b7cfecb8.js +0 -1
- package/assets/esri/core/workers/chunks/78981dee7b5403c32517.js +0 -1
- package/assets/esri/core/workers/chunks/7bb52be0a02fb2a2631c.js +0 -1
- package/assets/esri/core/workers/chunks/80f1f967646f7a7d37ec.js +0 -1
- package/assets/esri/core/workers/chunks/820bb7ea30ad30ce8f42.js +0 -1
- package/assets/esri/core/workers/chunks/8f2f2d497b875e2b4139.js +0 -1
- package/assets/esri/core/workers/chunks/95ea191f6a307b73b545.js +0 -1
- package/assets/esri/core/workers/chunks/9fab71f1041c40d976af.js +0 -1
- package/assets/esri/core/workers/chunks/a0a37c238863ffc1b768.js +0 -1
- package/assets/esri/core/workers/chunks/aa31073c7fe3b0e4e499.js +0 -1
- package/assets/esri/core/workers/chunks/af5d74311cec22601f73.js +0 -1
- package/assets/esri/core/workers/chunks/aff820b27ca9585e297e.js +0 -2
- package/assets/esri/core/workers/chunks/bf2d1a700fff4ae0db33.js +0 -1
- package/assets/esri/core/workers/chunks/da6c0c894e7e281169fa.js +0 -1
- package/assets/esri/core/workers/chunks/ed2ebe42d6483470939a.js +0 -2
- package/assets/esri/core/workers/chunks/f3f5c5138de8428bd30f.js +0 -2
- package/assets/esri/core/workers/chunks/f429d95eb986f3d215f3.js +0 -1
- package/assets/esri/core/workers/chunks/fce1158755f959730602.js +0 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +0 -5
- package/views/3d/input/handlers/SingleKey.js +0 -5
- package/views/3d/input/handlers/SingleKeyResetHeading.js +0 -5
- package/views/3d/input/handlers/SingleKeyResetTilt.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createUniqueColors as e}from"../../../core/colorUtils.js";import
|
|
5
|
+
import{createUniqueColors as e}from"../../../core/colorUtils.js";import r from"../../../core/Error.js";import a from"../../../renderers/support/AuthoringInfo.js";import i from"../../../renderers/support/AuthoringInfoVisualVariable.js";import{createFlowRenderer as t,estimateMagnitudeRange as n}from"../../../renderers/support/rasterRendererHelper.js";import o from"../../../renderers/support/RendererLegendOptions.js";import s from"../../../renderers/visualVariables/ColorVariable.js";import l from"../../../renderers/visualVariables/OpacityVariable.js";import m from"../../../renderers/visualVariables/SizeVariable.js";import p from"../../../renderers/visualVariables/support/ColorStop.js";import u from"../../../renderers/visualVariables/support/OpacityStop.js";import c from"../../../renderers/visualVariables/support/SizeStop.js";import{processRasterRendererParameters as f}from"../support/utils.js";import{getDataRange as d,createDataValues as h,getBasemapInfo as w}from"../../renderers/support/utils.js";import{cloneScheme as b,getSchemes as y}from"../../symbology/flow.js";const V=5;async function v(e){const r={...e};return r.theme||(r.theme="flow-line"),f(r)}async function S(e){let r=e.flowScheme,a=null,i=null;const t=await w(null,e.view);if(a=null!=t.basemapId?t.basemapId:null,i=null!=t.basemapTheme?t.basemapTheme:null,r)return{scheme:b(r),basemapId:a,basemapTheme:i};const n=y({basemapTheme:i,theme:e.theme,hasSizeVariable:e.hasSizeVariable});return n&&(r=n.primaryScheme,a=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:a,basemapTheme:i}}async function g(t,f){f.flowRepresentation&&(t.flowRepresentation=f.flowRepresentation);const w=await S({theme:f.theme,flowScheme:f.flowScheme,view:f.view,hasSizeVariable:f.includeSizeVariable}),y=w.scheme;if(!y)throw new r("flow-renderer:insufficient-info","Unable to find flow scheme");t.flowSpeed=y.flowSpeed,t.density=y.density,t.trailLength=y.trailLength,t.trailWidth=y.trailWidth,t.trailCap=y.trailCap,t.color=y.color;const v=[],g=[],x="Magnitude",j=f.layer.serviceRasterInfo,z=null==j?.statistics||"vector-magdir"!==j.dataType&&"vector-uv"!==j.dataType?{minMagnitude:0,maxMagnitude:10}:n(j.dataType,j.statistics);if(null==z?.minMagnitude||null==z.maxMagnitude)throw new r("flow-renderer:insufficient-info","stats not available");const I={min:z.minMagnitude,max:z.maxMagnitude},T={min:I.min,max:null!=I.max?I.max/2:null},O=d(T,null,null),M=h(O,T,null);if(f.includeColorVariable){const a=e(y.colors,V);if(a.length<V)throw new r("flow-renderer:insufficient-info","Flow scheme does not have enough colors");const t=new s({field:x,stops:M.map(((e,r)=>new p({value:e,color:a[r]})))});v.push(t);const n=new i({type:"color",minSliderValue:I.min,maxSliderValue:I.max,theme:"high-to-low"});g.push(n)}if(f.includeOpacityVariable){const e=new l({field:x,stops:[new u({value:M[0],opacity:y.minOpacity}),new u({value:M[4],opacity:y.maxOpacity})]});v.push(e);const r=new i({type:"opacity",minSliderValue:I.min,maxSliderValue:I.max});g.push(r)}if(f.includeSizeVariable){const e=new m({field:x,stops:[new c({value:I.min,size:y.minSize}),new c({value:I.max,size:y.maxSize})]});v.push(e);const r=new i({type:"size",minSliderValue:I.min,maxSliderValue:I.max,theme:"high-to-low"});g.push(r)}const R=new a({type:"flow",visualVariables:g.length?g:void 0,flowTheme:y.theme});return t.visualVariables=v,t.authoringInfo=R,t.legendOptions=o.from(f.legendOptions),{renderer:t,visualVariables:v.map((e=>e.clone())),flowScheme:b(y),basemapId:w.basemapId,basemapTheme:w.basemapTheme,layerEffect:y.layerEffect,statistics:I}}async function x(e){e=await v(e);const a=t(e.layer.serviceRasterInfo);if(null==a)throw new r("flow-renderer:not-supported","Only vector data is supported");return g(a,e)}export{x as createRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import{createUniqueColors as i}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as s}from"../../intl/messages.js";import l from"../../layers/support/AggregateField.js";import o from"../../layers/support/ExpressionInfo.js";import u from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as p}from"../../renderers/support/OthersCategory.js";import m from"../heuristics/outline.js";import c from"../heuristics/sizeRange.js";import{createVisualVariables as d}from"./size.js";import{spliceVisualVariables as f,findSizeVVIndex as b,updateAuthoringInfoVisualVariable as h,findOutlineVVIndex as y,findScaleDependentSizeVVIndex as w,processRegenerateParams as g,getRendererToUpdate as v,getStyleType as z,hasOutlineVV as S,hasScaleDependentSizeVV as E,isSizeVV as j}from"./support/regenerateUtils.js";import{errorCallback as V,createSymbol as x,getSymbolOutlineFromScheme as C,verifyBasicFieldValidity as T,getBasemapInfo as $}from"./support/utils.js";import I from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as O}from"../statistics/support/utils.js";import{verifyBinningParams as k}from"../support/binningUtils.js";import{getFieldsList as q}from"../support/utils.js";import{LayerType as B,binningCapableLayerTypes as L,createLayerAdapter as P,getLayerTypeLabels as R,getLayerTypes as U}from"../support/adapters/support/layerUtils.js";import{cloneScheme as F,getSchemes as M}from"../symbology/pieChart.js";import{getCIMSymbolColor as N}from"../../symbols/support/cimSymbolUtils.js";import _ from"../../symbols/SimpleLineSymbol.js";const A=[B.CSVLayer,B.FeatureLayer,B.GeoJSONLayer,B.KnowledgeGraphSublayer,B.OGCFeatureLayer,B.OrientedImageryLayer,B.StreamLayer,B.WFSLayer];async function D(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&k(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?L:A,i=P(r.layer,a,e.forBinning);if(!i)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+R(a).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),i.load(n)]);const s=i.geometryType,l="polygon"===s,o="point"===s||"multipoint"===s||l;if(r.outlineOptimizationEnabled=!!l&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!o&&r.sizeOptimizationEnabled,!o)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await q({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=T(i,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return{...r,layer:i}}async function G(e){const r="regenerate-pie-chart-renderer";await g(e,r);const a=await v(e);if("pie-chart"!==z(a))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{visualVariables:i}=a,{layer:n,forBinning:s,filter:l,view:o,signal:u}=e,p=S(a),m=E(a),c=i?.some(j),d=a.attributes.map((e=>({field:e.field,label:e.label,valueExpression:e.valueExpression,valueExpressionTitle:e.valueExpressionTitle}))),f=await D({layer:n,attributes:d,outlineOptimizationEnabled:p,sizeOptimizationEnabled:m,includeSizeVariable:c,forBinning:s,filter:l,view:o,signal:u});return{...e,creatorParameters:f,renderer:a}}async function W(e){let r=e.pieChartScheme,a=null,i=null;const t=await $(e.basemap,e.view);if(a=null!=t.basemapId?t.basemapId:null,i=null!=t.basemapTheme?t.basemapTheme:null,r)return{scheme:F(r),basemapId:a,basemapTheme:i};const n=M({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:i});return n&&(r=n.primaryScheme,a=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:a,basemapTheme:i}}async function H(e,r){const{valueExpression:a,sqlExpression:i,sqlWhere:t}=O(e.attributes),n=await s("esri/smartMapping/t9n/smartMapping");return d({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:i,sqlWhere:t,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:n.sumOfCategories},view:e.view,signal:e.signal})}async function J(e){const[l,o]=await Promise.all([D(e),s("esri/smartMapping/t9n/smartMapping")]),d=await W(l),f=d?.scheme;if(!f)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const{layer:b,includeSizeVariable:h,sizeOptimizationEnabled:y,outlineOptimizationEnabled:w,view:g,signal:v,filter:z}=l,S=f.sizeScheme,E=l.attributes,j=E.map((e=>e.field)).filter(a),[T,$,O,k]=await Promise.all([j.length>1?I({layer:b,fields:j,view:g,signal:v,filter:z}):null,h?H(l,S):null,!h&&y?c({layer:b,view:g,signal:v,filter:z}).catch(V):null,w?m({layer:b,view:g,signal:v,filter:z}).catch(V):null]),q=T?.predominantCategoryInfos?{uniqueValueInfos:T.predominantCategoryInfos}:{uniqueValueInfos:j.map((e=>({value:e,count:0})))},B=i(f.colors,E.length),L=E.map(((e,r)=>new u({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:B[r]}))),P=b.geometryType,R=null!=S&&"background"in S&&S.background,U=new r({attributes:L,othersCategory:new p({label:o.other,color:l.othersCategoryEnabled?f.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===l.shape?.45:0,backgroundFillSymbol:R?x(P,{type:"2d",color:R.color,outline:C(R,P,k?.opacity)}):null,size:n(f.size),outline:new _(C(f,"point",k?.opacity)),legendOptions:l.legendOptions});if($&&(Z($,y,P),U.authoringInfo=$.authoringInfo.clone(),U.visualVariables=$.visualVariables?.map((e=>e.clone()))),k?.visualVariables?.length){const e=k.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));U.visualVariables?U.visualVariables.push(...e):U.visualVariables=e}return O?.minSize&&(Q(O,P),U.visualVariables?U.visualVariables.push(O.minSize):U.visualVariables=[O.minSize]),{renderer:U,pieChartScheme:F(f),size:$,basemapId:d.basemapId,basemapTheme:d.basemapTheme,statistics:q}}async function K(e){const{creatorParameters:r,view:a,signal:i,filter:t,renderer:n}=await G(e),{layer:s,outlineOptimizationEnabled:l,includeSizeVariable:o,sizeOptimizationEnabled:u}=r,p=await W(r),d=p?.scheme?.sizeScheme,[g,v,z]=await Promise.all([l?m({layer:s,view:a,signal:i,filter:t}).catch(V):null,o?H(r,d):null,!o&&u?c({layer:s,view:a,signal:i,filter:t}).catch(V):null]),S=s.geometryType;if(v&&(Z(v,u,S),f(n,v?.visualVariables,b),h(n,v?.authoringInfo,"size")),g?.visualVariables?.length){const e=g.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));f(n,e,y)}return z?.minSize&&(Q(z,S),f(n,z?.minSize,w)),{renderer:n}}function Z(e,r,a){r||e.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),r&&"point"===a&&e.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))}))}function Q(e,r){"point"===r&&e.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===r&&e.minSize.stops?.forEach((e=>{e.size*=1.8}))}const X=new Set(["unique-value","class-breaks"]),Y=new e("#aaaaaa"),ee=new e("#5c5c5c"),re=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function ae(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!U(A).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+R(A).join(", "));const i=null!=r.signal?{signal:r.signal}:null;await a.load(i);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const{renderer:n}=a;if(!n)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!X.has(n.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${n.type} renderer.`);if("valueExpression"in n&&n.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===n.type){if(n.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=n.uniqueValueInfos&&n.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===n.type){if(n.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(n.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===n?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function ie(e){const a=await ae(e),{layer:i,shape:t,defaultSymbolEnabled:n,legendOptions:l}=a,{renderer:o}=i,p=(await s("esri/smartMapping/t9n/smartMapping")).other;let m=[];"unique-value"===o?.type&&(m=te({renderer:o,defaultSymbolEnabled:n,defaultLabelBackup:p})),"class-breaks"===o?.type&&(m=ne({renderer:o,defaultSymbolEnabled:n,defaultLabelBackup:p}));const c=[],d=[];for(const r of m){const{field:e,color:a}=r;c.push(e),d.push(new u({color:a,field:e.name,label:e.alias}))}return{fields:c,renderer:new r({attributes:d,legendOptions:l,holePercentage:"donut"===t?.45:0,outline:null,size:9,othersCategory:null})}}function te(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:s,defaultLabel:u}=r,p=r.uniqueValueInfos??[],m=s&&a,c=m?9:10,d=i(re,c),f=(n?p.slice(0,c).map(((e,r)=>{const a=e.label,i=d[r];return{field:new l({name:se(e.value?.toString()),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:oe(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}})):null)??[];if(m){const e="cluster_default",r=u||t;f.push({field:new l({name:se(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:ue(n,p),returnType:"number"}),statisticType:"sum"}),color:le(s,ee)})}return f}function ne(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:s,defaultSymbol:u,defaultLabel:p}=r,m=u&&a,c=m?9:10,d=i(re,c),f=s.slice(0,c).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,i=d[r];return{field:new l({name:se(a),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:pe(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}}));if(m){const e="cluster_default",r=p||t;f.push({field:new l({name:se(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:me(n,s),returnType:"number"}),statisticType:"sum"}),color:le(u,ee)})}return f}function se(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function le(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=N(e);if(r)return r.clone()}return r?r.clone():Y.clone()}function oe(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function ue(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function pe(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function me(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{J as createRenderer,ie as createRendererForClustering,K as regenerateRenderer};
|
|
5
|
+
import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import{createUniqueColors as i}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as s}from"../../intl/messages.js";import o from"../../layers/support/AggregateField.js";import l from"../../layers/support/ExpressionInfo.js";import u from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as p}from"../../renderers/support/OthersCategory.js";import m from"../../renderers/support/RendererLegendOptions.js";import c from"../heuristics/outline.js";import d from"../heuristics/sizeRange.js";import{createVisualVariables as f}from"./size.js";import{spliceVisualVariables as b,findSizeVVIndex as h,updateAuthoringInfoVisualVariable as y,findOutlineVVIndex as w,findScaleDependentSizeVVIndex as g,processRegenerateParams as v,getRendererToUpdate as z,getStyleType as S,hasOutlineVV as E,hasScaleDependentSizeVV as j,isSizeVV as V}from"./support/regenerateUtils.js";import{errorCallback as x,createSymbol as C,getSymbolOutlineFromScheme as T,verifyBasicFieldValidity as $,getBasemapInfo as I}from"./support/utils.js";import O from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as k}from"../statistics/support/utils.js";import{verifyBinningParams as q}from"../support/binningUtils.js";import{getFieldsList as B}from"../support/utils.js";import{LayerType as L,binningCapableLayerTypes as R,createLayerAdapter as P,getLayerTypeLabels as U,getLayerTypes as F}from"../support/adapters/support/layerUtils.js";import{cloneScheme as M,getSchemes as N}from"../symbology/pieChart.js";import{getCIMSymbolColor as _}from"../../symbols/support/cimSymbolUtils.js";import A from"../../symbols/SimpleLineSymbol.js";const D=[L.CSVLayer,L.FeatureLayer,L.GeoJSONLayer,L.KnowledgeGraphSublayer,L.OGCFeatureLayer,L.OrientedImageryLayer,L.StreamLayer,L.WFSLayer];async function G(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&q(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?R:D,i=P(r.layer,a,e.forBinning);if(!i)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+U(a).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),i.load(n)]);const s=i.geometryType,o="polygon"===s,l="point"===s||"multipoint"===s||o;if(r.outlineOptimizationEnabled=!!o&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!l&&r.sizeOptimizationEnabled,!l)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await B({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=$(i,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return{...r,layer:i}}async function W(e){const r="regenerate-pie-chart-renderer";await v(e,r);const a=await z(e);if("pie-chart"!==S(a))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{visualVariables:i}=a,{layer:n,forBinning:s,filter:o,view:l,signal:u}=e,p=E(a),m=j(a),c=i?.some(V),d=a.attributes.map((e=>({field:e.field,label:e.label,valueExpression:e.valueExpression,valueExpressionTitle:e.valueExpressionTitle}))),f=await G({layer:n,attributes:d,outlineOptimizationEnabled:p,sizeOptimizationEnabled:m,includeSizeVariable:c,forBinning:s,filter:o,view:l,signal:u});return{...e,creatorParameters:f,renderer:a}}async function H(e){let r=e.pieChartScheme,a=null,i=null;const t=await I(e.basemap,e.view);if(a=null!=t.basemapId?t.basemapId:null,i=null!=t.basemapTheme?t.basemapTheme:null,r)return{scheme:M(r),basemapId:a,basemapTheme:i};const n=N({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:i});return n&&(r=n.primaryScheme,a=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:a,basemapTheme:i}}async function J(e,r){const{valueExpression:a,sqlExpression:i,sqlWhere:t}=k(e.attributes),n=await s("esri/smartMapping/t9n/smartMapping");return f({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:i,sqlWhere:t,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:n.sumOfCategories},view:e.view,signal:e.signal})}async function K(e){const[o,l]=await Promise.all([G(e),s("esri/smartMapping/t9n/smartMapping")]),f=await H(o),b=f?.scheme;if(!b)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const{layer:h,includeSizeVariable:y,sizeOptimizationEnabled:w,outlineOptimizationEnabled:g,view:v,signal:z,filter:S}=o,E=b.sizeScheme,j=o.attributes,V=j.map((e=>e.field)).filter(a),[$,I,k,q]=await Promise.all([V.length>1?O({layer:h,fields:V,view:v,signal:z,filter:S}):null,y?J(o,E):null,!y&&w?d({layer:h,view:v,signal:z,filter:S}).catch(x):null,g?c({layer:h,view:v,signal:z,filter:S}).catch(x):null]),B=$?.predominantCategoryInfos?{uniqueValueInfos:$.predominantCategoryInfos}:{uniqueValueInfos:V.map((e=>({value:e,count:0})))},L=i(b.colors,j.length),R=j.map(((e,r)=>new u({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:L[r]}))),P=h.geometryType,U=null!=E&&"background"in E&&E.background,F=new r({attributes:R,othersCategory:new p({label:l.other,color:o.othersCategoryEnabled?b.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===o.shape?.45:0,backgroundFillSymbol:U?C(P,{type:"2d",color:U.color,outline:T(U,P,q?.opacity)}):null,size:n(b.size),outline:new A(T(b,"point",q?.opacity)),legendOptions:m.from(o.legendOptions)});if(I&&(Q(I,w,P),F.authoringInfo=I.authoringInfo.clone(),F.visualVariables=I.visualVariables?.map((e=>e.clone()))),q?.visualVariables?.length){const e=q.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));F.visualVariables?F.visualVariables.push(...e):F.visualVariables=e}return k?.minSize&&(X(k,P),F.visualVariables?F.visualVariables.push(k.minSize):F.visualVariables=[k.minSize]),{renderer:F,pieChartScheme:M(b),size:I,basemapId:f.basemapId,basemapTheme:f.basemapTheme,statistics:B}}async function Z(e){const{creatorParameters:r,view:a,signal:i,filter:t,renderer:n}=await W(e),{layer:s,outlineOptimizationEnabled:o,includeSizeVariable:l,sizeOptimizationEnabled:u}=r,p=await H(r),m=p?.scheme?.sizeScheme,[f,v,z]=await Promise.all([o?c({layer:s,view:a,signal:i,filter:t}).catch(x):null,l?J(r,m):null,!l&&u?d({layer:s,view:a,signal:i,filter:t}).catch(x):null]),S=s.geometryType;if(v&&(Q(v,u,S),b(n,v?.visualVariables,h),y(n,v?.authoringInfo,"size")),f?.visualVariables?.length){const e=f.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));b(n,e,w)}return z?.minSize&&(X(z,S),b(n,z?.minSize,g)),{renderer:n}}function Q(e,r,a){r||e.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),r&&"point"===a&&e.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))}))}function X(e,r){"point"===r&&e.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===r&&e.minSize.stops?.forEach((e=>{e.size*=1.8}))}const Y=new Set(["unique-value","class-breaks"]),ee=new e("#aaaaaa"),re=new e("#5c5c5c"),ae=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function ie(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!F(D).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+U(D).join(", "));const i=null!=r.signal?{signal:r.signal}:null;await a.load(i);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const n="renderer"in a?a.renderer:void 0;if(!n)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!Y.has(n.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${n.type} renderer.`);if("valueExpression"in n&&n.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===n.type){if(n.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=n.uniqueValueInfos&&n.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===n.type){if(n.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(n.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===n?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function te(e){const a=await ie(e),{layer:i,shape:t,defaultSymbolEnabled:n,legendOptions:o}=a,l="renderer"in i?i.renderer:void 0,p=(await s("esri/smartMapping/t9n/smartMapping")).other;let c=[];"unique-value"===l?.type&&(c=ne({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p})),"class-breaks"===l?.type&&(c=se({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p}));const d=[],f=[];for(const r of c){const{field:e,color:a}=r;d.push(e),f.push(new u({color:a,field:e.name,label:e.alias}))}return{fields:d,renderer:new r({attributes:f,legendOptions:m.from(o),holePercentage:"donut"===t?.45:0,outline:null,size:9,othersCategory:null})}}function ne(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:s,defaultLabel:u}=r,p=r.uniqueValueInfos??[],m=s&&a,c=m?9:10,d=i(ae,c),f=(n?p.slice(0,c).map(((e,r)=>{const a=e.label,i=d[r];return{field:new o({name:oe(e.value?.toString()),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:ue(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}})):null)??[];if(m){const e="cluster_default",r=u||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:pe(n,p),returnType:"number"}),statisticType:"sum"}),color:le(s,re)})}return f}function se(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:s,defaultSymbol:u,defaultLabel:p}=r,m=u&&a,c=m?9:10,d=i(ae,c),f=s.slice(0,c).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,i=d[r];return{field:new o({name:oe(a),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:me(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}}));if(m){const e="cluster_default",r=p||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:ce(n,s),returnType:"number"}),statisticType:"sum"}),color:le(u,re)})}return f}function oe(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function le(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=_(e);if(r)return r.clone()}return r?r.clone():ee.clone()}function ue(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function pe(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function me(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function ce(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{K as createRenderer,te as createRendererForClustering,Z as regenerateRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createScreenPoint as e,pt2px as t,toPt as n}from"../../../core/screenUtils.js";import{defaultBasemapGroups as r,getBasemapId as i}from"../../support/utils.js";const o=r.light,c=r.dark,s=[...o,...c];function l(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b}function u(e,t){let n=0;if(e.length===t.length){let r=e.every(((e,n)=>l(e,t[n])));if(r)n=1;else{r=e.slice().reverse().every(((e,n)=>l(e,t[n]))),r&&(n=-1)}}return n}function a(t){const n=t.width,r=t.height;let i=t.pixelSizeAt(t.toMap(e(.5*n,.5*r),{exclude:[]}));if(i<=0&&(i=t.pixelSizeAt(t.toMap(e(.5*n,.95*r),{exclude:[]})),i<=0)){const e=t.camera.position.clone();e.z=0,i=2*t.pixelSizeAt(e)}return i}function f(e,r){return Math.ceil(a(r)*t(n(e)))}function h(e){const t=i(e,s,!1);return t?o.includes(t)?"light":c.includes(t)?"dark":void 0:null}function p(e){if(!e)return[];const t=new Set,n=[e.primaryScheme];e.secondarySchemes&&n.push(...e.secondarySchemes);for(const r of n)r&&"tags"in r&&r.tags&&r.tags.forEach((e=>t.add(e)));return[...t]}export{h as getBasemapTheme,a as getPixelSize,p as getTagsFromSchemes,u as hasIdenticalColors,f as toWorldScale};
|
|
5
|
+
import{createScreenPoint as e,pt2px as t,toPt as n}from"../../../core/screenUtils.js";import{defaultBasemapGroups as r,getBasemapId as i}from"../../support/utils.js";const o=r.light,c=r.dark,s=[...o,...c];function l(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b}function u(e,t){let n=0;if(e.length===t.length){let r=e.every(((e,n)=>l(e,t[n])));if(r)n=1;else{r=e.slice().reverse().every(((e,n)=>l(e,t[n]))),r&&(n=-1)}}return n}function a(t){const n=t.width,r=t.height;let i=t.pixelSizeAt(t.toMap(e(.5*n,.5*r),{exclude:[]}));if(i<=0&&(i=t.pixelSizeAt(t.toMap(e(.5*n,.95*r),{exclude:[]})),i<=0&&"camera"in t)){const e=t.camera.position.clone();e.z=0,i=2*t.pixelSizeAt(e)}return i}function f(e,r){return Math.ceil(a(r)*t(n(e)))}function h(e){const t=i(e,s,!1);return t?o.includes(t)?"light":c.includes(t)?"dark":void 0:null}function p(e){if(!e)return[];const t=new Set,n=[e.primaryScheme];e.secondarySchemes&&n.push(...e.secondarySchemes);for(const r of n)r&&"tags"in r&&r.tags&&r.tags.forEach((e=>t.add(e)));return[...t]}export{h as getBasemapTheme,a as getPixelSize,p as getTagsFromSchemes,u as hasIdenticalColors,f as toWorldScale};
|
package/support/BasemapStyle.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import"../intl.js";import s from"../core/Accessor.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 e}from"../core/accessorSupport/decorators/subclass.js";import{getLocale as t}from"../intl/locale.js";import{normalizeMessageBundleLocale as p}from"../intl/messages.js";let i=class extends s{constructor(o){super(o),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}get languageParameter(){const o=this.language;let s="local"===o||"global"===o?o:p(o??t())??"global";return s="no"===s?"nb":s,s}};o([r()],i.prototype,"apiKey",void 0),o([r()],i.prototype,"id",void 0),o([r()],i.prototype,"language",void 0),o([r()],i.prototype,"places",void 0),o([r()],i.prototype,"serviceUrl",void 0),o([r()],i.prototype,"worldview",void 0),i=o([e("esri.support.BasemapStyle")],i);const l=i;export{l as default};
|
package/support/revision.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20241220",b="71bcf4dd5c83009937c33220ba9765f643881234";export{c as buildDate,b as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isLayerFromCatalog as e}from"../../layers/catalog/catalogUtils.js";import{FeatureLayerVersionAdapter as r}from"./FeatureLayerVersionAdapter.js";import{NetworkVersionAdapter as t}from"./NetworkVersionAdapter.js";import{SubTypeGroupLayerVersionAdapter as o}from"./SubTypeGroupLayerVersionAdapter.js";function n(n){return"networkServiceUrl"in n?new t(n):"feature"!==n.type||e(n)?"subtype-group"!==n.type||e(n)?null:new o(n):new r(n)}function p(e){const r=[];for(const t of e)if("group"===t.type){const e=t,o=e.allTables.concat(e.allLayers);for(const t of o)if("feature"===t.type||"subtype-group"===t.type){const e=n(t);e&&r.push(e)}}else{const e=n(t);e&&r.push(e)}return r}export{p as createVersionAdapters};
|
|
5
|
+
import{isLayerFromCatalog as e}from"../../layers/catalog/catalogUtils.js";import{FeatureLayerVersionAdapter as r}from"./FeatureLayerVersionAdapter.js";import{NetworkVersionAdapter as t}from"./NetworkVersionAdapter.js";import{SubTypeGroupLayerVersionAdapter as o}from"./SubTypeGroupLayerVersionAdapter.js";function n(n){return"networkServiceUrl"in n?new t(n):"feature"!==n.type||e(n)?"subtype-group"!==n.type||e(n)?null:new o(n):new r(n)}function p(e){const r=[];for(const t of e)if("group"===t.type){const e=t,o=e.allTables.concat(e.allLayers);for(const t of o)if("feature"===t.type||"subtype-group"===t.type){const e=n(t);e&&r.push(e)}}else{const e=n(t);e&&r.push(e)}return r}export{n as createVersionAdapter,p as createVersionAdapters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{numericHash as e}from"../../../../../../core/string.js";import{discardUrlIfHasUrlHash as t}from"../../Utils.js";import{AResourceProxy as r}from"../../shaderGraph/techniques/mesh/AResourceProxy.js";class s extends r{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(r){const s=t(r.resource),o=e(JSON.stringify(s));return this._pendingIds.has(o)||(this._pendingIds.add(o),this._pendingRequests.push({...r,resourceId:o})),o}async fetchEnqueuedResources(){const e=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;r<t.length;r++){const s=e[r].resourceId;this._resourceIdToResource.set(s,t[r])}}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e],this._abortOptions);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e],this._abortOptions);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}getResource(e){return this._resourceIdToResource.get(e)}}export{s as ResourceProxy};
|
|
5
|
+
import{numericHash as e}from"../../../../../../core/string.js";import{discardUrlIfHasUrlHash as t}from"../../Utils.js";import{AResourceProxy as r}from"../../shaderGraph/techniques/mesh/AResourceProxy.js";class s extends r{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(r){const s=t(r.resource),o=e(JSON.stringify(s));return this._pendingIds.has(o)||(this._pendingIds.add(o),this._pendingRequests.push({...r,resourceId:o})),o}async fetchEnqueuedResources(){const e=this._pendingRequests;if(this._pendingIds.clear(),this._pendingRequests=[],0===e.length)return;const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;r<t.length;r++){const s=e[r].resourceId;this._resourceIdToResource.set(s,t[r])}}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e],this._abortOptions);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e],this._abortOptions);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}getResource(e){return this._resourceIdToResource.get(e)}}export{s as ResourceProxy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as p}from"./handlers/DoubleTapDragZoom.js";import{DragPan as m}from"./handlers/DragPan.js";import{DragRotate as u}from"./handlers/DragRotate.js";import{GamepadNavigation as l}from"./handlers/GamepadNavigation.js";import{KeyPan as h}from"./handlers/KeyPan.js";import{KeyRotate as w}from"./handlers/KeyRotate.js";import{KeyZoom as d}from"./handlers/KeyZoom.js";import{MouseWheelZoom as v}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as g}from"./handlers/PinchAction.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as j,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{DoubleTapDrag as D}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as M}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as b}from"../../input/recognizers/SingleAndDoubleClick.js";const T={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}};let z=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r((()=>!e()),(()=>this._disconnect())),r(e,(()=>this._connect()))])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new f(e,this.view.input),o=[new M,new P,new b,new A(this.view.navigation),new D],r=new j({eventSource:t,recognizers:o});r.installHandlers("prevent-context-menu",[new _],y.INTERNAL),r.installHandlers("navigation",[new g(this.view),new l(this.view),new v(this.view),new c(this.view),new c(this.view,[T.counter]),new m(this.view,"primary"),new h(this.view,T.pan),new d(this.view,T.zoom),new w(this.view,T.rotate),new u(this.view,"secondary"),new p(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,i((()=>this.view?.navigation?.browserTouchPanEnabled),(e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)}),n)}get test(){}};e([s()],z.prototype,"view",void 0),e([s()],z.prototype,"latestPointerType",null),e([s()],z.prototype,"latestPointerLocation",null),e([s()],z.prototype,"multiTouchActive",null),z=e([a("esri.views.2d.input.MapViewInputManager")],z);const C=z;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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._pressed=!1,this.
|
|
5
|
+
import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._keyToDirection=new Map,this._pressed=!1,this._addKeysMapping(t),this.registerIncoming("key-down",s,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",s,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",s,(()=>this._handleStop())),this._visibilityHandle=i((e=>e?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_addKeysMapping(e){this._addKeyMapping(e.clockwise,"clockwise"),this._addKeyMapping(e.counterClockwise,"counterClockwise"),this._addKeyMapping(e.reset,"reset")}_addKeyMapping(e,i){for(const t of e)this._keyToDirection.set(t,i)}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection.get(e.data.key);if(this._pressed=null!=s,this._pressed){if(e.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{t as KeyRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{neverReached as a}from"../../../core/compilerUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as l}from"../../../core/maybe.js";import{notDeepEqual as h}from"../../../core/object.js";import{createAbortError as c,createResolver as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as g}from"../../../core/promiseUtils.js";import{watch as f,initial as m}from"../../../core/reactiveUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import v from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as b}from"../../../layers/graphics/featureConversionUtils.js";import A from"../../../layers/support/FeatureFilter.js";import{checkCurrentUserSupport as F}from"../../../layers/support/featureLayerUtils.js";import{packFields as S}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as x}from"../../../layers/support/timeSupport.js";import j from"../../../rest/support/AggregateFeatureSet.js";import C from"../../../rest/support/FeatureSet.js";import V from"../../../rest/support/Query.js";import{LayerView2DMixin as U}from"./LayerView2D.js";import{FeatureContainer as k}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as q}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as R}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as Q}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as I}from"./features/layerAdapters/FeatureLayerAdapter.js";import{InMemoryLayerAdapter as O}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as L}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as T}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as P}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as H}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as W}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as M}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as D}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import N from"./support/FeatureCommandQueue.js";import{handleNoEngineError as J}from"./support/handleNoEngineError.js";import{HighlightCounter as G}from"./support/HighlightCounter.js";import{toJSONGeometryType as $}from"./support/util.js";import{FeatureTileSubscriptionManager as z}from"../tiling/FeatureTileSubscriptionManager.js";import B from"../../layers/FeatureLayerView.js";import Z from"../../layers/LayerView.js";import K from"../../layers/RefreshableLayerView.js";import X from"../../../geometry/Extent.js";function Y(e,t){const r=new Set;return e&&e.forEach((e=>r.add(e))),t&&t.forEach((e=>r.add(e))),r.has("*")?["*"]:Array.from(r)}const ee=4294967294;let te=class extends(B(K(U(Z)))){constructor(){super(...arguments),this._commandsQueue=new N({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new G,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new R,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new v}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(c()),this._commandsQueue.destroy()}initialize(){this._workerAttached=p(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if("mesh"===e.geometryType)throw new o("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await q(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(c()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map((({vvEvaluators:e,deconflictionEnabled:i})=>({container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r})))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new O(this.layer):new I(this.layer);case"geojson":case"csv":case"wfs":return new O(this.layer);case"parquet":return new H(this.layer);case"subtype-group":return new M(this.layer);case"ogc-feature":return new T(this.layer);case"stream":return new W(this.layer);case"oriented-imagery":return new P(this.layer);case"knowledge-graph-sublayer":return new L(this.layer);case"catalog-footprint":return new Q(this.layer);default:a(this.layer)}return null}get timeExtent(){return x(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let a;e instanceof r?a=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?a=[e]:s.isCollection(e)&&e.length>0?a=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(a="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const o=a?.filter(i);return o?.length?(this._addHighlights(o,t),n((()=>this._removeHighlights(o,t)))):n()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,i){const s=await this.featureContainer.hitTest(i);if(0===s.length)return null;const a=await this.getWorker(),{features:o,aggregates:n}=await a.pipeline.getDisplayFeatures(s),u=this.featureContainer.getSortKeys(s),l=({displayId:e},{displayId:t})=>u.has(e)&&u.has(t)?u.get(e)-u.get(t):e-t;return o.sort(l).reverse(),n.sort(l).reverse(),[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...o.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}async queryStatistics(){const e=await this.getWorker();return J(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return J(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return J(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return J(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return J(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return J(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return J(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return J(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return J(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=C.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await J(r,{features:[]}),s=C.fromJSON(i);return s.features.forEach((e=>this._setLayersForFeature(e))),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await J(r,{features:[]}),s=j.fromJSON(i);return s.features.forEach((e=>this._setLayersForFeature(e))),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return J(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return J(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return J(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return J(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return J(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return J(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await J(r,{count:0,extent:null});return{count:i.count,extent:X.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(e.toJSON(),t),i=await J(r,{features:[]});return C.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new k(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new z({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),d(this._updatingHandles.addPromise(this.getWorker().then((t=>t.pipeline.updateSubscriptions(e)))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([f((()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,viewTimeExtent:this.view.timeExtent,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)})),(()=>this._update()),m),f((()=>this.updateSuspended),(e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())})),f((()=>this.visible),(e=>{this.view.labelManager.requestUpdate()}))]),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=l(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=p(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredFieldsPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("dataUpdating",e.data)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t))))},fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map((e=>e.toJSON())));const s=r.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});if(!a||!a.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await D(a.data,{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=V.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=V.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this._getEffectiveEdit(e);return t?this._commandsQueue.push(t).catch(y):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ee+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ee+1}_getEffectiveEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);if(r&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null;const s=this.layer,a=e.historicMoment?.getTime()??null,n="layerId"in s&&e.editedFeatures?.find((e=>e.layerId===s.layerId));if(n&&this._canEditByFeature(n)){const e=!1,r=!1,i=$(this.layer.geometryType),{adds:s,deletes:o,updates:u}=n.editedFeatures,l=this.layer.objectIdField,h=s.map((t=>b(t,i,e,r))),c=u.map((t=>b(t.current,i,e,r)));return{type:"edit-by-feature",added:h,removed:o.map((e=>"attributes"in e?{globalId:t?e.attributes[t]:null,objectId:l?e.attributes[l]:null}:e)),updated:c,historicMoment:a}}return{type:"edit-by-id",added:e.addedFeatures,updated:e.updatedFeatures,removed:e.deletedFeatures,historicMoment:a}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every((e=>this.view.spatialReference.equals(e.geometry?.spatialReference)))&&r.every((e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference)))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._updateRequiredFields(),F(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},i=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(i,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,i,this._displayRefreshVersion)},a=h(this._lastSchema?.source.mutable,s.source.mutable)||h(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const o=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${o}] FeatureLayerView2D._doUpdate`,{changes:a});const n=await this.getWorker();await n.pipeline.updateSchema(s,o),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${o}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(r){g(r),0}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return null!=this.filter||null!=this.timeExtent||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=Y(this._lastAvailableFields,e);return this._lastAvailableFields=t,S(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[re(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const i of this._highlightCounter.ids()){const t=this._highlightCounter.getHighlightGroups(i),r=this._getHighlightBits(t);e.push({objectId:i,highlightFlags:r})}const t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch((e=>{g(e)||u.getLogger(this).error(e)}));this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function re(e,t,r,i,s){s&&(s=s.clone());const a=null!=s?s.timeExtent:null,o=null!=r&&null!=a?r.intersection(a):r||a;o&&(s??=new A,s.timeExtent=o),s=t.addFilters?.(s,e)??s;let n=s?.toJSON()??null;return i.size&&(n??=(new A).toJSON(),n.hiddenIds=Array.from(i)),n}e([w()],te.prototype,"_commandsQueue",void 0),e([w()],te.prototype,"_sourceRefreshVersion",void 0),e([w()],te.prototype,"_displayRefreshVersion",void 0),e([w({readOnly:!0})],te.prototype,"_pipelineUpdating",void 0),e([w({readOnly:!0})],te.prototype,"hasAllFeatures",null),e([w({readOnly:!0})],te.prototype,"hasAllFeaturesInView",null),e([w({readOnly:!0})],te.prototype,"hasFullGeometries",null),e([w()],te.prototype,"featureEffectView",void 0),e([w()],te.prototype,"labelingCollisionInfos",null),e([w()],te.prototype,"layerAdapter",null),e([w({readOnly:!0})],te.prototype,"timeExtent",null),e([w()],te.prototype,"updating",void 0),te=e([_("esri.views.2d.layers.FeatureLayerView2D")],te);const ie=te;export{ie as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{neverReached as a}from"../../../core/compilerUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as l}from"../../../core/maybe.js";import{notDeepEqual as h}from"../../../core/object.js";import{createAbortError as c,createResolver as d,ignoreAbortErrors as p,throwIfNotAbortError as y,isAbortError as g}from"../../../core/promiseUtils.js";import{watch as f,initial as m}from"../../../core/reactiveUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../../core/support/UpdatingHandles.js";import b from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as F}from"../../../layers/graphics/featureConversionUtils.js";import A from"../../../layers/support/FeatureFilter.js";import{checkCurrentUserSupport as S}from"../../../layers/support/featureLayerUtils.js";import{packFields as j}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as x}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as E}from"../../../layers/support/timeSupport.js";import I from"../../../rest/support/AggregateFeatureSet.js";import U from"../../../rest/support/FeatureSet.js";import k from"../../../rest/support/Query.js";import{LayerView2DMixin as C}from"./LayerView2D.js";import{FeatureContainer as V}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as q}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as R}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as O}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as Q}from"./features/layerAdapters/FeatureLayerAdapter.js";import{InMemoryLayerAdapter as L}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as W}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as H}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as P}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as T}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as M}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as D}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as N}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import G from"./support/FeatureCommandQueue.js";import{handleNoEngineError as J}from"./support/handleNoEngineError.js";import{HighlightCounter as $}from"./support/HighlightCounter.js";import{toJSONGeometryType as z}from"./support/util.js";import{FeatureTileSubscriptionManager as B}from"../tiling/FeatureTileSubscriptionManager.js";import Z from"../../layers/FeatureLayerView.js";import K from"../../layers/LayerView.js";import X from"../../layers/RefreshableLayerView.js";import Y from"../../../geometry/Extent.js";function ee(e,t){const r=new Set;return e&&e.forEach((e=>r.add(e))),t&&t.forEach((e=>r.add(e))),r.has("*")?["*"]:Array.from(r)}const te=4294967294;let re=class extends(Z(X(C(K)))){constructor(){super(...arguments),this._commandsQueue=new G({process:e=>{switch(e.type){case"override":return this._doOverride(e.message);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new $,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new R,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new v,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new b}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(c()),this._commandsQueue.destroy()}initialize(){this._workerAttached=d(),p(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if("mesh"===e.geometryType)throw new o("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===x(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await q(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(c()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map((({vvEvaluators:e,deconflictionEnabled:i})=>({container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r})))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new L(this.layer):new Q(this.layer);case"geojson":case"csv":case"wfs":return new L(this.layer);case"parquet":return new T(this.layer);case"subtype-group":return new D(this.layer);case"ogc-feature":return new H(this.layer);case"stream":return new M(this.layer);case"oriented-imagery":return new P(this.layer);case"knowledge-graph-sublayer":return new W(this.layer);case"catalog-footprint":return new O(this.layer);default:a(this.layer)}return null}get timeExtent(){return E(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let a;e instanceof r?a=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?a=[e]:s.isCollection(e)&&e.length>0?a=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(a="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const o=a?.filter(i);return o?.length?(this._addHighlights(o,t),n((()=>this._removeHighlights(o,t)))):n()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,i){const s=await this.featureContainer.hitTest(i);if(0===s.length)return null;const a=await this.getWorker(),{features:o,aggregates:n}=await a.pipeline.getDisplayFeatures(s),u=this.featureContainer.getSortKeys(s),l=({displayId:e},{displayId:t})=>u.has(e)&&u.has(t)?u.get(e)-u.get(t):e-t;return o.sort(l).reverse(),n.sort(l).reverse(),[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...o.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}async queryStatistics(){const e=await this.getWorker();return J(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return J(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return J(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return J(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return J(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return J(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return J(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return J(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return J(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=U.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await J(r,{features:[]}),s=U.fromJSON(i);return s.features.forEach((e=>this._setLayersForFeature(e))),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await J(r,{features:[]}),s=I.fromJSON(i);return s.features.forEach((e=>this._setLayersForFeature(e))),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return J(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return J(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return J(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return J(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return J(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return J(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await J(r,{count:0,extent:null});return{count:i.count,extent:Y.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(e.toJSON(),t),i=await J(r,{features:[]});return U.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),p(this._updatingHandles.addPromise(this._workerAttached.promise)),p(this._attachProxy()),this.featureContainer=new V(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new B({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),p(this._updatingHandles.addPromise(this.getWorker().then((t=>t.pipeline.updateSubscriptions(e)))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([f((()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,viewTimeExtent:this.view.timeExtent,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)})),(()=>this._update()),m),f((()=>this.updateSuspended),(e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())})),f((()=>this.visible),(e=>{this.view.labelManager.requestUpdate()}))]),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._editUpdatingHandles.addPromise(this._edit(e)))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=l(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=d(),p(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredFieldsPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t))))},fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map((e=>e.toJSON())));const s=r.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});if(!a||!a.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await N(a.data,{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=k.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=k.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find((e=>e.layerId===t.layerId));if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map((e=>e.current)),n=t.map((e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e)),u=await this._resolveIdenifiers(n);return this.addOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]),n=[...s,...a];return this._commandsQueue.push({type:"override-by-id",updates:n,removed:o,historicMoment:r,isWeak:!0}).catch(y)}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%te+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%te+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}async addOverrides(e){const t=!1,r=!1,i=z(this.layer.geometryType),s=this.layer.objectIdField,a=[];for(const n of e.added){const e=F(n,i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=F(n,i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return this._commandsQueue.push({type:"override",updates:a,removed:e.removed,release:[],isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null})}async removeOverrides(e){for(const t of e)if(null==t)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:t});return this._commandsQueue.push({type:"override",updates:[],removed:[],release:e,isWeak:!1,historicMoment:null})}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every((e=>this.view.spatialReference.equals(e.geometry?.spatialReference)))&&r.every((e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference)))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._updateRequiredFields(),S(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},i=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(i,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,i,this._displayRefreshVersion)},a=h(this._lastSchema?.source.mutable,s.source.mutable)||h(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const o=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${o}] FeatureLayerView2D._doUpdate`,{changes:a});const n=await this.getWorker();await n.pipeline.updateSchema(s,o),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${o}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onOverride(e),this.featureContainer.editEnd()}catch(r){g(r),0}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return null!=this.filter||null!=this.timeExtent||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=ee(this._lastAvailableFields,e);return this._lastAvailableFields=t,j(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[ie(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const i of this._highlightCounter.ids()){const t=this._highlightCounter.getHighlightGroups(i),r=this._getHighlightBits(t);e.push({objectId:i,highlightFlags:r})}const t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch((e=>{g(e)||u.getLogger(this).error(e)}));this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ie(e,t,r,i,s){s&&(s=s.clone());const a=null!=s?s.timeExtent:null,o=null!=r&&null!=a?r.intersection(a):r||a;o&&(s??=new A,s.timeExtent=o),s=t.addFilters?.(s,e)??s;let n=s?.toJSON()??null;return i.size&&(n??=(new A).toJSON(),n.hiddenIds=Array.from(i)),n}e([w()],re.prototype,"_commandsQueue",void 0),e([w()],re.prototype,"_sourceRefreshVersion",void 0),e([w()],re.prototype,"_displayRefreshVersion",void 0),e([w({readOnly:!0})],re.prototype,"_pipelineUpdating",void 0),e([w()],re.prototype,"_sourceUpdating",void 0),e([w({readOnly:!0})],re.prototype,"dataUpdating",null),e([w({readOnly:!0})],re.prototype,"hasAllFeatures",null),e([w({readOnly:!0})],re.prototype,"hasAllFeaturesInView",null),e([w({readOnly:!0})],re.prototype,"hasFullGeometries",null),e([w()],re.prototype,"featureEffectView",void 0),e([w()],re.prototype,"labelingCollisionInfos",null),e([w()],re.prototype,"layerAdapter",null),e([w({readOnly:!0})],re.prototype,"timeExtent",null),e([w()],re.prototype,"updating",void 0),re=e([_("esri.views.2d.layers.FeatureLayerView2D")],re);const se=re;export{se 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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as i,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class p extends r{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case i.MAP:return this._renderMapPhase(e);case i.HIGHLIGHT:return this._renderHighlightPhase(e);case i.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&h.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(_(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new c(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new l((()=>this._stage),(e=>this._subscriptions.get(e)?.version),e,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){e(s);const r=t.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(t),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const r=t();return s?s.resolvers.push(r):(s={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(s)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=h.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),a=t.getViewport(),o=e.passOptions,h=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=i.HITTEST;const{distance:d,smallSymbolDistance:l}=e.passOptions,u=Math.max(d,l);for(const i of this.children)i.visible&&i.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(i,e,n.All);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(a),e.passOptions=o,e.drawPhase=h}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,d.Heatmap);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function _(e){return e.techniqueRef.type===d.Heatmap}export{p as FeatureContainer};
|
|
5
|
+
import has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as i,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class p extends r{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case i.MAP:return this._renderMapPhase(e);case i.HIGHLIGHT:return this._renderHighlightPhase(e);case i.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&h.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(_(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new c(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new l((()=>this._stage),(e=>this._subscriptions.get(e)?.version),e,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}swapRenderState(){this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){e(s);const r=t.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(t),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const r=t();return s?s.resolvers.push(r):(s={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(s)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=h.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),a=t.getViewport(),o=e.passOptions,h=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=i.HITTEST;const{distance:d,smallSymbolDistance:l}=e.passOptions,u=Math.max(d,l);for(const i of this.children)i.visible&&i.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(i,e,n.All);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(a),e.passOptions=o,e.drawPhase=h}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,d.Heatmap);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function _(e){return e.techniqueRef.type===d.Heatmap}export{p as FeatureContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import p from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tileSize as l}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import g from"./Processor.js";import{FeatureSource as _}from"./sources/FeatureSource.js";import{FeatureTileSubscription as b}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this.
|
|
5
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import p from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tileSize as l}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import g from"./Processor.js";import{FeatureSource as _}from"./sources/FeatureSource.js";import{FeatureTileSubscription as b}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new p(i),this._source=new _(e.service,this._aggregateAdapter,this._subscriptions,(()=>this._requestUpdate()),s),this._processor=new g(s,this._source),this._handles=t([u((()=>this._source.updateTracking.updating),(()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))}))])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),p=2*t,h=Math.ceil(l/p);for(const a of n){const t=a.tile,n=new Float64Array(h*h);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/p,i=u.readYForDisplay()/p,a=Math.floor(s),l=Math.floor(i);if(a<0||l<0||a>=h||l>=h)continue;const g=((.5+a-s)*p)**2+((.5+l-i)*p)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[l+a*h]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce(((e,t)=>e+t.size()),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe((t=>e.push(t.readLegacyFeatureWorldSpace()))),e}return null}const s=new Set,i=[],r=t.map((e=>e.reader.getCursor())),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s((()=>this._scheduleNextUpdate())))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally((()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()})),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new b(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,null!=e){const{schema:t,version:s}=e.inner;await this._doUpdateSchema(t,s)}const t=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=t){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",t.inner);const e=await this._source.normalizeOverrides(t.inner);null!=e.historicMoment&&this._source.unsafeSetQueryHistoricMoment(e.historicMoment),this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",t.inner)}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const s=this._source.cleanupRemovedChunks();this._processor.removeChunks(s);try{const e=this._source.takeOverrideUpdate();null!=e&&this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._processor.applyOverrideUpdate(e),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")),this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(r){i(r)}null!=t&&t.resolver.resolve(),null!=e&&e.resolver.resolve(),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values());await this._processor.update(e,t,s,i,r),has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y 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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as g}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as y}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as _}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as l}from"./support/AttributeStore.js";import{ComputedAttributeStorage as m}from"./support/ComputedAttributeStorage.js";class f{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new u,this._proxy=new h({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new l({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,(e=>e),((e,s,r)=>{t[r]=e})),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}async update(e,s,r,a,n){const h=e.processor,u=t(this._schema?.storage,h.storage),g=t(this._schema?.mesh.properties,h.mesh.properties),d=t(this._schema?.mesh.factory,h.mesh.factory),y=t(this._schema?.mesh.strategy,h.mesh.strategy),_=b(this._schema?.expressionProperties,h.expressionProperties),l=_.some((e=>this._attributeStore.hasArcadeDependency(e))),f=_.some((e=>this._factory?.hasArcadeDependency(e)??!1)),S=_.some((e=>this._strategy?.hasArcadeDependency(e)))||this._strategy?.isAggregate&&l,j=f||S,I=g||d||y;if(!(u||I||(f||l||S))&&!a)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,h),schema:h}),this._schema=h;const x=o.fromJSON(this._source.service.outSpatialReference),v=new m({fields:this._source.metadata.fieldsIndex,spatialReference:x});if((u||I||l)&&(await this._attributeStore.update(h.storage,v,this._source.metadata,x,s),this._strategy?.invalidateAttributeData(w(h))),!a&&!I&&!j)return;(y||g||j)&&await this._updateStrategy(h.mesh.strategy,x,n,w(h)),this._updateSortKey(v,"sortKey"in h.mesh.properties?h.mesh.properties.sortKey:null);const M=new p(v,this._proxy,r,this._registry);return(d||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(M,h.mesh.factory)),this._invalidate(),this._version=s,this._connection.container.updateRenderState(this._version)}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map((({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1}))),e);const t=this._strategy.displayMap(e,(({objectId:e})=>e),((e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t})));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new g({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch((e=>s(e)));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new _(this._source,this._attributeStore,r);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await y.create(this._connection,e,t,this._source,this._attributeStore,r)}for(const i of s)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),r(t.signal);const s=await this._write(e,t.tile.createArcadeEvaluationOptions(w(this._schema))),i=t.tile.tileInfoView.getLODInfoAt(t.tile.key),{message:a,transferList:o}=s.serialize(i),n={objectIdMap:null,inner:e.createMessage(a,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){n.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)n.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(n,{signal:t.signal,transferList:o}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),s=e.subscription.tile.createArcadeEvaluationOptions(w(this._schema));for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,s);await this._proxy.fetchEnqueuedResources()}async _write(e,t){const s=e.subscription.tile,r=e.reader?.getCursor(),i=r?.getSize()??0,a=s.tileInfoView.tileInfo.isWrappable,o=s.tileInfoView.tileInfo.spatialReference.isWGS84,c=new n(s.key,this._strategy.enablePixelBuffering,a,o,i);if(!r)return c;const h=s.createArcadeEvaluationOptions(w(this._schema));for(;r.next();){const e=this._getSortKeyValue(r,t);c.entityStart(r.getDisplayId(),e),this._factory.write(c,this._proxy,r,h,s.level),c.entityEnd()}return c}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function b(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function w(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{f 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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e){this._source=t,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,(t=>t),(t=>t))}getDisplayAndObjectIds(t){return this.displayMap(t,(t=>t),((t,e,s)=>[t,s]))}
|
|
5
|
+
class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e){this._source=t,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,(t=>t),(t=>t))}getDisplayAndObjectIds(t){return this.displayMap(t,(t=>t),((t,e,s)=>[t,s]))}afterUpdateChunks(){}}export{e as AProcessorStrategy,t as ASendState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../geometry.js";import{unquantizeOptimizedGeometry as e,convertToFeature as t}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as s}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as
|
|
5
|
+
import"../../../../../geometry.js";import{unquantizeOptimizedGeometry as e,convertToFeature as t}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as s}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as r}from"../../../../../layers/graphics/data/projectionSupport.js";import a from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as i}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as n}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as l,FeatureTileUpdateMessage as d}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as c}from"../support/ComputedAttributeStorage.js";import u from"../support/FeatureFilter.js";import{FeatureMetadata as f}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import h from"../../../tiling/TileKey.js";import g from"../../../../../geometry/SpatialReference.js";class m extends n{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.done=!1}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const t of this.featureCache.values()){const s=t.clone();s.geometry&&e(s.geometry,s.geometry,!1,!1,this.subscription.tile.transform),yield s}}}class y extends o{static async create(e,t,s,a,o){const n=new c({spatialReference:t}),l=await Promise.all(e.fields.map((async e=>i.create(n,e)))),d=e.featureFilter?await u.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return"geohash"===e.index.type&&await r(t,g.WGS84),new y(e,d,o,l,t,s,a)}constructor(e,t,s,r,i,o,n){super(o,n,i,r),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._metadata=f.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new a(e.fields).toJSON(),globalIdField:null,spatialReference:o.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new m(e,this._attributeStore)}async*applyOverrideUpdate(e){for(const t of this._sendStates.values()){t.reset();const e=new l(t.subscription,p.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),a=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=r.get(t);if(null!=o){const e=s(i,o,t);a.push(e),r.delete(t)}}return a}getDisplayFeatures(e){const s=new Set(e),r=new Set,a=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())s.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&a.push({...t(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:a}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const r of s.featuresWorldSpace())t.has(r.objectId)||(e(r),t.add(r.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,s=null!=t?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:s}}}}async*_update(e,t){const{handledChunks:r,subscription:a,bins:i,featureCache:o}=e,n=a.tile;if(e.done)return;for(const s of t.chunks()){if(r.has(s.chunkId))continue;r.add(s.chunkId);const t=s.queryInfo;if("tileId"in t){const e=new h(t.tileId);if(e.level!==n.level||e.world!==n.key.world)continue}s.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(i,e.tile.extent,e.tile.resolution)}const l=[],c=a.tile.transform,u=a.tile.key.level;for(const d of i.values()){let e=o.get(d.id);if(e)e.attributes=d.getAttributes();else{const t=d.getGeometry(this.spatialReference,c);e=new s(t,d.getAttributes(),null,d.id),t||(e.centroid=d.getGeometricCentroid(this.spatialReference,c)),e.displayId=this._attributeStore.createDisplayIdForObjectId(`${e.objectId}.${u}`),o.set(d.id,e)}l.push(e)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const f=p.fromOptimizedFeatures(l,this._metadata,c),g=f.getCursor(),m=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,m);const y=new d(e.subscription,f,[],e.done,{});yield y}}export{m as BinningState,y as BinningStrategy};
|