@arcgis/core 5.0.0-next.14 → 5.0.0-next.15
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/PopupTemplate.js +1 -1
- package/applications/Components/QuantityFormatter.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
- package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
- package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
- package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
- package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
- package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
- package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
- package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
- package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
- package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
- package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
- package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
- package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
- package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
- package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
- package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/config.js +1 -1
- package/copyright.txt +0 -60
- package/core/SetUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +105 -9
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/package.json +1 -1
- package/popup/content.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/renderers/support/numberUtils.js +1 -1
- package/rest/geometryService.js +1 -1
- package/rest/geoprocessor.js +1 -1
- package/rest/imageService.js +1 -1
- package/rest/locator.js +1 -1
- package/rest/query.js +1 -1
- package/smartMapping/labels/bins.js +1 -1
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/actions/actionUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/tables/elements.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/components/TooltipField.js +1 -1
- package/views/interactive/tooltip/components/ValueByValue.js +1 -1
- package/views/interactive/tooltip/content/Fields.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
- package/views/navigation/gamepad/GamepadSettings.js +1 -1
- package/views/overlay/BoxOverlayItem.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/overlay/OutlineOverlayItem.js +1 -1
- package/views/ui/UI.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PanelToolbar.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
- package/widgets/Editor/support/errors.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/Legend.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureContentMixin.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/styleUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print/FileLink.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
- package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/Heading.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
- package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
- package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
- package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
- package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
- package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
- package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
- package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
- package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
- package/widgets/support/jsxFactory.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{formatNumber as t}from"../../intl.js";const n=/^-?(\d+)(\.(\d+))?$/i;function e(t,n){return t-n}function r(t,n){let e,r;return e=Number(t.toFixed(n)),e<t?r=e+1/10**n:(r=e,e-=1/10**n),e=Number(e.toFixed(n)),r=Number(r.toFixed(n)),[e,r]}function o(t,n,e,r,o){const i=l(t,n,e,r),u=null==i.previous||i.previous<=o,c=null==i.next||i.next<=o;return u&&c||i.previous+i.next<=2*o}function i(t){const e=String(t),r=e.match(n);if(r?.[1])return{integer:r[1].split("").length,fractional:r[3]?r[3].split("").length:0};if(e.toLowerCase().includes("e")){const t=e.split("e"),n=t[0],r=t[1];if(n&&r){const t=Number(n);let e=Number(r);const o=e>0;o||(e=Math.abs(e));const l=i(t);return o?(l.integer+=e,e>l.fractional?l.fractional=0:l.fractional-=e):(l.fractional+=e,e>l.integer?l.integer=1:l.integer-=e),l}}return{integer:0,fractional:0}}function l(t,n,e,r){const o={previous:null,next:null};if(null!=e){const r=t-e,i=n-e-r;o.previous=Math.floor(Math.abs(100*i/r))}if(null!=r){const e=r-t,i=r-n-e;o.next=Math.floor(Math.abs(100*i/e))}return o}function u(t,n={}){const l=t.slice(),{tolerance:u=2,strictBounds:c=!1,indexes:s=l.map((t,n)=>n)}=n;s.sort(e);for(let e=0;e<s.length;e++){const t=s[e],n=l[t],a=0===t?null:l[t-1],f=t===l.length-1?null:l[t+1],g=i(n).fractional;if(g){let i,s=0,m=!1;for(;s<=g&&!m;){const t=r(n,s);i=c&&0===e?t[1]:t[0],m=o(n,i,a,f,u),s++}m&&(l[t]=i)}}return l}const c={maximumFractionDigits:20};function s(n){return t(n,c)}export{s as format,i as numDigits,l as percentChange,u as round};
|
package/rest/geometryService.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import{areasAndLengths as e}from"./geometryService/areasAndLengths.js";import{autoComplete as r}from"./geometryService/autoComplete.js";import{buffer as o}from"./geometryService/buffer.js";import{convexHull as t}from"./geometryService/convexHull.js";import{cut as i}from"./geometryService/cut.js";import{densify as m}from"./geometryService/densify.js";import{difference as s}from"./geometryService/difference.js";import{distance as a}from"./geometryService/distance.js";import{fromGeoCoordinateString as f}from"./geometryService/fromGeoCoordinateString.js";import{generalize as n}from"./geometryService/generalize.js";import{intersect as c}from"./geometryService/intersect.js";import{labelPoints as g}from"./geometryService/labelPoints.js";import{lengths as p}from"./geometryService/lengths.js";import{offset as y}from"./geometryService/offset.js";import{project as S}from"./geometryService/project.js";import{relation as j}from"./geometryService/relation.js";import{reshape as v}from"./geometryService/reshape.js";import{simplify as l}from"./geometryService/simplify.js";import{toGeoCoordinateString as d}from"./geometryService/toGeoCoordinateString.js";import{trimExtend as u}from"./geometryService/trimExtend.js";import{union as h}from"./geometryService/union.js";const C=e,x=r,b=o,G=t,z=i,A=m,E=s,H=a,L=f,P=n,k=c,q=g,w=p,B=y,D=S,F=j,I=v,J=l,K=d,M=u,N=h;export{C as areasAndLengths,x as autoComplete,b as buffer,G as convexHull,z as cut,A as densify,E as difference,H as distance,L as fromGeoCoordinateString,P as generalize,k as intersect,q as labelPoints,w as lengths,B as offset,D as project,F as relation,I as reshape,J as simplify,K as toGeoCoordinateString,M as trimExtend,N as union};
|
package/rest/geoprocessor.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import{execute as o}from"./geoprocessor/execute.js";import{submitJob as e}from"./geoprocessor/submitJob.js";const s=o,r=e;export{s as execute,r as submitJob};
|
package/rest/imageService.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../request.js";import{ensureClass as e}from"../core/accessorSupport/ensureType.js";import r from"../geometry/SpatialReference.js";import{fromJSON as o}from"../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as a}from"../geometry/support/normalizeUtils.js";import{srToRESTValue as s}from"../geometry/support/spatialReferenceUtils.js";import{parseUrl as n,encode as m,asValidOptions as i}from"./utils.js";import p from"./support/FindImagesParameters.js";import u from"./support/FindImagesResult.js";import c from"./support/ImageAngleParameters.js";import f from"./support/ImageAngleResult.js";import l from"./support/ImageAreaParameters.js";import g from"./support/ImageAreaResult.js";import y from"./support/ImageBoundaryParameters.js";import j from"./support/ImageBoundaryResult.js";import d from"./support/ImageDistanceParameters.js";import S from"./support/ImageDistanceResult.js";import I from"./support/ImageGPSInfoParameters.js";import N from"./support/ImageGPSInfoResult.js";import R from"./support/ImageHeightParameters.js";import h from"./support/ImageHeightResult.js";import O from"./support/ImageHistogramParameters.js";import J from"./support/ImageIdentifyParameters.js";import w from"./support/ImageIdentifyResult.js";import P from"./support/ImagePixelLocationParameters.js";import q from"./support/ImagePixelLocationResult.js";import G from"./support/ImagePointParameters.js";import $ from"./support/ImagePointResult.js";import C from"./support/ImageSampleParameters.js";import M from"./support/ImageSampleResult.js";import b from"./support/ImageToMapMultirayParameters.js";import v from"./support/ImageToMapParameters.js";import F from"./support/ImageUrlParameters.js";import T from"./support/ImageUrlResult.js";import A from"./support/ImageVolumeParameters.js";import L from"./support/ImageVolumeResult.js";import U from"./support/MapToImageParameters.js";import x from"./support/MeasureAreaFromImageResult.js";import H from"./support/MeasureFromImageParameters.js";import V from"./support/MeasureLengthFromImageResult.js";function B(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const r=[];null!=e.start&&r.push(e.start),null==e.end||r.includes(e.end)||r.push(e.end),t.time=r.join(",")}}async function D(t,r,o){r=e(O,r);const s=n(t),p=r.geometry?[r.geometry]:[],u=await a(p),c=r.toJSON();B(c);const f=u?.[0];null!=f&&(c.geometry=st(f));const l=m({...s.query,f:"json",...c});return i(l,o)}async function k(r,o,a){const s=(o=e(A,o)).toJSON();s.geometries=JSON.stringify(s.geometries);const p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/calculateVolume`,c);return L.fromJSON({volumes:f.results})}async function z(o,a,s){const p=
|
|
5
|
+
import t from"../request.js";import{ensureClass as e}from"../core/accessorSupport/ensureType.js";import r from"../geometry/SpatialReference.js";import{fromJSON as o}from"../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as a}from"../geometry/support/normalizeUtils.js";import{srToRESTValue as s}from"../geometry/support/spatialReferenceUtils.js";import{parseUrl as n,encode as m,asValidOptions as i}from"./utils.js";import p from"./support/FindImagesParameters.js";import u from"./support/FindImagesResult.js";import c from"./support/ImageAngleParameters.js";import f from"./support/ImageAngleResult.js";import l from"./support/ImageAreaParameters.js";import g from"./support/ImageAreaResult.js";import y from"./support/ImageBoundaryParameters.js";import j from"./support/ImageBoundaryResult.js";import d from"./support/ImageDistanceParameters.js";import S from"./support/ImageDistanceResult.js";import I from"./support/ImageGPSInfoParameters.js";import N from"./support/ImageGPSInfoResult.js";import R from"./support/ImageHeightParameters.js";import h from"./support/ImageHeightResult.js";import O from"./support/ImageHistogramParameters.js";import J from"./support/ImageIdentifyParameters.js";import w from"./support/ImageIdentifyResult.js";import P from"./support/ImagePixelLocationParameters.js";import q from"./support/ImagePixelLocationResult.js";import G from"./support/ImagePointParameters.js";import $ from"./support/ImagePointResult.js";import C from"./support/ImageSampleParameters.js";import M from"./support/ImageSampleResult.js";import b from"./support/ImageToMapMultirayParameters.js";import v from"./support/ImageToMapParameters.js";import F from"./support/ImageUrlParameters.js";import T from"./support/ImageUrlResult.js";import A from"./support/ImageVolumeParameters.js";import L from"./support/ImageVolumeResult.js";import U from"./support/MapToImageParameters.js";import x from"./support/MeasureAreaFromImageResult.js";import H from"./support/MeasureFromImageParameters.js";import V from"./support/MeasureLengthFromImageResult.js";function B(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const r=[];null!=e.start&&r.push(e.start),null==e.end||r.includes(e.end)||r.push(e.end),t.time=r.join(",")}}async function D(t,r,o){r=e(O,r);const s=n(t),p=r.geometry?[r.geometry]:[],u=await a(p),c=r.toJSON();B(c);const f=u?.[0];null!=f&&(c.geometry=st(f));const l=m({...s.query,f:"json",...c});return i(l,o)}async function k(r,o,a){const s=(o=e(A,o)).toJSON();s.geometries=JSON.stringify(s.geometries);const p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/calculateVolume`,c);return L.fromJSON({volumes:f.results})}async function z(o,a,s){const p=e(c,a),u=p.toJSON();null!=u.angleName&&(u.angleName=u.angleName.join(",")),p?.point?.spatialReference?.imageCoordinateSystem&&(u.point.spatialReference=nt(p.point.spatialReference)),p?.spatialReference?.imageCoordinateSystem&&(u.spatialReference=mt(p.spatialReference));const l=n(o),g=m({...l.query,f:"json",...u}),y=i(g,s),{data:j}=await t(`${l.path}/computeAngles`,y);return j.spatialReference=j.spatialReference?null!=j.spatialReference.geodataXform?new r({wkid:0,imageCoordinateSystem:j.spatialReference}):r.fromJSON(j.spatialReference):null,"NaN"===j.north&&(j.north=null),"NaN"===j.up&&(j.up=null),new f(j)}async function E(r,o,a){const s=(o=e(P,o)).toJSON(),{geometries:p}=o;if(p)for(let t=0;t<p.length;t++)p[t].spatialReference?.imageCoordinateSystem&&(s.geometries.geometries[t].spatialReference=nt(p[t].spatialReference));const u=n(r),c=m({...u.query,f:"json",...s}),f=i(c,a),{data:l}=await t(`${u.path}/computePixelLocation`,f);return q.fromJSON(l)}async function X(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeStatisticsHistograms`,a),{statistics:i}=m;return i?.length&&i.forEach(t=>{t.avg=t.mean,t.stddev=t.standardDeviation}),{statistics:i,histograms:m.histograms}}async function K(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeHistograms`,a);return{histograms:m.histograms}}async function Q(r,o,s){const p=(o=e(C,o)).toJSON();B(p),p.outFields?.length&&(p.outFields=p.outFields.join(","));const u=await a(o.geometry),c=u?.[0];null!=c&&(p.geometry=st(c));const f=n(r),l=m({...f.query,f:"json",...p}),g=i(l,s),{data:y}=await t(`${f.path}/getSamples`,g),j=y.samples.map(t=>{const e="NaN"===t.value||""===t.value?null:t.value.split(" ").map(t=>Number(t));return{...t,pixelValue:e}});return M.fromJSON({samples:j})}async function W(r,o,s){o=e(J,o);const p=n(r),u=o.geometry?[o.geometry]:[];return a(u).then(e=>{const r=o.toJSON(),a=e?.[0];null!=a&&(r.geometry=JSON.stringify(st(a)));const n=m({...p.query,f:"json",...r}),u=i(n,s);return t(p.path+"/identify",u)}).then(t=>w.fromJSON(t.data))}async function Y(t,r,o){const a=e(R,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return h.fromJSON(s)}async function Z(t,r,o){const a=e(l,r),s=await et(t,a,[a.geometry],o);return g.fromJSON(s)}async function _(t,r,o){const a=e(G,r),s=await et(t,a,[a.geometry],o);return $.fromJSON(s)}async function tt(t,r,o){const a=e(d,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return S.fromJSON(s)}async function et(e,r,o,s){const p=n(e),u=await a(o),c=r.toJSON();null!=u[0]&&(c.fromGeometry=JSON.stringify(st(u[0]))),null!=u[1]&&(c.toGeometry=JSON.stringify(st(u[1])));const f=m({...p.query,f:"json",...c}),l=i(f,s),{data:g}=await t(p.path+"/measure",l);return g}async function rt(t,e,r){const o=await at(t,e,r);return V.fromJSON(o)}async function ot(t,e,r){const o=await at(t,e,r);return x.fromJSON(o)}async function at(r,o,a){o=e(H,o);const s=n(r),p=o.toJSON(),u=m({...s.query,f:"json",...p}),c=i(u,a),{data:f}=await t(s.path+"/measureFromImage",c);return f}function st(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=nt(t.spatialReference)),e}function nt(t){const{imageCoordinateSystem:e}=t;if(e){const{id:t,referenceServiceName:r}=e;return null!=t?r?{icsid:t,icsns:r}:{icsid:t}:{ics:e}}return t.toJSON()}function mt(t,e){if(!t.imageCoordinateSystem)return s(t);const r=nt(t),{icsid:o,icsns:a}=r;return null==o||null!=a&&!e?.toLowerCase().includes("/"+a.toLowerCase()+"/")?JSON.stringify(r):`0:${o}`}async function it(r,o,a){o=e(y,o);const s=n(r),p=o.toJSON();o.outSpatialReference&&(p.outSR=mt(o.outSpatialReference));const u=m({...s.query,f:"json",...p}),c=i(u,a),{data:f}=await t(s.path+"/queryBoundary",c);return j.fromJSON(f)}async function pt(r,o,s){const p=(o=e(I,o)).toJSON();B(p),p.objectIds?.length&&(p.objectIds=p.objectIds.join(",")),p.geometry||p.objectIds||p.time||p.where||(p.where="1=1");const u=await a(o.geometry),c=u?.[0];null!=c&&(p.geometry=st(c));const f=c?.spatialReference??o.geometry?.spatialReference;f&&(p.inSR=mt(f));const l=n(r),g=m({...l.query,f:"json",...p}),y=i(g,s),{data:j}=await t(`${l.path}/queryGPSInfo`,y);return N.fromJSON(j)}async function ut(r,a,s){const p=(a=e(v,a)).toJSON();a.geometry.spatialReference.imageCoordinateSystem&&(p.geometry=st(a.geometry)),a.depthOffset&&a.adjust||delete p.options;const u=n(r),c=m({...u.query,f:"json",...p}),f=i(c,s),{data:l}=await t(`${u.path}/imageToMap`,f);return o(l)}async function ct(r,a,s){const p=(a=e(b,a)).toJSON();a.rasterIds?.length&&(p.rasterIds=a.rasterIds.join(","));const u=n(r),c=m({...u.query,f:"json",...p}),f=i(c,s),{data:l}=await t(`${u.path}/imageToMapMultiray`,f);return o(l)}async function ft(r,s,p){const u=(s=e(U,s)).toJSON(),c=await a(s.geometry),f=c?.[0];null!=f&&(u.geometry=st(f)),s.visibleOnly||delete u.options;const l=f?.spatialReference??s.geometry?.spatialReference;l&&(u.inSR=mt(l));const g=n(r),y=m({...g.query,f:"json",...u}),j=i(y,p),{data:d}=await t(`${g.path}/mapToImage`,j);return o(d)}async function lt(r,o,a){const s=(o=e(F,o)).toJSON(),p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/getImageUrl`,c);return T.fromJSON(f)}async function gt(r,o,s){const c=(o=e(p,o)).toJSON(),f=await a([o.fromGeometry,o.toGeometry]);null!=f[0]&&(c.fromGeometry=st(f[0]),f[0].spatialReference&&(c.inSR=mt(f[0].spatialReference))),null!=f[1]&&(c.toGeometry=st(f[1])),o.objectIds?.length&&(c.objectIds=c.objectIds.join(","));const l=n(r),g=m({...l.query,f:"json",...c}),y=i(g,s),{data:j}=await t(`${l.path}/find`,y);return u.fromJSON(j)}export{k as calculateVolume,z as computeAngles,K as computeHistograms,E as computePixelSpaceLocations,X as computeStatisticsHistograms,gt as findImages,nt as getImageSpatialReferenceJSON,mt as getImageSpatialReferenceQueryParameter,lt as getImageUrl,Q as getSamples,W as identify,ut as imageToMap,ct as imageToMapMultiray,ft as mapToImage,Z as measureAreaAndPerimeter,ot as measureAreaFromImage,tt as measureDistanceAndAngle,Y as measureHeight,rt as measureLengthFromImage,_ as measurePointOrCentroid,it as queryBoundary,pt as queryGPSInfo};
|
package/rest/locator.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import{addressesToLocations as o}from"./locator/addressesToLocations.js";import{addressToLocations as s}from"./locator/addressToLocations.js";import{locationToAddress as a}from"./locator/locationToAddress.js";import{suggestLocations as t}from"./locator/suggestLocations.js";const r=s,c=o,d=a,i=t;export{r as addressToLocations,c as addressesToLocations,d as locationToAddress,i as suggestLocations};
|
package/rest/query.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import{executeAttachmentQuery as e}from"./query/executeAttachmentQuery.js";import{executeAttributeBinsQuery as t}from"./query/executeAttributeBinsQuery.js";import{executeForCount as r}from"./query/executeForCount.js";import{executeForExtent as u}from"./query/executeForExtent.js";import{executeForIds as o}from"./query/executeForIds.js";import{executeForTopCount as s}from"./query/executeForTopCount.js";import{executeForTopExtents as x}from"./query/executeForTopExtents.js";import{executeForTopIds as c}from"./query/executeForTopIds.js";import{executeQueryJSON as m}from"./query/executeQueryJSON.js";import{executeQueryPBF as y}from"./query/executeQueryPBF.js";import{executeRelationshipQuery as p}from"./query/executeRelationshipQuery.js";import{executeTopFeaturesQuery as i}from"./query/executeTopFeaturesQuery.js";const a=e,F=t,n=r,f=u,j=o,q=s,Q=x,T=c,d=m,h=y,A=p,B=i;export{a as executeAttachmentQuery,F as executeAttributeBinsQuery,n as executeForCount,f as executeForExtent,j as executeForIds,q as executeForTopCount,Q as executeForTopExtents,T as executeForTopIds,d as executeQueryJSON,h as executeQueryPBF,A as executeRelationshipQuery,B as executeTopFeaturesQuery};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../intl.js";import
|
|
5
|
+
import{fetchMessageBundle as e}from"../../intl.js";import r from"../../core/Error.js";import{getAggregateFieldInfo as n,createLabelExpressionForAggregateField as t,createLabelClass as i}from"./support/utils.js";import{aggregateCountField as a}from"../support/binningUtils.js";async function o(e){const{layer:n,renderer:t}=e;if(await n.load(),"binning"!==n.featureReduction?.type)throw new r("bins-label-schemes:invalid-parameters","featureReduction type of the layer is not valid");const i=t||n.featureReduction.renderer;if(!i)throw new r("bins-label-schemes:invalid-parameters","'renderer' is not valid");return{layer:n,renderer:i}}async function s(e,r,a,o){const s=n(e,r);if(!s)return null;const l=t(r,a,s,o);return{name:`binning-${e}`,labelingInfo:[i(l,!0)],fieldName:e}}function l(e){let r=[];const n=e.featureReduction;return"fields"in n&&(r=n.fields.map(e=>e.name)),r}async function c(n){const[{renderer:t,layer:i},c]=await Promise.all([o(n),e("esri/smartMapping/t9n/smartMapping")]),f=c.clusters.predominantNoneValue;if(n.field){const e=await s(n.field,i,t,f);if(!e)throw new r("bins-label-schemes:invalid-parameters","'field' is not a valid aggregate field");return{primaryScheme:e,secondarySchemes:[]}}const m=await s(a,i),d=[],u=l(i).filter(e=>e.toLowerCase()!==a.toLowerCase());for(const e of u){const r=await s(e,i,t,f);r&&d.push(r)}return{primaryScheme:m,secondarySchemes:d}}export{c as getLabelSchemes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{substitute as e}from"../../../intl/substitute.js";import{numericTypes as t}from"../../../layers/support/fieldUtils.js";import
|
|
5
|
+
import{substitute as e}from"../../../intl/substitute.js";import{numericTypes as t}from"../../../layers/support/fieldUtils.js";import{TextContent as i}from"../../../popup/content.js";import n from"../../../popup/ExpressionInfo.js";import s from"../../../popup/FieldInfo.js";import r from"../../../popup/support/FieldInfoFormat.js";import{getFieldAndExpressionInfos as o,getContentFromFieldInfos as l}from"./utils.js";import{getStatisticInfos as u,getClusterField as a,getPredominantTypeExpression as f,clusterCountField as p}from"../../support/clusterUtils.js";import{isClusterCompatibleRenderer as m}from"../../../views/2d/layers/support/clusterUtils.js";function d(e){const{fieldName:i,label:n,type:o}=e,l=null!=o&&t.includes(o),u=new s({fieldName:i,label:n,visible:!0,format:l?new r({places:"integer"===o||"small-integer"===o?0:2,digitSeparator:!0}):void 0});return"date"===o&&(u.format=new r({dateFormat:"short-date-short-time"})),u}function c(e,t){const i=e?t.getField(e):null;return null!=i?i.alias||i.name:void 0}function y(t,i,n){const{attributeInfo:s,statisticType:r}=i,{field:o,normalizationField:l}=s;let u,a="";if("avg"===r?u=l?n.clusters.avgNormFieldLabel:n.clusters.avgFieldLabel:"type"===r&&(u=n.clusters.predominantFieldLabel),u){const i=s.valueExpression?s.valueExpressionTitle:c(o,t),n=l&&c(l,t);a=e(u,{fieldLabel:i||"",normFieldLabel:n||""})}return a}function I(t,i,n,s){const{attributeInfo:r,statisticType:o}=i,{field:l,normalizationField:u}=r;let a,f="";if("avg"===o?a=u?s.clusters.avgNormFieldSummary:s.clusters.avgFieldSummary:"type"===o&&(a=s.clusters.predominantFieldSummary),a){const i=r.valueExpression?r.valueExpressionTitle:c(l,t),s=u&&c(u,t);f=e(a,{fieldLabel:i||"",normFieldLabel:s||"",fieldValue:"{"+n+"}"})}return f}function b(t){return{fieldInfo:d({fieldName:p,label:t.clusters.numFeatures,type:"integer"}),fieldSummary:new i({text:e(t.clusters.countSummary,{count:`{${p}}`})})}}async function F(e,t,s){if(!m(t))return null;const r=u(e,t),o=s.clusters.predominantNoneValue,l="unique-value"===t.type?t.uniqueValueInfos??[]:[],{fieldInfo:p,fieldSummary:c}=b(s),F=[c],v=[p],x=[];for(const u of r){const{statisticType:t,attributeInfo:r}=u,p=a(r,t),m=y(e,u,s);if("avg"===t)F.push(new i({text:I(e,u,p,s)})),v.push(d({fieldName:p,label:m,type:"double"}));else if("type"===t){const t=`expression/${p}`;F.push(new i({text:I(e,u,t,s)})),x.push(new n({name:p,title:m,returnType:"string",expression:f(l,p,o)})),v.push(d({fieldName:t}))}}return{fieldInfos:v,expressionInfos:x,content:F}}async function v(e,t,i){if(!m(t))return null;const{fieldInfo:n,fieldSummary:s}=b(i),r=[s],u=[n],a=[],{fieldInfos:f,expressionInfos:p}=await o({renderer:t,layer:e,isFeatureReduction:!0}),d=await l(e,{fieldInfos:f,expressionInfos:p},!0);return r.push(...d),u.push(...f),a.push(...p),{fieldInfos:u,expressionInfos:a,content:r}}export{F as getContentAndInfos,v as getContentAndInfosForPieChart};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unique as e}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{fetchMessageBundle as
|
|
5
|
+
import{unique as e}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{fetchMessageBundle as i}from"../../../intl/messages.js";import{substitute as n}from"../../../intl/substitute.js";import{numericTypes as t}from"../../../layers/support/fieldUtils.js";import{FieldsContent as r,TextContent as s}from"../../../popup/content.js";import o from"../../../popup/ExpressionInfo.js";import a from"../../../popup/FieldInfo.js";import l from"../../../popup/support/FieldInfoFormat.js";import{getAttributes as p}from"../../../renderers/support/utils.js";import{viewScaleRE as f}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{getFeatureReductionFields as u}from"../../support/adapters/support/utils.js";let m=0;function d(e=0){}const c="expression/";function b(e){return"hasVisualVariables"in e&&e.hasVisualVariables()?e.visualVariables.filter(e=>!f.test(e.valueExpression)&&(!("target"in e)||"outline"!==e.target)):[]}function g(e,i){if(!i)return null;const n=u(e);return n?.find(e=>e.name.toLowerCase()===i.toLowerCase())}function x(e,i,n){let r=null;if(n&&"featureReduction"in e){const i=e.featureReduction;i&&"popupTemplate"in i&&i.popupTemplate&&(r=i.popupTemplate.fieldInfos)}else"popupTemplate"in e&&e.popupTemplate&&(r=e.popupTemplate.fieldInfos);const s=n?g(e,i):e.getField(i);let o=null;if(r&&r.some(e=>!(!e||e.fieldName?.toLowerCase()!==s?.name.toLowerCase())&&(o=e.clone(),!0)),!o){const e=t.includes(s.type),i="integer"===s.type||"small-integer"===s.type;o=new a({fieldName:s.name,isEditable:s.editable,visible:!0,format:e?new l({places:i?0:2,digitSeparator:!0}):void 0})}return o.label||(o.label=s.alias),o}function F(e){const{expression:i,title:n,returnType:t}=e;return new o({name:"expr"+m++,expression:i,title:n,returnType:t})}function $(e){const i="number"===e.returnType?new l({places:2,digitSeparator:!0}):void 0;return new a({fieldName:`${c}${e.name}`,visible:!0,format:i})}async function y(t){const r=await i("esri/smartMapping/t9n/smartMapping"),{renderer:s,layer:o,normFieldExpressionTemplate:a,isFeatureReduction:l}=t,f=[],u=[],m=p(s,b);for(const e of m)if("field"===e.type)f.push(x(o,e.field,l));else if("normalized-field"===e.type){const i=l?g(o,e.field):o.getField(e.field),t=l?g(o,e.normalizationField):o.getField(e.normalizationField),s=F({expression:`\n $feature["${i.name}"];\n $feature["${t.name}"];\n ${"percentage"===a?`($feature["${i.name}"] / $feature["${t.name}"]) * 100;`:`$feature["${i.name}"] / $feature["${t.name}"];`}\n `,title:n("percentage"===a?r.normFieldLabelAsPercent:r.normFieldLabel,{expression1:i.alias,expression2:t.alias}),returnType:"number"});f.push($(s),x(o,e.field,l),x(o,e.normalizationField,l)),u.push(s)}else if("expression"===e.type){const i=F(e);f.push($(i)),u.push(i)}return{fieldInfos:e(f,(e,i)=>e.fieldName===i.fieldName),expressionInfos:e(u,(e,i)=>e.expression===i.expression)}}async function w(e,t,o){const{fieldInfos:a,expressionInfos:l}=t,p=await i("esri/smartMapping/t9n/smartMapping");if(a.length>2)return[new r({fieldInfos:a})];const f=[];for(const i of a){const t=i.fieldName||"";let r=i.label;if(!r){const i=o?g(e,t):e.getField(t);if(i)r=i.alias||t;else if(l){const e=t.split(c)[1],i=l[l.findIndex(i=>i.name===e)];i&&(r=i.title||i.name)}}f.push(new s({text:n(p.fieldInfo,{fieldLabel:r,fieldValue:`{${t}}`})}))}return f}function V(e){return!(!("normalizationField"in e)||!e.normalizationField)||"hasVisualVariables"in e&&e.hasVisualVariables()&&e.visualVariables.some(e=>!(!("normalizationField"in e)||!e.normalizationField))}export{c as expressionFieldPrefix,w as getContentFromFieldInfos,F as getExpressionInfo,y as getFieldAndExpressionInfos,x as getFieldInfo,$ as getFieldInfoFromExpressionInfo,b as getPrimaryVisualVariables,V as hasNormalizedField,d as resetSuffixForTests};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Color.js";import"../../../intl.js";import
|
|
5
|
+
import e from"../../../Color.js";import{fetchMessageBundle as t,substitute as n}from"../../../intl.js";import o from"../../../core/Collection.js";import"../../../core/has.js";import i from"../../../core/Error.js";import{convertDateFormatToIntlOptions as r,formatDate as l}from"../../../intl/date.js";import{round as s}from"../../../renderers/support/numberUtils.js";import a from"../../../renderers/support/pointCloud/PointSizeSplatAlgorithm.js";import m from"../../heuristics/outline.js";import u from"../../statistics/classBreaks.js";import c from"../../statistics/summaryStatistics.js";import{getAgeExpressions as f}from"../../statistics/support/ageUtils.js";import{isAnyDateField as d,defaultStatisticTypes as p,getBasemapId as y,defaultBasemapGroups as w,getBasemapGroup as h}from"../../support/utils.js";import b from"../../../symbols/ExtrudeSymbol3DLayer.js";import g from"../../../symbols/FillSymbol3DLayer.js";import D from"../../../symbols/IconSymbol3DLayer.js";import j from"../../../symbols/LineSymbol3D.js";import S from"../../../symbols/LineSymbol3DLayer.js";import v from"../../../symbols/MeshSymbol3D.js";import x from"../../../symbols/ObjectSymbol3DLayer.js";import z from"../../../symbols/PathSymbol3DLayer.js";import T from"../../../symbols/PointSymbol3D.js";import U from"../../../symbols/PolygonSymbol3D.js";import L from"../../../symbols/SimpleFillSymbol.js";import V from"../../../symbols/SimpleLineSymbol.js";import k from"../../../symbols/SimpleMarkerSymbol.js";import F from"../../../symbols/edges/SketchEdges3D.js";import I from"../../../symbols/edges/SolidEdges3D.js";import{getTimeZoneFormattingOptions as M,shortTimeZoneName as C}from"../../../time/timeZoneUtils.js";import{getBackgroundColorTheme as Z}from"../../../views/support/colorUtils.js";const B=/^(\d+(\.\d+)?)\s*(%)$/i,E=new e([0,0,0,.4]),P=new Set(["hours","minutes","seconds"]),A=[...w.light,...w.dark];function R(e,t,n,o){if("string"==typeof e){const t=n.getField(e);if(t&&d(t))return t.alias||t.name}else if("number"==typeof e||e instanceof Date){const i=null!=t&&P.has(t),s=r(i?"short-date-short-time":"short-date");if(o&&i){const t=n.layer,{timeZone:i}=M("preferredTimeZone"in t?t.preferredTimeZone:null,"datesInUnknownTimezone"in t&&t.datesInUnknownTimezone,o.timeZone,s,"date");return l(e,{...s,timeZone:i,timeZoneName:C})}return l(e,s)}return e}function Y(e,t,n){return e+t>0&&0>e-t&&n<0?0:e}function N(e,t,n,o){const{avg:i,stddev:r,min:l,max:s}=e,a=W(e,!!n,o??!0);let m=a?a[0]:l,u=a?a[1]:s;return a?{minDataValue:m,maxDataValue:u,defaultValuesUsed:!0}:("above"===t?m=Y(i,r,l):"below"===t&&(u=Y(i,r,l)),{minDataValue:m,maxDataValue:u,defaultValuesUsed:!1})}function W(e,t,n){let o,i;const r=$({statistics:e,isDate:t});return r.defaultValuesUsed?(o=r.min,i=r.max):!n||null!=e.avg&&e.stddev||(o=e.min,i=e.max),null!=o&&null!=i?[o,i]:null}function $(e){let t,n,o=e&&e.statistics;if(o||(o={}),null==o.min)if(e.isDate){const e=q();t=e[0],n=e[1]}else t=0,n=100;else if(o.min===o.max)if(e.isDate){const e=q(o.min);t=e[0],n=e[1]}else o.min<0?(t=2*o.min,n=0):o.min>0?(t=0,n=2*o.min):(t=0,n=100);return{min:null!=t?t:o.min,max:null!=n?n:o.max,defaultValuesUsed:null!=t||null!=n}}function q(e){const t=("number"==typeof e?new Date(e):new Date).getUTCFullYear();let n=Date.UTC(t,0,1,12,0,0,0),o=Date.UTC(t,11,31,12,0,0,0);return"number"==typeof e&&(e<n&&(n=e),e>o&&(o=e)),[n,o]}function O({minDataValue:e,maxDataValue:t,defaultValuesUsed:n},o,i,r=!0){return n||"above"===i||"below"===i?H(e,t,5):J(o,r)}function _(e,t){const{avg:n,stddev:o}=e,i=e.min,r=e.max;if(null==n||null==o){const[n,o]=W(e,t,!0);return H(n,o,5)}const l=Y(n,o,i),a=r-l,m=l-i,u=Math.max(a,m);return s([l-u,l-u/2,l,u/2+l,l+u],{strictBounds:!0})}function G(e,t){const{min:n,max:o}=t,[i,r,l,a,m]=e,u=null!=n&&i<n,c=null!=o&&m>o;if(null==n||null==o||!u&&!c)return e;const f=u?n:i,d=c?o:m;return s([f,u?f+(l-f)/2:r,l,c?l+(d-l)/2:a,d],{strictBounds:!0})}function H(e,t,n){const o=(t-e)/(n-1),i=[e];for(let r=1;r<=n-2;r++)i.push(e+r*o);return i.push(t),s(i,{strictBounds:!0})}function J({min:e,max:t,avg:n,stddev:o},i=!0){if(null==e||null==t||null==n||null==o)return[];let r=n-o,l=n+o;r<e&&(r=e),l>t&&(l=t),i&&(n=r+(l-r)/2);let a=s([r,l],{strictBounds:!0});return r=a[0],l=a[1],a=[r,r+(n-r)/2,n,n+(l-n)/2,l],s(a,{strictBounds:!0})}function K(e,t,n){switch(t){case"point":case"multipoint":return n?"noDataSize"in e?e.noDataSize:null:"size"in e?e.size:null;case"polyline":return n?"noDataWidth"in e?e.noDataWidth:null:"width"in e?e.width:null;case"polygon":return"size"in e?e.size:null;default:return}}function Q(e,t,n){switch(t){case"point":case"multipoint":case"polygon":{if(!("outline"in e))return null;const t={color:e.outline.color,width:e.outline.width};if(null!=n&&t.color){const e=t.color.clone();e.a=n,t.color=e}return t}default:return}}function X(e,t){const{type:n,size:i,color:r,outline:l}=t;let s;switch(e){case"point":case"multipoint":if("2d"===n)s=new k({color:r,size:i,outline:{color:l.color,width:l.width}});else if("3d-flat"===n)s=new T({symbolLayers:new o([new D({size:i,resource:{primitive:"circle"},material:{color:r},outline:{color:l.color,size:l.width}})])});else if(n?.includes("3d-volumetric")){const e="3d-volumetric-uniform"===n,l=new x({height:i,resource:{primitive:e?"sphere":"cylinder"},material:{color:r}});e||(l.width=t.widthAndDepth,l.depth=t.widthAndDepth),s=new T({symbolLayers:new o([l])})}break;case"polyline":"2d"===n?s=new V({color:r,width:i}):"3d-flat"===n?s=new j({symbolLayers:new o([new S({size:i,material:{color:r}})])}):"3d-volumetric"===n&&(s=new j({symbolLayers:new o([new z({width:"number"==typeof i?i:parseFloat(i),height:"number"==typeof i?i:parseFloat(i),material:{color:r}})])}));break;case"polygon":"2d"===n?s=new L({color:r,outline:{color:l.color,width:l.width}}):"3d-flat"===n?s=new U({symbolLayers:new o([new g({material:{color:r},outline:{color:l.color,size:l.width}})])}):"3d-volumetric"===n&&(s=new U({symbolLayers:new o([new b({size:i,material:{color:r}})])}));break;case"mesh":{const e=t.meshInfo?.colorMixMode,n=t.meshInfo?.edgesType;s=new v({symbolLayers:new o([new g({material:{color:r,colorMixMode:e||null},edges:"solid"===n?new I({color:E}):"sketch"===n?new F({color:E}):null})])});break}}return s}function ee(e,t,n){const o=te({layer:e,fields:t});if(o.length)return new i(n,"Unknown fields: "+o.join(", ")+". You can only use fields defined in the layer schema");const r=ne({layer:e,fields:t});return r.length?new i(n,"Unsupported fields: "+r.join(", ")+". You can only use fields that are accessible to the renderer i.e. FieldUsageInfo.supportsRenderer must be true"):void 0}function te(e){const t=e.layer;return e.fields.filter(e=>!t.getField(e))}function ne(e){const t=e.layer;return e.fields.filter(e=>{const n=t.getFieldUsageInfo(e);return!n||!n.supportsRenderer})}async function oe(e,t){const n={layer:e.layer,view:e.view,filter:e.filter,signal:e.signal},[o,i]=await Promise.all([u(e).catch(ue),t?m(n).catch(ue):null]),r=W({min:o?.minValue,max:o?.maxValue,avg:null,stddev:null},!1,!1);return{result:r?await u({...e,classificationMethod:"equal-interval",numClasses:1,analyzeData:!1,minValue:r[0],maxValue:r[1],normalizationTotal:r[0]+r[1]}):o,defaultValuesUsed:!!r,outlineResult:i}}function ie(e){return c({outStatisticTypes:p,...e})}function re(e,t){let{minSize:n,maxSize:o}=e;if("height"===t){n=((o-n)/2+n)/(2*2.3),o*=2}return{minSize:n,maxSize:o}}function le(e){return B.test(e)}function se(e){if(null==e)return;const t=e.match(B),n=Number(t[1]);return"%"===t[3]?new a({scaleFactor:n/100}):void 0}function ae(e,t,n,o){e.startTime=t instanceof Date?t.getTime():t,e.endTime=n instanceof Date?n.getTime():n,e.units=o,e.field="string"==typeof t?t:"string"==typeof n?n:null}async function me(e,t){let n=null,o=null;if(!e&&!t)return{basemapId:n,basemapTheme:o};if(t&&(o=await Z(t),e||(e=t.map?.basemap)),e&&(n=y(e,A,!1),n&&!o)){const e=h(n);null!=e&&(o=e)}return!n&&o&&(n="dark"===o?"dark-gray":"gray"),{basemapId:n,basemapTheme:o}}function ue(e){const t=e.name?.toLowerCase();if(!t||t?.includes(":insufficient-info")||t?.includes(":insufficient-data"))return null;throw e}async function ce(e,o){const{layer:i,startTime:r,endTime:l,view:s}=e,a=f({layer:i,startTime:r,endTime:l,unit:o}).valueExpression,m=await t("esri/smartMapping/t9n/smartMapping");return{valueExpression:a,title:n(m[`ageInfo_${o}`],{unit:o,startTime:R(r,o,i,s),endTime:R(l,o,i,s)})}}export{G as clampAboveAndBelowStopValues,O as createDataValues,H as createDefaultStopValues,J as createStopValues,_ as createStopValuesForAboveBelow,X as createSymbol,ue as errorCallback,R as formatDate,Y as getBaseValueForAboveBelow,me as getBasemapInfo,oe as getClassBreaks,N as getDataRange,W as getDefaultDataRange,se as getPointSizeAlgorithm,re as getSizeRangeForAxis,ie as getSummaryStatistics,Q as getSymbolOutlineFromScheme,K as getSymbolSizeFromScheme,ce as getTitleAndExpressionForAgeRenderer,le as isValidPointSize,ae as updateAgeRendererAuthoringInfoVV,ee as verifyBasicFieldValidity};
|
package/support/BasemapStyle.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import
|
|
5
|
+
import{__decorate as o}from"tslib";import r from"../core/Accessor.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 e}from"../core/accessorSupport/decorators/subclass.js";import{getLocale as t}from"../intl/locale.js";import{normalizeMessageBundleLocale as l}from"../intl/messages.js";let p=class extends r{constructor(o){super(o),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2",this.worldview=null}get languageParameter(){const o=this.language;let r="local"===o||"global"===o?o:l(o??t())??"global";return r="no"===r?"nb":r,r}};o([s()],p.prototype,"apiKey",void 0),o([s()],p.prototype,"id",void 0),o([s()],p.prototype,"language",void 0),o([s()],p.prototype,"places",void 0),o([s()],p.prototype,"serviceUrl",void 0),o([s()],p.prototype,"worldview",void 0),p=o([e("esri.support.BasemapStyle")],p);const i=p;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{substitute as t}from"../../intl.js";import{loadCalciteComponents as i}from"../../widgets/support/componentsUtils.js";import{tsx as o}from"../../widgets/support/widget.js";const e=()=>i({action:()=>import("@esri/calcite-components/dist/components/calcite-action")});function n(t,i,e){const{title:n,textEnabled:c}=i,{type:r,active:s,uid:d,disabled:l,indicator:u}=t;return t.visible?o("calcite-action",{...i,active:"toggle"===r&&t.value,appearance:"solid","data-action-id":t.id,"data-action-uid":d,disabled:l,icon:a(t),indicator:u,loading:s,scale:"s",text:n??"",title:c?void 0:n},e):null}function a(t){return t.icon?t.icon:"image"in t&&t.image||t.className?void 0:"question"}function c(t){return t?{backgroundImage:`url(${t})`}:{}}function r({action:i,feature:o}){const e=o?.attributes,n="image"in i?i.image:void 0;return n&&e?t(n,e):n??""}export{a as getActionIcon,c as getActionStyles,e as loadActionUtilsComponents,n as renderAction,r as substituteActionImage};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20251014",d="01029bc694b76089ee5671cc3c221506fdd857d2";export{c as buildDate,d as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../Color.js";import has from"../../core/has.js";import{assertIsSome as e}from"../../core/maybe.js";import{pt2px as i,toPt as r}from"../../core/screenUtils.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{multiply as o,scale as s,identity as a,translate as l,rotate as h}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{getDashArray as c}from"./gfxUtils.js";import{nextBloomId as f,nextPatternId as u,nextLinearGradientId as d}from"./svgGlobalState.js";import"../../widgets/support/widgetUtils.js";import{tsx as y}from"../../widgets/support/jsxFactory.js";import"@arcgis/toolkit/dom";const p="http://www.w3.org/2000/svg",g=has("android"),m=has("chrome")||g&&g>=4?"auto":"optimizeLegibility",x={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},w=/([A-DF-Za-df-z])|([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let k={},b={};const j=Math.PI;function M(t,e){const i=t*(j/180);return Math.abs(e*Math.sin(i))+Math.abs(e*Math.cos(i))}function v(t){return t.map(t=>`${t.command} ${t.values.join(" ")}`).join(" ").trim()}function S(t,i,r,n,o){if(t){if("circle"===t.type)return y("circle",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",r:t.r,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-dashoffset":r.dashOffset,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("ellipse"===t.type)return y("ellipse",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",rx:t.rx,ry:t.ry,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("rect"===t.type)return y("rect",{fill:i,"fill-rule":"evenodd",height:t.height,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,width:t.width,x:t.x,y:t.y});if("image"===t.type)return y("image",{alt:o||"image",height:t.height,href:t.src,preserveAspectRatio:"none",width:t.width,x:t.x,y:t.y});if("path"===t.type){const e="string"!=typeof t.path?v(t.path):t.path;return y("path",{d:e,fill:i,"fill-rule":"evenodd",stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width})}if("text"===t.type)return e(n),y("text",{"dominant-baseline":n.dominantBaseline,fill:i,"fill-rule":"evenodd","font-family":n.font.family,"font-size":n.font.size,"font-style":n.font.style,"font-variant":n.font.variant,"font-weight":n.font.weight,kerning:n.kerning,rotate:n.rotate,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,"text-anchor":n.align,"text-decoration":n.decoration,"text-rendering":m,x:t.x,y:t.y},t.text)}return null}function $(e){if(!e)return{fill:"none",pattern:null,linearGradient:null};if(!("type"in e))return{fill:new t(e).toString(),pattern:null,linearGradient:null};if("pattern"===e.type){const t=`patternId-${u()}`;return{fill:`url(#${t})`,pattern:{id:t,x:e.x,y:e.y,width:e.width,height:e.height,image:{x:0,y:0,width:e.width,height:e.height,href:e.src}},linearGradient:null}}const i=`linearGradientId-${d()}`;return{fill:`url(#${i})`,pattern:null,linearGradient:{id:i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stops:e.colors.map(e=>({offset:e.offset,color:e.color&&new t(e.color).toString()}))}}}function A(e){const i={color:"none",width:1,cap:"butt",join:"4",dashArray:"none",dashOffset:"0"};return e&&(null!=e.width&&(i.width=e.width),e.cap&&(i.cap=e.cap),e.join&&(i.join=e.join.toString()),e.color&&(i.color=new t(e.color).toString()),e.dashArray&&(i.dashArray=e.dashArray),e.dashoffset&&(i.dashOffset=e.dashoffset),e.style&&!e.dashArray&&(i.dashArray=c(e).join(",")||"none")),i}function G(t,i){const r={align:null,decoration:null,kerning:null,rotate:null,font:{style:null,variant:null,weight:null,size:null,family:null}};if(t){const n=t.alignBaseline,o="baseline"===n?"auto":"top"===n?"text-top":"bottom"===n?"hanging":n;r.align=t.align,r.dominantBaseline=o,r.decoration=t.decoration,r.kerning=t.kerning?"auto":"0",r.rotate=t.rotated?"90":"0",e(i),r.font.style=i.style||"normal",r.font.variant=i.variant||"normal",r.font.weight=i.weight||"normal",r.font.size=i.size&&i.size.toString()||"10pt",r.font.family=i.family||"serif"}return r}function N(t){const{pattern:e,linearGradient:i}=t;if(e)return y("pattern",{height:e.height,id:e.id,patternUnits:"userSpaceOnUse",width:e.width,x:e.x,y:e.y},y("image",{height:e.image.height,href:e.image.href,width:e.image.width,x:e.image.x,y:e.image.y}));if(i){const t=i.stops.map((t,e)=>y("stop",{key:`${e}-stop`,offset:t.offset,"stop-color":t.color}));return y("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2},t)}return null}function z(t,e){if(!t||0===t.length)return null;const i=[];for(const r of t){const{shape:t,fill:e,stroke:n,font:o}=r,s=$(e),a=A(n),l="text"===t.type?G(t,o):null,h=S(t,s.fill,a,l);h&&i.push(h)}return y("mask",{id:e,maskUnits:"userSpaceOnUse"},y("g",null,i))}function B(t,e,i){return l(t,a(t),[e,i])}function I(t,e,i,r,n){return s(t,a(t),[e,i]),t[4]=t[4]*e-r*e+r,t[5]=t[5]*i-n*i+n,t}function U(t,e,i,r){const n=e%360*Math.PI/180;h(t,a(t),n);const o=Math.cos(n),s=Math.sin(n),l=t[4],c=t[5];return t[4]=l*o-c*s+r*s-i*o+i,t[5]=c*o+l*s-i*s-r*o+r,t}function F(t,e){k&&"left"in k?(null!=k.left&&k.left>t&&(k.left=t),(null==k.right||k.right<t)&&(k.right=t),(null==k.top||k.top>e)&&(k.top=e),(null==k.bottom||k.bottom<e)&&(k.bottom=e)):k={left:t,bottom:e,right:t,top:e}}function E(t){const e=t.args,i=e.length;let r;switch(t.action){case"M":case"L":case"C":case"S":case"Q":case"T":for(r=0;r<i;r+=2)F(e[r],e[r+1]);b.x=e[i-2],b.y=e[i-1];break;case"H":for(r=0;r<i;++r)F(e[r],b.y);b.x=e[i-1];break;case"V":for(r=0;r<i;++r)F(b.x,e[r]);b.y=e[i-1];break;case"m":{let t=0;"x"in b||(F(b.x=e[0],b.y=e[1]),t=2);for(r=t;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break}case"l":case"t":for(r=0;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break;case"h":for(r=0;r<i;++r)F(b.x+=e[r],b.y);break;case"v":for(r=0;r<i;++r)F(b.x,b.y+=e[r]);break;case"c":for(r=0;r<i;r+=6)F(b.x+e[r],b.y+e[r+1]),F(b.x+e[r+2],b.y+e[r+3]),F(b.x+=e[r+4],b.y+=e[r+5]);break;case"s":case"q":for(r=0;r<i;r+=4)F(b.x+e[r],b.y+e[r+1]),F(b.x+=e[r+2],b.y+=e[r+3]);break;case"A":for(r=0;r<i;r+=7)F(e[r+5],e[r+6]);b.x=e[i-2],b.y=e[i-1];break;case"a":for(r=0;r<i;r+=7)F(b.x+=e[r+5],b.y+=e[r+6])}}function O(t,e,i){const r=x[t.toLowerCase()];let n;"number"==typeof r&&(r?e.length>=r&&(n={action:t,args:e.slice(0,e.length-e.length%r)},i.push(n),E(n)):(n={action:t,args:[]},i.push(n),E(n)))}function T(t){const e=("string"!=typeof t.path?v(t.path):t.path).match(w),i=[];if(k={},b={},!e)return null;let r="",n=[];const o=e.length;for(let a=0;a<o;++a){const t=e[a],o=parseFloat(t);isNaN(o)?(r&&O(r,n,i),n=[],r=t):n.push(o)}O(r,n,i);const s={x:0,y:0,width:0,height:0};return k&&"left"in k&&(s.x=k.left,s.y=k.top,s.width=k.right-k.left,s.height=k.bottom-k.top),s}function L(t){const e={x:0,y:0,width:0,height:0};if("circle"===t.type)e.x=t.cx-t.r,e.y=t.cy-t.r,e.width=2*t.r,e.height=2*t.r;else if("ellipse"===t.type)e.x=t.cx-t.rx,e.y=t.cy-t.ry,e.width=2*t.rx,e.height=2*t.ry;else if("image"===t.type||"rect"===t.type)e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height;else if("path"===t.type){const i=T(t);e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height}return e}function R(t){const e={x:0,y:0,width:0,height:0};let i=null,r=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const o of t)i?(i.x=Math.min(i.x,o.x),i.y=Math.min(i.y,o.y),r=Math.max(r,o.x+o.width),n=Math.max(n,o.y+o.height)):(i=e,i.x=o.x,i.y=o.y,r=o.x+o.width,n=o.y+o.height);return i&&(i.width=r-i.x,i.height=n-i.y),i}function C(t,e,i,r,s,a,l,h,c){let f=(l&&a?M(a,e):e)/2,u=(l&&a?M(a,i):i)/2;if(c){const t=c[0],e=c[1];f=(l&&a?M(a,t):t)/2,u=(l&&a?M(a,e):e)/2}const d=t.width+r,y=t.height+r,p=n(),g=n();let m=!1;if(s&&0!==d&&0!==y){const t=e!==i?e/i:d/y,r=e>i?e:i;let n=1,s=1;isNaN(r)||(t>1?(n=r/d,s=r/t/y):(s=r/y,n=r*t/d)),o(g,g,I(p,n,s,f,u)),m=!0}const x=t.x+(d-r)/2,w=t.y+(y-r)/2;if(o(g,g,B(p,f-x,u-w)),!m&&(d>e||y>i)){const t=d/e>y/i,r=(t?e:i)/(t?d:y);o(g,g,I(p,r,r,x,w))}return h&&o(g,g,B(p,h[0],h[1])),a&&o(g,g,U(p,a,x,w)),`matrix(${g[0]},${g[1]},${g[2]},${g[3]},${g[4]},${g[5]})`}function D(t){const e=t?.match(/bloom\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s*\)/i);if(!e)return null;const[,n,o,s]=e;return{strength:Number(n),radius:i(r(o)),threshold:Number(s)}}function V(t,e,i){const r=D(t);if(!r)return null;const{strength:n,radius:o}=r,s=n>0?o:0,a=(n+s)*e,l=4*n+1;return y("filter",{filterUnits:"userSpaceOnUse",height:"300%",id:`bloom${i}`,width:"300%",x:"-100%",y:"-100%"},y("feMorphology",{in:"SourceGraphic",operator:"dilate",radius:(n+.5*s)*(5**(e/100)*(.4+e/100)),result:"dilate"}),y("feGaussianBlur",{in:"dilate",result:"blur",stdDeviation:a/25}),y("feGaussianBlur",{in:"blur",result:"intensityBlur",stdDeviation:a/50}),y("feComponentTransfer",{in:"SourceGraphic",result:"intensityBrightness"},y("feFuncR",{slope:l,type:"linear"}),y("feFuncG",{slope:l,type:"linear"}),y("feFuncB",{slope:l,type:"linear"})),y("feMerge",null,y("feMergeNode",{in:"intensityBlur"}),y("feMergeNode",{in:"intensityBrightness"}),y("feGaussianBlur",{stdDeviation:n/10})))}function q(t,i,r,n={}){const o=[],s=[],a=f(),l=V(n.cssEffectFilter,i,a);let h=null;if(l){const t=D(n.cssEffectFilter),e=n.clipBloomEffect||!t?.strength?0:(t.strength+t.radius/2)/3,o=i+i*e,s=r+r*e;h=[Math.max(o,10),Math.max(s,10)]}let c=i,u=r;if(n.useRotationSize)for(let e=0;e<t.length;e++){const t=n.rotations?.[e]??0;c=Math.max(M(t,i),c),u=Math.max(M(t,r),u)}for(let e=0;e<t.length;e++){const a=t[e],l=[],f=[];let d=0,p=0,g=0;for(const t of a){const{shape:e,fill:i,stroke:r,font:s,offset:a}=t;n.ignoreStrokeWidth||"text"===e.type||(d+=r?.width||0);const h=$(i),c=A(r),u="text"===e.type?G(e,s):null;o.push(N(h)),l.push(S(e,h.fill,c,u,n.ariaLabel)),f.push(L(e)),a&&(p+=a[0],g+=a[1])}const m=n.rotations?.[e]??0;n.useRotationSize&&(p+=(c-M(m,i))/2,g+=(u-M(m,r))/2);const x=C(R(f),i,r,d,n.scale??!1,m,n.useRotationSize??!1,[p,g],h);let w=null;if(n.masking){const t=`mask-${e}`,i=n.masking[e];o.push(z(i,t)),w=`url(#${t})`}s.push(w?y("g",{mask:w},y("g",{transform:x},l)):y("g",{transform:x},l))}l&&(e(h),c=h[0],u=h[1]);const d="display: block;";return y("svg",{"aria-label":n.ariaLabel,focusable:!1,height:u,role:"img",style:d,width:c,xmlns:p},l,y("defs",null,o),l?y("g",{filter:`url(#bloom${a})`},s):s)}export{R as computeBBox,$ as generateFillAttributes,A as generateStrokeAttributes,G as generateTextAttributes,L as getBoundingBox,C as getTransformMatrix,N as renderDef,q as renderSVG,S as renderShape};
|
|
5
|
+
import t from"../../Color.js";import has from"../../core/has.js";import{assertIsSome as e}from"../../core/maybe.js";import{pt2px as i,toPt as r}from"../../core/screenUtils.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{multiply as o,scale as s,identity as a,translate as l,rotate as h}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{getDashArray as f}from"./gfxUtils.js";import{nextBloomId as c,nextPatternId as u,nextLinearGradientId as d}from"./svgGlobalState.js";import{tsx as y}from"../../widgets/support/widget.js";const p="http://www.w3.org/2000/svg",g=has("android"),m=has("chrome")||g&&g>=4?"auto":"optimizeLegibility",x={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},w=/([A-DF-Za-df-z])|([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let k={},b={};const j=Math.PI;function M(t,e){const i=t*(j/180);return Math.abs(e*Math.sin(i))+Math.abs(e*Math.cos(i))}function v(t){return t.map(t=>`${t.command} ${t.values.join(" ")}`).join(" ").trim()}function S(t,i,r,n,o){if(t){if("circle"===t.type)return y("circle",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",r:t.r,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-dashoffset":r.dashOffset,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("ellipse"===t.type)return y("ellipse",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",rx:t.rx,ry:t.ry,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("rect"===t.type)return y("rect",{fill:i,"fill-rule":"evenodd",height:t.height,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,width:t.width,x:t.x,y:t.y});if("image"===t.type)return y("image",{alt:o||"image",height:t.height,href:t.src,preserveAspectRatio:"none",width:t.width,x:t.x,y:t.y});if("path"===t.type){const e="string"!=typeof t.path?v(t.path):t.path;return y("path",{d:e,fill:i,"fill-rule":"evenodd",stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width})}if("text"===t.type)return e(n),y("text",{"dominant-baseline":n.dominantBaseline,fill:i,"fill-rule":"evenodd","font-family":n.font.family,"font-size":n.font.size,"font-style":n.font.style,"font-variant":n.font.variant,"font-weight":n.font.weight,kerning:n.kerning,rotate:n.rotate,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,"text-anchor":n.align,"text-decoration":n.decoration,"text-rendering":m,x:t.x,y:t.y},t.text)}return null}function $(e){if(!e)return{fill:"none",pattern:null,linearGradient:null};if(!("type"in e))return{fill:new t(e).toString(),pattern:null,linearGradient:null};if("pattern"===e.type){const t=`patternId-${u()}`;return{fill:`url(#${t})`,pattern:{id:t,x:e.x,y:e.y,width:e.width,height:e.height,image:{x:0,y:0,width:e.width,height:e.height,href:e.src}},linearGradient:null}}const i=`linearGradientId-${d()}`;return{fill:`url(#${i})`,pattern:null,linearGradient:{id:i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stops:e.colors.map(e=>({offset:e.offset,color:e.color&&new t(e.color).toString()}))}}}function A(e){const i={color:"none",width:1,cap:"butt",join:"4",dashArray:"none",dashOffset:"0"};return e&&(null!=e.width&&(i.width=e.width),e.cap&&(i.cap=e.cap),e.join&&(i.join=e.join.toString()),e.color&&(i.color=new t(e.color).toString()),e.dashArray&&(i.dashArray=e.dashArray),e.dashoffset&&(i.dashOffset=e.dashoffset),e.style&&!e.dashArray&&(i.dashArray=f(e).join(",")||"none")),i}function G(t,i){const r={align:null,decoration:null,kerning:null,rotate:null,font:{style:null,variant:null,weight:null,size:null,family:null}};if(t){const n=t.alignBaseline,o="baseline"===n?"auto":"top"===n?"text-top":"bottom"===n?"hanging":n;r.align=t.align,r.dominantBaseline=o,r.decoration=t.decoration,r.kerning=t.kerning?"auto":"0",r.rotate=t.rotated?"90":"0",e(i),r.font.style=i.style||"normal",r.font.variant=i.variant||"normal",r.font.weight=i.weight||"normal",r.font.size=i.size&&i.size.toString()||"10pt",r.font.family=i.family||"serif"}return r}function N(t){const{pattern:e,linearGradient:i}=t;if(e)return y("pattern",{height:e.height,id:e.id,patternUnits:"userSpaceOnUse",width:e.width,x:e.x,y:e.y},y("image",{height:e.image.height,href:e.image.href,width:e.image.width,x:e.image.x,y:e.image.y}));if(i){const t=i.stops.map((t,e)=>y("stop",{key:`${e}-stop`,offset:t.offset,"stop-color":t.color}));return y("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2},t)}return null}function z(t,e){if(!t||0===t.length)return null;const i=[];for(const r of t){const{shape:t,fill:e,stroke:n,font:o}=r,s=$(e),a=A(n),l="text"===t.type?G(t,o):null,h=S(t,s.fill,a,l);h&&i.push(h)}return y("mask",{id:e,maskUnits:"userSpaceOnUse"},y("g",null,i))}function B(t,e,i){return l(t,a(t),[e,i])}function I(t,e,i,r,n){return s(t,a(t),[e,i]),t[4]=t[4]*e-r*e+r,t[5]=t[5]*i-n*i+n,t}function U(t,e,i,r){const n=e%360*Math.PI/180;h(t,a(t),n);const o=Math.cos(n),s=Math.sin(n),l=t[4],f=t[5];return t[4]=l*o-f*s+r*s-i*o+i,t[5]=f*o+l*s-i*s-r*o+r,t}function F(t,e){k&&"left"in k?(null!=k.left&&k.left>t&&(k.left=t),(null==k.right||k.right<t)&&(k.right=t),(null==k.top||k.top>e)&&(k.top=e),(null==k.bottom||k.bottom<e)&&(k.bottom=e)):k={left:t,bottom:e,right:t,top:e}}function E(t){const e=t.args,i=e.length;let r;switch(t.action){case"M":case"L":case"C":case"S":case"Q":case"T":for(r=0;r<i;r+=2)F(e[r],e[r+1]);b.x=e[i-2],b.y=e[i-1];break;case"H":for(r=0;r<i;++r)F(e[r],b.y);b.x=e[i-1];break;case"V":for(r=0;r<i;++r)F(b.x,e[r]);b.y=e[i-1];break;case"m":{let t=0;"x"in b||(F(b.x=e[0],b.y=e[1]),t=2);for(r=t;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break}case"l":case"t":for(r=0;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break;case"h":for(r=0;r<i;++r)F(b.x+=e[r],b.y);break;case"v":for(r=0;r<i;++r)F(b.x,b.y+=e[r]);break;case"c":for(r=0;r<i;r+=6)F(b.x+e[r],b.y+e[r+1]),F(b.x+e[r+2],b.y+e[r+3]),F(b.x+=e[r+4],b.y+=e[r+5]);break;case"s":case"q":for(r=0;r<i;r+=4)F(b.x+e[r],b.y+e[r+1]),F(b.x+=e[r+2],b.y+=e[r+3]);break;case"A":for(r=0;r<i;r+=7)F(e[r+5],e[r+6]);b.x=e[i-2],b.y=e[i-1];break;case"a":for(r=0;r<i;r+=7)F(b.x+=e[r+5],b.y+=e[r+6])}}function O(t,e,i){const r=x[t.toLowerCase()];let n;"number"==typeof r&&(r?e.length>=r&&(n={action:t,args:e.slice(0,e.length-e.length%r)},i.push(n),E(n)):(n={action:t,args:[]},i.push(n),E(n)))}function T(t){const e=("string"!=typeof t.path?v(t.path):t.path).match(w),i=[];if(k={},b={},!e)return null;let r="",n=[];const o=e.length;for(let a=0;a<o;++a){const t=e[a],o=parseFloat(t);isNaN(o)?(r&&O(r,n,i),n=[],r=t):n.push(o)}O(r,n,i);const s={x:0,y:0,width:0,height:0};return k&&"left"in k&&(s.x=k.left,s.y=k.top,s.width=k.right-k.left,s.height=k.bottom-k.top),s}function L(t){const e={x:0,y:0,width:0,height:0};if("circle"===t.type)e.x=t.cx-t.r,e.y=t.cy-t.r,e.width=2*t.r,e.height=2*t.r;else if("ellipse"===t.type)e.x=t.cx-t.rx,e.y=t.cy-t.ry,e.width=2*t.rx,e.height=2*t.ry;else if("image"===t.type||"rect"===t.type)e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height;else if("path"===t.type){const i=T(t);e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height}return e}function R(t){const e={x:0,y:0,width:0,height:0};let i=null,r=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const o of t)i?(i.x=Math.min(i.x,o.x),i.y=Math.min(i.y,o.y),r=Math.max(r,o.x+o.width),n=Math.max(n,o.y+o.height)):(i=e,i.x=o.x,i.y=o.y,r=o.x+o.width,n=o.y+o.height);return i&&(i.width=r-i.x,i.height=n-i.y),i}function C(t,e,i,r,s,a,l,h,f){let c=(l&&a?M(a,e):e)/2,u=(l&&a?M(a,i):i)/2;if(f){const t=f[0],e=f[1];c=(l&&a?M(a,t):t)/2,u=(l&&a?M(a,e):e)/2}const d=t.width+r,y=t.height+r,p=n(),g=n();let m=!1;if(s&&0!==d&&0!==y){const t=e!==i?e/i:d/y,r=e>i?e:i;let n=1,s=1;isNaN(r)||(t>1?(n=r/d,s=r/t/y):(s=r/y,n=r*t/d)),o(g,g,I(p,n,s,c,u)),m=!0}const x=t.x+(d-r)/2,w=t.y+(y-r)/2;if(o(g,g,B(p,c-x,u-w)),!m&&(d>e||y>i)){const t=d/e>y/i,r=(t?e:i)/(t?d:y);o(g,g,I(p,r,r,x,w))}return h&&o(g,g,B(p,h[0],h[1])),a&&o(g,g,U(p,a,x,w)),`matrix(${g[0]},${g[1]},${g[2]},${g[3]},${g[4]},${g[5]})`}function D(t){const e=t?.match(/bloom\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s*\)/i);if(!e)return null;const[,n,o,s]=e;return{strength:Number(n),radius:i(r(o)),threshold:Number(s)}}function V(t,e,i){const r=D(t);if(!r)return null;const{strength:n,radius:o}=r,s=n>0?o:0,a=(n+s)*e,l=4*n+1;return y("filter",{filterUnits:"userSpaceOnUse",height:"300%",id:`bloom${i}`,width:"300%",x:"-100%",y:"-100%"},y("feMorphology",{in:"SourceGraphic",operator:"dilate",radius:(n+.5*s)*(5**(e/100)*(.4+e/100)),result:"dilate"}),y("feGaussianBlur",{in:"dilate",result:"blur",stdDeviation:a/25}),y("feGaussianBlur",{in:"blur",result:"intensityBlur",stdDeviation:a/50}),y("feComponentTransfer",{in:"SourceGraphic",result:"intensityBrightness"},y("feFuncR",{slope:l,type:"linear"}),y("feFuncG",{slope:l,type:"linear"}),y("feFuncB",{slope:l,type:"linear"})),y("feMerge",null,y("feMergeNode",{in:"intensityBlur"}),y("feMergeNode",{in:"intensityBrightness"}),y("feGaussianBlur",{stdDeviation:n/10})))}function q(t,i,r,n={}){const o=[],s=[],a=c(),l=V(n.cssEffectFilter,i,a);let h=null;if(l){const t=D(n.cssEffectFilter),e=n.clipBloomEffect||!t?.strength?0:(t.strength+t.radius/2)/3,o=i+i*e,s=r+r*e;h=[Math.max(o,10),Math.max(s,10)]}let f=i,u=r;if(n.useRotationSize)for(let e=0;e<t.length;e++){const t=n.rotations?.[e]??0;f=Math.max(M(t,i),f),u=Math.max(M(t,r),u)}for(let e=0;e<t.length;e++){const a=t[e],l=[],c=[];let d=0,p=0,g=0;for(const t of a){const{shape:e,fill:i,stroke:r,font:s,offset:a}=t;n.ignoreStrokeWidth||"text"===e.type||(d+=r?.width||0);const h=$(i),f=A(r),u="text"===e.type?G(e,s):null;o.push(N(h)),l.push(S(e,h.fill,f,u,n.ariaLabel)),c.push(L(e)),a&&(p+=a[0],g+=a[1])}const m=n.rotations?.[e]??0;n.useRotationSize&&(p+=(f-M(m,i))/2,g+=(u-M(m,r))/2);const x=C(R(c),i,r,d,n.scale??!1,m,n.useRotationSize??!1,[p,g],h);let w=null;if(n.masking){const t=`mask-${e}`,i=n.masking[e];o.push(z(i,t)),w=`url(#${t})`}s.push(w?y("g",{mask:w},y("g",{transform:x},l)):y("g",{transform:x},l))}l&&(e(h),f=h[0],u=h[1]);const d="display: block;";return y("svg",{"aria-label":n.ariaLabel,focusable:!1,height:u,role:"img",style:d,width:f,xmlns:p},l,y("defs",null,o),l?y("g",{filter:`url(#bloom${a})`},s):s)}export{R as computeBBox,$ as generateFillAttributes,A as generateStrokeAttributes,G as generateTextAttributes,L as getBoundingBox,C as getTransformMatrix,N as renderDef,q as renderSVG,S as renderShape};
|
package/tables/elements.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deprecatedModule as e}from"../core/deprecate.js";import t from"../core/Logger.js";
|
|
5
|
+
import{deprecatedModule as e}from"../core/deprecate.js";import t from"../core/Logger.js";import r from"./elements/AttributeTableAttachmentElement.js";import m from"./elements/AttributeTableFieldElement.js";import o from"./elements/AttributeTableGroupElement.js";import l from"./elements/AttributeTableRelationshipElement.js";const s=m,i=o,n=l,a=r;e(t.getLogger("esri.tables.elements"),"esri.tables.elements",{replacement:"Individual element module imports",version:"4.34",warnOnce:!0});export{a as AttributeTableAttachmentElement,s as AttributeTableFieldElement,i as AttributeTableGroupElement,n as AttributeTableRelationshipElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import i from"../../../../core/ReactiveMap.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import s from"../../../../core/CircularArray.js";import{EventEmitter as r}from"../../../../core/Evented.js";import i from"../../../../core/Logger.js";import o from"../../../../core/ReactiveMap.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";const l=10;let u=class extends e{constructor(){super(...arguments),this.events=new r,this._updatingStrategy=!0,this._tileToEvent=new o,this._fetchStatus={outstanding:0,done:0},this._pipelineStatistics={type:"performance",usedMemory:0}}get hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}get pipelineStatistics(){return this._pipelineStatistics}get willQueryAllFeatures(){return this._strategyInfo?.willQueryAllFeatures??!1}get willQueryFullResolutionGeometry(){return this._strategyInfo?.willQueryAllFeatures??!1}onEvent(t){switch(t.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(t);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=t.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",t);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),t.done&&(this._fetchStatus={done:0,outstanding:0});break;case"performance":this._pipelineStatistics=t}}_hasAllTileData(){for(const t of this._tileToEvent.values()){const e=t.peekLast();if("loaded"!==e?.type)return!1}return!0}_handleTileEvent(t){switch(t.type){case"subscribe":{const e=new s(l);e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"unsubscribe":this._tileToEvent.delete(t.tile);break;case"loaded":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e);break}case"error":{const e=this._tileToEvent.get(t.tile);if(!e)return;e.enqueue(t),this._tileToEvent.set(t.tile,e),this.events.emit("error",t),i.getLogger(this).error(`Failed to load tile ${t.tile}.`,{error:t.error});break}}}};t([a({readOnly:!0})],u.prototype,"hasAllData",null),t([a()],u.prototype,"pipelineStatistics",null),t([a()],u.prototype,"willQueryAllFeatures",null),t([a()],u.prototype,"willQueryFullResolutionGeometry",null),t([a()],u.prototype,"_updatingStrategy",void 0),t([a()],u.prototype,"_strategyInfo",void 0),t([a()],u.prototype,"_tileToEvent",void 0),t([a()],u.prototype,"_pipelineStatistics",void 0),u=t([n("esri.views.2d.layers.features.FeatureSourceEventLog")],u);export{u as FeatureSourceEventLog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
5
|
+
import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as g}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as T}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as S}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let G;const C=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new _}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new g(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new _,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new g(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new _;return new g(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new g(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{G={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){C().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,S(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new T(e.subscription,a,!1,!1,{});for(const t of o)yield new T(e.subscription,t,!1,!1,{});yield new T(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return b({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return b({paths:s.paths},!1,!1)}return b({paths:[t]},!1,!1)}const s=G.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=G.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=G.toGeometry(t,r);if(null!=e&&"paths"in e)return b({paths:e.paths},!1,!1)}}return b({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{r as t}from"../../../../chunks/rbush.js";import{create as s,intersects as o,copy as i}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as r}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as m}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as l}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as a,hittestToleranceMobile as
|
|
5
|
+
import has from"../../../../core/has.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{r as t}from"../../../../chunks/rbush.js";import{create as s,intersects as o,copy as i}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as r}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as m}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as l}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as a,hittestToleranceMobile as c,hittestToleranceDesktop as u}from"../../engine/webgl/definitions.js";import{GraphicStoreItem as h}from"./GraphicStoreItem.js";import{pixelBuffer as d}from"./graphicsUtils.js";import{GraphicUpdateMessage as f}from"./GraphicUpdateMessage.js";const p=1e-5;function _(e,t){return t.zOrder-e.zOrder}class y{constructor(e,t,s,o,i){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new m(t),this._tileInfoView=s,this._store=i;const r=s.getClosestInfoForScale(o);this._resolution=this._tileInfoView.getTileResolution(r.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const o=[],i=[],r=[],n=new Set,m=[];let l=0;const a=new Set;for(const c of e.items){const e=c.uid;if(a.has(e))continue;a.add(e),l++;const r=this._items.get(e),u=t(c);if(n.add(e),r){const e=r.update(c,u,l),t=r.updateDensificationResolution(this._resolution);e&&m.push(this._updateItem(r,s)),(e||t)&&i.push(r);continue}const d=this._store.createDisplayIdForObjectId(e),f=h.fromGraphic(c,u,l,d);f.updateDensificationResolution(this._resolution),m.push(this._updateItem(f,s)),this._items.set(f.objectId,f),o.push(f)}for(const[c,u]of this._items.entries())n.has(c)||(this._store.releaseDisplayIdForObjectId(c),this._items.delete(c),r.push(u));return await Promise.all(m),this._index=null,new f(o,i,r)}updateLevel(e){if(this._resolution===e)return!1;this._index=null,this._boundsDirty=!0,this._resolution=e;for(const t of this.items())if(t.hasCurvedGeoemtry)return!0;return!1}hitTest(e,t,i,n,m){const l=has("esri-mobile"),h=l?c:u,f=h+(l?0:a);e=r(e,this._tileInfoView.spatialReference);const p=n*window.devicePixelRatio*f,y=s();y[0]=e-p,y[1]=t-p,y[2]=e+p,y[3]=t+p;const b=n*window.devicePixelRatio*h,I=s();I[0]=e-b,I[1]=t-b,I[2]=e+b,I[3]=t+b;const g=.5*n*(f+d),w=this._searchIndex(e-g,t-g,e+g,t+g);if(!w||0===w.length)return[];const x=[],j=s(),S=s();for(const s of w){if(!s.visible)continue;const{geometryBounds:e,symbolResource:t}=s;this._getSymbolBounds(j,t,e,S,m),S[3]=S[2]=S[1]=S[0]=0,o(j,y)&&x.push(s)}if(0===x.length)return[];const R=this._hittestDrawHelper,B=[];for(const s of x){const{projectedGeometry:e,symbolResource:t}=s;if(!t)continue;const{textInfo:o,symbolInfo:i}=t,r=i.cimSymbol;R.hitTest(I,r.symbol,e,o,m,n)&&B.push(s)}return B.sort(_),B.map(e=>e.objectId)}queryItems(e){return 0===this._items.size?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.symbolBounds,e.symbolResource,e.geometryBounds,e.size,0)}_searchIndex(e,s,o,i){return this._boundsDirty&&(this._items.forEach(e=>this._getSymbolBounds(e.symbolBounds,e.symbolResource,e.geometryBounds,e.size,0)),this._boundsDirty=!1),this._index||(this._index=t(9,e=>({minX:e.symbolBounds[0],minY:e.symbolBounds[1],maxX:e.symbolBounds[2],maxY:e.symbolBounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:s,maxX:o,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,o=e.bounds,i=n(t);if(i&&t.isWrappable){const[t,r]=i.valid,n=Math.abs(o[2]-r)<p,m=Math.abs(o[0]-t)<p;if((!n||!m)&&(n||m)){const i=e.resolution;let m;m=s(n?[t,o[1],t+i*d,o[3]]:[r-i*d,o[1],r,o[3]]);const l=this._searchIndex(o[0],o[1],o[2],o[3]),a=this._searchIndex(m[0],m[1],m[2],m[3]);return[...new Set([...l,...a])]}}return this._searchIndex(o[0],o[1],o[2],o[3])}_getSymbolBounds(t,o,r,n,m){if(!o||!o.symbolInfo.linearCIM)return null;if(t||(t=s()),i(t,r),!n||0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]){const{textInfo:t,symbolInfo:s}=o,i=s.cimSymbol;n||(n=[0,0,0,0]);const r=l.getSymbolInflateSize(n,i.symbol,this._cimResourceManager,m,t);n[0]=e(r[0]),n[1]=e(r[1]),n[2]=e(r[2]),n[3]=e(r[3])}const a=this._resolution,c=l.safeSize(n);return t[0]-=c*a,t[1]-=c*a,t[2]+=c*a,t[3]+=c*a,t}}export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../../../intl.js";import t from"../../../../../core/Accessor.js";import{unitRGBAFromColor as i,multiplyOpacityToUnitRGBA as s,getContrast as r,multiplyOpacity as n}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTen as a}from"../../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{formatDecimal as l}from"../../../../../core/quantityFormatUtils.js";import{watch as h,syncAndInitial as m,initial as c}from"../../../../../core/reactiveUtils.js";import{lengthUnitFromSpatialReference as p,convertUnit as d,adaptiveAreaUnit as u}from"../../../../../core/unitUtils.js";import{property as g}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as _}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromTranslation as v}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{e as b}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{toPreferredAreaUnit as w,preferredLengthUnit as S}from"./utils.js";import{LabelVisualElement as y}from"../../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as j}from"../../../interactive/visualElements/LineVisualElement.js";import{MeasurementAreaVisualElement as C}from"../../../interactive/visualElements/MeasurementAreaVisualElement.js";import{GeodesicSegment as D,EuclideanSegment as V}from"../../../interactive/visualElements/support/Segment.js";import{midpoint3d as A}from"../../../support/mathUtils.js";import{createStipplePatternSimple as M}from"../../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as x}from"../../../../../intl/locale.js";import{fetchMessageBundle as P}from"../../../../../intl/messages.js";let R=class extends t{get _parameters(){const{accentColor:e,textColor:t}=this.view.effectiveTheme,a=i(e),o=s(e,.5),l=s(r(e),.5),h=r(t,160);return{accentColor:a,transparentAccentColor:o,transparentContrastColor:l,intersectingLineColor:[1,.2,0,1],textColor:t,textBackgroundColor:n(h,.6),textCalloutColor:n(h,.5),pathLineWidth:3,perimeterLineWidth:2,projectionLineWidth:2,projectionLineStippleSize:5,labelDistance:25}}get visible(){return this.analysisViewData.visible}get _renderUnits(){const e=this.view.renderCoordsHelper.spatialReference;return p(e)??"meters"}get testData(){}constructor(e){super(e),this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._origin=f(),this._originTransform=L(),this.messages=null,this.viewData=I,this.areaLabel=null,this.perimeterLengthLabel=null,this.loadingMessages=!0}initialize(){const{analysisViewData:e,_parameters:t,view:i}=this;this._path=new j({view:i,attached:!0,width:t.pathLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._intersectedPath=new j({view:i,attached:!0,width:t.pathLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._perimeter=new j({view:i,attached:!0,width:t.perimeterLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._intersectedPerimeter=new j({view:i,attached:!0,width:t.perimeterLineWidth,color:t.intersectingLineColor,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._projectionLines=new j({view:i,attached:!0,width:t.projectionLineWidth,stipplePattern:M(t.projectionLineStippleSize),polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._measurementArea=new C({view:i,attached:!0,isDecoration:!0});const s={attached:!0,view:i,isDecoration:!0};this._areaLabel=new y({...s,fontSize:16}),this._perimeterLengthLabel=new y({...s,fontSize:12}),this.addHandles([h(()=>[e.mode,this.visible,e.unit,e.measurementData,e.stagedPoint],()=>this._update(),m),h(()=>i.state?.camera,()=>this._updateLabels(),m),x(()=>this._updateMessageBundle()),h(()=>this._parameters,({accentColor:e,transparentAccentColor:t,transparentContrastColor:i,textColor:s,textBackgroundColor:r,textCalloutColor:n})=>{const{_path:a,_intersectedPath:o,_perimeter:l,_projectionLines:h,_measurementArea:m,_areaLabel:c,_perimeterLengthLabel:p}=this;a.color=e,o.color=e,l.color=e,h.color=e,m.color1=t,m.color2=i,c.textColor=s,c.backgroundColor=r,c.calloutColor=n,p.textColor=s,p.backgroundColor=r,p.calloutColor=n},c)]),this._updateMessageBundle()}destroy(){this._measurementArea=o(this._measurementArea),this._path=o(this._path),this._intersectedPath=o(this._intersectedPath),this._perimeter=o(this._perimeter),this._intersectedPerimeter=o(this._intersectedPerimeter),this._areaLabel=o(this._areaLabel),this._perimeterLengthLabel=o(this._perimeterLengthLabel),this._projectionLines=o(this._projectionLines),this.set("view",null)}_update(){if(this.destroyed||!this.view.ready||!this.view.renderCoordsHelper)return;const{analysisViewData:{measurementData:e},analysisViewData:t}=this;null!=e&&(this._updateViewData(e,t.path),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(e,t){const i=e.validMeasurement,s="geodesic"===e.actualMeasurementMode,r=s?e.geodesicArea:e.area;let n=1;if(r){const e=w(r,this.analysisViewData.unit);n=a(Math.sqrt(e.value)/Math.sqrt(300)),n*=Math.sqrt(d(1,e.unit,"square-meters")),n=d(n,"meters",this._renderUnits)}const o={validMeasurement:i,numVertices:e.numVertices,hasStagedVertex:e.hasStagedVertex,path:t,mode:e.actualMeasurementMode,positionsRender:e.positionsRender,positionsFittedWorld:e.positionsFittedWorld,positionsFittedRender:e.positionsFittedRender,intersectingSegments:s?e.geodesicIntersectingSegments:e.intersectingSegments,triangleIndices:s?e.geodesicTriangleIndices:e.triangleIndices,areaCentroid:s?e.geodesicAreaCentroidRenderCoords:e.areaCentroidRenderCoords,perimeterLengthLabelSegmentIndex:0,area:s?e.geodesicArea:e.area,pathLength:s?e.geodesicPathLength:e.pathLength,perimeterLength:e.perimeterLength,checkerSize:n};this._set("viewData",o)}_updateOrigin(){const e=this.viewData;A(e.positionsRender,this._origin),v(this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(e){const t=this.viewData,i=this.view.renderCoordsHelper.spatialReference,s=t.mode,r=[],n=[],a=[],o=t.numVertices,l=t.validMeasurement?o:o-1;for(let m=0;m<l;++m){const l=t[e][m],h=t[e][(m+1)%o];let c=null;switch(s){case"euclidean":c=new V(l,h);break;case"geodesic":c=new D(l,h,i)}t.intersectingSegments.has(m)?a.push(c):n.push(c),r.push(c)}let h=null;return t.validMeasurement&&t.hasStagedVertex&&l>=2?h=r[r.length-2]:t.hasStagedVertex&&l>=1&&(h=r[r.length-1]),{all:r,nonIntersecting:n,intersecting:a,stagedSegment:h}}_updatePathSegments(){const{visible:e}=this,t=this._createSegments("positionsRender");this._path.setGeometryFromSegments(t.nonIntersecting,this._origin),this._path.visible=e,this._intersectedPath.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPath.visible=e,this._pathSegments=t.all}_updatePerimeterSegments(){const e=this.visible&&"euclidean"===this.viewData.mode&&this.viewData.path.numVertices>2,t=this._createSegments("positionsFittedRender");this._perimeter.setGeometryFromSegments(t.nonIntersecting,this._origin),this._perimeter.visible=e,this._intersectedPerimeter.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPerimeter.visible=e,this._perimeterSegments=t.all}_updateArea(){const e=this.viewData;switch(e.mode){case"euclidean":this._updateAreaEuclidean(e);break;case"geodesic":this._updateAreaGeodesic()}}_updateAreaEuclidean(e){const t=this.visible;e.validMeasurement&&0===e.intersectingSegments.size&&e.triangleIndices?(this._measurementArea.geometry={uv:e.positionsFittedWorld,position:e.positionsFittedRender,triangleIndices:e.triangleIndices},this._measurementArea.size=[e.checkerSize,e.checkerSize],this._measurementArea.visible=t):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const e=this.viewData,t=this.visible,i=e.mode,s=e.numVertices;if(s>0&&e.validMeasurement&&"euclidean"===i){const i=[];for(let t=0;t<s;++t){const s=f();b(s,e.positionsRender[t],this._origin);const r=f();b(r,e.positionsFittedRender[t],this._origin),i.push([s,r])}this._projectionLines.geometry=i,this._projectionLines.visible=t}else this._projectionLines.geometry=null,this._projectionLines.visible=!1}_updateLabels(){if(this.destroyed)return;const{viewData:e}=this,{area:t,path:i}=e;if(!i)return;const s=this.visible,r=this._areaLabel,n=this._perimeterLengthLabel,a=e.validMeasurement;r.visible=!0,n.visible=!0;let o=!1;const l=F(this.messages,t,this.analysisViewData.unit);if(null!=l&&s&&(r.geometry={type:"point",point:e.areaCentroid},r.text=l,o=e.validMeasurement&&0===e.intersectingSegments.size),this._set("areaLabel",l),s&&a&&0===e.intersectingSegments.size){const t="geodesic"===e.mode,i=t?e.pathLength:e.perimeterLength,s=z(this.messages,i,this.analysisViewData.unit);this._set("perimeterLengthLabel",s),n.distance=this._parameters.labelDistance,n.anchor="top",n.text=s;let r=!0;for(let a=0;a<e.numVertices;++a){const i=(e.perimeterLengthLabelSegmentIndex+a)%e.numVertices,s=t?this._pathSegments[i]:this._perimeterSegments[i];if(r=!0,n.geometry={type:"segment",segment:s,sampleLocation:"center"},!n.overlaps(this._areaLabel))break;r=!1}n.visible=r}else n.visible=!1;r.visible=o}_updateMessageBundle(){this.loadingMessages=!0,P("esri/core/t9n/Units").then(e=>{this.messages=e,this.view&&this._update()}).finally(()=>{this.loadingMessages=!1})}};function F(e,t,i){return e&&t&&l(e,t,u(t.value,t.unit,i))}function z(e,t,i){return e&&t&&l(e,t,S(t,i))}e([g()],R.prototype,"_parameters",null),e([g()],R.prototype,"view",void 0),e([g()],R.prototype,"messages",void 0),e([g()],R.prototype,"analysis",void 0),e([g()],R.prototype,"viewData",void 0),e([g()],R.prototype,"analysisViewData",void 0),e([g({readOnly:!0})],R.prototype,"areaLabel",void 0),e([g({readOnly:!0})],R.prototype,"perimeterLengthLabel",void 0),e([g()],R.prototype,"loadingMessages",void 0),e([g()],R.prototype,"visible",null),e([g()],R.prototype,"_renderUnits",null),R=e([_("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementVisualization")],R);const I={validMeasurement:!1,numVertices:0,hasStagedVertex:!1,path:null,mode:null,positionsRender:null,positionsFittedWorld:null,positionsFittedRender:null,intersectingSegments:null,triangleIndices:null,areaCentroid:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null,area:null,pathLength:null,perimeterLength:null};export{R as AreaMeasurementVisualization};
|
|
5
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,fetchMessageBundle as i}from"../../../../../intl.js";import s from"../../../../../core/Accessor.js";import{unitRGBAFromColor as r,multiplyOpacityToUnitRGBA as n,getContrast as a,multiplyOpacity as o}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTen as l}from"../../../../../core/mathUtils.js";import{destroyMaybe as h}from"../../../../../core/maybe.js";import{formatDecimal as m}from"../../../../../core/quantityFormatUtils.js";import{watch as c,syncAndInitial as d,initial as p}from"../../../../../core/reactiveUtils.js";import{lengthUnitFromSpatialReference as u,convertUnit as g,adaptiveAreaUnit as _}from"../../../../../core/unitUtils.js";import{property as v}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as L}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromTranslation as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{e as w}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{toPreferredAreaUnit as y,preferredLengthUnit as j}from"./utils.js";import{LabelVisualElement as C}from"../../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as D}from"../../../interactive/visualElements/LineVisualElement.js";import{MeasurementAreaVisualElement as V}from"../../../interactive/visualElements/MeasurementAreaVisualElement.js";import{GeodesicSegment as A,EuclideanSegment as M}from"../../../interactive/visualElements/support/Segment.js";import{midpoint3d as x}from"../../../support/mathUtils.js";import{createStipplePatternSimple as P}from"../../../webgl-engine/materials/lineStippleUtils.js";let R=class extends s{get _parameters(){const{accentColor:e,textColor:t}=this.view.effectiveTheme,i=r(e),s=n(e,.5),l=n(a(e),.5),h=a(t,160);return{accentColor:i,transparentAccentColor:s,transparentContrastColor:l,intersectingLineColor:[1,.2,0,1],textColor:t,textBackgroundColor:o(h,.6),textCalloutColor:o(h,.5),pathLineWidth:3,perimeterLineWidth:2,projectionLineWidth:2,projectionLineStippleSize:5,labelDistance:25}}get visible(){return this.analysisViewData.visible}get _renderUnits(){const e=this.view.renderCoordsHelper.spatialReference;return u(e)??"meters"}get testData(){}constructor(e){super(e),this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._origin=S(),this._originTransform=f(),this.messages=null,this.viewData=I,this.areaLabel=null,this.perimeterLengthLabel=null,this.loadingMessages=!0}initialize(){const{analysisViewData:e,_parameters:i,view:s}=this;this._path=new D({view:s,attached:!0,width:i.pathLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._intersectedPath=new D({view:s,attached:!0,width:i.pathLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._perimeter=new D({view:s,attached:!0,width:i.perimeterLineWidth,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._intersectedPerimeter=new D({view:s,attached:!0,width:i.perimeterLineWidth,color:i.intersectingLineColor,polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._projectionLines=new D({view:s,attached:!0,width:i.projectionLineWidth,stipplePattern:P(i.projectionLineStippleSize),polygonOffset:!0,renderOccluded:4,isDecoration:!0}),this._measurementArea=new V({view:s,attached:!0,isDecoration:!0});const r={attached:!0,view:s,isDecoration:!0};this._areaLabel=new C({...r,fontSize:16}),this._perimeterLengthLabel=new C({...r,fontSize:12}),this.addHandles([c(()=>[e.mode,this.visible,e.unit,e.measurementData,e.stagedPoint],()=>this._update(),d),c(()=>s.state?.camera,()=>this._updateLabels(),d),t(()=>this._updateMessageBundle()),c(()=>this._parameters,({accentColor:e,transparentAccentColor:t,transparentContrastColor:i,textColor:s,textBackgroundColor:r,textCalloutColor:n})=>{const{_path:a,_intersectedPath:o,_perimeter:l,_projectionLines:h,_measurementArea:m,_areaLabel:c,_perimeterLengthLabel:d}=this;a.color=e,o.color=e,l.color=e,h.color=e,m.color1=t,m.color2=i,c.textColor=s,c.backgroundColor=r,c.calloutColor=n,d.textColor=s,d.backgroundColor=r,d.calloutColor=n},p)]),this._updateMessageBundle()}destroy(){this._measurementArea=h(this._measurementArea),this._path=h(this._path),this._intersectedPath=h(this._intersectedPath),this._perimeter=h(this._perimeter),this._intersectedPerimeter=h(this._intersectedPerimeter),this._areaLabel=h(this._areaLabel),this._perimeterLengthLabel=h(this._perimeterLengthLabel),this._projectionLines=h(this._projectionLines),this.set("view",null)}_update(){if(this.destroyed||!this.view.ready||!this.view.renderCoordsHelper)return;const{analysisViewData:{measurementData:e},analysisViewData:t}=this;null!=e&&(this._updateViewData(e,t.path),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(e,t){const i=e.validMeasurement,s="geodesic"===e.actualMeasurementMode,r=s?e.geodesicArea:e.area;let n=1;if(r){const e=y(r,this.analysisViewData.unit);n=l(Math.sqrt(e.value)/Math.sqrt(300)),n*=Math.sqrt(g(1,e.unit,"square-meters")),n=g(n,"meters",this._renderUnits)}const a={validMeasurement:i,numVertices:e.numVertices,hasStagedVertex:e.hasStagedVertex,path:t,mode:e.actualMeasurementMode,positionsRender:e.positionsRender,positionsFittedWorld:e.positionsFittedWorld,positionsFittedRender:e.positionsFittedRender,intersectingSegments:s?e.geodesicIntersectingSegments:e.intersectingSegments,triangleIndices:s?e.geodesicTriangleIndices:e.triangleIndices,areaCentroid:s?e.geodesicAreaCentroidRenderCoords:e.areaCentroidRenderCoords,perimeterLengthLabelSegmentIndex:0,area:s?e.geodesicArea:e.area,pathLength:s?e.geodesicPathLength:e.pathLength,perimeterLength:e.perimeterLength,checkerSize:n};this._set("viewData",a)}_updateOrigin(){const e=this.viewData;x(e.positionsRender,this._origin),b(this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(e){const t=this.viewData,i=this.view.renderCoordsHelper.spatialReference,s=t.mode,r=[],n=[],a=[],o=t.numVertices,l=t.validMeasurement?o:o-1;for(let m=0;m<l;++m){const l=t[e][m],h=t[e][(m+1)%o];let c=null;switch(s){case"euclidean":c=new M(l,h);break;case"geodesic":c=new A(l,h,i)}t.intersectingSegments.has(m)?a.push(c):n.push(c),r.push(c)}let h=null;return t.validMeasurement&&t.hasStagedVertex&&l>=2?h=r[r.length-2]:t.hasStagedVertex&&l>=1&&(h=r[r.length-1]),{all:r,nonIntersecting:n,intersecting:a,stagedSegment:h}}_updatePathSegments(){const{visible:e}=this,t=this._createSegments("positionsRender");this._path.setGeometryFromSegments(t.nonIntersecting,this._origin),this._path.visible=e,this._intersectedPath.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPath.visible=e,this._pathSegments=t.all}_updatePerimeterSegments(){const e=this.visible&&"euclidean"===this.viewData.mode&&this.viewData.path.numVertices>2,t=this._createSegments("positionsFittedRender");this._perimeter.setGeometryFromSegments(t.nonIntersecting,this._origin),this._perimeter.visible=e,this._intersectedPerimeter.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPerimeter.visible=e,this._perimeterSegments=t.all}_updateArea(){const e=this.viewData;switch(e.mode){case"euclidean":this._updateAreaEuclidean(e);break;case"geodesic":this._updateAreaGeodesic()}}_updateAreaEuclidean(e){const t=this.visible;e.validMeasurement&&0===e.intersectingSegments.size&&e.triangleIndices?(this._measurementArea.geometry={uv:e.positionsFittedWorld,position:e.positionsFittedRender,triangleIndices:e.triangleIndices},this._measurementArea.size=[e.checkerSize,e.checkerSize],this._measurementArea.visible=t):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const e=this.viewData,t=this.visible,i=e.mode,s=e.numVertices;if(s>0&&e.validMeasurement&&"euclidean"===i){const i=[];for(let t=0;t<s;++t){const s=S();w(s,e.positionsRender[t],this._origin);const r=S();w(r,e.positionsFittedRender[t],this._origin),i.push([s,r])}this._projectionLines.geometry=i,this._projectionLines.visible=t}else this._projectionLines.geometry=null,this._projectionLines.visible=!1}_updateLabels(){if(this.destroyed)return;const{viewData:e}=this,{area:t,path:i}=e;if(!i)return;const s=this.visible,r=this._areaLabel,n=this._perimeterLengthLabel,a=e.validMeasurement;r.visible=!0,n.visible=!0;let o=!1;const l=F(this.messages,t,this.analysisViewData.unit);if(null!=l&&s&&(r.geometry={type:"point",point:e.areaCentroid},r.text=l,o=e.validMeasurement&&0===e.intersectingSegments.size),this._set("areaLabel",l),s&&a&&0===e.intersectingSegments.size){const t="geodesic"===e.mode,i=t?e.pathLength:e.perimeterLength,s=z(this.messages,i,this.analysisViewData.unit);this._set("perimeterLengthLabel",s),n.distance=this._parameters.labelDistance,n.anchor="top",n.text=s;let r=!0;for(let a=0;a<e.numVertices;++a){const i=(e.perimeterLengthLabelSegmentIndex+a)%e.numVertices,s=t?this._pathSegments[i]:this._perimeterSegments[i];if(r=!0,n.geometry={type:"segment",segment:s,sampleLocation:"center"},!n.overlaps(this._areaLabel))break;r=!1}n.visible=r}else n.visible=!1;r.visible=o}_updateMessageBundle(){this.loadingMessages=!0,i("esri/core/t9n/Units").then(e=>{this.messages=e,this.view&&this._update()}).finally(()=>{this.loadingMessages=!1})}};function F(e,t,i){return e&&t&&m(e,t,_(t.value,t.unit,i))}function z(e,t,i){return e&&t&&m(e,t,j(t,i))}e([v()],R.prototype,"_parameters",null),e([v()],R.prototype,"view",void 0),e([v()],R.prototype,"messages",void 0),e([v()],R.prototype,"analysis",void 0),e([v()],R.prototype,"viewData",void 0),e([v()],R.prototype,"analysisViewData",void 0),e([v({readOnly:!0})],R.prototype,"areaLabel",void 0),e([v({readOnly:!0})],R.prototype,"perimeterLengthLabel",void 0),e([v()],R.prototype,"loadingMessages",void 0),e([v()],R.prototype,"visible",null),e([v()],R.prototype,"_renderUnits",null),R=e([L("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementVisualization")],R);const I={validMeasurement:!1,numVertices:0,hasStagedVertex:!1,path:null,mode:null,positionsRender:null,positionsFittedWorld:null,positionsFittedRender:null,intersectingSegments:null,triangleIndices:null,areaCentroid:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null,area:null,pathLength:null,perimeterLength:null};export{R as AreaMeasurementVisualization};
|