@arcgis/core 4.34.0-next.44 → 4.34.0-next.46
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/AttributeBinsGraphic.js +1 -1
- package/PopupTemplate.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/geometry/wkt.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/04cbd3aa9965b2eb71ea.js +1 -0
- package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
- package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
- package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
- package/assets/esri/core/workers/chunks/{787d281b2fe1edf6cf30.js → 2bb61f80473b495163e3.js} +1 -1
- package/assets/esri/core/workers/chunks/2cda605c302176905e84.js +1 -0
- package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{78de16f65ea297452a65.js → 31c6e951b99315e8e68a.js} +1 -1
- package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
- package/assets/esri/core/workers/chunks/3610357c8fa9bec9e0dc.js +1 -0
- package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
- package/assets/esri/core/workers/chunks/{d547b27ac750953a998f.js → 46a470bea2a3601182dc.js} +1 -1
- package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +1 -0
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
- package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
- package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +1 -0
- package/assets/esri/core/workers/chunks/50d526a16bc86a481055.js +1 -0
- package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +1 -0
- package/assets/esri/core/workers/chunks/54b1a960bb8c3fe05976.js +1 -0
- package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +1 -0
- package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +1 -0
- package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
- package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +1 -0
- package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
- package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +1 -0
- package/assets/esri/core/workers/chunks/66db5f77e09d25e33951.js +1 -0
- package/assets/esri/core/workers/chunks/{863e87ac982d7727b435.js → 69e37365c17e7cc4168f.js} +1 -1
- package/assets/esri/core/workers/chunks/6fe738748ce837811ff4.js +1 -0
- package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
- package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +1 -0
- package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
- package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +1 -0
- package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +1 -0
- package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +1 -0
- package/assets/esri/core/workers/chunks/8736b78256037b145f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +1 -0
- package/assets/esri/core/workers/chunks/{4f3c187a7cb2b1444281.js → 8c81156b1605a16acc29.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
- package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +1 -0
- package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
- package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
- package/assets/esri/core/workers/chunks/{44116cf0bd4d6a127c96.js → 99b9392946d776a62997.js} +1 -1
- package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
- package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +1 -0
- package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +1 -0
- package/assets/esri/core/workers/chunks/9cbec2ffa445a72d4c33.js +1 -0
- package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
- package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +1 -0
- package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
- package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
- package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
- package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +1 -0
- package/assets/esri/core/workers/chunks/a69258f34a5eb5a1954f.js +1 -0
- package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +1 -0
- package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
- package/assets/esri/core/workers/chunks/{48514235c32917e43a3f.js → b3e2e826295620b1a9dd.js} +2 -2
- package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1c2afaf491d1c79a9e.js +1 -0
- package/assets/esri/core/workers/chunks/{f34739daceab54a280ad.js → beb77cdae0b1b6ad73da.js} +1 -1
- package/assets/esri/core/workers/chunks/{a638f1688ac9525a52a7.js → c2f184e9f579152aa29a.js} +1 -1
- package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +1 -0
- package/assets/esri/core/workers/chunks/{349da65a8793f7873366.js → c5a0976de958b3b01c70.js} +1 -1
- package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
- package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
- package/assets/esri/core/workers/chunks/cf6330f721c6910d25ff.js +1 -0
- package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{0faec78b2dd6990a5da0.js → d09ded9fb621491e2466.js} +1 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +1 -0
- package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
- package/assets/esri/core/workers/chunks/d62d41091f7ac5f77f16.js +1 -0
- package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
- package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +1 -0
- package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
- package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
- package/assets/esri/core/workers/chunks/{01ae7d36bda6b6186786.js → eb61b47df99a54a364c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +1 -0
- package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +1 -0
- package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
- package/assets/esri/core/workers/chunks/fc6408208c850eec4019.js +1 -0
- package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/NativeLine.glsl.js +5 -14
- package/chunks/bundle.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/colorUtils.js +1 -1
- package/config.js +1 -1
- package/core/BidiEngine.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/sql/DateOnly.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/uuid.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +5 -0
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/maquette-advanced-projector/utils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/package.json +1 -1
- package/rest/generateRenderer.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/CIMEffectHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/{DrawManipulator.js → LegacyDrawManipulator.js} +1 -1
- package/views/draw/{DrawTool.js → LegacyDrawTool.js} +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +5 -0
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Track/TrackViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
- package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
- package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
- package/assets/esri/core/workers/chunks/1acc620bfd2983d6853f.js +0 -1
- package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
- package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
- package/assets/esri/core/workers/chunks/28d71e1b866113650c75.js +0 -1
- package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
- package/assets/esri/core/workers/chunks/2c816d3a737e39e6eb84.js +0 -1
- package/assets/esri/core/workers/chunks/2f54776ff86f397adc55.js +0 -1
- package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
- package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +0 -1
- package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
- package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
- package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +0 -1
- package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
- package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
- package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
- package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
- package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
- package/assets/esri/core/workers/chunks/8f3ce10eacb5bc14a641.js +0 -1
- package/assets/esri/core/workers/chunks/91be247f868ce6596c9e.js +0 -1
- package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
- package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
- package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
- package/assets/esri/core/workers/chunks/aaab7694eb333ad480f5.js +0 -1
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
- package/assets/esri/core/workers/chunks/b5f6a0607b620b027cdd.js +0 -1
- package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
- package/assets/esri/core/workers/chunks/c6e3d4c6bb02d58d5cfe.js +0 -1
- package/assets/esri/core/workers/chunks/cd6398a2951922e13b86.js +0 -1
- package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +0 -1
- package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +0 -1
- package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
- package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
- package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
- package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +0 -1
- package/assets/esri/core/workers/chunks/e3f5afdf133c58b3d161.js +0 -1
- package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +0 -1
- package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
- package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +0 -1
- package/assets/esri/core/workers/chunks/e799433770e4303fcd9c.js +0 -1
- package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
- package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +0 -1
- package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +0 -1
- package/assets/esri/core/workers/chunks/ff34fdda7899e784ac73.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as m}from"../../core/lang.js";import{getExtent as e}from"./SDFHelper.js";import{CIMEffectHelper as r}from"./effects/CIMEffectHelper.js";const a=.01;function t(t
|
|
5
|
+
import{clone as m}from"../../core/lang.js";import{getExtent as e}from"./SDFHelper.js";import{CIMEffectHelper as r}from"./effects/CIMEffectHelper.js";const a=.01;function t(t){if(!t.frame)return t;const{markerGraphics:f}=t;if(!f||0===f.length)return t;let n=0,o=0,s=0,i=0;for(const m of f){const{geometry:a,symbol:t}=m;if(!a||!t||!("symbolLayers"in t))continue;const{symbolLayers:f}=t;if(f)for(const m of f){const{effects:t}=m,f=r.applyEffects(t,a),c=e(f);c&&(n=Math.min(n,c[0]),o=Math.min(o,c[1]),s=Math.max(s,c[2]),i=Math.max(i,c[3]))}}const{xmin:c,ymin:x,xmax:y,ymax:p}=t.frame,h=(y-c)/2,l=(p-x)/2,M=(y+c)/2,u=(p+x)/2;if(h<=0||l<=0)return t;const b=(M-n)/h,g=(s-M)/h,j=(u-o)/l,E=(i-u)/l,F=Math.max(Math.max(b,g),Math.max(j,E));return F<=1+a?t:(t=m(t)).frame?(t.frame.xmin=(t.frame.xmin-M)*F+M,t.frame.ymin=(t.frame.ymin-u)*F+u,t.frame.xmax=(t.frame.xmax-M)*F+M,t.frame.ymax=(t.frame.ymax-u)*F+u,!1!==t.respectFrame&&(t.size*=F),t):t}export{t as fitVectorMarker};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getPlacementOperator as t}from"../CIMOperators.js";class e{static getPlacement(e,r,n,s,c
|
|
5
|
+
import{getPlacementOperator as t}from"../CIMOperators.js";class e{static getPlacement(e,r,n,s,c){const o=t(n);if(!o)return null;-1===r&&e.invertY();return o.execute(e,n,s,c)}}export{e as CIMMarkerPlacementHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[n,r]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){n=a,r=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(n,r,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,n,r,a,o,t),P=this._curveHelper.getCoord2D(n,r,a,o,t);return this.internalPlacement.setTranslate(P[0]-this._offset*c,P[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{s as PlacementAtExtremities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new a(t,i,s)}}class a extends t{constructor(t,e,n){super(t),this._walker=new i,this._walker.updateTolerance(n),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*n:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*n:0,this._endGap=void 0!==e.endPosition?e.endPosition*n:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new s,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;i=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,e=this._beginGap+s;i=e-this._prevPos,this._prevPos=e,this.iteratePath=!0}const s=new e;if(!this._walker.nextPointAndAngle(i,s,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let a,h;return this._angleToLine?(a=s.ca,h=s.sa):(a=1,h=0),n&&(a=-a,h=-h),this.internalPlacement.setRotateCS(a,h),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}export{n as PlacementAtRatioPositions};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/RandomLCG.js";import{Placement as s}from"../CIMPlacements.js";const i=512,e=10,h=24,n=1e-6;class _{static{this.instance=null}static local(){return null===_.instance&&(_.instance=new _),_.instance}execute(t,s,i,e
|
|
5
|
+
import t from"../../../core/RandomLCG.js";import{Placement as s}from"../CIMPlacements.js";const i=512,e=10,h=24,n=1e-6;class _{static{this.instance=null}static local(){return null===_.instance&&(_.instance=new _),_.instance}execute(t,s,i,e){return new r(t,s,i,e)}}class r{constructor(e,h,n,_){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(h.stepX??16)*n,this._stepY=Math.abs(h.stepY??16)*n,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,0!==this._stepX&&0!==this._stepY){if(this._gridType=h.gridType??"Fixed","Random"===this._gridType){const s=h.seed??13,i=1;this._randomLCG=new t(s*i),this._randomness=(h.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=h.gridAngle??0,this._shiftOddRows=h.shiftOddRows??!1,this._offsetX=(h.offsetX??0)*n,this._offsetY=(h.offsetY??0)*n,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,null!=_){const[t,s,e,h]=_.split("/"),n=parseFloat(t),r=parseFloat(s),a=parseFloat(e),o=parseFloat(h);this._graphicOriginX=-(o*2**n+a)*i,this._graphicOriginY=r*i,this._testInsidePolygon=!0}this._internalPlacement=new s,this._calculateMinMax(e),this._geometryCursor=e}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!r._randValues){r._randValues=[];for(let t=0;t<h;t++)for(let s=0;s<h;s++)r._randValues.push(this._randomLCG.getFloat()),r._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(t){let s,e,h,n,_,r,a,o,l,f,c,u,p,M;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=o=p=c=Number.MAX_VALUE,l=f=M=u=-Number.MAX_VALUE;const g=1!==this._cosAngle;for(t.reset();t.nextPath();)for(;t.nextPoint();)r=t.x,_=t.y,s=r-this._graphicOriginX-this._offsetX,e=_-this._graphicOriginY-this._offsetY,g?(h=this._cosAngle*s-this._sinAngle*e,n=this._sinAngle*s+this._cosAngle*e):(h=s,n=e),a=Math.min(a,h),l=Math.max(l,h),o=Math.min(o,n),f=Math.max(f,n),c=Math.min(c,_),u=Math.max(u,_),p=Math.min(p,r),M=Math.max(M,r);c=c!==Number.MAX_VALUE?c:-i-this._stepY,u=u!==-Number.MAX_VALUE?u:this._stepY,p=p!==Number.MAX_VALUE?p:-this._stepX,M=M!==-Number.MAX_VALUE?M:i+this._stepX;const d=u-c,X=M-p;if(this._verticalSubdivision=d>=X,this._polygonMin=this._verticalSubdivision?c:p,this._testInsidePolygon){let t=0-this._graphicOriginX-this._offsetX-this._stepX,s=i-this._graphicOriginX-this._offsetX+this._stepX,e=-i-this._graphicOriginY-this._offsetY-this._stepY,h=0-this._graphicOriginY-this._offsetY+this._stepY;if(g){const i=[[t,e],[t,h],[s,e],[s,h]];t=e=Number.MAX_VALUE,s=h=-Number.MAX_VALUE;for(const n of i){const i=this._cosAngle*n[0]-this._sinAngle*n[1],_=this._sinAngle*n[0]+this._cosAngle*n[1];t=Math.min(t,i),s=Math.max(s,i),e=Math.min(e,_),h=Math.max(h,_)}}a=a!==Number.MAX_VALUE?Math.max(a,t):t,o=o!==Number.MAX_VALUE?Math.max(o,e):e,l=l!==-Number.MAX_VALUE?Math.min(l,s):s,f=f!==-Number.MAX_VALUE?Math.min(f,h):h}this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(l/this._stepX),this._yMin=Math.round(o/this._stepY),this._yMax=Math.round(f/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,p,M,c,u)}_buildAccelerationMap(t,s,h,n,_){t.reset();const r=new Map,a=this._verticalSubdivision,l=a?_-n:h-s;let f=Math.ceil(l/e);if(f<=1)return;const c=Math.floor(l/f);let u,p,M,g,d,X,m,x,A,Y,y;for(f++,this._delta=c,a?(A=-i-2*this._stepY,Y=2*this._stepY,y=n):(A=-2*this._stepX,Y=i+2*this._stepX,y=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=M,p=g){if(M=t.x,g=t.y,a){if(p===g||p<A&&g<A||p>Y&&g>Y)continue;d=Math.min(p,g),X=Math.max(p,g)}else{if(u===M||u<A&&M<A||u>Y&&M>Y)continue;d=Math.min(u,M),X=Math.max(u,M)}for(;d<X;)m=Math.floor((d-y)/c),o(m,u,p,M,g,r),d+=c;x=Math.floor((X-y)/c),x>m&&o(x,u,p,M,g,r)}this._accelerationMap=r}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,e;if(this._currentX++,"Random"===this._gridType){const n=(this._currentX%h+h)%h,_=(this._currentY%h+h)%h;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-r._randValues[_*h+n])*2/3,e=this._graphicOriginY+s+this._stepY*this._randomness*(.5-r._randValues[_*h+n+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,e=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,e,this._geometryCursor))return this._internalPlacement.setTranslate(i,e),this._internalPlacement}}_isInsidePolygon(t,s,i){if(null==this._accelerationMap)return a(t,s,i);t+=n,s+=n;const e=this._verticalSubdivision,h=e?s:t,_=Math.floor((h-this._polygonMin)/this._delta),r=this._accelerationMap.get(_);if(!r)return!1;let o,l,f,c=0;for(const n of r){if(o=n[0],l=n[1],e){if(o[1]>s==l[1]>s)continue;f=(l[0]-o[0])*(s-o[1])-(l[1]-o[1])*(t-o[0])}else{if(o[0]>t==l[0]>t)continue;f=(l[1]-o[1])*(t-o[0])-(l[0]-o[0])*(s-o[1])}f>0?c++:c--}return 0!==c}}function a(t,s,i){let e,h,_,r,a=0;for(t+=n,s+=n,i.reset();i.nextPath();)if(i.nextPoint())for(e=i.x,h=i.y;i.nextPoint();e=_,h=r){if(_=i.x,r=i.y,h>s==r>s)continue;(_-e)*(s-h)-(r-h)*(t-e)>0?a++:a--}return 0!==a}function o(t,s,i,e,h,n){let _=n.get(t);_||(_=[],n.set(t,_)),_.push([[s,i],[e,h]])}export{_ as PlacementInsidePolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo,this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),u=this._curveHelper.getCoord2D(e,o,a,l,t),_=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(u[0]-_*f,u[1]+_*c),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,o=l,r+=n}}return null}}export{i as PlacementOnLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s){return new n(t,e,s)}}class n extends t{constructor(t,s,i){super(t),this._curveHelper=new e,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._endPoints=void 0===s.placeOnEndPoints||s.placeOnEndPoints,this._controlPoints=void 0===s.placeOnControlPoints||s.placeOnControlPoints,this._regularVertices=void 0===s.placeOnRegularVertices||s.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),n=Math.sin(e[2]);s-=this._offset*n,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,i=!1,n=0,a=0;if(t.seekPathStart(),t.nextPoint()){let r=t.x,h=t.y,l=t.getControlPoint(),_=!0,c=t.nextPoint();for(;c;){const g=t.x,P=t.y,u=t.getControlPoint();(this._angleToLine||0!==this._offset)&&(n=this._curveHelper.getAngle(r,h,g,P,0)),_?(_=!1,e?(s=n,i=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([r,h,n])):l?this._controlPoints&&this._tags.push([r,h,o(a,n)]):this._regularVertices&&this._tags.push([r,h,o(a,n)]),(this._angleToLine||0!==this._offset)&&(a=this._curveHelper.getAngle(r,h,g,P,1)),c=t.nextPoint(),c||(e?u||i?this._controlPoints&&this._tags.push([g,P,o(a,s)]):this._regularVertices&&this._tags.push([g,P,o(a,s)]):(this._endPoints||this._controlPoints&&u)&&this._tags.push([g,P,a])),r=g,h=P,l=u}}this._tagIterator=0}}function o(t,e){const i=Math.PI;for(;Math.abs(e-t)>i+2*s;)e-t>i?e-=2*i:e+=2*i;return(t+e)/2}export{i as PlacementOnVertices};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";import{weightedAreaCentroid as e}from"../../../geometry/support/centroid.js";import{getLabelPoint as s}from"../../../geometry/support/labelPoint.js";import{Placement as r}from"../CIMPlacements.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";import{weightedAreaCentroid as e}from"../../../geometry/support/centroid.js";import{getLabelPoint as s}from"../../../geometry/support/labelPoint.js";import{Placement as r}from"../CIMPlacements.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new o(t,e,s)}}class o{constructor(t,e,s){this._geometryCursor=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0,this._method=void 0!==e.method?e.method:"OnPolygon",this._placementPerPart=void 0!==e.placePerPart&&e.placePerPart,this._internalPlacement=new r}next(){const t=this._geometryCursor;if(!t)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(t);for(;t.nextPath();)if(!(t.getCurrentRingArea()<0))return this._polygonCenter(t.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(r){let n=!1;switch(this._method){case"CenterOfMass":{const t=e(r);t&&(this._internalPlacement.setTranslate(t[0]+this._offsetX,t[1]+this._offsetY),n=!0)}break;case"BoundingBoxCenter":{const e=t(r);e&&(this._internalPlacement.setTranslate((e[2]+e[0])/2+this._offsetX,(e[3]+e[1])/2+this._offsetY),n=!0)}break;default:{const t=s(r);null!==t&&(this._internalPlacement.setTranslate(t[0]+this._offsetX,t[1]+this._offsetY),n=!0)}}return n?this._internalPlacement:null}}export{n as PlacementPolygonCenter};
|
package/symbols/cim/utils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const l=" /-,\n";function i(e){let t=e.length;for(;t--;)if(!l.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,i(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const l=t[e.slice(n,o)];l&&r.push([null,l,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,i(t)])}return r}function c(e,t,r){let n="",o=null;for(const l of t){const[t,r,i]=l;if(null!=t&&""!==t)i?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",l=null;for(const i of t){const[t,n,a]=i;if(null!=t&&""!==t)a?l=t:(null!=l&&(o+=l,l=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const i=e.attributes[t];null!=i&&""!==i&&(null!=l&&(o+=l,l=null),o+=i)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,l,i=!0){const a=t/o,c=r/l,s=Math.ceil(a/2),u=Math.ceil(c/2);for(let f=0;f<l;f++)for(let r=0;r<o;r++){const M=4*(r+(i?l-f-1:f)*o);let y=0,m=0,C=0,I=0,p=0,h=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,l=(r+.5)*a,i=o*o;for(let c=Math.floor(r*a);c<(r+1)*a;c++){let r=Math.abs(l-(c+.5))/s;const o=Math.sqrt(i+r*r);o>=-1&&o<=1&&(y=2*o*o*o-3*o*o+1,y>0&&(r=4*(c+n*t),b+=y*e[r+3],C+=y,e[r+3]<255&&(y=y*e[r+3]/250),I+=y*e[r],p+=y*e[r+1],h+=y*e[r+2],m+=y))}}n[M]=I/m,n[M+1]=p/m,n[M+2]=h/m,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function y(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function I(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function p(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const h=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1],S=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectDonut":case"CIMGeometricEffectOffset":case"CIMGeometricEffectTaperedPolygon":case"CIMGeometricEffectEnclosingPolygon":return!0}return!1};function g(){return import("../../geometry/geometryEngineJSON.js")}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function T(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function A(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(null!=e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidFill":return e.color}return null}function N(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=N(e);if(null!=t)return t}break}case"CIMTextSymbol":return N(e.symbol);case"CIMSolidStroke":return e.color}}function x(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=G(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function E(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function F(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const V=e=>e.includes("data:image/svg+xml");function z(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function D(e,t,r,n,o,l,i=!0){const{infos:a}=l;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:I,offsetY:p,rotation:h,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){M=C?1:c;u=K(I,p,s,M,u),f=$(I,p,s,M,f),d&&(S||i)&&(c*=b/d),s=Q(h,k,s)}const y=K(n,o,s,M,u),m=$(n,o,s,M,f);return{size:e*c,rotation:Q(t,r,s),offsetX:y,offsetY:m}}function j(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>j(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function q(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function B(e){return e.split(" ").map(e=>Number(e))}function R(e){return"string"==typeof e?B(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=R(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&p(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function Y(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function $(e,t,r,n,o){const l=r*Math.PI/180;if(l){const r=Math.cos(l);return(Math.sin(l)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const l=r*Math.PI/180;if(l){return(Math.cos(l)*e-Math.sin(l)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let l=t[O(r)];if(null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180)),null==l&&(l=q(t.type,r.toLowerCase()),null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]]:o&&(l*=Math.PI/180))),null!=t.primitiveName){const i=e[t.primitiveName];if(null!=i){const e=i[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(l=e,null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180))):(l={valueExpressionInfo:e,defaultValue:l},null!=l&&(n?l={type:"Process",op:"ArcadeColor",value:l}:o&&(l={type:"Process",op:"Divide",left:l,right:180/Math.PI}))))}}if(null==l)throw new Error(`Failed to derive a value or an expression for "${r}".`);return l}function _(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function ee(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,D as applyParentTransform,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,T as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,E as fromCIMVerticalAlignment,q as getDefaultCIMValue,d as getEnum,W as getFieldName,A as getFillColor,P as getFontStyle,w as getFontWeight,h as getNumericValue,Z as getProcessParam,ee as getRelativeGradientSize,U as getSize,N as getStrokeColor,G as getStrokeWidth,J as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,_ as hasProcessParam,x as hasStrokeLayer,g as importGeometryEngine,I as isCIMFill,m as isCIMMarker,p as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,S as isGeometryEngineRequired,V as isSVGImage,j as isValidCIMValue,z as mapCIMSymbolToGeometryType,M as normalizeAlpha,H as normalizeDashEffectTemplate,R as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,B as parseDashTemplate,f as resampleHermite,y as toCIMSymbolJSON,Y as toLowerCaseProps,O as uncapitalize};
|
|
5
|
+
import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const l=" /-,\n";function i(e){let t=e.length;for(;t--;)if(!l.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,i(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const l=t[e.slice(n,o)];l&&r.push([null,l,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,i(t)])}return r}function s(e,t,r){let n="",o=null;for(const l of t){const[t,r,i]=l;if(null!=t&&""!==t)i?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function c(e,t,r,n){let o="",l=null;for(const i of t){const[t,n,a]=i;if(null!=t&&""!==t)a?l=t:(null!=l&&(o+=l,l=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const i=e.attributes[t];null!=i&&""!==i&&(null!=l&&(o+=l,l=null),o+=i)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,l,i=!0){const a=t/o,s=r/l,c=Math.ceil(a/2),u=Math.ceil(s/2);for(let f=0;f<l;f++)for(let r=0;r<o;r++){const y=4*(r+(i?l-f-1:f)*o);let M=0,m=0,C=0,p=0,h=0,I=0,b=0;const d=(f+.5)*s;for(let n=Math.floor(f*s);n<(f+1)*s;n++){const o=Math.abs(d-(n+.5))/u,l=(r+.5)*a,i=o*o;for(let s=Math.floor(r*a);s<(r+1)*a;s++){let r=Math.abs(l-(s+.5))/c;const o=Math.sqrt(i+r*r);o>=-1&&o<=1&&(M=2*o*o*o-3*o*o+1,M>0&&(r=4*(s+n*t),b+=M*e[r+3],C+=M,e[r+3]<255&&(M=M*e[r+3]/250),p+=M*e[r],h+=M*e[r+1],I+=M*e[r+2],m+=M))}}n[y]=p/m,n[y+1]=h/m,n[y+2]=I/m,n[y+3]=b/C}}function y(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function M(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function p(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function h(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const I=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?y(e.tintColor):[255,255,255,1];class S{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function g(e){return new S(e)}const P=g(()=>import("../../geometry/geometryEngineJSON.js"));function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function L(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function A(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function N(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function T(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=T(t);if(null!=e)return e}break;case"CIMTextSymbol":return T(e.symbol);case"CIMSolidFill":return e.color}return null}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=x(e);if(null!=t)return t}break}case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":return e.color}}function v(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function F(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=F(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return F(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function V(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function z(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function G(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const O=e=>e.includes("data:image/svg+xml");function D(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function E(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function j(e,t,r,n,o,l,i=!0){const{infos:a}=l;let s=1,c=0,u=0,f=0,y=1;for(const{absoluteAnchorPoint:C,offsetX:p,offsetY:h,rotation:I,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){y=C?1:s;u=K(p,h,c,y,u),f=$(p,h,c,y,f),d&&(S||i)&&(s*=b/d),c=Q(I,k,c)}const M=K(n,o,c,y,u),m=$(n,o,c,y,f);return{size:e*s,rotation:Q(t,r,c),offsetX:M,offsetY:m}}function q(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>q(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function R(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function _(e){return e.split(" ").map(e=>Number(e))}function B(e){return"string"==typeof e?_(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=B(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&h(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map(e=>({...e,propertyName:E(e.propertyName)}))}function Y(e){const t={};for(const r in e){const n=e[r];t[E(r)]=n}return t}function $(e,t,r,n,o){const l=r*Math.PI/180;if(l){const r=Math.cos(l);return(Math.sin(l)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const l=r*Math.PI/180;if(l){return(Math.cos(l)*e-Math.sin(l)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let l=t[E(r)];if(null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180)),null==l&&(l=R(t.type,r.toLowerCase()),null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]]:o&&(l*=Math.PI/180))),null!=t.primitiveName){const i=e[t.primitiveName];if(null!=i){const e=i[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(l=e,null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180))):(l={valueExpressionInfo:e,defaultValue:l},null!=l&&(n?l={type:"Process",op:"ArcadeColor",value:l}:o&&(l={type:"Process",op:"Divide",left:l,right:180/Math.PI}))))}}if(null==l)throw new Error(`Failed to derive a value or an expression for "${r}".`);return l}function ee(e,t,r){if(null!=t[E(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function te(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,j as applyParentTransform,c as assignTextValuesFromFeature,G as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,N as fromCIMFontDecoration,A as fromCIMFontStyle,V as fromCIMHorizontalAlignment,z as fromCIMVerticalAlignment,R as getDefaultCIMValue,d as getEnum,W as getFieldName,T as getFillColor,w as getFontStyle,L as getFontWeight,I as getNumericValue,Z as getProcessParam,te as getRelativeGradientSize,U as getSize,x as getStrokeColor,F as getStrokeWidth,J as getTextCasing,s as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,ee as hasProcessParam,v as hasStrokeLayer,g as importLazily,p as isCIMFill,m as isCIMMarker,h as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,O as isSVGImage,q as isValidCIMValue,P as lazyGeometryEngine,D as mapCIMSymbolToGeometryType,y as normalizeAlpha,H as normalizeDashEffectTemplate,B as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,_ as parseDashTemplate,f as resampleHermite,M as toCIMSymbolJSON,Y as toLowerCaseProps,E as uncapitalize};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../config.js";import t from"../../../../request.js";import{bidiText as i}from"../../../../core/BidiText.js";import s from"../../../../core/Error.js";import{getFullyQualifiedFontName as r}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{throwIfAborted as n,isAbortError as o}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{pt2px as h}from"../../../../core/screenUtils.js";import{numericHash as l}from"../../../../core/string.js";import u from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as p}from"../../../../symbols/cim/CIMSymbolHelper.js";import m from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as d}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as g,textureBindingSpriteAtlas as f,textureBindingGlyphAtlas as y}from"./definitions.js";import _ from"./GlyphMosaic.js";import M from"./GlyphSource.js";import I from"./Rect.js";import w from"./SDFConverter.js";import S from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as z}from"./urlUtils.js";import{charCodes as C,getCIMMarkerPlacementHash as T,isSVGImage as R}from"./Utils.js";import{AnimatableTextureResource as x}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as P}from"./animations/store/AnimationStore.js";const b="arial-unicode-ms-regular",$=()=>a.getLogger("esri.views.MapView"),j=(e,t,i)=>$().error(new s(e,t,i)),v=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,s){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=s}}class F{constructor(i){this._requestRender=i,this._resourceManager=new u,this._invalidFonts=new Set,this._sdfConverter=new w(g),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new c({concurrency:10,process:async(e,i)=>{n(i);try{return await t(e,{responseType:"image",signal:i})}catch(r){if(!o(r))throw new s("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,r);throw r}}}),this.animationStore=new P,this._spriteMosaic=new S(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new _(1024,1024,this._glyphSource),this._rasterizer=new m(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return j("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:s}=i;return{rect:new I(s.column,s.row,t.length,1),page:s.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return j("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t);return e}const s=await this._rasterizeSprite(i,t);return s&&this._setTextureBinding(0,s),s}getMosaicInfo(e,t,i=!1){const s=this._getTextureBindingInfo(e,t,i);return s?{size:s.size,texture:{texture:s.texture,unit:"sprite"===s.type?f:y}}:(j("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,i){const s=this._bindingInfos[t-1],r=s.page,a="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(r),this.sprites.getHeight(r)],i=this._spriteMosaic.getTexture(e,r);return i.setSamplingMode(a),{type:"sprite",texture:i,size:t}}case 1:{const t=[this.glyphs.width,this.glyphs.height],i=this._glyphMosaic.getTexture(e,r);return this._glyphMosaic.bind(e,a,r,y),i.setSamplingMode(a),{type:"glyph",texture:i,size:t}}default:return j("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const s=k.fromMosaic(e,t),r=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,r),this._bindingInfos.push(s)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:s,textString:a}=e,n=r(s),o=this._invalidFonts.has(n),[c,h]=i(a),l=C(c);try{const e=o?b:n;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(e);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(e,l,t),isRightToLeft:h}}catch(u){v(`Font ${n} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(n);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(b,l,t),isRightToLeft:h}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${T(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${d(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(z(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=l(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t=[];p.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,t),t.length>0&&await Promise.all(t)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:s,image:r,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,s,{type:"static",data:r},A(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let s;return s="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,s),s.finally(()=>this._ongoingRasterizations.delete(e)),s}async _handleSVG(e,t,i){const s=[g,g],{asFill:r}=e,a=await this._sdfConverter.draw(e.path,r,i);return this._addItemToMosaic(t,s,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,i){const s=e.url,r=this.resourceManager.getResource(s);if(null==r)return null;const{width:a,height:n}=r;if(r instanceof HTMLImageElement){if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:s,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,r,i);return this._addItemToMosaic(t,s,{type:"static",data:c},A(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=A(e),c={type:"CIMAnimatedSymbolProperties"},h=0);const l=new x(r,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,i){const r=e.url;if(B(r)||N(r))return this._handleGIFOrPNG(e,t,i);if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let s;const a=this.resourceManager.getResource(r);if(null!=a&&a instanceof HTMLImageElement)s=a;else{const{data:e}=await this._imageRequestQueue.push(r,{...i});s=e}if(R(r))if("width"in e&&"height"in e)s.width=h(e.width),s.height=h(e.height);else if("cim"in e){const t=e;s.width=h(t.width??t.scaleX*t.size),s.height=h(t.size)}if(!s.width||!s.height)return null;const n=s.width,o=s.height,c="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,s,c);return this._addItemToMosaic(t,l,{type:"static",data:p},A(e),u,!1)}catch(j){if(!o(j))throw new s("mapview-invalid-resource",`Could not fetch requested resource at ${r}. ${j.message}`);throw j}}_addItemToMosaic(e,t,i,s,r,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,s,r,a,n,o,c,h)}}function A(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),B=e=>e&&(e.includes(".gif")||G(e)),O=e=>null!=e&&e.startsWith("data:image/png"),N=e=>e&&(e.includes(".png")||O(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{F as default};
|
|
5
|
+
import e from"../../../../config.js";import t from"../../../../request.js";import{bidiText as i}from"../../../../core/BidiText.js";import r from"../../../../core/Error.js";import{getFullyQualifiedFontName as s}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{throwIfAborted as n,isAbortError as o}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{pt2px as h}from"../../../../core/screenUtils.js";import{numericHash as l}from"../../../../core/string.js";import u from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as p}from"../../../../symbols/cim/CIMSymbolHelper.js";import m from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as d}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as g,textureBindingSpriteAtlas as f,textureBindingGlyphAtlas as y}from"./definitions.js";import _ from"./GlyphMosaic.js";import M from"./GlyphSource.js";import I from"./Rect.js";import w from"./SDFConverter.js";import S from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as z}from"./urlUtils.js";import{charCodes as C,getCIMMarkerPlacementHash as T,isSVGImage as R}from"./Utils.js";import{AnimatableTextureResource as x}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as P}from"./animations/store/AnimationStore.js";const b="arial-unicode-ms-regular",$=()=>a.getLogger("esri.views.MapView"),j=(e,t,i)=>$().error(new r(e,t,i)),v=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class F{constructor(i){this._requestRender=i,this._resourceManager=new u,this._invalidFonts=new Set,this._sdfConverter=new w(g),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new c({concurrency:10,process:async(e,i)=>{n(i);try{return await t(e,{responseType:"image",signal:i})}catch(s){if(!o(s))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new P,this._spriteMosaic=new S(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new _(1024,1024,this._glyphSource),this._rasterizer=new m(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return j("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new I(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return j("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size,texture:{texture:r.texture,unit:"sprite"===r.type?f:y}}:(j("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,i){const r=this._bindingInfos[t-1],s=r.page,a="Nearest"===r.samplingMode?9728:i?9987:9729;switch(r.mosaicType){case 0:{const t=[this.sprites.getWidth(s),this.sprites.getHeight(s)],i=this._spriteMosaic.getTexture(e,s);return i.setSamplingMode(a),{type:"sprite",texture:i,size:t}}case 1:{const t=[this.glyphs.width,this.glyphs.height],i=this._glyphMosaic.getTexture(e,s);return this._glyphMosaic.bind(e,a,s,y),i.setSamplingMode(a),{type:"glyph",texture:i,size:t}}default:return j("mapview-texture-manager",`Cannot handle unknown type ${r.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=k.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:r,textString:a}=e,n=s(r),o=this._invalidFonts.has(n),[c,h]=i(a),l=C(c);try{const e=o?b:n;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(e);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(e,l,t),isRightToLeft:h}}catch(u){v(`Font ${n} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(n);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(b,l,t),isRightToLeft:h}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${T(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${d(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(z(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=l(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t=[];p.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,t),t.length>0&&await Promise.all(t)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},A(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[g,g],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},A(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=A(e),c={type:"CIMAnimatedSymbolProperties"},h=0);const l=new x(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,i){const s=e.url;if(B(s)||N(s))return this._handleGIFOrPNG(e,t,i);if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let r;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)r=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...i});r=e}if(R(s))if("width"in e&&"height"in e)r.width=h(e.width),r.height=h(e.height);else if("cim"in e){const t=e;r.width=h(t.width??t.scaleX*t.size),r.height=h(t.size)}if(!r.width||!r.height)return null;const n=r.width,o=r.height,c="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,r,c);return this._addItemToMosaic(t,l,{type:"static",data:p},A(e),u,!1)}catch(j){if(!o(j))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${j.message}`);throw j}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function A(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),B=e=>e&&(e.includes(".gif")||G(e)),O=e=>null!=e&&e.startsWith("data:image/png"),N=e=>e&&(e.includes(".png")||O(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{F as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Float as r,Int as o,Vec4 as n,Vec2 as s}from"./graph/glsl.js";import{GlslShaderWriter as i}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as p}from"./graph/ShaderGraphContext.js";import{setReachableUids as a}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as u}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function y(t){return new t}function d(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{d(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const h=t=>(e,r)=>{d(e,"builtins",{builtin:t,propertyKey:r})},l=t=>(e,r,o)=>{d(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},m=t=>(e,r)=>{d(e,"uniforms",{typeCtor:t,propertyKey:r})},g=t=>(e,r)=>{d(e,"options",{typeCtor:t,propertyKey:r})},_=(t,e)=>{d(t,"defines",{propertyKey:e})};function K(t){return(e,r)=>{d(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const
|
|
5
|
+
import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Float as r,Int as o,Vec4 as n,Vec2 as s}from"./graph/glsl.js";import{GlslShaderWriter as i}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as p}from"./graph/ShaderGraphContext.js";import{setReachableUids as a}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as u}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function y(t){return new t}function d(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{d(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const h=t=>(e,r)=>{d(e,"builtins",{builtin:t,propertyKey:r})},l=t=>(e,r,o)=>{d(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},m=t=>(e,r)=>{d(e,"uniforms",{typeCtor:t,propertyKey:r})},g=t=>(e,r)=>{d(e,"options",{typeCtor:t,propertyKey:r})},_=(t,e)=>{d(t,"defines",{propertyKey:e})};function K(t){return(e,r)=>{d(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class x{static{this.builtins=[]}}t([b("gl_VertexID",o)],x.prototype,"glVertexID",void 0);class C{}class I{static{this.builtins=[]}}t([b("gl_FragCoord",n)],I.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",s)],I.prototype,"glPointCoord",void 0);class v{}t([h("gl_FragDepth")],v.prototype,"glFragDepth",void 0);class w{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class P{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new u(n,s,this.renamedLocationsMap,i,this.transformFeedbackBindings)}catch(n){return new u("","",this.renamedLocationsMap,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),s=Object.keys(r).map(t=>`${t}.${r[t]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join(".");return`${this.type}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),u=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(u,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const i in h){const t=h[i];a(l,t)}const m=this._getVertexInputBuiltins(),g={};for(const[i,p]of Object.entries(s))g[i]=p;if(null!=c)for(const[i,p]of Object.entries(c))g[i]=p;const _=p.createVertex(g,d,m,n,this.transformFeedbackBindings,l);(new i).write(_);const K=this._getFragmentInputBuiltins(h);K.set("glPointCoord","gl_PointCoord");const b=p.createFragment(f,h,K,n,_,this.transformFeedbackBindings);(new i).write(b);const x=this._createShaderBuilder(_,b),C=x.generate("vertex"),I=x.generate("fragment");return this.logShader&&(console.log(C),console.log(I)),{vertex:C,fragment:I,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=y(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:y(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=y(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:y(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const o={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);o[n]=s.divide(new r(i))}else o[n]=s}return o}_injectComputePackPrecisionFactor(t,e){const o={},n=new Map;for(const r in this.computeAttributes)for(const t of this.computeAttributes[r]??[])n.set(t,r);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);o[s]=i.divide(new r(a))}else o[s]=i}return o}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of I.builtins){const t=y(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{C as ComputeVertexInput,I as FragmentInput,v as FragmentOutput,P as GraphShaderModule,w as UniformGroup,x as VertexInput,h as builtin,_ as define,l as input,f as location,g as option,K as transformFeedback,m as uniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as s}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as n,sizing as a,animationPointerAndBaseSizeAndReferenceSize as c,uv as l,offset as m,pos as d,bitset as p,id as h,lineLength as u,value1Position2Value2 as f,zoomRange as y}from"./attributes.js";import{createComputedAnimatedMeshParams as x}from"./ComputedAnimatedParams.js";import{
|
|
5
|
+
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as s}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as n,sizing as a,animationPointerAndBaseSizeAndReferenceSize as c,uv as l,offset as m,pos as d,bitset as p,id as h,lineLength as u,value1Position2Value2 as f,zoomRange as y}from"./attributes.js";import{createComputedAnimatedMeshParams as x}from"./ComputedAnimatedParams.js";import{c256ToRad as P}from"../shaders/constants.js";const M=64,g=64,w=2;class v extends o{get vertexSpec(){return{createComputedParams:x,optionalAttributes:{zoomRange:y,value1Position2Value2:f,lineLength:u},attributes:{id:h,bitset:p,pos:d,offset:m.marker,uv:l.marker,animationPointerAndBaseSizeAndReferenceSize:c,sizing:a,angle:n}}}_write(e,t){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const s=t.getDisplayId();if(this.shift&&"esriGeometryPolyline"===t.geometryType)this._writeParticles(e,t);else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,t);else if("esriGeometryPolygon"===t.geometryType){const i=t.readCentroidForDisplay();if(!i)return;const[r,o]=i.coords;this._writeQuad(e,s,r,o)}else if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else{const i=t.readGeometryForDisplay();i&&i.forEachVertex((t,i)=>{this._writeQuad(e,s,t,i)})}e.recordEnd()}_writePlacedMarkers(s,o){const n=t.fromFeatureSetReaderCIM(o)?.clone();if(!n)return;const a=-1,c=r.getPlacement(n,a,this.evaluatedMeshParams.placement,e(1),s.id);if(!c)return;const l=o.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>i||Math.abs(t)>i){m=c.next();continue}const r=-m.getAngle();s.recordBounds(e,t,M,g),this.shift?d&&this._writeQuad(s,l,d[0],d[1],void 0,r):this._writeQuad(s,l,e,t,void 0,r),d=[e,t],m=c.next()}}_writeParticles(e,t){const i=t.getDisplayId(),r=t.readGeometryForDisplay();if(!r)return;const s=[];r.forEachVertex((e,t)=>{s.push([e,t])});const o=_(s);let n=0;for(let l=1;l<s.length;l++){const e=s[l][0]-s[l-1][0],t=s[l][1]-s[l-1][1],i=Math.sqrt(e*e+t*t);n+=i}const a=t=>{for(const r of o){const{a:s,b:o}=r;this._writeQuad(e,i,s.position[0],s.position[1],[s.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(s.direction[1],s.direction[0]):0,n,!0)}},{placement:c}=this.evaluatedMeshParams;if(!c||"placementTemplate"in c||"CIMMarkerPlacementOnVertices"===c.type){let e;if(c&&"CIMMarkerPlacementOnVertices"!==c.type)e=c.placementTemplate;else{e=[0];for(const t of o){const{a:i,b:r}=t,s=i.position[0]-r.position[0],o=i.position[1]-r.position[1],n=Math.sqrt(s*s+o*o);e.push(n)}}let t=-1*n;for(;t<(1+w/2)*n;)for(const i of e)t+=i,a(t)}else"CIMMarkerPlacementAtExtremities"===c.type?"JustBegin"===c.extremityPlacement?a(1):"JustEnd"===c.extremityPlacement?(a(n-1),a(-1)):"Both"===c.extremityPlacement&&(a(1),a(n-1)):"CIMMarkerPlacementOnLine"===c.type&&a(n/2)}_writeQuad(e,t,i,r,o,n=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+s,p=m.y+s,h=m.x+m.width-s,u=m.y+m.height-s,f=e.vertexCount();c||e.recordBounds(i,r,M,M);const y={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:o,angle:n/P,lineLength:a};for(let s=0;s<4;s++)this._writeVertex(e,t,i,r,y);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function _(e){const t=[];let i=0;for(let r=1;r<e.length;r++){const s=e[r-1],o=e[r],n=o[0]-s[0],a=o[1]-s[1],c=Math.sqrt(n*n+a*a),l=n/c,m=a/c;t.push({a:{position:s,distance:i,direction:[l,m]},b:{position:o,distance:i+c,direction:[l,m]}}),i+=c}return t}class b extends v{constructor(){super(...arguments),this.shift=!1}}class C extends v{constructor(){super(...arguments),this.shift=!0}}export{b as AnimatedMarkerMeshWriter,C as AnimatedMarkerShiftMeshWriter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as r,rotate as o}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as c}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as l}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{minMaxZoomPrecisionFactor as m}from"../../../definitions.js";import{processColorInput as u,getMinMaxZoom as d,packByteSqrt as p,getBitMask as h}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as f}from"./ComputedMarkerParams.js";import{MarkerConstants as y}from"./markerConstants.js";import{
|
|
5
|
+
import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as r,rotate as o}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as c}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as l}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{minMaxZoomPrecisionFactor as m}from"../../../definitions.js";import{processColorInput as u,getMinMaxZoom as d,packByteSqrt as p,getBitMask as h}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as f}from"./ComputedMarkerParams.js";import{MarkerConstants as y}from"./markerConstants.js";import{MeshWriter as M}from"../mesh/MeshWriter.js";import{DataType as x}from"../../../../../../webgl/enums.js";const P=3.14159265359/180,g=128/Math.PI;function k(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function b(e){return k(e*g,256)}function v(e,a,i,n,c=!1){const l=s(),m=c?1:-1;return t(l),(a||i)&&r(l,l,[a,-i]),n&&o(l,l,m*P*-n),l}const S={createComputedParams:e=>f.from(e),optionalAttributes:{zoomRange:{type:x.SHORT,count:2,packPrecisionFactor:m,pack:({scaleInfo:e},{tileInfo:t})=>d(e,t)}},attributes:{pos:{type:x.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:x.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:x.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:r,overrideOutlineColor:o,colorLocked:s})=>{let a=0;return e.sdf&&(a|=h(y.bitset.isSDF)),1===t&&(a|=h(y.bitset.isMapAligned)),r&&(a|=h(y.bitset.scaleSymbolsProportionally)),o&&(a|=h(y.bitset.overrideOutlineColor)),s&&(a|=h(y.bitset.colorLocked)),a}},offset:{type:x.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:r,anchorX:o,anchorY:s,offsetX:i,offsetY:n,rotateClockwise:c})=>{const l=v(0,i,n,-e,c),m=-(.5+o)*t,u=-(.5-s)*r,d=[m,u],p=[m+t,u],h=[m,u+r],f=[m+t,u+r];return a(d,d,l),a(p,p,l),a(h,h,l),a(f,f,l),[d,p,h,f]}}},textureUV:{type:x.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:r,texYmin:o})=>[[t,o],[e,o],[t,r],[e,r]]}},color:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>u(e)},outlineColor:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>u(e)},sizing:{type:x.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:r,referenceSize:o})=>{const s=Math.max(e,t);return[p(s,128),p(r,128),p(o,128),0]}},placementAngle:{type:x.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>b(e)},sdfDecodeCoeff:{type:x.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class I extends M{constructor(){super(...arguments),this.vertexSpec=S}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,r){const o=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,o);const a=this.evaluatedMeshParams.minPixelBuffer,i=Math.max(this.evaluatedMeshParams.computedWidth,a),l=Math.max(this.evaluatedMeshParams.computedHeight,a),m=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,d=this.evaluatedMeshParams.offsetX+m,p=-this.evaluatedMeshParams.offsetY+u;if(null!=this.evaluatedMeshParams.placement){let o=null;if(null!=r){const e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight);if(o=n(r,2*e,!1),null===o)return}this._writePlacedMarkers(e,t,o,i,l)}else if(r?.nextPath()){r.nextPoint();const t=r.x,o=r.y;e.recordBounds(t+d,o+p,i,l),this._writeQuad(e,s,t,o)}else if("esriGeometryPolygon"===t.geometryType){const r=t.readCentroidForDisplay();if(!r)return;const[o,a]=r.coords;e.recordBounds(o+d,a+p,i,l),this._writeQuad(e,s,o,a)}else if("esriGeometryPoint"===t.geometryType){const r=t.readXForDisplay(),o=t.readYForDisplay();e.recordBounds(r+d,o+p,i,l),this._writeQuad(e,s,r,o)}else{const r=t.readGeometryForDisplay();r?.forEachVertex((t,r)=>{e.recordBounds(t+d,r+p,i,l),Math.abs(t)>c||Math.abs(r)>c||this._writeQuad(e,s,t,r)})}e.recordEnd()}_writePlacedMarkers(t,r,o,s,a){const n=o??i.fromFeatureSetReaderCIM(r);if(!n)return;const m=-1,u=l.getPlacement(n,m,this.evaluatedMeshParams.placement,e(1),t.id);if(!u)return;const d=r.getDisplayId();let p=u.next();const h=this.evaluatedMeshParams.offsetX,f=-this.evaluatedMeshParams.offsetY;for(;null!=p;){const e=p.tx,r=-p.ty;if(Math.abs(e)>c||Math.abs(r)>c){p=u.next();continue}const o=-p.getAngle();t.recordBounds(e+h,r+f,s,a),this._writeQuad(t,d,e,r,o),p=u.next()}}_writeQuad(e,t,r,o,s){const a=e.vertexCount(),i=null==s?null:{placementAngle:s};this._writeVertex(e,t,r,o,i),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}}export{I as MarkerMeshWriter,S as MarkerVertexSpec};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{
|
|
5
|
+
import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{loadGeometryOperatorsForEffect as t}from"../../../../../../../symbols/cim/CIMEffects.js";import{CIMEffectHelper as r}from"../../../../../../../symbols/cim/effects/CIMEffectHelper.js";import{MeshWriterVertexPack as s}from"./MeshWriterVertexPack.js";class a{constructor(e,t,r,s){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=r,this._viewParams=s,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=s.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await t(e)}enqueueRequest(e,t,r){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,r)}write(e,t,r,s,a){this.ensurePacked(t,r,s);const i=this.evaluatedMeshParams.effects;if(!i||0===i.length)return void this._write(e,r,void 0,a);const n=this.getEffectCursor(e,r,i);if(!n)return;let c;for(;c=n.next();)c.invertY(),this._write(e,r,c,a)}ensurePacked(e,t,r){if(!this._evaluator.hasDynamicProperties)return;const s=this._evaluator.evaluateMeshParams(e,t,r);this._vertexPack.pack(s,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,r,s,a){const i=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,r,s,i,a)}getEffectCursor(t,s,a){const i=s.readGeometryForDisplay()?.clone();if(!i)return;const n=e.fromOptimizedCIM(i,s.geometryType);n.invertY();const c=t.id||"";return r.executeEffects(a,n,c,this._preventEffectClipping)}}export{a as MeshWriter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as
|
|
5
|
+
import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as i}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as r,getYDirection as s}from"../../../alignmentUtils.js";import{minMaxZoomPrecisionFactor as n,maxTextLineWidth as a,minTextLineWidth as c,magicLabelLineHeight as l,glyphSize as h}from"../../../definitions.js";import{shapeGlyphs as f}from"../../../mesh/templates/shapingUtils.js";import{processColorInput as p,packBitset as m,getMinMaxZoom as d}from"../fill/meshWriterUtils.js";import{MeshWriter as u}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as g,bitsetTextIsMapAligned as x}from"../shaders/constants.js";import{TextMeshTransformProps as y}from"./TextParams.js";import{DataType as S}from"../../../../../../webgl/enums.js";const _=28,P=[4,4],b=[16,4],T={topLeft:b,topRight:b,bottomLeft:b,bottomRight:b},k=[4,2],z=[4,6],B={topLeft:k,topRight:k,bottomLeft:z,bottomRight:z},R={topLeft:k,topRight:z,bottomLeft:k,bottomRight:z},M={topLeft:z,topRight:z,bottomLeft:P,bottomRight:P},L={topLeft:P,topRight:P,bottomLeft:z,bottomRight:z},w={topLeft:z,topRight:P,bottomLeft:z,bottomRight:P},I={topLeft:P,topRight:z,bottomLeft:P,bottomRight:z},A={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:S.UNSIGNED_SHORT,count:2,packPrecisionFactor:n,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||_]},clipAngle:{type:S.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>G(t||0)},referenceSymbol:{type:S.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,o)=>{const i=t.isLineLabel||!t.referenceBounds,n=r(i?"center":o.horizontalAlignment),a=s(i?"middle":o.verticalAlignment),{offsetX:c,offsetY:l,size:h}=i?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[e(c),-e(l),Math.round(e(h)),n+1<<2|a+1]}},visibility:{type:S.FLOAT,count:1,otherSource:!0}},attributes:{pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>m([[g,t],[x,!!e]])},offset:{type:S.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:r}=t;return[i,r,e,o]}}},textureUV:{type:S.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:r}=t;return[i,r,e,o]}}},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontAndReferenceSize:{type:S.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:o})=>[Math.round(e(t)),Math.round(e(o??t))]},outlineColor:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>p(t)},haloColor:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>p(t)},outlineAndHaloSize:{type:S.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:o})=>[Math.round(e(t)),Math.round(e(o))]}}};class E extends u{constructor(){super(...arguments),this.vertexSpec=A,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new y(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,o){const i=this._getShaping();if(!i)return;const r=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,i,o);if(o?.nextPath())return o.nextPoint(),this._writeGlyphs(t,r,o.x,o.y,i,0);if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[s,n]=o.coords;return this._writeGlyphs(t,r,s,n,i,0)}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex((e,o)=>this._writeGlyphs(t,r,e,o,i,0))}const s=e.readXForDisplay(),n=e.readYForDisplay();return this._writeGlyphs(t,r,s,n,i,0)}_writePlacedTextMarkers(t,r,s,n){const a=n??o.fromFeatureSetReaderCIM(r);if(!a)return;const c=-1,l=i.getPlacement(a,c,this.evaluatedMeshParams.placement,e(1),t.id);if(!l)return;const h=r.getDisplayId();let f=l.next();for(;null!=f;){const e=f.tx,o=-f.ty,i=-f.getAngle();this._writeGlyphs(t,h,e,o,s,i),f=l.next()}}_getShaping(o){const i=this._textMeshTransformProps,r=this.evaluatedMeshParams;if(!r.glyphs?.glyphs.length)return null;const s=e(i.fontSize),n=e(i.offsetX),p=e(i.offsetY),m=t(e(r.lineWidth),c,a),d=l*t(r.lineHeightRatio,.25,4);return f(r.glyphs,{scale:s/h,angle:i.postAngle,xOffset:n,yOffset:p,horizontalAlignment:r.horizontalAlignment,verticalAlignment:o||r.verticalAlignment,maxLineWidth:m,lineHeight:d,decoration:r.decoration,borderLineSizePx:e(r.boxBorderLineSize),hasBackground:!!r.boxBackgroundColor,useCIMAngleBehavior:r.useCIMAngleBehavior})}_writeGlyphs(t,o,i,r,s,n,a,c,l=!0){const h=this.evaluatedMeshParams,f=this._textMeshTransformProps,m=e(f.fontSize),u=f.haloSize,g=f.outlineSize,x=e(f.offsetX),y=e(f.offsetY),[S,_]=d(h.scaleInfo,this.getTileInfo());0!==n&&s.setRotation(n);const P=s.bounds,b=i+P.x+x,T=r+P.y-y,k=2*(h.minPixelBuffer?h.minPixelBuffer/m:1),z=Math.max(P.width,P.height)*k;s.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),l&&t.recordBounds(b,T,z,z),this._writeTextBox(t,o,i,r,s.textBox,a,c),t.recordEnd());for(const e of s.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),l&&t.recordBounds(b,T,z,z);const{texcoords:s,offsets:n}=e;this._writeQuad(t,o,i,r,{texcoords:s,offsets:n,fontSize:m,haloSize:u,outlineSize:g,color:p(h.color),isBackground:!1,referenceBounds:a,minZoom:S,maxZoom:_,...c}),t.recordEnd()}0!==n&&s.setRotation(-n)}_writeTextBox(t,e,o,i,r,s,n){const a=this.evaluatedMeshParams,{fontSize:c,haloSize:l,outlineSize:h}=this._textMeshTransformProps,{boxBackgroundColor:f,boxBorderLineColor:m}=a,d={isBackground:!0,fontSize:c,haloSize:l,outlineSize:h,referenceBounds:s,...n};f&&(this._writeQuad(t,e,o,i,{texcoords:T,offsets:r.main,color:p(f),...d}),m||(this._writeQuad(t,e,o,i,{texcoords:M,offsets:r.top,color:p(f),...d}),this._writeQuad(t,e,o,i,{texcoords:L,offsets:r.bot,color:p(f),...d}),this._writeQuad(t,e,o,i,{texcoords:w,offsets:r.left,color:p(f),...d}),this._writeQuad(t,e,o,i,{texcoords:I,offsets:r.right,color:p(f),...d}))),m&&(this._writeQuad(t,e,o,i,{texcoords:B,offsets:r.top,color:p(m),...d}),this._writeQuad(t,e,o,i,{texcoords:B,offsets:r.bot,color:p(m),...d}),this._writeQuad(t,e,o,i,{texcoords:R,offsets:r.left,color:p(m),...d}),this._writeQuad(t,e,o,i,{texcoords:R,offsets:r.right,color:p(m),...d}))}_writeQuad(t,e,o,i,r){const s=t.vertexCount();this._writeVertex(t,e,o,i,r),t.indexWrite(s+0),t.indexWrite(s+1),t.indexWrite(s+2),t.indexWrite(s+1),t.indexWrite(s+3),t.indexWrite(s+2)}}const G=t=>Math.round(t*(254/360));export{E as TextMeshWriter,A as TextVertexSpec,_ as maxLabelZoom};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import t from"../../../../core/Accessor.js";import{watch as e}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{ControlPointsTransformTool as a}from"./ControlPointsTransformTool.js";import{TransformTool as r}from"./TransformTool.js";const n={redo:"r",undo:"z"};let d=class extends t{constructor(o){super(o),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:o,mediaElement:t,preserveAspectRatio:s,snapRotation:i,advancedMode:d}=this;this._originalOpacity=t.opacity,this._transformTool=new r({target:t,view:o,preserveAspectRatio:s,snapRotation:i}),this._controlPointsTransformTool=new a({mediaElement:t,view:o}),this._advancedModeTransformTool=new a({mediaElement:d.mediaElement,view:d.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const l=t.georeference,c=d.mediaElement.georeference;d.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in c&&"controlPoints"in l&&this.addHandles([d.view.on("key-down",o=>{o.key===n.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===n.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}),d.view.on("focus",
|
|
5
|
+
import{__decorate as o}from"tslib";import t from"../../../../core/Accessor.js";import{watch as e}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{ControlPointsTransformTool as a}from"./ControlPointsTransformTool.js";import{TransformTool as r}from"./TransformTool.js";const n={redo:"r",undo:"z"};let d=class extends t{constructor(o){super(o),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:o,mediaElement:t,preserveAspectRatio:s,snapRotation:i,advancedMode:d}=this;this._originalOpacity=t.opacity,this._transformTool=new r({target:t,view:o,preserveAspectRatio:s,snapRotation:i}),this._controlPointsTransformTool=new a({mediaElement:t,view:o}),this._advancedModeTransformTool=new a({mediaElement:d.mediaElement,view:d.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const l=t.georeference,c=d.mediaElement.georeference;d.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in c&&"controlPoints"in l&&this.addHandles([d.view.on("key-down",o=>{o.key===n.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===n.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}),d.view.on("focus",()=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),e(()=>c.controlPoints,o=>{l.controlPoints=o.map(({sourcePoint:o},t)=>({sourcePoint:o,mapPoint:l.controlPoints[t].mapPoint})),this._activeTool?.refresh()}),e(()=>this._controlPointsTransformTool.activeHandle,o=>{this._advancedModeTransformTool.updateActiveHandle(o),this.activeHandle=o}),e(()=>this._advancedModeTransformTool.activeHandle,o=>{this._controlPointsTransformTool.updateActiveHandle(o),this.activeHandle=o})]),this.addHandles([o.on("key-down",o=>{o.key===n.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===n.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}),o.on("focus",()=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),o.tools.addMany([this._transformTool,this._controlPointsTransformTool]),o.activeTool=this._transformTool,this._activeTool=this._transformTool,o.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:o,operation:t}=this._sharedUndoStack.pop();o!==this._activeTool&&o.refresh(),t.undo(),o.updateGraphics(),this._sharedRedoStack.push({tool:o,operation:t}),this._activeTool!==o&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:o,operation:t}=this._sharedRedoStack.pop();o!==this._activeTool&&o.refresh(),t.apply(),o.updateGraphics(),this._sharedUndoStack.push({tool:o,operation:t}),this._activeTool!==o&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};o([s()],d.prototype,"activeHandle",void 0),o([s({constructOnly:!0})],d.prototype,"advancedMode",void 0),o([s()],d.prototype,"preserveAspectRatio",void 0),o([s()],d.prototype,"snapRotation",void 0),o([s({constructOnly:!0,nonNullable:!0})],d.prototype,"mediaElement",void 0),o([s({constructOnly:!0})],d.prototype,"view",void 0),d=o([i("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],d);export{d as MediaTransformToolsWrapper,n as keys};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../../core/has.js";import{AProcessorStrategy as t,ASendState as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends e{}class i extends t{constructor(t,e,s,r){super(t,e,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(t){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=t,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,t))}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(t){return new d(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),o=[];for(const a of this._source.chunks()){const t=a.reader.getCursor();for(;t.next();){const e=t.getObjectId(),a=t.getDisplayId(),n=r.get(e);if(null!=n){const t=s(a,n,e);o.push(t),r.delete(e)}}}return o}getDisplayFeatures(t){const e=new Set(t),s=new Set,r=[];for(const o of this._source.chunks()){const t=o.reader.getCursor();for(;t.next();){const o=t.getObjectId(),a=t.getDisplayId();e.has(a)&&!s.has(o)&&(r.push({...t.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(t){const e=[];for(const s of t.modified){const t=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=t,e.push(t)}const r=n.fromOptimizedFeatures(t.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of t.removed){const t=this._attributeStore.getDisplayIdForObjectId(s);null!=t&&a.push(t)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:t,modifiedDisplayIds:e,removedDisplayIds:a});const d=o.fromFeatures(t.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,e,!1,d.queryInfo);for(const o of this._sendStates.values()){const t=d.getTileReader(o.subscription.tile);yield new s(o.subscription,t,a,!1,d.queryInfo)}for(const s of t.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){
|
|
5
|
+
import has from"../../../../../core/has.js";import{AProcessorStrategy as t,ASendState as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends e{}class i extends t{constructor(t,e,s,r){super(t,e,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(t){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=t,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,t))}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(t){return new d(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),o=[];for(const a of this._source.chunks()){const t=a.reader.getCursor();for(;t.next();){const e=t.getObjectId(),a=t.getDisplayId(),n=r.get(e);if(null!=n){const t=s(a,n,e);o.push(t),r.delete(e)}}}return o}getDisplayFeatures(t){const e=new Set(t),s=new Set,r=[];for(const o of this._source.chunks()){const t=o.reader.getCursor();for(;t.next();){const o=t.getObjectId(),a=t.getDisplayId();e.has(a)&&!s.has(o)&&(r.push({...t.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(t){const e=[];for(const s of t.modified){const t=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=t,e.push(t)}const r=n.fromOptimizedFeatures(t.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of t.removed){const t=this._attributeStore.getDisplayIdForObjectId(s);null!=t&&a.push(t)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:t,modifiedDisplayIds:e,removedDisplayIds:a});const d=o.fromFeatures(t.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,e,!1,d.queryInfo);for(const o of this._sendStates.values()){const t=d.getTileReader(o.subscription.tile);yield new s(o.subscription,t,a,!1,d.queryInfo)}for(const s of t.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){this._updateAttributeData();for(const t of this._sendStates.values())yield*this._update(t)}}removeChunks(t){for(const e of t)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const t of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(t);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(t){if(this.handledChunksForIdCreation.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(t.chunkId)}}_updateAttributeData(){for(const t of this._source.chunks()){const{chunkId:e,reader:s}=t;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const t=s.getCursor();for(;t.next();){const e=this._attributeStore.createDisplayIdForObjectId(t.getObjectId());t.setDisplayId(e)}}}for(const t of this._source.chunks())if(!this.handledChunksForAttributeData.has(t.chunkId)){this.handledChunksForAttributeData.add(t.chunkId);const e=t.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions,this._sqlOptions)}}}*_update(t){const{subscription:e,handledChunks:s}=t;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a)||!this.handledChunksForIdCreation.has(a)||!this.handledChunksForAttributeData.has(a))continue;s.add(a);const n=o.getTileReader(e.tile);n&&(yield new r(t.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
|