@arcgis/core 5.2.0-next.81 → 5.2.0-next.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/components/assets/icon/deleteAndReplaceFeatures16.json +1 -0
- package/assets/components/assets/icon/deleteAndReplaceFeatures24.json +1 -0
- package/assets/components/assets/icon/deleteAndReplaceFeatures32.json +1 -0
- package/assets/components/assets/icon/moveAndRotate16.json +1 -0
- package/assets/components/assets/icon/moveAndRotate24.json +1 -0
- package/assets/components/assets/icon/moveAndRotate32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{88d6a7ebded4d359deb0.js → 027af54888befb209aaa.js} +1 -1
- package/assets/esri/core/workers/chunks/028bee58f7bc19e5e39e.js +1 -0
- package/assets/esri/core/workers/chunks/{9bd4cda90daf90189bfc.js → 03895d49fbd34ccb3ead.js} +1 -1
- package/assets/esri/core/workers/chunks/{694216224d5fd3a8956d.js → 04f5ff688785a4bd3b03.js} +1 -1
- package/assets/esri/core/workers/chunks/0775d1e3034d5e7ef7bc.js +1 -0
- package/assets/esri/core/workers/chunks/{3adba34224cba869a39c.js → 10ac92dcd3738ec23dfb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a537054c99cbc492715.js → 11d911f70bf0ca252c19.js} +1 -1
- package/assets/esri/core/workers/chunks/1354b8442c2c501238f1.js +1 -0
- package/assets/esri/core/workers/chunks/{95ff342e5c29bf91a765.js → 13a43c87d7952facbed4.js} +1 -1
- package/assets/esri/core/workers/chunks/{8cfe817299eb16cb2664.js → 1438f571f738e83b4d1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfd532e33800755b1f48.js → 14511c92cbbc26d80c86.js} +1 -1
- package/assets/esri/core/workers/chunks/{e59101f1d060d0a30a65.js → 14def8f47ae7265dd71b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbb0b2f4ec0ba458ddeb.js → 19dac19122eeeb5e36b2.js} +1 -1
- package/assets/esri/core/workers/chunks/1b00789511c9b27da4a7.js +1 -0
- package/assets/esri/core/workers/chunks/1b277311a4beb4243bf8.js +2 -0
- package/assets/esri/core/workers/chunks/1d03db4df18524cf391c.js +1 -0
- package/assets/esri/core/workers/chunks/{f71a3fe5f30aa782193a.js → 20db27d9828397d0b37a.js} +1 -1
- package/assets/esri/core/workers/chunks/24bfe759c8848143361e.js +1 -0
- package/assets/esri/core/workers/chunks/{b3081c0b037abc49d09b.js → 26c12804a0d801df29bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{8006ffa263fb8016afdb.js → 26c8ed0aef59ed6d5267.js} +1 -1
- package/assets/esri/core/workers/chunks/2d1c0d80a9843567df8d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b79b376b0d60d2f0d5c.js → 2d6e1bf7c1981bed4357.js} +1 -1
- package/assets/esri/core/workers/chunks/30dade7bf6032be32599.js +2 -0
- package/assets/esri/core/workers/chunks/{7028671ffdaafe2725bc.js → 33aaa5a49e396a0aca47.js} +1 -1
- package/assets/esri/core/workers/chunks/{dcec7fc66385c12ecdf0.js → 33dc93d82407052fafe1.js} +1 -1
- package/assets/esri/core/workers/chunks/{578904043e873424904c.js → 3a6990058f1003bd2812.js} +1 -1
- package/assets/esri/core/workers/chunks/{0fd7590e545864f5fff4.js → 3ca0d503ce733088a6c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfac0f47e81055585002.js → 3f0625c31dd46b563160.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a5894e8ebdf0e97b98f.js → 43122c435497228a7583.js} +1 -1
- package/assets/esri/core/workers/chunks/{8fff4a41a54d39db470a.js → 44d13f65465646e5f6e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c17bfbfc347ac289b6e.js → 463b7952a4825541eb13.js} +1 -1
- package/assets/esri/core/workers/chunks/46b3d6814ba4c0a71111.js +1 -0
- package/assets/esri/core/workers/chunks/49784f8e8e5fac0cc5a9.js +1 -0
- package/assets/esri/core/workers/chunks/{1ed6a8bb415999c4e8a6.js → 4cf2c33494cb75942511.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8b38c196b06e801c4e6.js → 5156d94f01b4fbbf8cde.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c372d85b5783dd2a793.js → 52042fd36f4a572938f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8a9a686a3c23afc9d1f.js → 5568448e7f51508ffdf5.js} +1 -1
- package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +1 -0
- package/assets/esri/core/workers/chunks/598221c7054415b84904.js +1 -0
- package/assets/esri/core/workers/chunks/{89df303abcbc0167e4d2.js → 5a006ff759fad9fc25cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{218ddad849745d652a28.js → 5a3c1fe24814a345ab39.js} +1 -1
- package/assets/esri/core/workers/chunks/5b292831127bf981c1c5.js +1 -0
- package/assets/esri/core/workers/chunks/{40ebe69b08ea54e0e780.js → 5b60fc95757b2a53558a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c336f300fe6100e36592.js → 5c634b3e6dc76299b1df.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a67bd724aa7fcdebe16.js → 5d30accf1dcda0c70f95.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbca32f0e0c2c2e2ccf3.js → 5f13ade03500b39c1720.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d16d53643dd8d489c25.js → 605da92d28e067f4a4c6.js} +1 -1
- package/assets/esri/core/workers/chunks/6154f4d39f9e53fe56cc.js +1 -0
- package/assets/esri/core/workers/chunks/62b116307483d5f0e37d.js +2 -0
- package/assets/esri/core/workers/chunks/6433a623af765b7e53ab.js +1 -0
- package/assets/esri/core/workers/chunks/{5c9a398e659ecd427fb5.js → 657528eb6a3d3b3cb631.js} +1 -1
- package/assets/esri/core/workers/chunks/65eff0ae773505495f21.js +1 -0
- package/assets/esri/core/workers/chunks/{d845f2115848b56c0369.js → 66292e98b4111ea3658d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f57e5e7d0748d9a370f7.js → 680496660b2aaa710099.js} +1 -1
- package/assets/esri/core/workers/chunks/6d11b922898a8039dbe7.js +1 -0
- package/assets/esri/core/workers/chunks/{fbcc346fa603d6edac98.js → 6db4a4f9a9ce7cc738d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{a9e944f28bd573c8230d.js → 6eb28086dc28f6d144ec.js} +1 -1
- package/assets/esri/core/workers/chunks/7188559a685e0ba30c4f.js +1 -0
- package/assets/esri/core/workers/chunks/{a3cbd3e983e21f40b253.js → 724b2631c9ced80a1661.js} +1 -1
- package/assets/esri/core/workers/chunks/7493ce5d02224c07a6d5.js +1 -0
- package/assets/esri/core/workers/chunks/7ad70c8a56f2481adc82.js +1 -0
- package/assets/esri/core/workers/chunks/7bd8ebb321ecf1f06496.js +1 -0
- package/assets/esri/core/workers/chunks/7ca188f824956a5cac35.js +2 -0
- package/assets/esri/core/workers/chunks/{d0aaa4ad7f76f577f117.js → 7d5877eede2f552dea9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf5831a7c12b1e42c669.js → 83a77d3f45c8c21cec45.js} +1 -1
- package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +1 -0
- package/assets/esri/core/workers/chunks/{d62a5a33a24418a3e283.js → 88771a75adcbd54c4fac.js} +1 -1
- package/assets/esri/core/workers/chunks/{37fb38db03cb39e3c342.js → 8c6a60d96c73982febd2.js} +1 -1
- package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js → 8e1b913067b8e88ff365.js} +2 -2
- package/assets/esri/core/workers/chunks/{6065caa7981cef255277.js → 911f3a1b8dd4bc5c9782.js} +1 -1
- package/assets/esri/core/workers/chunks/{70c371c9f133ab9f7925.js → 918577ea025f67ebe372.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3eab61815ef1c521a6c.js → 9568932bafe689c38f63.js} +1 -1
- package/assets/esri/core/workers/chunks/{e72fa08b0bd324514a0e.js → 996ac351e2322298a17d.js} +1 -1
- package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +1 -0
- package/assets/esri/core/workers/chunks/{d1baf17f3219f70106f7.js → 9be05d32528b395a7d34.js} +1 -1
- package/assets/esri/core/workers/chunks/{552d6aecc7d88d16227b.js → 9d41c02601d0bb75b525.js} +1 -1
- package/assets/esri/core/workers/chunks/{64a1ffc221e5b63b43fb.js → a4bb0951e1389e7b803c.js} +1 -1
- package/assets/esri/core/workers/chunks/{74cd17aca5f7e0caac90.js → a9a1061cdf82b372835f.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2448e26e19005ef9ab2.js → aabffe53508730e504ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{82da6d98bd4980a3d454.js → af88f8dd1a53e4740aa6.js} +1 -1
- package/assets/esri/core/workers/chunks/b61c30cdf698b4d1573a.js +1 -0
- package/assets/esri/core/workers/chunks/{61190c833791f0833a39.js → b7bcc2d0b0fa8e703c83.js} +1 -1
- package/assets/esri/core/workers/chunks/{37a121316d114999ac70.js → ba67aaa08e4f11e1140a.js} +1 -1
- package/assets/esri/core/workers/chunks/bbb97c38d8670329d07e.js +2 -0
- package/assets/esri/core/workers/chunks/{5d50a030bf9f4e94f69d.js → bbeb61d9302323bae9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/bd8b483e70acf0fc601e.js +1 -0
- package/assets/esri/core/workers/chunks/bef32acf368b4d5aba37.js +1 -0
- package/assets/esri/core/workers/chunks/c1f125594e684c1b4ffc.js +1 -0
- package/assets/esri/core/workers/chunks/c90dfdf2302b7db1f6f7.js +1 -0
- package/assets/esri/core/workers/chunks/{09f0805b32e6cab980e6.js → cc1a00694cc9f7c606d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a36b999cbd65dd2f16c.js → d8c3bdc3c6be8ba7c5e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc30c0de6dcb106b24a1.js → da233362b06b6db375f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce81f29134ab3971bd54.js → dd91824692bec809909c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9e9e79f78be32e5d475.js → e706c37b44e98fbcb5f7.js} +1 -1
- package/assets/esri/core/workers/chunks/ef269dd559c1c79957e5.js +1 -0
- package/assets/esri/core/workers/chunks/{4a6158994a8cc8b8664f.js → f0692e10af5983f6ad93.js} +1 -1
- package/assets/esri/core/workers/chunks/{40b842d055b87e442156.js → f20b88f5a6d3b988a055.js} +1 -1
- package/assets/esri/core/workers/chunks/{fae32c9ce811934b6a64.js → f6ae0c483579e227a2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c15551e33a3c6cda61d.js → f762f0f6c83748d8e328.js} +1 -1
- package/assets/esri/core/workers/chunks/{4eaa93859ceec1b38530.js → fa29b5064d6626cfc019.js} +1 -1
- package/assets/esri/core/workers/chunks/fcf7299e2ee904ab9882.js +1 -0
- package/assets/esri/core/workers/chunks/{388b71211a0ad5cbd6b9.js → fe06cc2f90b2d551e4c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{86035e46777ed896c658.js → ffad5fd9c5e98f4fe2c3.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/EmissionComposite.glsl.js +7 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/GeographicTransformation.js +2 -0
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/GeographicTransformation.d.ts +7 -0
- package/geometry/operators/support/GeographicTransformation.js +1 -1
- package/geometry/operators/support/GeographicTransformationStep.d.ts +7 -1
- package/geometry/operators/support/GeographicTransformationStep.js +1 -1
- package/geometry/operators/support/geographicTransformationUtils.d.ts +13 -2
- package/geometry/operators/support/geographicTransformationUtils.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/raster/types.d.ts +1 -1
- package/layers/support/AggregateField.d.ts +9 -3
- package/layers/support/FeatureReductionCluster.d.ts +16 -6
- package/layers/support/I3SExtractChanges.js +2 -0
- package/package.json +4 -4
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/AuthoringInfo.d.ts +8 -3
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONLabelUtils.js +2 -0
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementLeafPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/GroundAndIMSurface.js +2 -0
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/MapView.d.ts +0 -60
- package/views/SceneView.js +1 -1
- package/views/View2D.d.ts +59 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/draw/support/types.d.ts +6 -0
- package/views/interactive/interactiveToolUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/jsxWidgetSupport.js +1 -1
- package/assets/esri/core/workers/chunks/0dcfd82a2669df6eb5a0.js +0 -1
- package/assets/esri/core/workers/chunks/177c3b23c1cbd4737049.js +0 -1
- package/assets/esri/core/workers/chunks/21f763694a41968ac21a.js +0 -1
- package/assets/esri/core/workers/chunks/230925079cee040a8d77.js +0 -1
- package/assets/esri/core/workers/chunks/25696c194457e42b3bdc.js +0 -1
- package/assets/esri/core/workers/chunks/2f3525df00fb265661fc.js +0 -1
- package/assets/esri/core/workers/chunks/453c69879f4b82ba13a1.js +0 -1
- package/assets/esri/core/workers/chunks/4f36596280142be1c666.js +0 -1
- package/assets/esri/core/workers/chunks/53d80202b5f43542d45b.js +0 -1
- package/assets/esri/core/workers/chunks/540a3685e614bb006744.js +0 -1
- package/assets/esri/core/workers/chunks/61312d3b5477ed9d87d9.js +0 -2
- package/assets/esri/core/workers/chunks/6f08c8a1e8e3ffd0a96a.js +0 -1
- package/assets/esri/core/workers/chunks/71ee7c51d2c60a180f1e.js +0 -1
- package/assets/esri/core/workers/chunks/856dba96332509fb1d7a.js +0 -2
- package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +0 -1
- package/assets/esri/core/workers/chunks/927582ec15bff2acbb49.js +0 -1
- package/assets/esri/core/workers/chunks/95b9eaf7a49eeb17e62f.js +0 -1
- package/assets/esri/core/workers/chunks/973440553c9e058b0132.js +0 -1
- package/assets/esri/core/workers/chunks/98739b6e7904045edbab.js +0 -1
- package/assets/esri/core/workers/chunks/a69c10bfd632a5546b34.js +0 -1
- package/assets/esri/core/workers/chunks/c5853fbb975e169c44c5.js +0 -1
- package/assets/esri/core/workers/chunks/c899457f19b749516275.js +0 -1
- package/assets/esri/core/workers/chunks/d4b78d11a5ce4320a29a.js +0 -1
- package/assets/esri/core/workers/chunks/da0ef984509057ec8507.js +0 -1
- package/assets/esri/core/workers/chunks/e2473de49189d93714d3.js +0 -1
- package/assets/esri/core/workers/chunks/eca0736953a20cfc64ad.js +0 -2
- package/assets/esri/core/workers/chunks/efd176c5ac35f313e7a2.js +0 -1
- package/assets/esri/core/workers/chunks/f2d99f693a590f384315.js +0 -1
- package/assets/esri/core/workers/chunks/fc2234e0d202631f3abf.js +0 -2
- package/assets/esri/core/workers/chunks/fcb943c3b31b1bf62e65.js +0 -2
- package/assets/esri/core/workers/chunks/ffe2cbfea38b92a231d6.js +0 -1
- /package/assets/esri/core/workers/chunks/{eca0736953a20cfc64ad.js.LICENSE.txt → 1b277311a4beb4243bf8.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{856dba96332509fb1d7a.js.LICENSE.txt → 30dade7bf6032be32599.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fc2234e0d202631f3abf.js.LICENSE.txt → 62b116307483d5f0e37d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{61312d3b5477ed9d87d9.js.LICENSE.txt → 7ca188f824956a5cac35.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js.LICENSE.txt → 8e1b913067b8e88ff365.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fcb943c3b31b1bf62e65.js.LICENSE.txt → bbb97c38d8670329d07e.js.LICENSE.txt} +0 -0
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const d="20260821",a="d471aa3ff020a33156d5d46063d08a7391dbd78d";export{d as buildDate,a as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{Point as s}from"../../../../../geometry/support/TileClipper.js";import{tilePixelRatio as i,tileSizeInTileUnits as a}from"../constants.js";import{cDegToRad as o,log2 as r,interpolate as l}from"../GeometryUtils.js";import{Anchor as h}from"../Placement.js";import{sdfGlyphSize as x,TextShaping as c}from"../TextShaping.js";import d from"./BaseBucket.js";import{IconLayout as f,TextLayout as g}from"../style/StyleLayer.js";const y=10;function m(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class u extends d{constructor(e,t,n,s,i,a,o,r,l){super(t,n,l.getSpriteItems()),this.type=3,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=s,this._iconIndexBuffer=i,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=r,this._workerTileHandler=l}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,s){const i=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=i.getLayoutProperty("icon-image"),r=i.getLayoutProperty("text-field");let l=i.getLayoutProperty("text-transform"),h=i.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=i.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=i.getLayoutValue("text-font",a),h=null);for(const y of this._features){const m=y.getGeometry(e);if(!m||0===m.length)continue;let p,_;o&&(p=o.isDataDriven?o.getValue(a,y):this._replaceKeys(c,y.values),p&&t(p));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,y):this._replaceKeys(d,y.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,y)),f){case 2:_=_.toLowerCase();break;case 1:_=_.toUpperCase()}if(u._bidiEngine.hasBidiChar(_)){let e;e="rtl"===u._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=u._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,y));for(const e of g){let t=s[e];t||(t=s[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!p&&!_)continue;const b=i.getLayoutValue("symbol-sort-key",a,y),P={feature:y,sprite:p,label:_,rtl:M,geometry:m,hash:(_?n(_):0)^(p?n(p):0),priority:b,textFont:g};x.push(P)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,r=n.getLayoutValue("symbol-placement",s),l=0!==r,d=n.getLayoutValue("symbol-spacing",s)*i,y=n.getLayoutProperty("icon-image"),p=n.getLayoutProperty("text-field"),_=y?new f(n,s,l):null,M=p?new g(n,s,l):null,b=this._workerTileHandler;let P;y&&(P=b.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const I=[];let A=1;M?.size&&(A=M.size/x);const V=M?M.maxAngle*o:0,w=M?M.size*i:0;for(const o of this._symbolFeatures){let e;_&&P&&o.sprite&&(e=P[o.sprite],e&&e.sdf&&(this._isIconSDF=!0));let n;!!e&&_.update(s,o.feature);let f=0;const g=o.label;if(g){t(M),M.update(s,o.feature);const e=l&&0===M.rotationAlignment?M.keepUpright:M.writingMode&&M.writingMode.includes(1);let a=.5;switch(M.anchor){case 5:case 1:case 7:a=0;break;case 6:case 2:case 8:a=1}let r=.5;switch(M.anchor){case 5:case 3:case 6:r=0;break;case 7:case 4:case 8:r=1}let h=.5;switch(M.justify){case 0:h=a;break;case 1:h=0;break;case 3:h=1}const d=M.letterSpacing*x,y=l?0:M.maxWidth*x,m=M.lineHeight*x,u=o.textFont.map(e=>b.getGlyphItems(e));if(n=new c(u,y,m,d,a,r,h).getShaping(g,o.rtl,e),n&&n.length>0){let e=1e30,t=-1e30;for(const s of n)e=Math.min(e,s.x),t=Math.max(t,s.x);f=(t-e+2*x)*A*i}}for(let t of o.geometry){const s=[];if(1===r){if(n?.length&&M?.size){const e=M.size*i*(2+Math.min(2,4*Math.abs(M.offset[1])));t=u._smoothVertices(t,e)}u._pushAnchors(s,t,d,f)}else 2===r?u._pushCenterAnchor(s,t):3===o.feature.type?u._pushCentroid(s,t):s.push(new h(t[0].x,t[0].y));for(const i of s){if(i.x<0||i.x>a||i.y<0||i.y>a)continue;if(l&&f>0&&0===M?.rotationAlignment&&!u._honorsTextMaxAngle(t,i,f,V,w))continue;const s={shaping:n,line:t,iconMosaicItem:e,anchor:i,symbolFeature:o,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};I.push(s),this._processFeature(s,_,M)}}}I.sort(m),this._addPlacedGlyphs(),this._symbolInstances=I}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=u._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),s=new Float32Array(t.buffer),[i,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(i),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=u.serializeSymbols(t,n,s,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=y;for(const e of n.iconColliders)t+=y;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,s,i){i=i||[],t[s++]=i.length;for(const a of i){t[s++]=a.anchor.x,t[s++]=a.anchor.y,t[s++]=a.symbolFeature.hash,t[s++]=a.symbolFeature.priority,t[s++]=a.symbolFeature.feature.featureIndex,t[s++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[s++]=e.xTile,t[s++]=e.yTile,t[s++]=e.dxPixels,t[s++]=e.dyPixels,t[s++]=e.hard?1:0,t[s++]=e.partIndex,n[s++]=e.minLod,n[s++]=e.maxLod,t[s++]=e.width,t[s++]=e.height;for(const e of a.iconColliders)t[s++]=e.xTile,t[s++]=e.yTile,t[s++]=e.dxPixels,t[s++]=e.dyPixels,t[s++]=e.hard?1:0,t[s++]=e.partIndex,n[s++]=e.minLod,n[s++]=e.maxLod,t[s++]=e.width,t[s++]=e.height;t[s++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[s++]=e,t[s++]=n;t[s++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[s++]=e,t[s++]=n}return s}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,(e,n)=>n in t?t[n]:"")}_processFeature(e,t,n){const{line:s,iconMosaicItem:i,shaping:a,anchor:o}=e,l=this.zoom,h=this.layer,x=!!i;let c=!0;x&&(c=t?.optional||!i);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,i,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,s,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),s=Math.sin(t),i=e.dxPixels*n-e.dyPixels*s,a=e.dxPixels*s+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*s,r=(e.dxPixels+e.width)*s+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*s,h=e.dxPixels*s+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s+(e.dyPixels+e.height)*n,d=Math.min(i,o,l,x),f=Math.max(i,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,i.page,1===t.rotationAlignment,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),s=Math.sin(t),i=e.dxPixels*n-e.dyPixels*s,a=e.dxPixels*s+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*s,r=(e.dxPixels+e.width)*s+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*s,h=e.dxPixels*s+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s+(e.dyPixels+e.height)*n,d=Math.min(i,o,l,x),f=Math.max(i,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,s,i,a){const o=Math.max(n-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=i?0:Math.max(n+r(c.minzoom),o),d=i?25:Math.min(n+r(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,b=c.anchor,P=l.index,I=u.x,A=u.y,V=I+u.width,w=A+u.height,L=l.index;l.add(b.x,b.y,f.x,f.y,I,A,p,_,M,t,d,a),l.add(b.x,b.y,g.x,g.y,V,A,p,_,M,t,d,a),l.add(b.x,b.y,y.x,y.y,I,w,p,_,M,t,d,a),l.add(b.x,b.y,m.x,m.y,V,w,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===L?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([L,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),x.has(s)?x.get(s)[1]+=6:x.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[s,i]of this._glyphBufferDataStorage)for(const a of i){const i=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),n.has(s)?n.get(s)[1]+=6:n.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,s,i){const a=Math.max(n-1,0),o=1===s;let l,h,x,c,d,f,g,y,m,u,p;for(const _ of t){if(l=o?0:Math.max(n+r(_.minzoom),a),h=o?25:Math.min(n+r(_.maxzoom),25),h<=l)continue;x=_.tl,c=_.tr,d=_.bl,f=_.br,g=_.labelAngle,y=_.minAngle,m=_.maxAngle,u=_.anchor,p=_.mosaicRect,this._glyphBufferDataStorage.has(_.page)||this._glyphBufferDataStorage.set(_.page,[]);this._glyphBufferDataStorage.get(_.page).push({glyphAnchor:[u.x,u.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:l,maxLod:h,placementLod:a,symbolInstance:e,ddAttributes:i})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let l=0;l<o;l++)a+=s.distance(t[l],t[l+1]);let r=i||n;if(r*=.5,a<=r)return;const x=r/a;let c=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<c+f;){d+=n;const t=(d-c)/f,y=l(i.x,a.x,t),m=l(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new h(y,m,g,s,x))}c+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,x=i.y-n.y,c=Math.sqrt(r*r+x*x);if(a<o+c){const t=(a-o)/c,d=l(n.x,i.x,t),f=l(n.y,i.y,t),g=Math.atan2(x,r);return void e.push(new h(d,f,g,s,0))}o+=c}}static _deviation(e,t,n){const s=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),i=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(i,s)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _pushCentroid(e,t){const n=0,s=0,i=a,o=a,r=t.length-1;let l=0,x=0,c=0,d=t[0].x,f=t[0].y;d>i&&(d=i),d<n&&(d=n),f>o&&(f=o),f<s&&(f=s);for(let a=1;a<r;a++){let e=t[a].x,r=t[a].y,h=t[a+1].x,g=t[a+1].y;e>i&&(e=i),e<n&&(e=n),r>o&&(r=o),r<s&&(r=s),h>i&&(h=i),h<n&&(h=n),g>o&&(g=o),g<s&&(g=s);const y=(e-d)*(g-f)-(h-d)*(r-f);l+=y*(d+e+h),x+=y*(f+r+g),c+=y}l/=3*c,x/=3*c,isNaN(l)||isNaN(x)||e.push(new h(l,x))}}export{u as default};
|
|
2
|
+
import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{Point as s}from"../../../../../geometry/support/TileClipper.js";import{tilePixelRatio as i,tileSizeInTileUnits as a}from"../constants.js";import{cDegToRad as o,log2 as r,interpolate as l}from"../GeometryUtils.js";import{Anchor as h}from"../Placement.js";import{sdfGlyphSize as x,TextShaping as c}from"../TextShaping.js";import d from"./BaseBucket.js";import{getPolygonLabelPlacement as f}from"../style/GeoJSONLabelUtils.js";import{IconLayout as g,TextLayout as y}from"../style/StyleLayer.js";const m=10;function u(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class p extends d{constructor(e,t,n,s,i,a,o,r,l){super(t,n,l.getSpriteItems()),this.type=3,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=s,this._iconIndexBuffer=i,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=r,this._workerTileHandler=l}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,s){const i=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=i.getLayoutProperty("icon-image"),r=i.getLayoutProperty("text-field");let l=i.getLayoutProperty("text-transform"),h=i.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=i.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=i.getLayoutValue("text-font",a),h=null);for(const y of this._features){const m=y.getGeometry(e);if(!m||0===m.length)continue;let u,_;o&&(u=o.isDataDriven?o.getValue(a,y):this._replaceKeys(c,y.values),u&&t(u));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,y):this._replaceKeys(d,y.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,y)),f){case 2:_=_.toLowerCase();break;case 1:_=_.toUpperCase()}if(p._bidiEngine.hasBidiChar(_)){let e;e="rtl"===p._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=p._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,y));for(const e of g){let t=s[e];t||(t=s[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!u&&!_)continue;const b=i.getLayoutValue("symbol-sort-key",a,y),P={feature:y,sprite:u,label:_,rtl:M,geometry:m,hash:(_?n(_):0)^(u?n(u):0),priority:b,textFont:g};x.push(P)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,r=n.getLayoutValue("symbol-placement",s),l=0!==r,d=n.getLayoutValue("symbol-spacing",s)*i,f=n.getLayoutProperty("icon-image"),m=n.getLayoutProperty("text-field"),_=f?new g(n,s,l):null,M=m?new y(n,s,l):null,b=this._workerTileHandler;let P;f&&(P=b.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const I=[];let A=1;M?.size&&(A=M.size/x);const V=M?M.maxAngle*o:0,w=M?M.size*i:0;for(const o of this._symbolFeatures){let e;_&&P&&o.sprite&&(e=P[o.sprite],e&&e.sdf&&(this._isIconSDF=!0));let f;!!e&&_.update(s,o.feature);let g=0;const y=o.label;if(y){t(M),M.update(s,o.feature);const e=l&&0===M.rotationAlignment?M.keepUpright:M.writingMode&&M.writingMode.includes(1);let n=.5;switch(M.anchor){case 5:case 1:case 7:n=0;break;case 6:case 2:case 8:n=1}let a=.5;switch(M.anchor){case 5:case 3:case 6:a=0;break;case 7:case 4:case 8:a=1}let r=.5;switch(M.justify){case 0:r=n;break;case 1:r=0;break;case 3:r=1}const h=M.letterSpacing*x,d=l?0:M.maxWidth*x,m=M.lineHeight*x,u=o.textFont.map(e=>b.getGlyphItems(e));if(f=new c(u,d,m,h,n,a,r).getShaping(y,o.rtl,e),f&&f.length>0){let e=1e30,t=-1e30;for(const n of f)e=Math.min(e,n.x),t=Math.max(t,n.x);g=(t-e+2*x)*A*i}}const m=p._getPlacementCandidates(n,r,o.feature,o.geometry);for(const t of m){let{vertices:n}=t;const s=[];if(1===r){if(f?.length&&M?.size){const e=M.size*i*(2+Math.min(2,4*Math.abs(M.offset[1])));n=p._smoothVertices(n,e)}p._pushAnchors(s,n,d,g)}else 2===r?p._pushCenterAnchor(s,n):3===o.feature.type?t.anchor?s.push(t.anchor):p._pushCentroid(s,n):s.push(new h(n[0].x,n[0].y));for(const t of s){if(t.x<0||t.x>a||t.y<0||t.y>a)continue;if(l&&g>0&&0===M?.rotationAlignment&&!p._honorsTextMaxAngle(n,t,g,V,w))continue;const s={shaping:f,line:n,iconMosaicItem:e,anchor:t,symbolFeature:o,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};I.push(s),this._processFeature(s,_,M)}}}I.sort(u),this._addPlacedGlyphs(),this._symbolInstances=I}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=p._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),s=new Float32Array(t.buffer),[i,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(i),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=p.serializeSymbols(t,n,s,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=m;for(const e of n.iconColliders)t+=m;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,s,i){i=i||[],t[s++]=i.length;for(const a of i){t[s++]=a.anchor.x,t[s++]=a.anchor.y,t[s++]=a.symbolFeature.hash,t[s++]=a.symbolFeature.priority,t[s++]=a.symbolFeature.feature.featureIndex,t[s++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[s++]=e.xTile,t[s++]=e.yTile,t[s++]=e.dxPixels,t[s++]=e.dyPixels,t[s++]=e.hard?1:0,t[s++]=e.partIndex,n[s++]=e.minLod,n[s++]=e.maxLod,t[s++]=e.width,t[s++]=e.height;for(const e of a.iconColliders)t[s++]=e.xTile,t[s++]=e.yTile,t[s++]=e.dxPixels,t[s++]=e.dyPixels,t[s++]=e.hard?1:0,t[s++]=e.partIndex,n[s++]=e.minLod,n[s++]=e.maxLod,t[s++]=e.width,t[s++]=e.height;t[s++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[s++]=e,t[s++]=n;t[s++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[s++]=e,t[s++]=n}return s}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,(e,n)=>n in t?t[n]:"")}_processFeature(e,t,n){const{line:s,iconMosaicItem:i,shaping:a,anchor:o}=e,l=this.zoom,h=this.layer,x=!!i;let c=!0;x&&(c=t?.optional||!i);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,i,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,s,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),s=Math.sin(t),i=e.dxPixels*n-e.dyPixels*s,a=e.dxPixels*s+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*s,r=(e.dxPixels+e.width)*s+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*s,h=e.dxPixels*s+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s+(e.dyPixels+e.height)*n,d=Math.min(i,o,l,x),f=Math.max(i,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,i.page,1===t.rotationAlignment,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),s=Math.sin(t),i=e.dxPixels*n-e.dyPixels*s,a=e.dxPixels*s+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*s,r=(e.dxPixels+e.width)*s+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*s,h=e.dxPixels*s+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s+(e.dyPixels+e.height)*n,d=Math.min(i,o,l,x),f=Math.max(i,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,s,i,a){const o=Math.max(n-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=i?0:Math.max(n+r(c.minzoom),o),d=i?25:Math.min(n+r(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,b=c.anchor,P=l.index,I=u.x,A=u.y,V=I+u.width,w=A+u.height,L=l.index;l.add(b.x,b.y,f.x,f.y,I,A,p,_,M,t,d,a),l.add(b.x,b.y,g.x,g.y,V,A,p,_,M,t,d,a),l.add(b.x,b.y,y.x,y.y,I,w,p,_,M,t,d,a),l.add(b.x,b.y,m.x,m.y,V,w,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===L?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([L,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),x.has(s)?x.get(s)[1]+=6:x.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[s,i]of this._glyphBufferDataStorage)for(const a of i){const i=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),n.has(s)?n.get(s)[1]+=6:n.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,s,i){const a=Math.max(n-1,0),o=1===s;let l,h,x,c,d,f,g,y,m,u,p;for(const _ of t){if(l=o?0:Math.max(n+r(_.minzoom),a),h=o?25:Math.min(n+r(_.maxzoom),25),h<=l)continue;x=_.tl,c=_.tr,d=_.bl,f=_.br,g=_.labelAngle,y=_.minAngle,m=_.maxAngle,u=_.anchor,p=_.mosaicRect,this._glyphBufferDataStorage.has(_.page)||this._glyphBufferDataStorage.set(_.page,[]);this._glyphBufferDataStorage.get(_.page).push({glyphAnchor:[u.x,u.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:l,maxLod:h,placementLod:a,symbolInstance:e,ddAttributes:i})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let l=0;l<o;l++)a+=s.distance(t[l],t[l+1]);let r=i||n;if(r*=.5,a<=r)return;const x=r/a;let c=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<c+f;){d+=n;const t=(d-c)/f,y=l(i.x,a.x,t),m=l(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new h(y,m,g,s,x))}c+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,x=i.y-n.y,c=Math.sqrt(r*r+x*x);if(a<o+c){const t=(a-o)/c,d=l(n.x,i.x,t),f=l(n.y,i.y,t),g=Math.atan2(x,r);return void e.push(new h(d,f,g,s,0))}o+=c}}static _deviation(e,t,n){const s=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),i=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(i,s)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _getPlacementCandidates(e,t,n,s){if(0!==t||3!==n.type||"geojson"!==e.sourceType)return s.map(e=>({anchor:null,vertices:e}));const i=f(s);return i?[{anchor:new h(i.x,i.y),vertices:i.vertices}]:[]}static _pushCentroid(e,t){const n=0,s=0,i=a,o=a,r=t.length-1;let l=0,x=0,c=0,d=t[0].x,f=t[0].y;d>i&&(d=i),d<n&&(d=n),f>o&&(f=o),f<s&&(f=s);for(let a=1;a<r;a++){let e=t[a].x,r=t[a].y,h=t[a+1].x,g=t[a+1].y;e>i&&(e=i),e<n&&(e=n),r>o&&(r=o),r<s&&(r=s),h>i&&(h=i),h<n&&(h=n),g>o&&(g=o),g<s&&(g=s);const y=(e-d)*(g-f)-(h-d)*(r-f);l+=y*(d+e+h),x+=y*(f+r+g),c+=y}l/=3*c,x/=3*c,isNaN(l)||isNaN(x)||e.push(new h(l,x))}}export{p as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{GeometryCursor as o}from"../../../../../geometry/GeometryCursor.js";import{getPolylabelPoint as t}from"../../../../../geometry/support/labelPoint.js";import r from"../../../../../layers/graphics/OptimizedGeometry.js";function e(e){let l=null,s=0,m=[],f=0;for(const o of e){const t=n(o);t>0?(f>s&&(s=f,l=m),m=[o],f=t):t<0&&m.length>0&&(m.push(o),f+=t)}if(f>s&&(l=m),!l)return null;const i=l.map(o=>o.length),p=[];for(const o of l)for(const t of o)p.push(t.x,t.y);const u=o.fromOptimized(new r(i,p),"esriGeometryPolygon"),y=t(u);return y?{x:y[0],y:y[1],vertices:l[0]}:null}function n(o){let t=0;for(let r=0,e=o.length-1;r<o.length;e=r++)t+=(o[e].x-o[r].x)*(o[r].y+o[e].y);return.5*t}export{e as getPolygonLabelPlacement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as t}from"../../../../../geometry/support/aaBoundingRect.js";import{tilePixelRatio as i}from"../constants.js";import{translateAnchor as e,offsetLine as a,distanceFromToPolylineWithinThreshold as o,pointInPolygon as r}from"../GeometryUtils.js";import{VTLBackgroundMaterial as n}from"../shaders/VTLBackgroundMaterial.js";import{VTLCircleMaterial as s}from"../shaders/VTLCircleMaterial.js";import{VTLFillMaterial as l,VTLOutlineMaterial as h}from"../shaders/VTLFillMaterial.js";import{VTLLineMaterial as u}from"../shaders/VTLLineMaterial.js";import{VTLIconMaterial as p,VTLTextMaterial as g}from"../shaders/VTLSymbolMaterial.js";import c from"./Filter.js";import{StyleDefinition as y}from"./StyleDefinition.js";import P from"./StyleProperty.js";import{thinLineHalfWidthThreshold as f}from"../../webgl/definitions.js";class D{constructor(t,i,e,a,o,r){this.layer=t,this.feature=i,this.bounds=e,this.normalizationRatio=a,this.normalizationOffsetX=o,this.normalizationOffsetY=r}}class m{constructor(t,i,e,a){switch(this.type=t,this.typeName=i.type,this.id=i.id,this.source=i.source,this.sourceLayer=i["source-layer"]??i.source,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.filter=i.filter,this.layout=i.layout,this.paint=i.paint,this.z=e,this.uid=a,t){case 0:this._layoutDefinition=y.backgroundLayoutDefinition,this._paintDefinition=y.backgroundPaintDefinition;break;case 1:this._layoutDefinition=y.fillLayoutDefinition,this._paintDefinition=y.fillPaintDefinition;break;case 2:this._layoutDefinition=y.lineLayoutDefinition,this._paintDefinition=y.linePaintDefinition;break;case 3:this._layoutDefinition=y.symbolLayoutDefinition,this._paintDefinition=y.symbolPaintDefinition;break;case 4:this._layoutDefinition=y.circleLayoutDefinition,this._paintDefinition=y.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=c.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,i,e){let a;const o=this._layoutProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._layoutDefinition[t].default),a}getPaintValue(t,i,e){let a;const o=this._paintProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._paintDefinition[t].default),a}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const i in t)if(t[i].isDataDriven)return!0;return!1}isIntersectingFeature(t,i,e,a,o,r,n,s){return!1}getFeatureInflatedBounds(t,i,e,a){return null}_parseLayout(t){const i={};for(const e in t){const a=this._layoutDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}_parsePaint(t){const i={};for(const e in t){const a=this._paintDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}computeAttributesKey(t,i,e,a){let o=0,r=0;for(const n of i){let t=3;if(n&&n!==a){const i=e[n],{isLayout:a,isOptional:o}=i,r=a?this.getLayoutProperty(n):this.getPaintProperty(n);t=r?.interpolator?2:r?.isDataDriven?1:o&&!r?3:0}r|=t<<o,o+=2}return r<<3|t}}class d extends m{constructor(t,i,e,a){super(t,i,e,a),this.backgroundMaterial=new n(this.computeAttributesKey(0,n.ATTRIBUTES,n.ATTRIBUTES_INFO))}}class _ extends m{constructor(t,i,e,a){super(t,i,e,a);const o=this.getPaintProperty("fill-color"),r=this.getPaintProperty("fill-opacity"),n=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=o?.isDataDriven,this.hasDataDrivenOpacity=r?.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||n?.isDataDriven;const s=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!s,this.hasDataDrivenOutlineColor=s?.isDataDriven,this.hasDataDrivenOutline=s?s.isDataDriven:!!o&&o.isDataDriven,this.hasDataDrivenOutline=(s?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new l(this.computeAttributesKey(1,l.ATTRIBUTES,l.ATTRIBUTES_INFO)),this.outlineMaterial=new h(this.computeAttributesKey(2,this.outlineUsesFillColor?h.ATTRIBUTES_FILL:h.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?h.ATTRIBUTES_INFO_FILL:h.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("fill-translate",i,t),n=a*Math.max(r[0],r[1]);return o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n,o}isIntersectingFeature(t,a,n,s,l,h,u,p){const g=s.getGeometry();if(!g)return!1;const c=i/p.normalizationRatio,y=c/u;t=t/p.normalizationRatio+p.normalizationOffsetX,a=a/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("fill-translate",l,s),this.getPaintValue("fill-translate-anchor",l,s),h,y);t-=c*P.x,a-=c*P.y;return!!r(t,a,g)||o(t,a,g,n)}}class L extends m{constructor(t,i,e,a){super(t,i,e,a);const o=this.getPaintProperty("line-pattern");if(this.lineMaterial=new u(this.computeAttributesKey(3,u.ATTRIBUTES,u.ATTRIBUTES_INFO,o?"line-dasharray":"")),this.hasDataDrivenLine=this.getPaintProperty("line-blur")?.isDataDriven||this.getPaintProperty("line-color")?.isDataDriven||this.getPaintProperty("line-gap-width")?.isDataDriven||this.getPaintProperty("line-offset")?.isDataDriven||this.getPaintProperty("line-opacity")?.isDataDriven||this.getPaintProperty("line-pattern")?.isDataDriven||this.getPaintProperty("line-dasharray")?.isDataDriven||this.getLayoutProperty("line-cap")?.isDataDriven||this.getPaintProperty("line-width")?.isDataDriven,this.canUseThinTessellation=!1,!this.hasDataDrivenLine){const t=this.getPaintProperty("line-width");if(!t||"number"==typeof t&&.5*t<f){const t=this.getPaintProperty("line-offset");(!t||"number"==typeof t&&0===t)&&(this.canUseThinTessellation=!0)}}}getDashKey(t,i){let e;switch(i){case 0:default:e="Butt";break;case 1:e="Round";break;case 2:e="Square"}return`dasharray-[${t.toString()}]-${e}`}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("line-translate",i,t),n=a*Math.max(r[0],r[1]);o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n;const s=a*Math.abs(this.getPaintValue("line-offset",i,t)||0),l=a*(this.getPaintValue("line-width",i,t)/2);return o[0]-=s+l,o[1]-=s+l,o[2]+=s+l,o[3]+=s+l,o}isIntersectingFeature(t,r,n,s,l,h,u,p){let g=s.getGeometry();if(!g)return!1;const c=i/p.normalizationRatio,y=c/u;t=t/p.normalizationRatio+p.normalizationOffsetX,r=r/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("line-translate",l,s),this.getPaintValue("line-translate-anchor",l,s),h,y);t-=c*P.x,r-=c*P.y;const f=y*this.getPaintValue("line-offset",l,s)||0;0!==f&&(g=a(g,-f));const D=this.getPaintValue("line-width",l,s);return o(t,r,g,y*(D/2)+n)}}class v extends m{constructor(t,i,e,a){super(t,i,e,a),this.iconMaterial=new p(this.computeAttributesKey(4,p.ATTRIBUTES,p.ATTRIBUTES_INFO)),this.textMaterial=new g(this.computeAttributesKey(6,g.ATTRIBUTES,g.ATTRIBUTES_INFO)),this.hasDataDrivenIcon=this.getPaintProperty("icon-color")?.isDataDriven||this.getPaintProperty("icon-halo-blur")?.isDataDriven||this.getPaintProperty("icon-halo-color")?.isDataDriven||this.getPaintProperty("icon-halo-width")?.isDataDriven||this.getPaintProperty("icon-opacity")?.isDataDriven||this.getLayoutProperty("icon-size")?.isDataDriven,this.hasDataDrivenText=this.getPaintProperty("text-color")?.isDataDriven||this.getPaintProperty("text-halo-blur")?.isDataDriven||this.getPaintProperty("text-halo-color")?.isDataDriven||this.getPaintProperty("text-halo-width")?.isDataDriven||this.getPaintProperty("text-opacity")?.isDataDriven||this.getLayoutProperty("text-size")?.isDataDriven}}class x extends m{constructor(t,i,e,a){super(t,i,e,a),this.circleMaterial=new s(this.computeAttributesKey(5,s.ATTRIBUTES,s.ATTRIBUTES_INFO))}getFeatureInflatedBounds(t,e,a,o){const r=z(t);if(!r)return null;const n=this.getPaintValue("circle-translate",e,t),s=Math.max(n[0],n[1]);r[0]-=s,r[2]-=s,r[1]+=s,r[3]+=s;const l=o*(i*(this.getPaintValue("circle-radius",e,t)+this.getPaintValue("circle-stroke-width",e,t))/2);return r[0]-=l,r[1]-=l,r[2]+=l,r[3]+=l,r}isIntersectingFeature(t,a,o,r,n,s,l,h){const u=r.getGeometry();if(!u)return!1;const p=i/h.normalizationRatio/l;t=t/h.normalizationRatio+h.normalizationOffsetX,a=a/h.normalizationRatio+h.normalizationOffsetY;const g=e(this.getPaintValue("circle-translate",n,r),this.getPaintValue("circle-translate-anchor",n,r),s,p),c=p*(this.getPaintValue("circle-radius",n,r)+this.getPaintValue("circle-stroke-width",n,r));let y,P;for(const i of u)if(i)for(const e of i){y=e.x+g.x,P=e.y+g.y;if(Math.sqrt((t-y)*(t-y)+(a-P)*(a-P))-o<=c)return!0}return!1}}class V{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("icon-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",i),this.keepUpright=t.getLayoutValue("icon-keep-upright",i),this.optional=t.getLayoutValue("icon-optional",i),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("icon-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("icon-anchor",i),a=t.getLayoutProperty("icon-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("icon-offset",i),a=t.getLayoutProperty("icon-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("icon-padding",i),a=t.getLayoutProperty("icon-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("icon-rotate",i),a=t.getLayoutProperty("icon-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("icon-size",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i))}}class T{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("text-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",i),this.keepUpright=t.getLayoutValue("text-keep-upright",i),this.optional=t.getLayoutValue("text-optional",i),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("text-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("text-anchor",i),a=t.getLayoutProperty("text-justify"),a?.isDataDriven?this._justifyProp=a:this.justify=t.getLayoutValue("text-justify",i),a=t.getLayoutProperty("text-letter-spacing"),a?.isDataDriven?this._letterSpacingProp=a:this.letterSpacing=t.getLayoutValue("text-letter-spacing",i),a=t.getLayoutProperty("text-line-height"),a?.isDataDriven?this._lineHeightProp=a:this.lineHeight=t.getLayoutValue("text-line-height",i),a=t.getLayoutProperty("text-max-angle"),a?.isDataDriven?this._maxAngleProp=a:this.maxAngle=t.getLayoutValue("text-max-angle",i),a=t.getLayoutProperty("text-max-width"),a?.isDataDriven?this._maxWidthProp=a:this.maxWidth=t.getLayoutValue("text-max-width",i),a=t.getLayoutProperty("text-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("text-offset",i),a=t.getLayoutProperty("text-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("text-padding",i),a=t.getLayoutProperty("text-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("text-rotate",i),a=t.getLayoutProperty("text-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("text-size",i),a=t.getLayoutProperty("text-writing-mode"),a?.isDataDriven?this._writingModeProp=a:this.writingMode=t.getLayoutValue("text-writing-mode",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._justifyProp&&(this.justify=this._justifyProp.getValue(t,i)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(t,i)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(t,i)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(t,i)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(t,i))}}function z(i){const e=i?.getGeometry();if(null==e)return null;let a=1/0,o=1/0,r=-1/0,n=-1/0;for(const t of e)if(t)for(const i of t)a=Math.min(a,i.x),o=Math.min(o,i.y),r=Math.max(r,i.x),n=Math.max(n,i.y);return t(a,o,r,n)}export{d as BackgroundStyleLayer,x as CircleStyleLayer,_ as FillStyleLayer,V as IconLayout,D as IndexItem,L as LineStyleLayer,m as StyleLayer,v as SymbolStyleLayer,T as TextLayout};
|
|
2
|
+
import{fromValues as t}from"../../../../../geometry/support/aaBoundingRect.js";import{tilePixelRatio as i}from"../constants.js";import{translateAnchor as e,offsetLine as a,distanceFromToPolylineWithinThreshold as o,pointInPolygon as r}from"../GeometryUtils.js";import{VTLBackgroundMaterial as n}from"../shaders/VTLBackgroundMaterial.js";import{VTLCircleMaterial as s}from"../shaders/VTLCircleMaterial.js";import{VTLFillMaterial as l,VTLOutlineMaterial as h}from"../shaders/VTLFillMaterial.js";import{VTLLineMaterial as u}from"../shaders/VTLLineMaterial.js";import{VTLIconMaterial as p,VTLTextMaterial as c}from"../shaders/VTLSymbolMaterial.js";import g from"./Filter.js";import{StyleDefinition as y}from"./StyleDefinition.js";import P from"./StyleProperty.js";import{thinLineHalfWidthThreshold as f}from"../../webgl/definitions.js";class D{constructor(t,i,e,a,o,r){this.layer=t,this.feature=i,this.bounds=e,this.normalizationRatio=a,this.normalizationOffsetX=o,this.normalizationOffsetY=r}}class m{constructor(t,i,e,a,o=null){switch(this.type=t,this.typeName=i.type,this.id=i.id,this.source=i.source,this.sourceLayer=i["source-layer"]??i.source,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.filter=i.filter,this.layout=i.layout,this.paint=i.paint,this.z=e,this.uid=a,this.sourceType=o,t){case 0:this._layoutDefinition=y.backgroundLayoutDefinition,this._paintDefinition=y.backgroundPaintDefinition;break;case 1:this._layoutDefinition=y.fillLayoutDefinition,this._paintDefinition=y.fillPaintDefinition;break;case 2:this._layoutDefinition=y.lineLayoutDefinition,this._paintDefinition=y.linePaintDefinition;break;case 3:this._layoutDefinition=y.symbolLayoutDefinition,this._paintDefinition=y.symbolPaintDefinition;break;case 4:this._layoutDefinition=y.circleLayoutDefinition,this._paintDefinition=y.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=g.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,i,e){let a;const o=this._layoutProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._layoutDefinition[t].default),a}getPaintValue(t,i,e){let a;const o=this._paintProperties[t];return o&&(a=o.getValue(i,e)),void 0===a&&(a=this._paintDefinition[t].default),a}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const i in t)if(t[i].isDataDriven)return!0;return!1}isIntersectingFeature(t,i,e,a,o,r,n,s){return!1}getFeatureInflatedBounds(t,i,e,a){return null}_parseLayout(t){const i={};for(const e in t){const a=this._layoutDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}_parsePaint(t){const i={};for(const e in t){const a=this._paintDefinition[e];a&&(i[e]=new P(a,t[e]))}return i}computeAttributesKey(t,i,e,a){let o=0,r=0;for(const n of i){let t=3;if(n&&n!==a){const i=e[n],{isLayout:a,isOptional:o}=i,r=a?this.getLayoutProperty(n):this.getPaintProperty(n);t=r?.interpolator?2:r?.isDataDriven?1:o&&!r?3:0}r|=t<<o,o+=2}return r<<3|t}}class d extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.backgroundMaterial=new n(this.computeAttributesKey(0,n.ATTRIBUTES,n.ATTRIBUTES_INFO))}}class _ extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("fill-color"),n=this.getPaintProperty("fill-opacity"),s=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=r?.isDataDriven,this.hasDataDrivenOpacity=n?.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||s?.isDataDriven;const u=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!u,this.hasDataDrivenOutlineColor=u?.isDataDriven,this.hasDataDrivenOutline=u?u.isDataDriven:!!r&&r.isDataDriven,this.hasDataDrivenOutline=(u?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new l(this.computeAttributesKey(1,l.ATTRIBUTES,l.ATTRIBUTES_INFO)),this.outlineMaterial=new h(this.computeAttributesKey(2,this.outlineUsesFillColor?h.ATTRIBUTES_FILL:h.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?h.ATTRIBUTES_INFO_FILL:h.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("fill-translate",i,t),n=a*Math.max(r[0],r[1]);return o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n,o}isIntersectingFeature(t,a,n,s,l,h,u,p){const c=s.getGeometry();if(!c)return!1;const g=i/p.normalizationRatio,y=g/u;t=t/p.normalizationRatio+p.normalizationOffsetX,a=a/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("fill-translate",l,s),this.getPaintValue("fill-translate-anchor",l,s),h,y);t-=g*P.x,a-=g*P.y;return!!r(t,a,c)||o(t,a,c,n)}}class L extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o);const r=this.getPaintProperty("line-pattern");if(this.lineMaterial=new u(this.computeAttributesKey(3,u.ATTRIBUTES,u.ATTRIBUTES_INFO,r?"line-dasharray":"")),this.hasDataDrivenLine=this.getPaintProperty("line-blur")?.isDataDriven||this.getPaintProperty("line-color")?.isDataDriven||this.getPaintProperty("line-gap-width")?.isDataDriven||this.getPaintProperty("line-offset")?.isDataDriven||this.getPaintProperty("line-opacity")?.isDataDriven||this.getPaintProperty("line-pattern")?.isDataDriven||this.getPaintProperty("line-dasharray")?.isDataDriven||this.getLayoutProperty("line-cap")?.isDataDriven||this.getPaintProperty("line-width")?.isDataDriven,this.canUseThinTessellation=!1,!this.hasDataDrivenLine){const t=this.getPaintProperty("line-width");if(!t||"number"==typeof t&&.5*t<f){const t=this.getPaintProperty("line-offset");(!t||"number"==typeof t&&0===t)&&(this.canUseThinTessellation=!0)}}}getDashKey(t,i){let e;switch(i){case 0:default:e="Butt";break;case 1:e="Round";break;case 2:e="Square"}return`dasharray-[${t.toString()}]-${e}`}getFeatureInflatedBounds(t,i,e,a){const o=z(t);if(!o)return null;const r=this.getPaintValue("line-translate",i,t),n=a*Math.max(r[0],r[1]);o[0]-=n,o[2]-=n,o[1]+=n,o[3]+=n;const s=a*Math.abs(this.getPaintValue("line-offset",i,t)||0),l=a*(this.getPaintValue("line-width",i,t)/2);return o[0]-=s+l,o[1]-=s+l,o[2]+=s+l,o[3]+=s+l,o}isIntersectingFeature(t,r,n,s,l,h,u,p){let c=s.getGeometry();if(!c)return!1;const g=i/p.normalizationRatio,y=g/u;t=t/p.normalizationRatio+p.normalizationOffsetX,r=r/p.normalizationRatio+p.normalizationOffsetY;const P=e(this.getPaintValue("line-translate",l,s),this.getPaintValue("line-translate-anchor",l,s),h,y);t-=g*P.x,r-=g*P.y;const f=y*this.getPaintValue("line-offset",l,s)||0;0!==f&&(c=a(c,-f));const D=this.getPaintValue("line-width",l,s);return o(t,r,c,y*(D/2)+n)}}class v extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.iconMaterial=new p(this.computeAttributesKey(4,p.ATTRIBUTES,p.ATTRIBUTES_INFO)),this.textMaterial=new c(this.computeAttributesKey(6,c.ATTRIBUTES,c.ATTRIBUTES_INFO)),this.hasDataDrivenIcon=this.getPaintProperty("icon-color")?.isDataDriven||this.getPaintProperty("icon-halo-blur")?.isDataDriven||this.getPaintProperty("icon-halo-color")?.isDataDriven||this.getPaintProperty("icon-halo-width")?.isDataDriven||this.getPaintProperty("icon-opacity")?.isDataDriven||this.getLayoutProperty("icon-size")?.isDataDriven,this.hasDataDrivenText=this.getPaintProperty("text-color")?.isDataDriven||this.getPaintProperty("text-halo-blur")?.isDataDriven||this.getPaintProperty("text-halo-color")?.isDataDriven||this.getPaintProperty("text-halo-width")?.isDataDriven||this.getPaintProperty("text-opacity")?.isDataDriven||this.getLayoutProperty("text-size")?.isDataDriven}}class x extends m{constructor(t,i,e,a,o=null){super(t,i,e,a,o),this.circleMaterial=new s(this.computeAttributesKey(5,s.ATTRIBUTES,s.ATTRIBUTES_INFO))}getFeatureInflatedBounds(t,e,a,o){const r=z(t);if(!r)return null;const n=this.getPaintValue("circle-translate",e,t),s=Math.max(n[0],n[1]);r[0]-=s,r[2]-=s,r[1]+=s,r[3]+=s;const l=o*(i*(this.getPaintValue("circle-radius",e,t)+this.getPaintValue("circle-stroke-width",e,t))/2);return r[0]-=l,r[1]-=l,r[2]+=l,r[3]+=l,r}isIntersectingFeature(t,a,o,r,n,s,l,h){const u=r.getGeometry();if(!u)return!1;const p=i/h.normalizationRatio/l;t=t/h.normalizationRatio+h.normalizationOffsetX,a=a/h.normalizationRatio+h.normalizationOffsetY;const c=e(this.getPaintValue("circle-translate",n,r),this.getPaintValue("circle-translate-anchor",n,r),s,p),g=p*(this.getPaintValue("circle-radius",n,r)+this.getPaintValue("circle-stroke-width",n,r));let y,P;for(const i of u)if(i)for(const e of i){y=e.x+c.x,P=e.y+c.y;if(Math.sqrt((t-y)*(t-y)+(a-P)*(a-P))-o<=g)return!0}return!1}}class V{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("icon-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",i),this.keepUpright=t.getLayoutValue("icon-keep-upright",i),this.optional=t.getLayoutValue("icon-optional",i),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("icon-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("icon-anchor",i),a=t.getLayoutProperty("icon-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("icon-offset",i),a=t.getLayoutProperty("icon-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("icon-padding",i),a=t.getLayoutProperty("icon-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("icon-rotate",i),a=t.getLayoutProperty("icon-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("icon-size",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i))}}class T{constructor(t,i,e){let a;this.allowOverlap=t.getLayoutValue("text-allow-overlap",i),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",i),this.keepUpright=t.getLayoutValue("text-keep-upright",i),this.optional=t.getLayoutValue("text-optional",i),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",i),2===this.rotationAlignment&&(this.rotationAlignment=e?0:1),a=t.getLayoutProperty("text-anchor"),a?.isDataDriven?this._anchorProp=a:this.anchor=t.getLayoutValue("text-anchor",i),a=t.getLayoutProperty("text-justify"),a?.isDataDriven?this._justifyProp=a:this.justify=t.getLayoutValue("text-justify",i),a=t.getLayoutProperty("text-letter-spacing"),a?.isDataDriven?this._letterSpacingProp=a:this.letterSpacing=t.getLayoutValue("text-letter-spacing",i),a=t.getLayoutProperty("text-line-height"),a?.isDataDriven?this._lineHeightProp=a:this.lineHeight=t.getLayoutValue("text-line-height",i),a=t.getLayoutProperty("text-max-angle"),a?.isDataDriven?this._maxAngleProp=a:this.maxAngle=t.getLayoutValue("text-max-angle",i),a=t.getLayoutProperty("text-max-width"),a?.isDataDriven?this._maxWidthProp=a:this.maxWidth=t.getLayoutValue("text-max-width",i),a=t.getLayoutProperty("text-offset"),a?.isDataDriven?this._offsetProp=a:this.offset=t.getLayoutValue("text-offset",i),a=t.getLayoutProperty("text-padding"),a?.isDataDriven?this._paddingProp=a:this.padding=t.getLayoutValue("text-padding",i),a=t.getLayoutProperty("text-rotate"),a?.isDataDriven?this._rotateProp=a:this.rotate=t.getLayoutValue("text-rotate",i),a=t.getLayoutProperty("text-size"),a?.isDataDriven?this._sizeProp=a:this.size=t.getLayoutValue("text-size",i),a=t.getLayoutProperty("text-writing-mode"),a?.isDataDriven?this._writingModeProp=a:this.writingMode=t.getLayoutValue("text-writing-mode",i)}update(t,i){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,i)),this._justifyProp&&(this.justify=this._justifyProp.getValue(t,i)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(t,i)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(t,i)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(t,i)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(t,i)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,i)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,i)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,i)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,i)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(t,i))}}function z(i){const e=i?.getGeometry();if(null==e)return null;let a=1/0,o=1/0,r=-1/0,n=-1/0;for(const t of e)if(t)for(const i of t)a=Math.min(a,i.x),o=Math.min(o,i.y),r=Math.max(r,i.x),n=Math.max(n,i.y);return t(a,o,r,n)}export{d as BackgroundStyleLayer,x as CircleStyleLayer,_ as FillStyleLayer,V as IconLayout,D as IndexItem,L as LineStyleLayer,m as StyleLayer,v as SymbolStyleLayer,T as TextLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../../core/lang.js";import{CircleStyleLayer as t,SymbolStyleLayer as r,LineStyleLayer as a,FillStyleLayer as
|
|
2
|
+
import{clone as e}from"../../../../../core/lang.js";import{CircleStyleLayer as t,SymbolStyleLayer as r,LineStyleLayer as a,FillStyleLayer as s,BackgroundStyleLayer as i}from"./StyleLayer.js";class l{constructor(t,r=!0){if(this.backgroundBucketIds=[],this._uidToLayer=new Map,this._layerByName={},this._runningId=0,this._style=r?e(t):t,this._style.layers||(this._style.layers=[]),this.version=parseFloat(this._style.version),this.layers=this._style.layers.map((e,t,r)=>this._create(e,t,r)).filter(e=>!!e),this.layers)for(let e=0;e<this.layers.length;e++){const t=this.layers[e];this._layerByName[t.id]=t,this._uidToLayer.set(t.uid,t),0===t.type&&this.backgroundBucketIds.push(t.id)}this._identifyRefLayers()}getLayerStyleProperties(e,t){const r=this.getStyleLayerByUID(e),a=0!==r?.getLayoutValue("symbol-placement",t);let s=r?.getLayoutValue("icon-rotation-alignment",t);2===s&&(s=a?0:1);let i=r?.getLayoutValue("text-rotation-alignment",t);2===i&&(i=a?0:1);const l=r?.getPaintValue("icon-translate",t),n=r?.getPaintValue("icon-translate-anchor",t),y=r?.getPaintValue("text-translate",t),o=r?.getPaintValue("text-translate-anchor",t);return{geometryType:null,iconAllowOverlap:r?.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:r?.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:r?.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:r?.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:s,textRotationAlignment:i,iconTranslateAnchor:n,iconTranslate:l,textTranslateAnchor:o,textTranslate:y}}isPainterDataDriven(e){const t=this._layerByName[e];return!!t&&t.isPainterDataDriven()}getStyleLayerId(e){return e>=this.layers.length?null:this.layers[e].id}getStyleLayerByUID(e){return this._uidToLayer.get(e)??null}getStyleLayerIndex(e){const t=this._layerByName[e];return t?this.layers.indexOf(t):-1}setStyleLayer(e,t){if(!e?.id)return;const r=this._style;null!=t&&t>=this.layers.length&&(t=this.layers.length-1);let a,s=!0;const i=this._layerByName[e.id];if(i){const n=this.layers.indexOf(i);t||(t=n),t===n?(s=!1,a=l._recreateLayer(e,i,this._getSourceType(e.source)),this.layers[t]=a,r.layers[t]=e):(this.layers.splice(n,1),r.layers.splice(n,1),a=this._create(e,t,this.layers),this.layers.splice(t,0,a),r.layers.splice(t,0,e))}else a=this._create(e,t,this.layers),!t||t>=this.layers.length?(this.layers.push(a),r.layers.push(e)):(this.layers.splice(t,0,a),r.layers.splice(t,0,e));this._layerByName[e.id]=a,this._uidToLayer.set(a.uid,a),s&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(e){const t=this._layerByName[e];return t?{type:t.typeName,id:t.id,source:t.source,"source-layer":t.sourceLayer,minzoom:t.minzoom,maxzoom:t.maxzoom,filter:t.filter,layout:t.layout,paint:t.paint}:null}deleteStyleLayer(e){const t=this._layerByName[e];if(t){delete this._layerByName[e],this._uidToLayer.delete(t.uid);const r=this.layers.indexOf(t);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(e){return this._layerByName[e]}getLayoutProperties(e){const t=this._layerByName[e];return t?t.layout:null}getPaintProperties(e){const t=this._layerByName[e];return t?t.paint:null}setPaintProperties(e,t){const r=this._layerByName[e];if(!r)return;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:t},s=l._recreateLayer(a,r,r.sourceType),i=this.layers.indexOf(r);this.layers[i]=s,this._style.layers[i].paint=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setLayoutProperties(e,t){const r=this._layerByName[e];if(!r)return;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:t,paint:r.paint},s=l._recreateLayer(a,r,r.sourceType),i=this.layers.indexOf(r);this.layers[i]=s,this._style.layers[i].layout=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setStyleLayerVisibility(e,t){const r=this._layerByName[e];if(!r)return;const a=r.layout||{};a.visibility=t;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:a,paint:r.paint},i=l._recreateLayer(s,r,r.sourceType),n=this.layers.indexOf(r);this.layers[n]=i,this._style.layers[n].layout=a,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}getStyleLayerVisibility(e){const t="string"==typeof e?this._layerByName[e]:this._uidToLayer.get(e);if(!t)return!1;const r=t.getLayoutProperty("visibility");return!r||1!==r.getValue()}_recomputeZValues(){const e=this.layers,t=1/(e.length+1);for(let r=0;r<e.length;r++)e[r].z=1-(1+r)*t}_identifyRefLayers(){const e=[],t=[];let r=0;for(const a of this.layers){const s=a.layout;if(1===a.type){const t=a;let i=a.source+"|"+a.sourceLayer;i+="|"+(s?.visibility??""),i+="|"+a.minzoom,i+="|"+a.maxzoom,i+="|"+JSON.stringify(a.filter),(t.hasDataDrivenFill||t.hasDataDrivenOutline)&&(i+="|"+r),e.push({key:i,layer:a})}else if(2===a.type){const e=a,i=a.paint,l=null!=i&&(null!=i["line-pattern"]||null!=i["line-dasharray"]);let n=a.source+"|"+a.sourceLayer;n+="|"+(s?.visibility??""),n+="|"+a.minzoom,n+="|"+a.maxzoom,n+="|"+JSON.stringify(a.filter),n+="|"+(void 0!==s?s["line-cap"]:""),n+="|"+(void 0!==s?s["line-join"]:""),(e.hasDataDrivenLine||l)&&(n+="|"+r),t.push({key:n,layer:a})}++r}this._assignRefLayers(e),this._assignRefLayers(t)}_assignRefLayers(e){let t,r;e.sort((e,t)=>e.key<t.key?-1:e.key>t.key?1:0);const a=e.length;for(let s=0;s<a;s++){const i=e[s];if(i.key===t)i.layer.refLayerId=r;else if(t=i.key,r=i.layer.id,1===i.layer.type){if(!i.layer.getPaintProperty("fill-outline-color"))for(let l=s+1;l<a;l++){const a=e[l];if(a.key!==t)break;if(a.layer.getPaintProperty("fill-outline-color")){e[s]=a,e[l]=i,r=a.layer.id;break}}}else if(2===i.layer.type){let l=i.layer;for(let n=s+1;n<a;n++){const a=e[n];if(a.key!==t)break;const y=a.layer;(l.canUseThinTessellation&&!y.canUseThinTessellation||!l.canUseThinTessellation&&(y.getPaintProperty("line-pattern")||y.getPaintProperty("line-dasharray")))&&(l=y,e[s]=a,e[n]=i,r=a.layer.id)}}}}_create(e,l,n){const y=1-(1+l)*(1/(n.length+1)),o=this._runningId++,u=this._getSourceType(e.source);switch(e.type){case"background":return new i(0,e,y,o,u);case"fill":return new s(1,e,y,o,u);case"line":return new a(2,e,y,o,u);case"symbol":return new r(3,e,y,o,u);case"raster":return console.warn(`Unsupported vector tile raster layer ${e.id}`),null;case"circle":return new t(4,e,y,o,u)}return null}_getSourceType(e){return this._style.sources?.[e]?.type??null}static _recreateLayer(e,l,n){switch(e.type){case"background":return new i(0,e,l.z,l.uid,n);case"fill":return new s(1,e,l.z,l.uid,n);case"line":return new a(2,e,l.z,l.uid,n);case"symbol":return new r(3,e,l.z,l.uid,n);case"raster":return console.warn(`Unsupported vector tile raster layer ${e.id}`),null;case"circle":return new t(4,e,l.z,l.uid,n)}return null}}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as s,option as r}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as
|
|
2
|
+
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as s,option as r}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as m,Sampler2D as p,cond as u,equal as d,negate as c,step as y,sin as v,cos as f,Mat3 as h,Vec3 as b,lessThanEqual as S,ifElse as w,texture2D as g,clamp as V,abs as x,block as z}from"../../graph/glsl.js";import{AnimationUniformInfo as T}from"./AnimationUniformInfo.js";import{MarkerConstants as P}from"../markers/markerConstants.js";import{FeatureVertexInput as j,AFeatureShader as _,FeatureFragmentInput as C}from"../shaders/AFeatureShader.js";import{softEdgeRatio as M}from"../shaders/constants.js";import{LocalTileOffset as O}from"../shaders/LocalTileOffset.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as F,rgba2float as A}from"../shaders/utils.js";import{VisualVariableColor as I}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as L}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as R}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as k}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as U}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as E}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as B}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as G,getVisualVariableAngle as q}from"../shaders/vvUtils.js";class N extends j{}i([o(3,l)],N.prototype,"offset",void 0),i([o(4,n)],N.prototype,"sizing",void 0),i([o(5,n)],N.prototype,"value1Position2Value2",void 0),i([o(6,n)],N.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,l)],N.prototype,"zoomRange",void 0),i([o(8,m)],N.prototype,"lineLength",void 0);class W extends C{}class Z extends _{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:s,sizing:r}=i,l=s.xy,n=s.z,p=s.w,v=r.xy,f=u([d(F(i.bitset,P.bitset.isMapAligned),new m(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new m(0)]),h=c(f.add(t)),b=this._getEvalParams(i,v,e,h);let S,w;if(i.value1Position2Value2){let t;t=this.hittestRequest?new m(0):H(l,6,b).a.multiply(this.tile.getDisplayZoomFactor(this.tileContainer));const e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,s=i.value1Position2Value2.w,r=t.subtract(a).divide(s.subtract(a));w=e.add(o.subtract(e).multiply(r)),S=y(new m(1),r).add(y(new m(0),c(r)))}else w=i.pos,S=new m(0);const g=r.z,V=F(i.bitset,P.bitset.isStroke),x=r.w,z=F(i.bitset,P.bitset.scaleSymbolsProportionally),T=H(l,0,b),j=T.xy,_=T.z,C=T.w,M=F(i.bitset,P.bitset.isSDF),O=G(this,o,new m(p)).divide(new m(p));return{baseSize:n,animationPointer:l,strokeWidth:g,isOutline:V,unscaledDistanceToPx:x,scaleSymbolsProportionally:z,isSDF:M,position:this._getScreenPosition({id:o,pos:w,offset:a,referenceSize:p,translation:j,rotation:_,scale:C,vvScale:O}),evalParams:b,vvScale:O,scale:C,clip:S}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:s,id:r,vvScale:l}=i,n=q(this,r).multiply(Math.PI/180),p=e.x.multiply(4/3),u=e.y.multiply(-1).multiply(4/3),d=v(n),y=f(n),S=y.multiply(p).add(c(d).multiply(u)),w=d.multiply(p).add(y.multiply(u)),g=v(o.subtract(n)),V=f(o.subtract(n)),x=new m(0),z=new m(1),T=new h(z,x,x,x,z,x,S,w,z),P=new h(V,g.multiply(-1),x,g,V,x,0,0,z),j=a.multiply(l).multiply(4/3),_=P.multiply(j),C=this.tile.getViewScreenMat3(this.view,this.tileContainer).multiply(new b(t,1)),M=T.multiply(C).xy,O=_.multiply(new b(s,0)).xy;return M.add(O)}_clip(i,e){let o=super.clip(i,e);const a=S(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(o=o.add(u([a,()=>new m(2)],[!0,()=>new m(0)]))),o}_getLocalTimeOrigin(i){return this.getLocalTimeOrigin(i)}_toNdc(i){return this.view.displayMat3.multiply(new b(i,1)).xy}_getEvalParams(i,t,e,o){const{globalTime:a,animationTextureSize:s}=this.animationInfo;return{globalTime:a,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:s,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:e,globalRotation:o}}_getColor(i,t){return w(d(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return g(this.mosaicTexture,i).multiply(t.color)}_getSDFColor(i,t){const e=g(this.mosaicTexture,i),o=new m(.5).subtract(A(e)).multiply(t.distanceToPx).multiply(M),a=V(new m(.5).subtract(o),new m(0),new m(1)),s=t.color.multiply(a),r=t.outlineSize.multiply(.5),l=x(o).subtract(r),n=V(new m(.5).subtract(l),new m(0),new m(1)),p=t.outlineColor.multiply(n);return new m(1).subtract(p.a).multiply(s).add(p)}}function H(i,t,o){const a=i.add(new l(t,0)),s=g(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(s),z({animationPointer:i,...o},n,null,i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})})}i([a(D)],Z.prototype,"mosaicInfo",void 0),i([a(T)],Z.prototype,"animationInfo",void 0),i([a(O)],Z.prototype,"localTileOffset",void 0),i([s(p)],Z.prototype,"mosaicTexture",void 0),i([r(I)],Z.prototype,"visualVariableColor",void 0),i([r(L)],Z.prototype,"visualVariableOpacity",void 0),i([r(k)],Z.prototype,"visualVariableSizeMinMaxValue",void 0),i([r(U)],Z.prototype,"visualVariableSizeScaleStops",void 0),i([r(E)],Z.prototype,"visualVariableSizeStops",void 0),i([r(B)],Z.prototype,"visualVariableSizeUnitValue",void 0),i([r(R)],Z.prototype,"visualVariableRotation",void 0),i([s(p)],Z.prototype,"animationTexture",void 0);export{W as AAnimatedFragmentInput,Z as AAnimatedShader,N as AAnimatedVertexInput,H as getValue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as h}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/mathUtils.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as G}from"../../support/Scheduler.js";let U=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([h(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),h(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:G.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],n=p(t);for(const{elementView:{normalizedCoords:o,element:l}}of this._elementReferences.values())if(n){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=o&&y(r,o.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=o&&f(o.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(q,e,!0);const r=new u({xmin:q[0],ymin:q[1],xmax:q[2],ymax:q[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([c({readOnly:!0})],U.prototype,"elements",void 0),U=e([d("esri.views.2d.layers.MediaLayerView2D")],U);const q=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(q,t.key,!0),V.xmin=q[0],V.ymin=q[1],V.xmax=q[2],V.ymax=q[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=U;export{M as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as h}from"../../../core/screenUtils.js";import{property as p,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Extent.js";import{create as f}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as g}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/mathUtils.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import E from"../engine/webgl/OverlayContainer.js";import{LayerView2D as S}from"./LayerView2D.js";import{getMapPointsFromScreen as R}from"../support/hitTestUtils.js";import T from"../../layers/MediaLayerView.js";import{TaskPriority as G}from"../../support/Scheduler.js";let U=class extends(S(T)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{const e=this.layer.effectiveSource;if(e)for(const{elementView:{element:t}}of this._elementReferences.values())e.hasElement(t)||this._removeElementReference(t);this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new E,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:G.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],n=h(t);for(const{elementView:{normalizedCoords:o,element:l}}of this._elementReferences.values())if(n){const r=R(this.view,t).map(e=>[e.x,e.y]);null!=o&&y(r,o.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=o&&g(o.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(q,e,!0);const r=new d({xmin:q[0],ymin:q[1],xmax:q[2],ymax:q[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i&&(i.tiles.delete(e),i.tiles.size||this._removeElementReference(t))}_removeElementReference(e){const t=this._elementReferences.get(e.uid);t&&(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),this._debugGraphicsView?.graphics.remove(t.debugGraphic))}_elementUpdateHandler(e){if(!this.layer.effectiveSource?.hasElement(e))return;let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return void this._removeElementReference(e);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([p({readOnly:!0})],U.prototype,"elements",void 0),U=e([u("esri.views.2d.layers.MediaLayerView2D")],U);const q=f(),V={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(q,t.key,!0),V.xmin=q[0],V.ymin=q[1],V.xmax=q[2],V.ymax=q[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=U;export{M as default};
|
package/views/3d/GroundView3D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as n,watch as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as n,on as i,watch as a}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as l,equals as u,intersection as d}from"../../geometry/support/aaBoundingRect.js";import p from"../GroundView.js";import{ElevationRange as g}from"./support/ElevationRange.js";import{toBoundingRect as h}from"./support/extentUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as c}from"./terrain/TerrainConst.js";let v=class extends(r(p)){initialize(){super.initialize();const e=()=>{this.emit("elevation-query-change")};this.addHandles(n(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(i(()=>this._integratedMeshGroundLayerView?.elevationProvider,"elevation-change",e=>this._elevationChange(e))),this.addHandles([a(()=>this.memoizedElevationQueryDependencies,e)])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>"elevation"===e.type||"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this._usingIntegratedMesh&&(this._terrainSurface?.enabled??!1)}get _usingIntegratedMesh(){return this.hasTerrainReplacement&&(this._integratedMeshGroundLayerView?.visible??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const r=l(),n=h(t,r,e)?r:null,i=this._get("userClippingExtent");return u(n,i)?i:n}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){return this._elevationProvider?.getElevation(e,t,r,n)}getElevations(e,t,r){const{_elevationProvider:n}=this;if(n?.getElevations)return n.getElevations(e,t,r);for(let i=0;i<t;++i)r(i,null)}intersect(e,t,r,n){if(this._usingTerrain)return void this._terrainSurface.intersect(e,t,r,n);const i=this._integratedMeshGroundLayerView;this._usingIntegratedMesh&&i&&i.intersect(e,t,r,n)}getSphereElevationRange(e,t,r){return this._elevationProvider?.getSphereElevationRange?.(e,t)}getRootElevationRange(){return this._elevationProvider?.getRootElevationRange?.()}get _elevationProvider(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.elevationProvider:this._terrainSurface}get elevationQueryCache(){const e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(const e of this.ground?.allLayers??[])if("integrated-mesh-3dtiles"===e.type&&e.replacesTerrain&&"failed"!==e.loadStatus&&null==e.queryElevationCallback)return!1;return!0}get groundExtent(){const{fullGroundExtent:e}=this;return e?this.userClippingExtent?d(e,this.userClippingExtent,l()):this.fullGroundExtent:null}get fullGroundExtent(){if(this._usingTerrain)return this._terrainSurface.fullGroundExtent;if(this._usingIntegratedMesh){const e=this.view.spatialReference;if(e.isWebMercator||e.isWGS84)return _(e);throw new t("GroundView:unsupportedSpatialReference","View spatial reference incompatible with groundLayer")}return null}get visibleElevationRange(){return this._source?.visibleElevationRange??f}get opaque(){return this._source?.opaque??!1}get invisible(){return this._source?.invisible??!1}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return!!this._usingTerrain&&(this._terrainSurface?.wireframe??!1)}get freeze(){return(this._usingTerrain?this._terrainSurface?.freeze:this._integratedMeshGroundLayerView?.freeze)??!1}set freeze(e){this._usingTerrain?this._terrainSurface.freeze=e:this._usingIntegratedMesh&&(this._integratedMeshGroundLayerView.freeze=e)}get suspended(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.suspended??!1:super.suspended}get ready(){return this._source?.ready??!1}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([s()],v.prototype,"memoizedElevationQueryDependencies",null),e([s({readOnly:!0})],v.prototype,"_integratedMeshGroundLayerView",null),e([s({readOnly:!0})],v.prototype,"_terrainSurface",null),e([s({readOnly:!0})],v.prototype,"_usingTerrain",null),e([s({readOnly:!0})],v.prototype,"_usingIntegratedMesh",null),e([s({readOnly:!0})],v.prototype,"spatialReference",null),e([s({readOnly:!0})],v.prototype,"userClippingExtent",null),e([s({type:Boolean,readOnly:!0})],v.prototype,"updating",null),e([s({readOnly:!0})],v.prototype,"elevationQueryCache",null),e([s()],v.prototype,"elevationQueryReady",null),e([s({readOnly:!0})],v.prototype,"groundExtent",null),e([s({readOnly:!0})],v.prototype,"fullGroundExtent",null),e([s({readOnly:!0})],v.prototype,"visibleElevationRange",null),e([s({readOnly:!0})],v.prototype,"opaque",null),e([s({readOnly:!0})],v.prototype,"invisible",null),e([s({readOnly:!0})],v.prototype,"baseOpacity",null),e([s({readOnly:!0})],v.prototype,"wireframe",null),e([s()],v.prototype,"freeze",null),e([s({readOnly:!0})],v.prototype,"suspended",null),e([s({readOnly:!0})],v.prototype,"ready",null),e([s({readOnly:!0})],v.prototype,"_source",null),v=e([o("esri.views.3d.GroundView3D")],v);const f=new g(0,0);function _(e){return e.isWebMercator?y:c}export{v as GroundView3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import n from"../../../../analysis/LineOfSightAnalysisObserver.js";import e from"../../../../analysis/LineOfSightAnalysisTarget.js";import{length as o,normalize as t,scaleAndAdd as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as i,getConvertedElevation as s,getGraphicEffectiveElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import f from"../../../../symbols/support/ElevationInfo.js";function a(n){return n?.clone()??null}function p(n){return n?.clone()??null}function m(e,o=null){return g(e,o,()=>new n)}function d(n,o=null){return g(n,o,()=>new e)}function g(n,e,o){if(null==n)return null;const t=e??o();return t.position=n.position?.clone()??null,t.elevationInfo=n.elevationInfo?.clone()??null,t.feature=n.feature??null,t}function v(n,e,o=null){const t=e.clone();return t.z=s(n,e,o??i,i),t}function h(n,e,o,t=null){const r=v(e,o,t);try{return n.getMapPointIntersection(r)}catch{return null}}function I(n,e,o,t,{elevationInfo:r=null,sourceElevationInfo:l=i,preservedIntersection:u=null,usesAuthoredAbsoluteHeight:s=!1}={}){const c=A(r,l,s),f=u??h(o,n,t,c);return null!=f&&(y(n,e,f,{snappedMapPoint:t,elevationInfo:r,sourceElevationInfo:l,usesAuthoredAbsoluteHeight:s}),!0)}function y(n,e,o,{snappedMapPoint:t=o.mapPoint,elevationInfo:r=null,sourceElevationInfo:l=i,usesAuthoredAbsoluteHeight:u=!1}={}){if(null==t)return e.position=null,e.elevationInfo=null,void(e.feature=null);const c=o.context,f=v(n,t,A(r,l,u)),a=b(o,r,u),p="graphic"===c?.type?c.graphic:null;e.elevationInfo=a,e.feature=p,"gaussian-splat"===c?.type?e.position=x(n,f,a,o.normal):(f.z=s(n,f,i,a),e.position=f)}function A(n,e,o){return o&&null==n?i:n??e}function b(n,e,o){if(null!=e)return e.clone();if(o)return null;const t=n.context;if("ground"===t?.type)return new f({mode:"on-the-ground"});if("graphic"!==t?.type)return null;const r=c(t.graphic);return"on-the-ground"===r.mode&&(r.mode="relative-to-ground",r.offset=0),new f(r)}function x(n,e,c,f){const a=e.clone(),p=l(e.x,e.y,e.z??0);if(!n.renderCoordsHelper.toRenderCoords(p,e.spatialReference,p)||0===o(f))return a.z=s(n,a,i,c),a;const m=4,d=n.state.camera.computeScreenPixelSizeAt(p)*m,g=t(u(),f);r(p,p,g,d);const v=n.renderCoordsHelper.fromRenderCoords(p,a);return null==v?(a.z=s(n,a,i,c),a):(v.z=s(n,v,i,c),v)}export{x as getGaussianSplatOffsetPosition,h as getLineOfSightMapPointIntersection,m as restoreLineOfSightObserverState,d as restoreLineOfSightTargetState,a as snapshotLineOfSightObserverState,p as snapshotLineOfSightTargetState,I as updateLineOfSightItemFromAuthoredPoint,y as updateLineOfSightItemFromIntersection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,initial as r,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,initial as r,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as u}from"../../../../geometry/support/lineSegment.js";import{absoluteHeightElevationInfo as h,getConvertedElevation as p}from"../../../../support/elevationInfoUtils.js";import{LineOfSightInteractionVisuals as v}from"./LineOfSightInteractionVisuals.js";import{Settings as d}from"../../interactive/editingTools/settings.js";import{VerticesVisualElement as f}from"../../interactive/visualElements/VerticesVisualElement.js";let V=class extends t{constructor(e){super(e),this.elevationInfo=null,this.analysisVisible=!0,this._active=!1,this._rendererVisuals=new Map,this._observerRenderLocation=l(),this._targetRenderLocation=l(),this._laserLineSegment=c(),this._settings=new d({getTheme:()=>this.view.effectiveTheme})}initialize(){this._interactionVisuals=new v({view:this.view});const e=this._settings;this.addHandles([this._connectInteractionVisuals(),s(()=>({selectedColor:e.colors.selected.toUnitRGBA(),outlineColor:e.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{for(const{element:i}of this._rendererVisuals.values())i.color=e,i.outlineColor=t},r)])}destroy(){for(const e of this._rendererVisuals.keys())this.removeVisual(e);i(this._interactionVisuals)}activate(){this._active=!0,this._refreshVisuals(),this._refreshInteractionVisuals()}refresh(){this._refreshVisuals(),this._refreshInteractionVisuals()}deactivate(){this._active=!1;for(const{element:e}of this._rendererVisuals.values())e.attached=!1;this._interactionVisuals.hide()}addOrUpdateGraphic(e,t){}addOrUpdateVisual(e,t){const i=this._rendererVisuals.get(e),s=w(t,i?.props);if(!_(s))return void this.removeVisual(e);if(i)return i.props=s,this._applyVisual(i.element,s),void this._refreshInteractionVisuals();const r=this._settings,o=r.manipulators.vertex,n=new f({view:this.view,isDecoration:!0,spatialReference:this.view.renderCoordsHelper.spatialReference,elevationInfo:h,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,color:r.colors.selected.toUnitRGBA(),outlineColor:o.outlineColor.toUnitRGBA()});this._rendererVisuals.set(e,{element:n,props:s}),this._applyVisual(n,s),this._refreshInteractionVisuals()}removeGraphic(e){}removeVisual(e){const t=this._rendererVisuals.get(e);t&&(t.element.destroy(),this._rendererVisuals.delete(e),this._refreshInteractionVisuals())}hitTestVisualDistance(e,t){return null}_connectInteractionVisuals(){return s(()=>({active:this._active,analysisVisible:this.analysisVisible,cursorTargetElevationInfo:this.analysisViewData.cursorTarget?.elevationInfo,cursorTargetPosition:this.analysisViewData.cursorTarget?.position,observerElevationInfo:this.analysis.observer?.elevationInfo,observerPosition:this.analysis.observer?.position}),()=>this._refreshInteractionVisuals(),o)}_refreshVisuals(){for(const{element:e,props:t}of this._rendererVisuals.values())this._applyVisual(e,t)}_refreshInteractionVisuals(){const{_observerRenderLocation:e,_targetRenderLocation:t,_laserLineSegment:i,view:s}=this,r=this.analysis.observer,o=this.analysisViewData.cursorTarget;if(!this._active||!this.analysisVisible)return void this._interactionVisuals.hide();if(null==r?.position){const e=this._getObserverPreviewRenderLocation();return void this._interactionVisuals.update({target:e,visible:null!=e})}if(null==o?.position)return void this._interactionVisuals.hide();const n=g(s,r.position,r.elevationInfo,e),a=g(s,o.position,o.elevationInfo,t);if(null==n||null==a)return void this._interactionVisuals.hide();const l=u(n,a,i);this._interactionVisuals.update({target:a,lineVerticalPlaneSegment:l,visible:!0})}_getObserverPreviewRenderLocation(){for(const{props:e}of this._rendererVisuals.values()){if("cursor"!==e.role)continue;const t=m(e.geometry);return t?g(this.view,t,this.elevationInfo):null}return null}_applyVisual(e,t){const i=m(t.geometry);if(!i)return e.vertices=[],void(e.attached=!1);const s=g(this.view,i,this.elevationInfo);if(!s)return e.vertices=[],void(e.attached=!1);this._applyVisualStyle(e),e.vertices=[s],e.attached=this._active&&this.analysisVisible}_applyVisualStyle(e){const t=this._settings,i=t.manipulators.vertex;e.color=t.colors.selected.toUnitRGBA(),e.outlineColor=i.outlineColor.toUnitRGBA()}get test(){}};function _(e){return null!=m(e.geometry)&&("cursor"===e.role||"controlPoint"===e.role)}function m(e){if(!e)return null;switch(e.type){case"point":return e;case"multipoint":return y(e);default:return null}}function y(e){return 0===e.points.length?null:e.getPoint(e.points.length-1)}function g(e,t,i,s=l()){const r=p(e,t,i??h,h);return s[0]=t.x,s[1]=t.y,s[2]=r??0,e.renderCoordsHelper.toRenderCoords(s,t.spatialReference,s)?s:null}function w(e,t={geometry:null,role:"outputGeometry",state:"idle"}){return{...t,...e}}e([n({constructOnly:!0})],V.prototype,"analysis",void 0),e([n({constructOnly:!0})],V.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],V.prototype,"view",void 0),e([n()],V.prototype,"elevationInfo",void 0),e([n()],V.prototype,"analysisVisible",void 0),e([n()],V.prototype,"_active",void 0),V=e([a("esri.views.3d.analysis.LineOfSight.LineOfSightDrawToolRenderer")],V);export{V as LineOfSightDrawToolRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,initial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("move-start",({objects:t})=>{const e=t.at(0);null!=e&&this._itemTool.startMoveInteraction(e)}),this._moveTool.events.on("move-stop",()=>this._itemTool.stopMoveInteraction())])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){this._setSelectedItem(null)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.stopMoveInteraction(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return;const e=this.analysis.targets.indexOf(t);if(e<0)return;const i=l(t),s=this._selectedItem===t;this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)})}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,initial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("move-start",({objects:t})=>{const e=t.at(0);null!=e&&this._itemTool.startMoveInteraction(e)}),this._moveTool.events.on("move-stop",()=>this._itemTool.stopMoveInteraction())])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){this._setSelectedItem(null)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.stopMoveInteraction(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return;const e=this.analysis.targets.indexOf(t);if(e<0)return;const i=l(t),s=this._selectedItem===t;this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)})}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as l,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{laserLineConfiguration as a,getLaserLineColors as o}from"./LineOfSightConfiguration.js";import{Settings as c}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as m}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as u}from"../../interactive/visualElements/LaserlineVisualElement.js";const h=Symbol("line-of-sight-interaction-visual-elements");let d=class extends t{constructor(e){super(e),this._settings=new c({getTheme:()=>this.view.effectiveTheme}),this._laserLineVisualElement=null,this._verticalLineVisualElement=null}initialize(){this._createVisuals()}update({target:e,lineVerticalPlaneSegment:t=null,visible:i}){const l=this.laserLineVisualElement,n=this.verticalLineVisualElement;null!=l&&null!=n&&(l.visible=i,l.heightManifoldTarget=i?e:null,l.lineVerticalPlaneSegment=i?t:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e),n.attached=i&&null!=e)}hide(){this.update({target:null,visible:!1})}get laserLineVisualElement(){return this._laserLineVisualElement}get verticalLineVisualElement(){return this._verticalLineVisualElement}get test(){}_createVisuals(){const{glowWidth:e,innerWidth:t}=a,s=this._settings.visualElements,r=new u({view:this.view,attached:!0,visible:!1,style:{glowWidth:e,innerWidth:t},isDecoration:!0}),c=new m({view:this.view,extensionType:s.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._laserLineVisualElement=r,this._verticalLineVisualElement=c,this.addHandles([l(()=>o(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:i})=>{const l=r.style;r.style={...l,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:i}},n),l(()=>s.zVerticalLine,e=>e.apply(c),n),i(()=>{r.destroy(),c.destroy(),this._laserLineVisualElement=null,this._verticalLineVisualElement=null})],h)}};e([s({constructOnly:!0})],d.prototype,"view",void 0),e([s()],d.prototype,"_settings",void 0),d=e([r("esri.views.3d.analysis.LineOfSight.LineOfSightInteractionVisuals")],d);export{d as LineOfSightInteractionVisuals};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{initial as a,watch as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../geometry/Point.js";import{create as u,fromPoints as d}from"../../../../geometry/support/lineSegment.js";import{clonePoint as m}from"../../../../layers/graphics/hydratedFeatures.js";import{LineOfSightInteractionVisuals as h}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as v,LineOfSightTargetManipulator as g,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as y}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as b}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as f}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as j}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as O,dragAtLocation as M,sceneSnappingAtLocation as V}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import S from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as T}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as R,enterInputModeIfAvailable as H}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as U}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const D=u();let x=class extends w{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new c,this._toolOptions=new S({tooltips:{enabled:!0}}),this._interactionVisuals=null,this._grabbedManipulator=null,this._moveInteractionObject=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new U({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=R(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new h({view:t}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),s(()=>this._grabbedManipulator,()=>this._syncInteractionVisuals(),a)]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=n(this._tooltip),this._interactionVisuals=n(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}startMoveInteraction(t){this._moveInteractionObject=t,this._syncInteractionVisuals()}stopMoveInteraction(){this._moveInteractionObject=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new v(this.view,{deleting:!1,intersection:null,type:"observer"}):new g(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip()),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){let i=!1;for(const[e,n]of this._manipulatorByObject){const o=e===t;n.selected=o,i||=o}return i}onInputEvent(t){H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const n=()=>this._syncManipulator(t,i);return e([t.on("committed",n),t.on("modified-externally",n),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===I.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip())}),i.events.on("drag",i=>t.updateDragIntersection(i)),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return O(i,(e,n,o,a)=>{const s=t.operations;if(null==s)return;let r=null;const{cancelSnapping:l,snappingStep:c}=B({snappingContext:new T({editGeometryOperations:s,elevationInfo:t.elevationInfo,pointer:a,visualizer:new b}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const u=s.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:u?.pos})).next(M(this.view,i.elevationAlignedLocation)).next(f(this.view,s.data.geometry,t.elevationInfo,s.data.spatialReference)).next(V(this.view,t.elevationInfo)).next(...c).next(t=>(s.trySetGeometry(m(t.mapEnd,new p),"start"===t.action?0:1),"end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=j(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=o(this._tooltipHandle),this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive,null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const n=this.analysisViewData.computations.find(i=>i.target===t.item),o=null!=n&&n.computationResult.isValid?n.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting?y(o):o}_syncInteractionVisuals(){const t=this._grabbedManipulator??(null==this._moveInteractionObject?null:this._manipulatorByObject.get(this._moveInteractionObject)),i=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];null!=this._interactionVisuals&&null!=t&&null!=i&&(this.active||null!=this._moveInteractionObject)&&this.visible&&this.analysisViewData.visible?this._interactionVisuals.update({target:t.renderLocation,lineVerticalPlaneSegment:t===i?null:d(i.renderLocation,t.renderLocation,D),visible:!0}):this._interactionVisuals?.hide()}};t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r({constructOnly:!0})],x.prototype,"snappingManager",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r()],x.prototype,"automaticManipulatorSelection",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r()],x.prototype,"interacting",void 0),t([r()],x.prototype,"manipulatorsInteractive",void 0),t([r()],x.prototype,"_grabbedManipulator",void 0),t([r()],x.prototype,"updating",null),x=t([l("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],x);export{x as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,sync as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as r}from"./LineOfSightPlacementLeafPlugin.js";import{usesLineOfSightAuthoredAbsoluteHeight as s}from"./lineOfSightPlacementUtils.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var p,l;const u=Symbol("line-of-sight-observer-vertex"),d=Symbol("line-of-sight-observer-plugin-marker");let c=class extends a{constructor(){super(...arguments),this[p]=!0,this[l]=!0,this.observer=null,this.defaultCaptureMode="capture-always",this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{p=d,l=r}get usesAuthoredAbsoluteHeight(){return s(this._context,this._interactiveHandle)}start(e){super.start(e),this.preservedIntersection=null;const{session:o,positionOfLastUserInput:n}=e,r="grabbable-object"===this.defaultCaptureMode?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??n:this.inputMapPosition??n;!r||"grabbable-object"!==this.defaultCaptureMode&&this._interactiveHandle||o.appendOrReplacePoint(u,r),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:"grabbable-object"===this.defaultCaptureMode?r??void 0:void 0}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(u,e)},i),this._ownHandlesKey))}};function h(e){return!!e&&d in e}function v(e={}){return{uniqueId:Symbol("line-of-sight-observer-plugin"),kind:["vertex"],geometryType:"point",hidden:!0,localizationKey:"leaf-point-segment",icon:"point",create:()=>new c(e)}}e([o({constructOnly:!0})],c.prototype,"observer",void 0),e([o()],c.prototype,"defaultCaptureMode",void 0),e([o()],c.prototype,"inputMapPosition",void 0),e([o()],c.prototype,"preservedIntersection",void 0),e([o()],c.prototype,"_interactiveHandle",void 0),c=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin")],c);export{c as LineOfSightObserverPlugin,v as createLineOfSightObserverPluginConfiguration,h as isLineOfSightObserverPlugin,d as lineOfSightObserverPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
|
|
2
|
+
const n=Symbol("line-of-sight-placement-leaf-plugin-marker");function e(e){return!!e&&n in e}export{e as isLineOfSightPlacementLeafPlugin,n as lineOfSightPlacementLeafPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisObserver.js";import i from"../../../../analysis/LineOfSightAnalysisTarget.js";import s from"../../../../core/Collection.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as a,isMultipoint as l}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as u}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as h,createLineOfSightObserverPluginConfiguration as g}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as c}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as _}from"./LineOfSightTargetPlugin.js";import{PluginBase as y}from"../../../draw/plugins/PluginBase.js";let v=class extends y{constructor(){super(...arguments),this.observerElevationInfo=null,this.targetElevationInfo=null,this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new s,this._operationTargets=new s}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=r(this._intersector)}start(t){super.start(t),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,f(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),t.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(t){return{geometryType:"point",useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:"cancel"}}attachPlugin(t){this._downstreamPlugin=t}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(t,s){if(this._downstreamPlugin===t&&(this._downstreamPlugin=null),m(t)&&this._clearCursorTarget(),"complete"!==s)return void this._syncAnalysisFromSession();const r=this._context?.getSession(t)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"point"});if(!r||!a(r))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._truncateItemsToSession();const n=c(t)?t.preservedIntersection:null,o=!!c(t)&&t.
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisObserver.js";import i from"../../../../analysis/LineOfSightAnalysisTarget.js";import s from"../../../../core/Collection.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as a,isMultipoint as l}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as u}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as h,createLineOfSightObserverPluginConfiguration as g}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as c}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as _}from"./LineOfSightTargetPlugin.js";import{PluginBase as y}from"../../../draw/plugins/PluginBase.js";let v=class extends y{constructor(){super(...arguments),this.observerElevationInfo=null,this.targetElevationInfo=null,this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new s,this._operationTargets=new s}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=r(this._intersector)}start(t){super.start(t),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,f(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),t.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(t){return{geometryType:"point",useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:"cancel"}}attachPlugin(t){this._downstreamPlugin=t}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(t,s){if(this._downstreamPlugin===t&&(this._downstreamPlugin=null),m(t)&&this._clearCursorTarget(),"complete"!==s)return void this._syncAnalysisFromSession();const r=this._context?.getSession(t)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"point"});if(!r||!a(r))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._truncateItemsToSession();const n=c(t)?t.preservedIntersection:null,o=!!c(t)&&t.usesAuthoredAbsoluteHeight;if(h(t)){const i=t.observer??this._operationObserver??new e;if(!this._intersector||!u(this.view,i,this._intersector,r,{elevationInfo:this.observerElevationInfo,preservedIntersection:n,usesAuthoredAbsoluteHeight:o}))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._operationObserver=i}else if(m(t)){const e=t.target??new i;if(!this._intersector||!u(this.view,e,this._intersector,r,{elevationInfo:this.targetElevationInfo,preservedIntersection:n,usesAuthoredAbsoluteHeight:o}))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._operationTargets.add(e)}this._appendCommittedPoint(r),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(t){const e=this._session;e&&(e.appendOrReplacePoint(null,t),e.appendOrReplacePart(null,[]),e.automaticRestart=!1,e.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){const t=this._getCommittedPointCount();null==this._initialObserver&&0===t&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(t))}_restartDownstreamPlugin(){const t=null==this.analysis.observer,e=t?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();t&&h(this._downstreamPlugin)||!t&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(e,{cancelExisting:!0})}_createObserverPluginConfiguration(t=null){return g({observer:t,defaultCaptureMode:t?"grabbable-object":"capture-always",inputMapPosition:t?.position??null})}_createTargetPluginConfiguration(t=null){return _({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:t?"grabbable-object":"capture-always",elevationInfo:this.targetElevationInfo,inputMapPosition:t?.position??null,target:t,view:this.view})}_syncAnalysisFromSession(){const t=this._getCommittedPointCount(),e=this._getCommittedOperationTargetCount(t);this.analysis.observer=this._getActiveObserver(t),f(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,e)))}_getActiveObserver(t){return null!=this._initialObserver?this._operationObserver??null:t>0?this._operationObserver:null}_getCommittedOperationTargetCount(t){return Math.max(0,t-(null!=this._initialObserver?0:Math.min(t,1)))}_getCommittedPointCount(){const t=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"multipoint"});return t&&l(t)?t.points.length:0}};function d(t){return{uniqueId:Symbol("line-of-sight-root-plugin"),kind:["multipart"],geometryType:"multipoint",hidden:!0,localizationKey:"line-of-sight-root",icon:"point",create:()=>new v(t)}}function f(t,e){let i=-1;for(let s=0;s<Math.min(t.length,e.length);s++)if(t.getItemAt(s)!==e[s]){i=s;break}if(-1===i){if(t.length===e.length)return;i=Math.min(t.length,e.length)}t.splice(i,t.length-i,...e.slice(i))}t([n({constructOnly:!0})],v.prototype,"analysis",void 0),t([n({constructOnly:!0})],v.prototype,"analysisViewData",void 0),t([n({constructOnly:!0})],v.prototype,"view",void 0),t([n({constructOnly:!0})],v.prototype,"observerElevationInfo",void 0),t([n({constructOnly:!0})],v.prototype,"targetElevationInfo",void 0),t([n()],v.prototype,"_intersector",void 0),t([n()],v.prototype,"_downstreamPlugin",void 0),v=t([o("esri.views.3d.analysis.LineOfSight.LineOfSightRootPlugin")],v);export{v as LineOfSightRootPlugin,d as createLineOfSightRootPluginConfiguration};
|