@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{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{GridCell as a}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as d}from"./AProcessorStrategy.js";import{WithDisplayId as
|
|
5
|
+
import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{GridCell as a}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as d}from"./AProcessorStrategy.js";import{WithDisplayId as u}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as h}from"../support/ComputedAttributeStorage.js";import p from"../support/FeatureFilter.js";import{FeatureMetadata as f}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as g}from"../support/FeatureSetReaderJSON.js";import _ from"../../../tiling/TileKey.js";const m=128;class y extends d{constructor(e){super(e),this.didSend=!1,this.done=!1}}class S{constructor(e,t,s,i,r){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield i}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const a of e){const e=a.queryInfo;if("tileId"in e){if(new _(e.tileId).level!==this._level)continue}if(!this._handledChunks.has(a.normalizedChunkId)){this._handledChunks.add(a.normalizedChunkId),s=!0;a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells)}}const i={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},r=l(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of t){const e=a.tile.bounds,t=Math.floor(e[0]*r/n),s=Math.floor(e[1]*r/n),l=Math.ceil(e[2]*r/n),o=Math.ceil(e[3]*r/n);i.xMin=Math.min(i.xMin,t),i.yMin=Math.min(i.yMin,s),i.xMax=Math.max(i.xMax,l),i.yMax=Math.max(i.yMax,o)}return null!=this._lastCellBounds&&i.xMin===this._lastCellBounds.xMin&&i.yMin===this._lastCellBounds.yMin&&i.yMin===this._lastCellBounds.yMin&&i.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=i),s&&this._clusterCells(i),s}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map((([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue})));await e.container.updateStatistics(this._level,t)}}createAggregateFeatures(e,i){const n=e.subscription,a=[],l=n.tile.transform;for(const o of this._clusters.values()){let e=o.inner.getCentroidX(l);const i=o.inner.getCentroidY(l),d=n.tile.lod,u=d.wrap?d.worldSize[0]:null,c=1===o.inner.count?o.inner.firstObjectId:o.inner.id,h=o.displayId;if(null!=u)if(1===u){const n=new s([],[e,i]),l=new t(n,o.inner.getAttributes(),null,c,h);l.geometry.coords[0]-=r,a.push(l);const d=new s([],[e,i]),u=new t(d,o.inner.getAttributes(),null,c,h);u.geometry.coords[0]+=r,a.push(u)}else e>r+r/2?e-=u*r:e<-r/2&&(e+=u*r);if(e<r+m&&e>=-m&&i<r+m&&i>=-m){const r=new s([],[e,i]),n=new t(r,o.inner.getAttributes(),null,c,h);a.push(n)}}return g.fromOptimizedFeatures(a,i,n.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort(((e,t)=>t.count-e.count));const s=[];for(const a of this._clusters.values())s.push(a.inner.id);this._clusters.clear();const i=this._clusterRadius*(1/l(this._indexOptions.spatialReference,this._scale)),r=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const l of t){if(n.has(l.id))continue;if(l.gridX<e.xMin||l.gridX>e.xMax||l.gridY<e.yMin||l.gridY>e.yMax)continue;const t=this._store.createDisplayIdForObjectId(l.id),s=new u(l.clone(),t);n.add(l.id),this._clusters.set(l.id,s);const o=l.centroidXWorld,d=l.centroidYWorld;for(let e=l.gridY-r;e<=l.gridY+r;e++)for(let t=l.gridX-r;t<=l.gridX+r;t++){if(e===l.gridY&&t===l.gridX)continue;const r=this._cells.get(a.createId(t,e));if(!r||n.has(r.id))continue;const u=Math.abs(r.centroidXWorld-o),c=Math.abs(r.centroidYWorld-d);u<i&&c<i&&(s.inner.merge(r),n.add(r.id))}}for(const a of s)this._store.releaseDisplayIdForObjectId(a)}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,n=e.get(r.name);if(n){const{minValue:e,maxValue:i}=n,r=Math.min(n.minValue,t),a=Math.max(n.maxValue,t);e===r&&i===a||(n.minValue=r,n.maxValue=a,s=!0)}else e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class x extends o{static async create(e,t,s,i,r,a){const l=new h({spatialReference:s}),o={type:"grid",fields:await Promise.all(t.fields.map((async e=>n.create(l,e)))),spatialReference:s,featureFilter:t.featureFilter?await p.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:a};return new x(e,t.clusterRadius,o,t.fields,i,r)}constructor(e,t,s,r,n,a){super(n,a,s.spatialReference,s.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=f.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new i([...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new y(e)}async*applyOverrideUpdate(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const i=new Map(e.map((e=>[t(e),e]))),r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.clusters()){const e=i.get(a.inner.id);if(null==e){if(1===a.inner.count){const{firstObjectId:e}=a.inner,t=e?i.get(e):null;if(null!=t){const n=s(a.displayId,t,e);r.push(n),i.delete(e)}}}else{const t=s(a.displayId,e,a.inner.id);r.push(t),i.delete(a.inner.id)}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const l of a.aggregatesWorldSpace())if(s.has(l.displayId)&&!i.has(l.displayId)){const t=e(l,this._metadata.geometryType,!1,!1);if(i.add(l.displayId),1===t.attributes.cluster_count){r.push({...t,displayId:l.displayId});continue}n.push({...t,displayId:l.displayId})}return{features:r,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter((e=>e.subscription.tile.level===this._requiredLevel));if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const n of s)n.subscription.tile.level===this._requiredLevel&&(n.didSend=!1,n.done=!1);const i=Array.from(this._sendStates.values()).filter((e=>e.done)).map((e=>e.subscription.tile.key)),r=new Set(i);for(const n of this._sendStates.values()){if(this._source.updateTracking.updating){if(i.some((e=>e.containsChild(n.subscription.tile.key))))continue;if(n.subscription.tile.key.getChildKeys().every((e=>r.has(e))))continue}n.didSend||n.subscription.tile.level!==this._requiredLevel||(n.didSend=!0,yield*this._update(n,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new S(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,n);const a=new c(e.subscription,i,!0,e.done,{});yield a}}export{y as ClusterState,x as ClusterStrategy};
|
|
@@ -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{ASendState as e,AProcessorStrategy as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as
|
|
5
|
+
import has from"../../../../../core/has.js";import{ASendState as e,AProcessorStrategy as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends e{}class i extends t{constructor(e,t,s){super(e,t),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,this._evalOptions=a(this._evalOptions.$view.scale,e)}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new d(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),o=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const t=e.getObjectId(),a=e.getDisplayId(),n=r.get(t);if(null!=n){const e=s(a,n,t);o.push(e),r.delete(t)}}}return o}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const o=e.getObjectId(),a=e.getDisplayId();t.has(a)&&!s.has(o)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const r=n.fromOptimizedFeatures(e.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions);const a=[];for(const s of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(s);null!=e&&a.push(e)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:a});const d=o.fromFeatures(e.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,t,!1,d.queryInfo);for(const o of this._sendStates.values()){const e=d.getTileReader(o.subscription.tile);yield new s(o.subscription,e,a,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a))continue;s.add(a);const n=o.getTileReader(t.tile);n&&(yield new r(e.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
|
|
@@ -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
|
|
5
|
+
import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as u}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as c}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as m}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as p}from"./strategies/PagedTileLoadStrategy.js";import{ParquetLoadStrategy as l}from"./strategies/ParquetLoadStrategy.js";import{SnapshotLoadStrategy as _}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as y}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as f}from"../support/FeatureMetadata.js";import{UpdateTracking2D as v}from"../../support/UpdateTracking2D.js";class S{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._onChange=r,this._connection=a,this._updateTracking=new v({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=f.createFeature(e.metadata),this._store=new g(this._onChange,this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map((e=>e.close()))}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,objectIdField:s.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!(!i(n,"dataFilter")&&!i(n,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new c(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=new Set(e),s=this.metadata.globalIdField;if(null==s)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=[];return this._store.forEachUnsafe((e=>{const a=e.readAttribute(s);if(t.has(a)){const t=e.getObjectId();null!=t&&r.push(t)}})),r}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new y(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return new l(e,this._metadata,this._schema,this._store)}const a=this.service,i=u.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new _(a,i,this._store,n.featureCount,this.metadata,this._connection):r?new p(a,i,this._store,this.metadata,this._connection):new m(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map((e=>this._strategy.load(e).then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))))));this._updateTracking.addPromise(i);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r||!r.supportsSnapshotMinThreshold||!r.snapshotCountThresholds)return null;const a=e.source,i=t.createQuery();i.inner.orderByFields=[],i.inner.returnGeometry=!1;const n=(await d(a,i.inner,{query:i.customParameters})).data.count,{min:o,max:h}=r.snapshotCountThresholds;return n<=o||r.supportsSnapshotMaxThreshold&&n<h?{featureCount:n}:null}}export{S as FeatureSource};
|
|
@@ -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 r{constructor(r){this._store=r,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(r){throw new Error("InternalError: LoadStrategy does not support query info")}async
|
|
5
|
+
class r{constructor(r){this._store=r,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(r){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(r){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(r){throw new Error("InternalError: LoadStrategy does not support loading blobs")}}export{r as ALoadStrategy};
|
|
@@ -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{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as
|
|
5
|
+
import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as r}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as a}from"../../../support/FeatureSetReaderIndirect.js";class i{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const t=this._getSpatialIndex().search(e);return a.from(this.reader,t)}getAggregateIndex(e){const a=JSON.stringify(e);if(a!==this._aggregateIndexHash){switch(this._aggregateIndexHash=a,e.type){case"grid":this._aggregateIndex=new r(e);break;case"geohash":this._aggregateIndex=new t(e)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{i as ASourceChunk};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as t}from"../../../support/FeatureSetReaderJSON.js";class s{constructor(){this.modified=[],this.removed=[]}modify(e){this.modified.push(e)}remove(e){this.removed.push(e)}get isEmpty(){return 0===this.modified.length&&0===this.removed.length}}class r extends e{constructor(e){super(),this._reader=e,this.chunkId="override",this.normalizedChunkId="override"}static fromFeatures(e,s){const i=t.fromOptimizedFeatures(e,s);return new r(i)}get reader(){return this._reader}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}getTileReader(e){if(!this._reader.getSize())return null;const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class i{constructor(e,t){this.inner=e,this.isWeak=t,this.lastWeak=null}}class o{constructor(){this._overrides=new Map,this._update=new s}hasOverride(e){return this._overrides.has(e)}onChunkInsert(e){if(this._overrides.size){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),s=this._overrides.get(e);s?.lastWeak&&(s.lastWeak=null),s?.isWeak&&(this._overrides.delete(e),this._update.remove(e),this.invalidate())}}e.registerOverrides(this)}apply(e,t){const{updateWeak:s,removeWeak:r,update:o,remove:n,release:d}=e.commands;this.invalidate();for(const a of s)this._overrides.set(a.objectId,new i(a,!0)),this._update.modify(a);for(const a of o){const e=new i(a,!1),t=this._overrides.get(a.objectId);t?.isWeak&&(e.lastWeak=t),this._overrides.set(a.objectId,e),this._update.modify(a)}for(const a of r)this._overrides.set(a,new i(null,!0)),this._update.remove(a);for(const a of n){const e=new i(null,!1),t=this._overrides.get(a);t?.isWeak&&(e.lastWeak=t),this._overrides.set(a,e),this._update.remove(a)}if(d.length){const e=new Set;for(const t of d){const s=this._overrides.get(t);s?.lastWeak?this._overrides.set(t,s.lastWeak):s&&!s.isWeak&&(this._overrides.delete(t),e.add(t))}t.forEachUnsafe((t=>{const s=t.getObjectId();e.has(s)&&(this._update.modify(t.readOptimizedFeatureWorldSpace()),e.delete(s))}));for(const t of e.values())this._update.remove(t)}}takeOverrideUpdate(){const e=this._update;return e.isEmpty?null:(this._update=new s,e)}asChunk(e){if(!this._chunk){const t=[];for(const e of this._overrides.values())null!=e.inner&&t.push(e.inner);this._chunk=r.fromFeatures(t,e)}return this._chunk}invalidate(){this._chunk=null}}export{r as OverrideChunk,o as OverrideState,s as OverrideUpdate};
|
|
@@ -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/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{
|
|
5
|
+
import e from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{OverrideState as o}from"./Overrides.js";class r{constructor(s,r){this._onChange=s,this._metadata=r,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new o,this.events=new e,this.featureAdapter=new t}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear()}*chunks(){this._overrides&&(yield this._overrides.asChunk(this._metadata)),yield*this._chunks.values()}insert(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrides.onChunkInsert(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyOverride(e){this._overrides.apply(e,this),this.events.emit("changed");for(const s of this._chunks.values())s.invalidate()}takeOverrideUpdate(){return this._overrides.takeOverrideUpdate()}forEach(e){const s=new Set;for(const t of this.chunks()){const o=t.reader.getCursor();for(;o.next();){const t=o.getObjectId();s.has(t)||(e(o.copy()),s.add(t))}}}forEachUnsafe(e){const s=new Set;for(const t of this.chunks()){const o=t.reader.getCursor();for(;o.next();){const t=o.getObjectId();s.has(t)||(e(o),s.add(t))}}}forEachInBounds(e,s){const t=new Set;for(const o of this.chunks()){const r=o.queryFeaturesInBounds(e);for(;r.next();){const e=r.getObjectId();t.has(e)||(s(r.copy()),t.add(e))}}}forEachBounds(e,t){const o=s();for(const s of e){s.getBounds(o)&&t(o)}}}export{r as FeatureSourceChunkStore};
|
|
@@ -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{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{getCentroidOptimizedGeometry as n}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as d,quantizeOptimizedGeometry as u,unquantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as c}from"../../../../../layers/graphics/OptimizedFeature.js";import l from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as m,unknown as y}from"../../../../../time/timeZoneUtils.js";import{FeatureSetCache as f}from"./FeatureSetCache.js";import{StaticBitSet as p}from"./StaticBitSet.js";import{fromJSON as g}from"../../../../../geometry/support/jsonUtils.js";const _=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],b=_[0],x=_[1],T=_[2],I=_[3],D=has("featurelayer-simplify-payload-size-factors")??[1,2,4],F=D[0],A=D[1],S=D[2],j=has("featurelayer-simplify-mobile-factor")??2,B=has("esri-mobile"),M=4294967295;function C(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class G{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=B?j:1;t>4e6?r=S*s:t>1e6?r=A*s:t>5e5?r=F*s:t>1e5&&(r=s);let i=0;return e>4e3?i=I*r:e>2e3?i=T*r:e>100?i=x:e>15&&(i=b),i}getBounds(e){if(C(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===M)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(M),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return o(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e.values())r.has(t)&&this._removeAtIndex(r.get(t))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new c(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return d(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){const t=this.readGeometryForDisplay(),r=new l;return u(r,t,this.hasZ,this.hasM,this.geometryType,e),r.deltaDecode()}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&h(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&h(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new f(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=d(e,this.geometryType,this.hasZ,this.hasM),r=g(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??m):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===y}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(null==this.getInTransform())return n(new l,e,this.hasM,this.hasZ);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=a(t);return r?(r[1]*=-1,new l([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return d(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new l([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new l([2],[e-1,t+1,1,-1])}_removeAtIndex(e){null==this._deleted&&(this._deleted=p.create(this.getSize())),this._deleted.set(e)}}export{G as FeatureSetReader};
|
|
5
|
+
import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{DateOnly as t}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as s}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{getCentroidOptimizedGeometry as o}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as n,quantizeOptimizedGeometry as d,unquantizeOptimizedGeometry as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as h}from"../../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as l,unknown as m}from"../../../../../time/timeZoneUtils.js";import{FeatureSetCache as y}from"./FeatureSetCache.js";import{fromJSON as f}from"../../../../../geometry/support/jsonUtils.js";const p=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],g=p[0],_=p[1],b=p[2],x=p[3],T=has("featurelayer-simplify-payload-size-factors")??[1,2,4],D=T[0],F=T[1],A=T[2],I=has("featurelayer-simplify-mobile-factor")??2,S=has("esri-mobile"),B=4294967295;function j(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class G{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=S?I:1;t>4e6?r=A*s:t>1e6?r=F*s:t>5e5?r=D*s:t>1e5&&(r=s);let i=0;return e>4e3?i=x*r:e>2e3?i=b*r:e>100?i=_:e>15&&(i=g),i}getBounds(e){if(j(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===B)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(B),!1;let r=1/0,s=1/0,a=-1/0,o=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),a=Math.max(a,e),o=Math.max(o,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(a),this.setBoundsYMax(o),i(e,r,s,a,o),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),a=this.getBoundsYMax();return i(e,t,r,s,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new h(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return n(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){const t=this.readGeometryForDisplay(),r=new c;return d(r,t,this.hasZ,this.hasM,this.geometryType,e),r.deltaDecode()}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&u(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&u(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new y(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=n(e,this.geometryType,this.hasZ,this.hasM),r=f(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??l):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===m}field(s){let i=this.fields.get(s);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(this.readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(this.readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,this.readAttribute(s,!0));default:return this.readAttribute(s,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(s),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(a._readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(a._readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,a._readAttribute(s,!0));default:return this.readAttribute(s,!1)}throw new Error(`Field ${s} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return o(new c,e,this.hasM,this.hasZ);const t=s.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=a(t);return r?(r[1]*=-1,new c([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return n(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new c([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new c([2],[e-1,t+1,1,-1])}}export{G as FeatureSetReader};
|
|
@@ -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{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import i from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";class u extends n{static fromFeatures(t,r){const{objectIdField:s,geometryType:i}=r,n=e([],t,i,!1,!1,s);for(let e=0;e<n.length;e++)n[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(n,r)}static fromFeatureSet(e,r){const s=t(e,r.objectIdField);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new i(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=t.geometryType,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}
|
|
5
|
+
import{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import i from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";class u extends n{static fromFeatures(t,r){const{objectIdField:s,geometryType:i}=r,n=e([],t,i,!1,!1,s);for(let e=0;e<n.length;e++)n[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(n,r)}static fromFeatureSet(e,r){const s=t(e,r.objectIdField);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new i(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=t.geometryType,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new u(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return s(this._current)?r(this._current.geometry,2):0}_readX(){return s(this._current)?this._current.geometry.coords[0]:0}_readY(){return s(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return s(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(e,t){if(!this._fieldsIndex){const t=this._current.attributes[e];if(void 0!==t)return t;const r=e.toLowerCase();for(const e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e];return}const r=this._fieldsIndex.get(e);if(!r)return;const s=this._current.attributes[r.name];return null==s?s:t&&this.fields.isDateField(e)?new Date(s):s}_readAttributes(){return this._current.attributes}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}}export{u as FeatureSetReaderJSON};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{createResolver as e}from"../../../../core/promiseUtils.js";class s{constructor(){this._commands=new Map,this._historicMoment=null,this._resovler=e()}get promise(){return this._resovler.promise}resolve(){this._resovler.resolve()}add(e){switch(e.type){case"override":return this._addOverride(e);case"override-by-id":return this._addOverrideById(e)}}toMessage(){const e={historicMoment:this._historicMoment,commands:{updateByIdWeak:[],updateWeak:[],removeWeak:[],update:[],remove:[],release:[]}};for(const[s,r]of this._commands.entries())switch(r.type){case"override-update-by-id":e.commands.updateByIdWeak.push(s);break;case"override-update":r.isWeak?e.commands.updateWeak.push(r.feature):e.commands.update.push(r.feature);break;case"override-remove":r.isWeak?e.commands.removeWeak.push(s):e.commands.remove.push(s);break;case"override-release":e.commands.release.push(s)}return e}_addOverrideById(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s,{type:"override-update-by-id",isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak})}_addOverride(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s.objectId,{type:"override-update",feature:s,isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak});for(const s of e.release)this._commands.set(s,{type:"override-release"})}}export{s as DebouncedFeatureOverride};
|
|
@@ -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{ignoreAbortErrors as e}from"../../../../core/promiseUtils.js";import{UpdateTracking2D as s}from"./UpdateTracking2D.js";import{QueueProcessor as
|
|
5
|
+
import{ignoreAbortErrors as e}from"../../../../core/promiseUtils.js";import{DebouncedFeatureOverride as r}from"./DebouncedFeatureOverride.js";import{UpdateTracking2D as s}from"./UpdateTracking2D.js";import{QueueProcessor as t}from"../../../support/QueueProcessor.js";class i{constructor(e){this.updateTracking=new s({debugName:"FeatureCommandQueue"}),this._nextOverride=null,this.process=e.process,this._queueProcessor=new t({concurrency:1,process:async e=>{if("override"===e.type){const e=this._nextOverride;if(null==e)throw new Error("InternalError: Override should be defined");return this._nextOverride=null,await this.process({type:"override",message:e.toMessage()}),void e.resolve()}return this.process(e)}})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(r){return e(this.updateTracking.addPromise(this._doPush(r)))}async _doPush(e){const r=this._queueProcessor,s=r.last();switch(e.type){case"update":case"highlight":if(s?.type===e.type)return;return r.push(e);case"override":case"override-by-id":return this._pushOverride(e)}}_pushOverride(e){return null==this._nextOverride&&(this._nextOverride=new r,this._queueProcessor.push({type:"override"})),this._nextOverride.add(e),this._nextOverride.promise}}export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{watch as r,initial as i}from"../../../core/reactiveUtils.js";import{property as n}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 s}from"./handlers/DoubleClickZoom.js";import{DragRotate as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{watch as r,initial as i}from"../../../core/reactiveUtils.js";import{property as n}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 s}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as d}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as l}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as u}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as g}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as h}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as w}from"../../input/BrowserEventSource.js";import{InputManager as y,ViewEventPriorities as _}from"../../input/InputManager.js";import{PreventContextMenu as f}from"../../input/handlers/PreventContextMenu.js";import{Drag as v}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as D}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as j}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as M}from"../../input/recognizers/VerticalTwoFingerDrag.js";import{PivotPoint as P}from"../state/controllers/RotateController.js";let b=class extends e{destroy(){this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(t){"pan"!==t&&"rotate"!==t||t===this._get("primaryDragAction")||(this._set("primaryDragAction",t),this._updateMode())}get mode(){return this._get("mode")}set mode(t){"default"!==t&&"pro"!==t||t===this._get("mode")||(this._set("mode",t),this._updateMode())}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=o(this._inputManager),this._source=o(this._source)}connect(){const t=this.view;this._source=new w(this.view.surface,t.input);const e=[new D,new A,new j,new v(this.view.navigation),new M],o=new y({eventSource:this._source,recognizers:e});this._inputManager=o,o.installHandlers("prevent-context-menu",[new f],_.INTERNAL);const n={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new u(t,"primary"),this._modeDragRotate=new m(t,"secondary",P.CENTER),this._modeDragZoom=new p(t,"tertiary",n.fov),this._modeKeyboardNavigation=new c(t,n),o.installHandlers("navigation",[new g(t),new s(t),new d(t),new l(t,n.fov),new m(t,"primary",P.EYE,[n.lookAround.modifier]),new m(t,"secondary",P.CENTER,[n.lookAround.modifier]),new u(t,"tertiary",[n.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new h(t)],_.INTERNAL),this.view.viewEvents.connect(o),this._updateMode(),this.addHandles(r((()=>this.view.navigation?.browserTouchPanEnabled),(t=>{this._source.browserTouchPanningEnabled=!t}),i))}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_updateMode(){const t=this.mode,e=this.primaryDragAction,o=T.get(t)?.get(e);o&&(this._modeDragPan&&(this._modeDragPan.pointerAction=o.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=o.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=o.zoom))}get test(){}};t([n()],b.prototype,"view",void 0),t([n({value:"pan"})],b.prototype,"primaryDragAction",null),t([n({value:"default"})],b.prototype,"mode",null),t([n({readOnly:!0})],b.prototype,"updating",null),t([n()],b.prototype,"latestPointerType",null),t([n()],b.prototype,"latestPointerLocation",null),t([n()],b.prototype,"multiTouchActive",null),t([n()],b.prototype,"_inputManager",void 0),b=t([a("esri.views.3d.input.SceneInputManager")],b);const T=new Map,z=new Map,R=new Map;z.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),z.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),R.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),R.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),T.set("default",z),T.set("pro",R);const E=b;export{E 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{ViewingMode as t}from"../../../ViewingMode.js";import{GamepadKeyboardController as i}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as o}from"../../../input/VisibilityChange.js";var
|
|
5
|
+
import{ViewingMode as t}from"../../../ViewingMode.js";import{GamepadKeyboardController as i}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as o}from"../../../input/VisibilityChange.js";var n;!function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.FORWARD=2]="FORWARD",t[t.BACKWARD=3]="BACKWARD",t[t.UP=4]="UP",t[t.DOWN=5]="DOWN",t[t.HEADINGLEFT=6]="HEADINGLEFT",t[t.HEADINGRIGHT=7]="HEADINGRIGHT",t[t.TILTUP=8]="TILTUP",t[t.TILTDOWN=9]="TILTDOWN",t[t.ZOOMIN=10]="ZOOMIN",t[t.ZOOMOUT=11]="ZOOMOUT"}(n||(n={}));class a extends e{constructor(i,e){super(!0),this._view=i,this._keyToDirection=new Map,this._keyToAction=new Map,this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:t.Local},this._stickyKeyTimeoutHandle=void 0,this._stickyKeyDuration=200,this._addKeysMapping(e),this.registerIncoming("key-down",null,(t=>this._handleKeyDown(t))),this.registerIncoming("key-up",null,(t=>this._handleKeyUp(t))),this.registerIncoming("blur",null,(()=>this._handleStop())),this._visibilityHandle=o((t=>t?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}setStickyKeyDuration(t){this._stickyKeyDuration=t}_addKeysMapping(t){this._addKeyMapping(t.pan.left,n.LEFT),this._addKeyMapping(t.pan.right,n.RIGHT),this._addKeyMapping(t.pan.forward,n.FORWARD),this._addKeyMapping(t.pan.backward,n.BACKWARD),this._addKeyMapping(t.pan.up,n.UP),this._addKeyMapping(t.pan.down,n.DOWN),this._addKeyMapping(t.lookAround.headingLeft,n.HEADINGLEFT),this._addKeyMapping(t.lookAround.headingRight,n.HEADINGRIGHT),this._addKeyMapping(t.lookAround.tiltUp,n.TILTUP),this._addKeyMapping(t.lookAround.tiltDown,n.TILTDOWN),this._addKeyMapping(t.zoom.zoomIn,n.ZOOMIN),this._addKeyMapping(t.zoom.zoomOut,n.ZOOMOUT),this._addKeyAction(t.reset.heading,(()=>this._resetHeading())),this._addKeyAction(t.reset.tilt,(()=>this._resetTilt()))}_addKeyMapping(t,i){for(const e of this._eachKey(t))this._keyToDirection.set(e,i)}*_eachKey(t){"string"==typeof t?yield t:yield*t}_addKeyAction(t,i){for(const e of this._eachKey(t))this._keyToAction.set(e,i)}_handleKeyDown(t){if(t.data.native.ctrlKey||t.data.native.metaKey)return;const e=this._keyToAction.get(t.data.key);if(null!=e)return t.stopPropagation(),void e();const o=this._keyToDirection.get(t.data.key);if(null!=o&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.running||(this._cameraControllerKeyboard=new i({view:this._view,disableMovements:this._disableMovements}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.running)){if(t.stopPropagation(),this._cameraControllerKeyboard.directionActive(o))return;if(this._cameraControllerKeyboard.activateDirection(o),this._cameraControllerKeyboard.countActiveDirections()>1||!this._isPanning(o))return;this._stickyKeyDuration>0&&(this._stickyKeyTimeoutHandle=setTimeout((()=>{this._stickyKeyTimeoutHandle=void 0,null!=this._stickyDirection&&void 0!==this._stickyDirection&&(this._cameraControllerKeyboard?.deactivateDirection(this._stickyDirection),this._stickyDirection=void 0)}),this._stickyKeyDuration))}}_handleStop(){this._cameraControllerKeyboard?.running&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(t){if(t.data.native.ctrlKey||t.data.native.metaKey||!this._cameraControllerKeyboard?.running)return;const i=this._keyToDirection.get(t.data.key);if(null==i)return;t.stopPropagation();const e=void 0===this._stickyKeyTimeoutHandle;void 0===this._stickyKeyTimeoutHandle||1!==this._cameraControllerKeyboard?.countActiveDirections()?(this._cameraControllerKeyboard?.deactivateDirection(i),e&&(this._stickyDirection=void 0)):this._stickyDirection=i}_isPanning(t){return t<=3}_resetHeading(){this._view.goTo({heading:0}).catch((()=>{}))}_resetTilt(){this._view.goTo({tilt:0}).catch((()=>{}))}}export{a as KeyboardNavigation};
|
|
@@ -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{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as s,J as a}from"../../../../../../chunks/vec32.js";import{freeze as i,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as f}from"./shader/VertexDiscardMode.js";import{MaterialBase as v,parameter as b,parameterBlock as y,MaterialParameterBlock as M}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as T}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as O}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as C}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as N}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as j}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as D}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as q,CullFaceOptions as A}from"../../../lib/basicInterfaces.js";import{OITPass as R}from"../../../lib/OITPass.js";import{advancedMRRFactors as F}from"../../../materials/pbrUtils.js";class I extends v{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=F,this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new L,this.componentParameters=new k,this.textureAlphaCutoff=N,this.alphaDiscardMode=q.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=j.Earth,this.hasOccludees=!1;const a=new D(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveFactor,l)}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new m(e.context.spherical,e.context.doublePrecisionRequiresObfuscation);s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===T.Material&&null!=r.oitPass?r.oitPass:R.NONE,s.terrainDepthTest=t.identifier===T.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===T.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,s.hasColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();if(s.blendingEnabled=a===E.Transparent||a===E.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?H(r)?_(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?P.Disabled:P.Schematic:P.Normal:P.Disabled,s.emissionSource=null!=this.emissionTexture?C.Texture:s.pbrMode===P.Normal?C.Value:C.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===T.ShadowMap)s.output=O.Shadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.ViewshedShadowMap)s.output=O.ViewshedShadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.Highlight)s.output=O.Highlight,s.vertexDiscardMode=f.None;else{switch(a===E.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?f.Opaque:f.Transparent:s.vertexDiscardMode=f.None,s.output=t.output,s.receiveAmbientOcclusion=s.receiveShadows=!1,t.output){case O.Color:case O.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao,s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data;break;case O.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(r)}const i=e.acquire(c,s);return this._setClean(),i}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(0===this.objectOpacity)return;const{components:o,renderable:s}=r,{geometry:a}=s,i=s.meta.cameraDepthSquared,{geometryRanges:l,highlightRanges:n,defaultShadowMapRanges:h}=o;switch(this._computeWhichMaterialPass()){case E.Opaque:e.materialOpaque.submitDraw(this,a,l,i);break;case E.Transparent:e.materialTransparent.submitDraw(this,a,l,i);break;case E.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,a,l,i),e.materialTransparent.submitDraw(this,a,l,i);break;case E.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,a,l,i),B(t)&&e.highlightIntegratedMesh.submitDraw(this,a,l,i)}const u=this.componentParameters.castShadows!==W.None;if(u&&e.shadowMap.submitDraw(this,a,l,i),null!=n)for(const p of n)e.highlight.submitDraw(this,a,p[1],i,p[0]),u&&e.highlightShadowMap.submitDraw(this,a,p[1],i,p[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,a,l,i),u&&null!=h&&e.defaultShadowMap.submitDraw(this,a,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?E.IntegratedMesh:this.objectOpacity<1?E.Transparent:this.componentParameters.opaqueOverride===W.All?E.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===q.Blend||this.alphaDiscardMode===q.MaskBlend?E.Transparent:this.componentParameters.transparent===W.None?E.Opaque:this.componentParameters.transparent===W.All?E.Transparent:E.OpaqueAndTransparent}}var E,W;e([b({vectorOps:n})],I.prototype,"baseColor",void 0),e([b()],I.prototype,"usePBR",void 0),e([b()],I.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:a})],I.prototype,"mrrFactors",void 0),e([b({vectorOps:a})],I.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],I.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],I.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],I.prototype,"emissionTexture",void 0),e([b({dispose:!0})],I.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],I.prototype,"normalTexture",void 0),e([b()],I.prototype,"objectOpacity",void 0),e([y()],I.prototype,"commonMaterialParameters",void 0),e([y()],I.prototype,"componentParameters",void 0),e([b()],I.prototype,"textureAlphaCutoff",void 0),e([b()],I.prototype,"alphaDiscardMode",void 0),e([b()],I.prototype,"isIntegratedMesh",void 0),e([b()],I.prototype,"polygonOffsetEnabled",void 0),e([b()],I.prototype,"ellipsoidMode",void 0),e([b()],I.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(E||(E={}));class L extends M{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=A.Back,this.hasSlicePlane=!0}}e([b()],L.prototype,"doubleSided",void 0),e([b()],L.prototype,"cullFace",void 0),e([b()],L.prototype,"hasSlicePlane",void 0);class k extends M{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=W.All}get transparent(){return this.externalColor[3]<1?W.All:W.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?W.All:W.None}get visible(){return this.externalColor[3]>0?W.All:W.None}get type(){return x.Uniform}}e([b({vectorOps:n})],k.prototype,"externalColor",void 0),e([b()],k.prototype,"externalColorMixMode",void 0),e([b()],k.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(W||(W={}));class V extends M{constructor(){super(...arguments),this.texture=null,this.transparent=W.None,this.opaqueOverride=W.None,this.castShadows=W.None}get type(){return x.Varying}}function B(e){return null!=e.overlay?.getTexture(d.Highlight)}function _(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function H(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}e([b()],V.prototype,"texture",void 0),e([b()],V.prototype,"transparent",void 0),e([b()],V.prototype,"opaqueOverride",void 0),e([b()],V.prototype,"castShadows",void 0);export{L as CommonMaterialParameters,I as ComponentMaterial,W as ComponentParameterSummary,k as ComponentParametersUniform,V as ComponentParametersVarying};
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as s,J as a}from"../../../../../../chunks/vec32.js";import{freeze as i,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as f}from"./shader/VertexDiscardMode.js";import{MaterialBase as v,parameter as b,parameterBlock as y,MaterialParameterBlock as M}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as T}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as O}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as C}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as N}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as j}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as D}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as q,CullFaceOptions as A}from"../../../lib/basicInterfaces.js";import{OITPass as R}from"../../../lib/OITPass.js";import{advancedMRRFactors as F}from"../../../materials/pbrUtils.js";class I extends v{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=F,this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new L,this.componentParameters=new k,this.textureAlphaCutoff=N,this.alphaDiscardMode=q.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=j.Earth,this.hasOccludees=!1;const a=new D(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveFactor,l)}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new m(e.context.spherical,e.context.doublePrecisionRequiresObfuscation);s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===T.Material&&null!=r.oitPass?r.oitPass:R.NONE,s.terrainDepthTest=t.identifier===T.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===T.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,s.hasColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();if(s.blendingEnabled=a===E.Transparent||a===E.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?H(r)?_(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?P.Disabled:P.Schematic:P.Normal:P.Disabled,s.emissionSource=null!=this.emissionTexture?C.Texture:s.pbrMode===P.Normal?C.Value:C.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===T.ShadowMap)s.output=O.Shadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.ViewshedShadowMap)s.output=O.ViewshedShadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.Highlight)s.output=O.Highlight,s.vertexDiscardMode=f.None;else{switch(a===E.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?f.Opaque:f.Transparent:s.vertexDiscardMode=f.None,s.output=t.output,s.receiveAmbientOcclusion=s.receiveShadows=!1,t.output){case O.Color:case O.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao,s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data;break;case O.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(r)}const i=e.acquire(c,s);return this._setClean(),i}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(0===this.objectOpacity)return;const{components:o,renderable:s}=r,{geometry:a}=s,i=s.meta.cameraDepthSquared,{geometryRanges:l,highlightRanges:n,defaultShadowMapRanges:h}=o;switch(this._computeWhichMaterialPass()){case E.Opaque:e.materialOpaque.submitDraw(this,a,l,i);break;case E.Transparent:e.materialTransparent.submitDraw(this,a,l,i);break;case E.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,a,l,i),e.materialTransparent.submitDraw(this,a,l,i);break;case E.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,a,l,i),B(t)&&e.highlightIntegratedMesh.submitDraw(this,a,l,i)}const u=this.componentParameters.castShadows!==W.None;if(u&&e.shadowMap.submitDraw(this,a,l,i),null!=n)for(const p of n)e.highlight.submitDraw(this,a,p[1],i,p[0]),u&&e.highlightShadowMap.submitDraw(this,a,p[1],i,p[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,a,l,i),u&&null!=h&&e.defaultShadowMap.submitDraw(this,a,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?E.IntegratedMesh:this.objectOpacity<1&&!this.hasEmissions?E.Transparent:this.componentParameters.opaqueOverride===W.All?E.Opaque:(this.baseColor[3]<1||this.alphaDiscardMode===q.Blend||this.alphaDiscardMode===q.MaskBlend)&&!this.hasEmissions?E.Transparent:this.componentParameters.transparent===W.None||this.hasEmissions?E.Opaque:this.componentParameters.transparent===W.All?E.Transparent:E.OpaqueAndTransparent}}var E,W;e([b({vectorOps:n})],I.prototype,"baseColor",void 0),e([b()],I.prototype,"usePBR",void 0),e([b()],I.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:a})],I.prototype,"mrrFactors",void 0),e([b({vectorOps:a})],I.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],I.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],I.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],I.prototype,"emissionTexture",void 0),e([b({dispose:!0})],I.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],I.prototype,"normalTexture",void 0),e([b()],I.prototype,"objectOpacity",void 0),e([y()],I.prototype,"commonMaterialParameters",void 0),e([y()],I.prototype,"componentParameters",void 0),e([b()],I.prototype,"textureAlphaCutoff",void 0),e([b()],I.prototype,"alphaDiscardMode",void 0),e([b()],I.prototype,"isIntegratedMesh",void 0),e([b()],I.prototype,"polygonOffsetEnabled",void 0),e([b()],I.prototype,"ellipsoidMode",void 0),e([b()],I.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(E||(E={}));class L extends M{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=A.Back,this.hasSlicePlane=!0}}e([b()],L.prototype,"doubleSided",void 0),e([b()],L.prototype,"cullFace",void 0),e([b()],L.prototype,"hasSlicePlane",void 0);class k extends M{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=W.All}get transparent(){return this.externalColor[3]<1?W.All:W.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?W.All:W.None}get visible(){return this.externalColor[3]>0?W.All:W.None}get type(){return x.Uniform}}e([b({vectorOps:n})],k.prototype,"externalColor",void 0),e([b()],k.prototype,"externalColorMixMode",void 0),e([b()],k.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(W||(W={}));class V extends M{constructor(){super(...arguments),this.texture=null,this.transparent=W.None,this.opaqueOverride=W.None,this.castShadows=W.None}get type(){return x.Varying}}function B(e){return null!=e.overlay?.getTexture(d.Highlight)}function _(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function H(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}e([b()],V.prototype,"texture",void 0),e([b()],V.prototype,"transparent",void 0),e([b()],V.prototype,"opaqueOverride",void 0),e([b()],V.prototype,"castShadows",void 0);export{L as CommonMaterialParameters,I as ComponentMaterial,W as ComponentParameterSummary,k as ComponentParametersUniform,V as ComponentParametersVarying};
|
|
@@ -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 s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as a,invert as r}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as h}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{i as o,c as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as l,ShadowMapPassParameters as c,HighlightPassParameters as p,ViewshedShadowMapPassParameters as
|
|
5
|
+
import{_ as s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as a,invert as r}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as h}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{i as o,c as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as l,ShadowMapPassParameters as c,HighlightPassParameters as p,ViewshedShadowMapPassParameters as d,RenderPassIdentifier as u}from"./AllRenderPasses.js";import{RenderPass as _,RenderPassSorting as g}from"./RenderPass.js";import{ShaderOutput as w}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as P}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as f}from"../../effects/RenderPlugin.js";import{DepthRange as R}from"../../lib/DepthRange.js";import{RenderSlot as S}from"../../lib/RenderSlot.js";let E=class extends f{constructor(){super({}),this._passes=null,this.produces=new Map([[S.OPAQUE_MATERIAL,s=>this._produces(s)],[S.TRANSPARENT_MATERIAL,s=>!!(this._passes&&this._passes.materialTransparent.count>0)&&this._produces(s)],[S.INTEGRATED_MESH,s=>this._produces(s)]]),this._materialPassParameters=new l,this._shadowPassParameters=new c,this._highlightPassParameters=new p,this._viewshedPassParameters=new d,this._systems=new Set}initializeRenderContext(s){this._context=s;const e=s.renderContext.rctx,t=s.techniques;this._passes={materialOpaque:new _(e,t),materialTransparent:new _(e,t,g.BackToFront),materialIntegratedMesh:new _(e,t),shadowMap:new _(e,t),highlight:new _(e,t),highlightIntegratedMesh:new _(e,t),highlightShadowMap:new _(e,t),viewshedShadowMap:new _(e,t),defaultShadowMap:new _(e,t)}}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear()}register(s){this._systems.add(s)}_produces(s){return 0!==this._systems.size&&null!==this._passes&&(s===w.Highlight?this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0:s!==w.ShadowHighlight||this._passes.highlight.count>0)}prepareRender(s){if(0!==this._systems.size&&null!==this._passes){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((e=>e.submit(this._passes,s.bind)));for(const s of Object.values(this._passes))s.finishSubmit();this._context.techniques.frameUpdate()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=s.output===w.Shadow||s.output===w.ShadowHighlight||s.output===w.ShadowExcludeHighlight?this._shadowPassParameters:s.output===w.ViewshedShadow?this._viewshedPassParameters:s.output===w.Highlight?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot===S.TRANSPARENT_MATERIAL),this._materialPassParameters.output=s.output,this._invoke(s,((e,t)=>e.acquire(t,s.bind)))}render(s,e){this._invoke(s,((t,a)=>t.dispatch(a,s.bind,e)))}_invoke(s,e){if(null===this._passes)return null;const t=s.output;switch(s.bind.slot){case S.OPAQUE_MATERIAL:switch(t){case w.Color:case w.ColorEmission:case w.Depth:case w.Normal:case w.ObjectAndLayerIdColor:return e(this._passes.materialOpaque,this._materialPassParameters);case w.Highlight:return e(this._passes.highlight,this._highlightPassParameters);case w.Shadow:return e(this._passes.shadowMap,this._shadowPassParameters);case w.ShadowHighlight:return e(this._passes.highlightShadowMap,this._shadowPassParameters);case w.ShadowExcludeHighlight:return e(this._passes.defaultShadowMap,this._shadowPassParameters);case w.ViewshedShadow:return e(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case S.TRANSPARENT_MATERIAL:switch(t){case w.Color:case w.ColorEmission:case w.Depth:case w.Normal:case w.ObjectAndLayerIdColor:return e(this._passes.materialTransparent,this._materialPassParameters)}break;case S.INTEGRATED_MESH:switch(t){case w.Color:case w.ColorEmission:case w.Depth:case w.Normal:case w.ObjectAndLayerIdColor:return e(this._passes.materialIntegratedMesh,this._materialPassParameters);case w.Highlight:return e(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new R;return this._systems.forEach((t=>e.union(t.queryShadowCasterDepthRange(s)))),e}get hasEmissions(){let s=!1;return this._systems.forEach((e=>s=e.hasEmissions||s)),s}_updateParameters(s,e,i){const m=s.viewInverseTransposeMatrix;o(b,m[3],m[7],m[11]),j.set(b),n(e.transformWorldFromViewTH,j.high),n(e.transformWorldFromViewTL,j.low),n(e.slicePlaneLocalOrigin,b),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),h(e.transformProjFromView,s.projectionMatrix),e.identifier===u.Material&&(this._materialPassParameters.transparent=i,a(M,e.transformViewFromCameraRelativeRS),r(e.transformNormalViewFromGlobal,M))}};E=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],E);const b=m(),M=i(),j=new P;export{E as RenderPassManager};
|
|
@@ -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{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as
|
|
5
|
+
import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as i}from"./OITBlendTechniqueConfiguration.js";import{ColorAttachment as r}from"../../../../webgl/enums.js";class s{constructor(r){this._techniques=r,this._parameters=new e,this._configuration=new i,r.precompile(t,this._configuration),this._configuration.hasEmission=!0,r.precompile(t,this._configuration)}blend(e,i,s,n,o){this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(r.COLOR_ATTACHMENT1),this._parameters.frontFaceTexture=s.getTexture(),this._configuration.hasEmission=o;const a=this._techniques.acquire(t,this._configuration);e.bindTechnique(a,n,this._parameters),e.screen.draw(),a.release()}}export{s as OITBlend};
|
|
@@ -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{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as
|
|
5
|
+
import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as n}from"./OITPass.js";import{BlendFactor as t,CompareFunction as e,ColorAttachment as o}from"../../../webgl/enums.js";import{separateBlendingParams as u,premultipliedAlphaToPremultipliedAlpha as c,defaultDepthWrite as s}from"../../../webgl/renderState.js";const a=u(t.ONE,t.ZERO,t.ONE,t.ONE_MINUS_SRC_ALPHA);function l(r){return r===n.FrontFace?null:a}function i(r){switch(r){case n.NONE:return c;case n.ColorAlpha:return a;case n.FrontFace:case n.COUNT:return null}}function O(r){if(r.draped)return null;switch(r.oitPass){case n.NONE:case n.FrontFace:return r.writeDepth?s:null;case n.ColorAlpha:case n.COUNT:return null}}const f=5e5,N={factor:-1,units:-2};function p(r){return r?N:null}function E(r,t=e.LESS){return r===n.NONE||r===n.FrontFace?t:e.LEQUAL}function A(t,e){const u=r(e);return t===n.ColorAlpha||u?{buffers:[o.COLOR_ATTACHMENT0,o.COLOR_ATTACHMENT1]}:null}export{N as OITPolygonOffset,f as OITPolygonOffsetLimit,i as blending,a as blendingColorAlpha,O as depthWrite,A as getDrawBuffers,p as getOITPolygonOffset,l as oitBlending,E as oitDepthTest};
|