@arcgis/core 5.2.0-next.125 → 5.2.0-next.126
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/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +3 -2
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{fe9582bc2244667e40ab.js → 05afa8c2b5929ce0545a.js} +1 -1
- package/assets/esri/core/workers/chunks/0a20f84b5f004a77a9f9.js +1 -0
- package/assets/esri/core/workers/chunks/{cfd56e0a716baf95e17b.js → 0a2b7c691a577cb3d189.js} +1 -1
- package/assets/esri/core/workers/chunks/{6cf34cfdd063a1b6fe3e.js → 0ccd4200c5a2a5de6e16.js} +1 -1
- package/assets/esri/core/workers/chunks/{bdf012e591a8476db467.js → 1406a884241809b62bff.js} +1 -1
- package/assets/esri/core/workers/chunks/17218d714cb07b607c2f.js +1 -0
- package/assets/esri/core/workers/chunks/1d040aa8951fff3141d9.js +1 -0
- package/assets/esri/core/workers/chunks/30604a29df320d7a4c6b.js +1 -0
- package/assets/esri/core/workers/chunks/3ef367c9b7bf1588307d.js +1 -0
- package/assets/esri/core/workers/chunks/{5b9b76e180cf206a8a0c.js → 4327d2c39a660bd89da7.js} +1 -1
- package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +1 -0
- package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +1 -0
- package/assets/esri/core/workers/chunks/{f05becec0952a61bc654.js → 4d18451e0ea6ca54101a.js} +1 -1
- package/assets/esri/core/workers/chunks/{26bc509a031788bfa678.js → 4f464047c6f6c9486efd.js} +1 -1
- package/assets/esri/core/workers/chunks/{58528ccb7f72ae76d52b.js → 540f60e31b19d85e9371.js} +1 -1
- package/assets/esri/core/workers/chunks/{44857a76be2c0ac65bb9.js → 55a560fd872f7463b33d.js} +1 -1
- package/assets/esri/core/workers/chunks/56acda1eed3a013430e2.js +1 -0
- package/assets/esri/core/workers/chunks/{1f55701d23a5e5a0c70c.js → 57ab87e70ef85b9405f9.js} +122 -122
- package/assets/esri/core/workers/chunks/{f0901f9c7135b708434f.js → 5adf2792416b22cd602f.js} +1 -1
- package/assets/esri/core/workers/chunks/5fe5ef5ccf480634d159.js +1 -0
- package/assets/esri/core/workers/chunks/67678054342178b601cf.js +1 -0
- package/assets/esri/core/workers/chunks/67dcf9b873cb037b2647.js +1 -0
- package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +1 -0
- package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +1 -0
- package/assets/esri/core/workers/chunks/7dd94567833386dc74de.js +1 -0
- package/assets/esri/core/workers/chunks/806f96ad09e882be41af.js +1 -0
- package/assets/esri/core/workers/chunks/{bbaaebe1774a22dba39b.js → 97602019a1ccad22a03a.js} +1 -1
- package/assets/esri/core/workers/chunks/{378bdb4e5cd1ebada1f4.js → 9ca98fffd43e63d5ade3.js} +1 -1
- package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +1 -0
- package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +1 -0
- package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +1 -0
- package/assets/esri/core/workers/chunks/{e22a013ec38989caf9de.js → a790fc6b22acf651574b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f52ad525744b8793d49.js → a8258636096416c837a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{813dd84933b407c8fe86.js → b34305474a861aaf6ccb.js} +1 -1
- package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +1 -0
- package/assets/esri/core/workers/chunks/{f0709c48daca93e759c8.js → c692e583e87af58f6d91.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f7e8e4ddf52b5245ea4.js → c77496c350004ee66eb2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0fba5c0e89b057da548d.js → cb7cb7d57c4e7f76600f.js} +1 -1
- package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +1 -0
- package/assets/esri/core/workers/chunks/d5f0fed415b5b155d57c.js +1 -0
- package/assets/esri/core/workers/chunks/{3f082329a544c2c1d62d.js → d5f72670634e73c0b53a.js} +1 -1
- package/assets/esri/core/workers/chunks/d6e914f6ed45ea59034e.js +1 -0
- package/assets/esri/core/workers/chunks/{5afc12671a9a1bb6c56c.js → dc52e036547612949d32.js} +1 -1
- package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +1 -0
- package/assets/esri/core/workers/chunks/e1ae83ff3e0225708d4d.js +1 -0
- package/assets/esri/core/workers/chunks/{df79c00b5ddbef7148a0.js → eaa7cb3ffa8c11706a09.js} +1 -1
- package/assets/esri/core/workers/chunks/eebbc86a15ae3adb5f38.js +1 -0
- package/assets/esri/core/workers/chunks/fdbda3d2afea25142b86.js +1 -0
- package/assets/esri/libs/pdfjs/pdf.worker.mjs +4 -63051
- package/assets/esri/widgets/Editor/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-TW.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +9 -9
- package/chunks/GlobalIlluminationBlur.glsl.js +8 -8
- package/chunks/HeatmapDensity.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +30 -30
- package/chunks/RibbonLine.glsl.js +19 -19
- package/config.js +1 -1
- package/core/accessorSupport/types.d.ts +5 -1
- package/interfaces.d.ts +3 -0
- package/kernel.js +1 -1
- package/layers/ParquetLayer.d.ts +3 -2
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +2 -2
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +2 -0
- package/layers/geospatialPDF/projectionToWKTUtils.js +2 -0
- package/layers/geospatialPDF/renderExtentUtils.js +1 -1
- package/layers/geospatialPDF/sharedUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/types.d.ts +6 -0
- package/layers/support/TimeSeriesCalculation.d.ts +32 -0
- package/layers/support/TimeSeriesCalculation.js +2 -0
- package/layers/support/TimeSeriesInfo.d.ts +19 -0
- package/layers/support/TimeSeriesInfo.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/timeSeriesUtils.d.ts +25 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/types.d.ts +1 -0
- package/package.json +2 -2
- package/popup/FeatureContentCollection.d.ts +4 -1
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/types.d.ts +14 -3
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/sceneLayerItem.js +1 -1
- package/renderers/support/AuthoringInfo.d.ts +8 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.d.ts +8 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +1 -1
- package/rest/knowledgeGraph/DataModel.js +1 -1
- package/smartMapping/renderers/color.d.ts +12 -0
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.d.ts +6 -0
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.d.ts +12 -0
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/renderers/type.d.ts +6 -0
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.d.ts +6 -0
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +8 -0
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +8 -0
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +3 -2
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/Dimension/DimensionController.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +3 -2
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/input/handlers/DragRotate.js +1 -1
- package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/planarDistanceToGroundRatio.js +2 -0
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +13 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/LengthDimensionResult.d.ts +4 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +4 -2
- package/views/interactive/options/SnappingOptions.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +18 -0
- package/views/interactive/options/bindViewToolOptions.js +2 -0
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/allLayerSnapping.js +1 -1
- package/views/overlay/FocusRegionOverlayItem.js +1 -1
- package/views/selection/SelectionOperation.d.ts +27 -1
- package/views/selection/types.d.ts +8 -20
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +1 -0
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -0
- package/widgets/BasemapLayerList.d.ts +1 -0
- package/widgets/BatchAttributeForm/expressions/types.d.ts +1 -0
- package/widgets/BatchAttributeForm/types.d.ts +5 -1
- package/widgets/BatchAttributeForm.d.ts +1 -0
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +1 -0
- package/widgets/Bookmarks.d.ts +1 -0
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +1 -0
- package/widgets/CatalogLayerList.d.ts +1 -0
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +1 -0
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.d.ts +1 -0
- package/widgets/FeatureForm.d.ts +1 -0
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +14 -0
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +14 -0
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +1 -0
- package/widgets/FeatureTemplates.d.ts +1 -0
- package/widgets/Features/FeaturesViewModel.d.ts +1 -0
- package/widgets/Features.d.ts +2 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -0
- package/widgets/Home/HomeViewModel.d.ts +1 -0
- package/widgets/Home.d.ts +1 -0
- package/widgets/LayerList/LayerListViewModel.d.ts +1 -0
- package/widgets/LayerList.d.ts +1 -0
- package/widgets/Locate/LocateViewModel.d.ts +1 -0
- package/widgets/Locate.d.ts +1 -0
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +4 -1
- package/widgets/OrientedImageryViewer.d.ts +4 -1
- package/widgets/Popup.d.ts +1 -0
- package/widgets/Print/PrintViewModel.d.ts +1 -0
- package/widgets/Print.d.ts +1 -0
- package/widgets/Search.d.ts +1 -0
- package/widgets/Sketch.d.ts +1 -0
- package/widgets/Slider.d.ts +4 -0
- package/widgets/TimeSlider.d.ts +1 -0
- package/widgets/Track/TrackViewModel.d.ts +1 -0
- package/widgets/Track.d.ts +1 -0
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +1 -0
- package/widgets/UtilityNetworkTrace.d.ts +1 -0
- package/widgets/ValuePicker/types.d.ts +1 -0
- package/widgets/ValuePicker.d.ts +1 -0
- package/widgets/smartMapping/SmartMappingSliderBase.d.ts +1 -0
- package/widgets/support/SelectionList/types.d.ts +2 -0
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +2 -1
- package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +0 -1
- package/assets/esri/core/workers/chunks/0a4a5ed831a4e4d8e0fc.js +0 -1
- package/assets/esri/core/workers/chunks/0acc754907395e83bbc6.js +0 -1
- package/assets/esri/core/workers/chunks/0f8ff964461cf8e0673b.js +0 -1
- package/assets/esri/core/workers/chunks/1e46703cb566c25458ad.js +0 -1
- package/assets/esri/core/workers/chunks/25c90092def215949db9.js +0 -1
- package/assets/esri/core/workers/chunks/2a34760b3f0c134898ec.js +0 -1
- package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +0 -1
- package/assets/esri/core/workers/chunks/3b4ceaf21be540cb3499.js +0 -1
- package/assets/esri/core/workers/chunks/4c4ba466e23159991322.js +0 -1
- package/assets/esri/core/workers/chunks/606ac9358f508bda94f2.js +0 -1
- package/assets/esri/core/workers/chunks/6c4def0faaef861a09c9.js +0 -1
- package/assets/esri/core/workers/chunks/7285a37cd5359aa4bac5.js +0 -1
- package/assets/esri/core/workers/chunks/753d1ff177ecee8e2377.js +0 -1
- package/assets/esri/core/workers/chunks/8a8e94b5d7d153361b0b.js +0 -1
- package/assets/esri/core/workers/chunks/923c45ebcf45d9ce8ae0.js +0 -1
- package/assets/esri/core/workers/chunks/9af36ee6a0df224859bc.js +0 -1
- package/assets/esri/core/workers/chunks/a7ce5b958dfeb240c4a5.js +0 -1
- package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +0 -1
- package/assets/esri/core/workers/chunks/be52c319a0a81ce1ba36.js +0 -1
- package/assets/esri/core/workers/chunks/c0ec87800faf99cbd8bd.js +0 -1
- package/assets/esri/core/workers/chunks/ca5a4f62b09cc8579dc0.js +0 -1
- package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +0 -1
- package/assets/esri/core/workers/chunks/e9f8325a4cf89ae816cc.js +0 -1
- package/assets/esri/core/workers/chunks/ed7d4e8725aaa0ca4589.js +0 -1
- package/assets/esri/core/workers/chunks/f4572ad25712d204f258.js +0 -1
- package/layers/geospatialPDF/GeospatialPDFParserUtils.js +0 -2
- package/layers/geospatialPDF/Projection.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../../core/Error.js";import{Loadable as t}from"../../core/Loadable.js";import{open as o}from"../../core/workers.js";import{subclass as s}from"../../core/accessorSupport/decorators.js";import a from"./GeospatialPDFFrame.js";import{parse as i}from"./
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../../core/Error.js";import{Loadable as t}from"../../core/Loadable.js";import{open as o}from"../../core/workers.js";import{subclass as s}from"../../core/accessorSupport/decorators.js";import a from"./GeospatialPDFFrame.js";import{parse as i}from"./geospatialPDFParserUtils.js";let n=class extends t{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){const r=o("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);const{geospatialMetadata:o}=await this._workerHandler.loadPDF(e,t),s=i(o,0),n=s.lgiDictFrame??s.vpFrame;if(!n)throw new r("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");const l=new a(n),c=l.spatialReference.toJSON();return{frame:l,sourceSpatialReference:c,fullExtent:l.toExtent()}}async render(e,r,t,o,s,a){const i={sourceExtentAsJSON:e.toJSON(),width:r,height:t,ctm:o,currentRing:s};return this._workerHandler.renderPDF(i,a)}};n=e([s("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],n);export{n as GeospatialPDFWorkerClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../core/Error.js";import{fromValues as i}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{expandMediaBox as n,createGeoreferencer as a,validateTransform as r,affineTransformationFromGeoreference as o}from"./sharedUtils.js";class s{constructor(t){const i=this.inputValidation(t);this._registration=i.registration,this._projection=i.projection,this._neatline=i.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=n(i.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=i.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:n,registration:a,projection:r,display:o,neatline:s,mediaBox:l}=e;if(n&&6!==n.length)throw new t("geospatial-pdf-layer:
|
|
2
|
+
import t from"../../core/Error.js";import{fromValues as i}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{expandMediaBox as n,createGeoreferencer as a,validateTransform as r,affineTransformationFromGeoreference as o}from"./sharedUtils.js";class s{constructor(t){const i=this.inputValidation(t);this._registration=i.registration,this._projection=i.projection,this._neatline=i.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=n(i.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=i.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:n,registration:a,projection:r,display:o,neatline:s,mediaBox:l}=e;if(n&&6!==n.length)throw new t("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!n&&(!a||a.length<3))throw new t("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!l||4!==l.length)throw new t("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!s||s.length<4||s.length%2!=0)throw new t("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:n?i(n[0],n[1],n[2],n[3],n[4],n[5]):void 0,registration:a??[],projection:r,display:o,neatline:s,mediaBox:l}}outputValidation(){if(6!==this.ctm.length)throw new t("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new t("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new t("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new t("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){const t=[],i=[];for(const a of this._registration)a.length<4||(t.push(e(a[0],a[1])),i.push(e(a[2],a[3])));const n=this._getSourceRect(),s=a(t,i,this.toSpatialReference(),n),l=r(s);return o(l)}_extentFromArray(i){let e=1/0,n=1/0,a=-1/0,r=-1/0;for(let t=0;t<i.length;t++){const o=i[t];e=Math.min(e,o[0]),n=Math.min(n,o[1]),a=Math.max(a,o[0]),r=Math.max(r,o[1])}if(!(Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(a)&&Number.isFinite(r)))throw new t("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:e,ymin:n,xmax:a,ymax:r}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);const i=this._getRegistrationPoints("page");if(i.length>=2)return this._extentFromArray(i);throw new t("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(t){const[i,e]="page"===t?[0,1]:[2,3];return this._registration.filter(t=>t.length>e).map(t=>[t[i],t[e]])}_pairNeatline(){const t=[];for(let i=0;i<this._neatline.length;i+=2){const e=this._neatline[i],n=this._neatline[i+1];Number.isFinite(e)&&Number.isFinite(n)&&t.push([e,n])}return 2===t.length&&(t.splice(1,0,[t[1][0],t[0][1]]),t.push([t[0][0],t[2][1]])),t}}export{s as LGIDictMapFrame};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../core/Error.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import o from"../../geometry/Point.js";import i from"../../geometry/SpatialReference.js";import{projectExecute as s}from"../../geometry/operators/projectOperator.js";import{expandMediaBox as n,validateTransform as a,affineTransformationFromGeoreference as r,createGeoreferencer as l}from"./sharedUtils.js";class h{constructor(t){const{bbox:e,bounds:o,gpts:i,lpts:s,gcs:l,mediaBox:h}=this.inputValidation(t);this._bbox=e,this._bounds=o,this._gpts=i,this._lpts=s,this._gcs=l,this.outerExtentMediaBox=n(h),this.geoControlPoints=this._getProjectedGeoControlPoints().map(t=>[t[0],t[1]]);const g=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=g.map(t=>[t[0],t[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const p=a(this._georeference);this.ctm=r(p),this.outputValidation()}toSpatialReference(){return new i({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:o,bounds:i,gpts:s,lpts:n,gcs:a,mediaBox:r}=e;if(!o||4!==o.length)throw new t("geospatial-pdf-layer:
|
|
2
|
+
import t from"../../core/Error.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import o from"../../geometry/Point.js";import i from"../../geometry/SpatialReference.js";import{projectExecute as s}from"../../geometry/operators/projectOperator.js";import{expandMediaBox as n,validateTransform as a,affineTransformationFromGeoreference as r,createGeoreferencer as l}from"./sharedUtils.js";class h{constructor(t){const{bbox:e,bounds:o,gpts:i,lpts:s,gcs:l,mediaBox:h}=this.inputValidation(t);this._bbox=e,this._bounds=o,this._gpts=i,this._lpts=s,this._gcs=l,this.outerExtentMediaBox=n(h),this.geoControlPoints=this._getProjectedGeoControlPoints().map(t=>[t[0],t[1]]);const g=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=g.map(t=>[t[0],t[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const p=a(this._georeference);this.ctm=r(p),this.outputValidation()}toSpatialReference(){return new i({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:o,bounds:i,gpts:s,lpts:n,gcs:a,mediaBox:r}=e;if(!o||4!==o.length)throw new t("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!r||4!==r.length)throw new t("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!s||s.length<6||s.length%2!=0)throw new t("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!n||n.length<6||n.length%2!=0)throw new t("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(n.length!==s.length)throw new t("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!a?.WKT)throw new t("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:o,bounds:i,gpts:s,lpts:n,gcs:{WKT:a.WKT},mediaBox:r}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new t("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new t("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new t("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new t("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){const t=this._getPageControlPoints(),e=this._getProjectedGeoControlPoints(),o=this._getViewportRect();return l(t,e,this.toSpatialReference(),o)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;const t=[];for(let e=0;e<this._bounds.length;e+=2)t.push({u:this._bounds[e],v:this._bounds[e+1]});return t}_getBoundsPolygonPage(){const t=this._getBoundsPolygonLocal();return t?.map(t=>this._localToPage(t.u,t.v))??null}_getPageControlPoints(){const t=[];for(let e=0;e<this._lpts.length;e+=2){const o=this._lpts[e],i=this._lpts[e+1];t.push(this._localToPage(o,i))}return t}_getProjectedGeoControlPoints(){const t=this.toSpatialReference(),i=[];for(let n=0;n<this._gpts.length;n+=2){const a=this._gpts[n],r=this._gpts[n+1],l=new o({x:r,y:a}),h=s(l,t);i.push(e(h.x,h.y))}return i}_getViewportRect(){const[t,e,o,i]=this._bbox;return{xmin:Math.min(t,o),ymin:Math.min(e,i),xmax:Math.max(t,o),ymax:Math.max(e,i)}}_localToPage(t,o){const[i,s,n,a]=this._bbox;return e(i+t*(n-i),s+o*(a-s))}}export{h as ViewportMeasureFrame};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import r from"../../core/Error.js";import"../../core/has.js";import{LGIDictMapFrame as e}from"./LGIDictMapFrame.js";import{projectionToSpatialReference as i}from"./projectionToWKTUtils.js";import{ViewportMeasureFrame as n}from"./ViewportMeasureFrame.js";function t(t,u=0){const s={mediaBox:_(t.MediaBox),rotate:P(t.Rotate),hasLGIDict:null!=t.LGIDict,hasVP:null!=t.VP},l=o(t.LGIDict,u);if(l){if(!l.Projection)throw new r("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");const n=i(l.Projection);let o;try{o=l.Display?i(l.Display):void 0}catch{o=n}return{result:s,lgiDictFrame:new e({ctm:l.CTM,registration:l.Registration,projection:n,display:o,neatline:l.Neatline,mediaBox:_(t.MediaBox)})}}const c=a(t.VP,u);if(c){return{result:s,vpFrame:new n({bbox:c.BBox,bounds:c.Measure?.Bounds,gpts:c.Measure?.GPTS,lpts:c.Measure?.LPTS,gcs:c.Measure?.GCS,mediaBox:_(t.MediaBox)})}}return{result:s}}function o(r,e){return u(r)[e]}function a(r,e){return s(r)[e]}function u(r){return null==r?[]:Array.isArray(r)?r.map(r=>l(r)):[l(r)]}function s(r){return null==r?[]:Array.isArray(r)?r.map(r=>c(r)):[c(r)]}function l(r){const e=M(r,"LGIDict map frame must be an object.");return{CTM:_(e.CTM),Registration:S(e.Registration),Neatline:_(e.Neatline),Projection:p(e.Projection),Display:p(e.Display)}}function c(r){const e=M(r,"Viewport frame must be an object."),i=d(e.Measure);return{BBox:_(e.BBox),Measure_Raw:e.Measure,Measure:i,Raw:e}}function d(r){if(w(r))return{Bounds:_(r.Bounds),GPTS:_(r.GPTS),LPTS:_(r.LPTS),GCS:f(r.GCS)}}function f(r){if(w(r))return{WKT:T(r.WKT)}}function p(r){if(w(r))return{Type:L(r.Type),Units:L(r.Units),Datum:m(r.Datum),Projection_Type:L(r.ProjectionType),Central_Meridian:P(r.CentralMeridian),False_Easting:P(r.FalseEasting),False_Northing:P(r.FalseNorthing),Height:P(r.Height),Hemisphere:L(r.Hemisphere),Latitude_One:P(r.LatitudeOne),Latitude_Two:P(r.LatitudeTwo),Latitude_Of_True_Scale:P(r.LatitudeOfTrueScale),Longitude_One:P(r.LongitudeOne),Longitude_Two:P(r.LongitudeTwo),Longitude_Down_From_Pole:P(r.LongitudeDownFromPole),Orientation:L(r.Orientation),Origin_Height:P(r.OriginHeight),Origin_Latitude:P(r.OriginLatitude),Origin_Longitude:P(r.OriginLongitude),Scale_Factor:P(r.ScaleFactor),Standard_Parallel:P(r.StandardParallel),Standard_Parallel_One:P(r.StandardParallelOne),Standard_Parallel_Two:P(r.StandardParallelTwo),Zone:P(r.Zone),Description:L(r.Description),raw:r}}function m(r){return null==r?null:"string"==typeof r?{kind:"name",name:L(r),ellipsoid:null,to_WGS84:null,raw:r}:w(r)?{kind:"definition",name:L(r.Description),ellipsoid:g(r.Ellipsoid),to_WGS84:y(r.ToWGS84),raw:r}:{kind:"unknown",name:L(r),ellipsoid:null,to_WGS84:null,raw:r}}function g(r){if(w(r))return{semi_Major_Axis:P(r.SemiMajorAxis),inverse_Flattening:P(r.InvFlattening),semi_Minor_Axis:P(r.SemiMinorAxis),description:L(r.Description)}}function y(r){if(w(r))return{dx:P(r.dx)??0,dy:P(r.dy)??0,dz:P(r.dz)??0,rx:P(r.rx)??0,ry:P(r.ry)??0,rz:P(r.rz)??0,sf:P(r.sf)??0}}function _(r){if(!Array.isArray(r))return;const e=[];for(const i of r){const r=P(i);if(void 0===r)return;e.push(r)}return e}function S(r){if(Array.isArray(r))return r.filter(r=>Array.isArray(r)).map(r=>r.map(r=>P(r)).filter(r=>void 0!==r))}function T(r){if(null!=r)return"string"==typeof r?r:String(r)}function L(r){const e=T(r);if(void 0!==e)return e.trim()}function P(r){if(null==r)return;if("number"==typeof r)return Number.isFinite(r)?r:void 0;if("string"!=typeof r)return;const e=r.trim();if(""===e)return;const i=Number(e);return Number.isFinite(i)?i:void 0}function w(r){return null!=r&&"object"==typeof r&&!Array.isArray(r)}function M(e,i){if(!w(e))throw new r("geospatial-pdf-layer:parse",i);return e}export{t as parse};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import e from"../../core/Error.js";import n from"../../geometry/SpatialReference.js";const t={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},r=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,a=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,i=/^(?:WGS84|WGS 84|WGE)$/i;function o(e){const t=s(e);if("projected"===t.kind){const{projectionType:r,datum:a}=t;return"SPCS"===r?D(e,a):new n({wkt:A(e,r,a)})}}function s(e){return l(e)}function l(n){const t=c(n.Type),r=_(n.Projection_Type);let a;if(r||(a="Projection is missing or has unsupported ProjectionType"),t||(a="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),n.Datum||(a="Projection is missing a Datum"),a)throw new e("geospatial-pdf-layer:invalid-projection",a);return u(n,r),{kind:"projected",dictionaryType:t,projectionType:r,datum:n.Datum}}function c(e){switch(e){case"Projection":case"Display":return e;default:return}}function _(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}function u(n,r){const a=d(r);for(const i of a){const a=n[t[i]];if(void 0===a||""===a)throw new e("geospatial-pdf-layer:invalid-projection",`Projection ${r} missing required parameter ${i}.`)}}function d(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}function A(e,n,t){const r=E(e,n,t),a=p(n),i=f(t),o=g(e.Units??"M"),s=T(e,n);return`PROJCS["${r}",GEOGCS["${$(t)}",${i},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${a}"],${s.join(",\n ")},${o}]`}function p(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}function E(e,n,t){const r=P(t);switch(n){case"TC":return`${r}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${r}_GeospatialPDF_Polyconic`;case"UT":return`${r}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${r}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${r}_GeospatialPDF_Lambert_Conformal_Conic`}}function P(e){const n=M(e);return n?F(n)?"NAD_1983":C(n)?"NAD_1927":h(n)?"WGS_1984":"geospatialPDF":"geospatialPDF"}function f(n){if("definition"===n.kind){const t=n.ellipsoid;if(!t?.semi_Major_Axis)throw new e("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");const r=R(t),a=n.name??"GeospatialPDF_Datum",i=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${r}]`,o=n.to_WGS84;return`DATUM["${a}",${i}${o?`,TOWGS84[${o.dx??0},${o.dy??0},${o.dz??0},${o.rx??0},${o.ry??0},${o.rz??0},${o.sf??0}]`:""}]`}if(n.name){const e=n.name.toUpperCase();if(F(e))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(C(e))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(h(e))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new e("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+n.name)}function g(e){const n=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(n)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(n)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}function T(e,n){switch(n){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return m(e)}}function m(n){if(!n.Zone)throw new e("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");const t=6*n.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(n.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}function R(n){if(null!=n.inverse_Flattening)return n.inverse_Flattening;const t=n.semi_Major_Axis,r=n.semi_Minor_Axis;if(null==t||null==r)throw new e("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===r?0:t/(t-r)}function $(e){const n=M(e);return n?F(n)?"GCS_North_American_1983":C(n)?"GCS_North_American_1927":h(n)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}function M(e){return e.name?S(e.name):null}function S(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}function F(e){return r.test(e)}function C(e){return a.test(e)}function h(e){return i.test(e)}function D(t,r){const a=M(r);if(2800===t.Zone&&a&&F(a))return new n({wkid:32110});throw new e("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${r.name}, zone ${t.Zone}`)}export{o as projectionToSpatialReference,s as validateProjection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../core/Error.js";import"../../core/has.js";import{onAbort as o,throwIfAborted as n}from"../../core/promiseUtils.js";import{fromValues as r,create as e}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{multiply as a}from"../../core/libs/gl-matrix-2/math/mat2d.js";async function i(r,i,m,l,f,p,x,h,v){const d=s(r,i,m),g=e();a(g,d,l);const u=e();a(u,g,x);const w=new OffscreenCanvas(i,m),y=w.getContext("2d");if(!y)throw new t("geospatial-pdf-layer:
|
|
2
|
+
import t from"../../core/Error.js";import"../../core/has.js";import{onAbort as o,throwIfAborted as n}from"../../core/promiseUtils.js";import{fromValues as r,create as e}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{multiply as a}from"../../core/libs/gl-matrix-2/math/mat2d.js";async function i(r,i,m,l,f,p,x,h,v){const d=s(r,i,m),g=e();a(g,d,l);const u=e();a(u,g,x);const w=new OffscreenCanvas(i,m),y=w.getContext("2d");if(!y)throw new t("geospatial-pdf-layer:invalid-canvas","Failed to create bitmap canvas context.");if(h.length){const t=c(h,r,i,m);y.save(),y.fillStyle="white",y.fill(t),y.restore()}const b=f.render({canvas:null,canvasContext:y,viewport:p,transform:u,annotationMode:0,background:"rgba(0,0,0,0)"}),j=o(v?.signal,()=>{b.cancel()});try{await b.promise}catch(C){throw n(v),C}finally{j?.remove()}return w}function s(t,o,n){const e=(t.xmax-t.xmin)/o,a=(t.ymax-t.ymin)/n;return r(1/e,0,0,-1/a,-t.xmin/e,t.ymax/a)}function c(t,o,n,r){const e=new Path2D,a=s(o,n,r);for(let i=0;i<t.length;i++){const[o,n]=t[i],r=a[0]*o+a[2]*n+a[4],s=a[1]*o+a[3]*n+a[5];0===i?e.moveTo(r,s):e.lineTo(r,s)}return e.closePath(),e}export{i as renderBitmap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import r from"../../core/Error.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import o from"../../geometry/Point.js";import t from"../support/ControlPointsGeoreference.js";function n(r,e,n,i){const m=Math.min(r.length,e.length,3),a=r.slice(0,m).map((r,t)=>({sourcePoint:{x:r[0],y:r[1]},mapPoint:new o({x:e[t][0],y:e[t][1],spatialReference:n})}));return new t({controlPoints:a,width:i.xmax-i.xmin,height:i.ymax-i.ymin})}function i(e){if(!e?.transform||e.transform.length<6)throw new r("geospatial-pdf-layer:
|
|
2
|
+
import r from"../../core/Error.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import o from"../../geometry/Point.js";import t from"../support/ControlPointsGeoreference.js";function n(r,e,n,i){const m=Math.min(r.length,e.length,3),a=r.slice(0,m).map((r,t)=>({sourcePoint:{x:r[0],y:r[1]},mapPoint:new o({x:e[t][0],y:e[t][1],spatialReference:n})}));return new t({controlPoints:a,width:i.xmax-i.xmin,height:i.ymax-i.ymin})}function i(e){if(!e?.transform||e.transform.length<6)throw new r("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function m(r){return e(r[0],-r[1],-r[3],r[4],r[2],r[5])}function a(r){return[[r[0],r[1]],[r[0],r[3]],[r[2],r[3]],[r[2],r[1]]]}export{m as affineTransformationFromGeoreference,n as createGeoreferencer,a as expandMediaBox,i as validateTransform};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{
|
|
2
|
+
import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as r,zeros as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{rectifyMapPointPanoramic as n,rectifyMapPoint as o}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as c,hasAngles as s,convertPixelToHeadingPitch as f,adjustHorizonAngles as l,reducerFn as p,scaleAndAddWithFactor as m,validatePixelsToTransform as h,validateRotationMatrix as u,computeFarplaneVertices as y,computeHFOVAndVFOV as d,vecToPoint as w,or as g,isUpdateElevationWithElevationSource as x,computeNewReferenceCoordinates as v,projectiveTransform as R}from"./utils.js";import{worldToImage as M}from"./worldToImage.js";import{viewingLimit as P}from"../../../widgets/OrientedImageryViewer/constants.js";async function A(e,t,r){const{verticalFieldOfView:a,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=D(e,t),p=new Array;return await V(s,o,i,f,t,p,c,n,a,r,l),Array.isArray(e)?p:p[0]}async function V(e,t,r,a,n,c,s,f,l,p,m){let h=n.averageElevation;const u=e.length;for(let y=0;y<u;y+=1){const u=e.at(y),d=T(t,r,u,a,n),w=m?.at(y);if("number"==typeof w){const e=j(d,s,f),t=w*f,r=[s[0]+e[0]*t,s[1]+e[1]*t,s[2]+e[2]*w];c.push(new i(r,n.cameraLocation.spatialReference));continue}if(p&&g("elevationSample"in p,x(p))){h=(await o(a(d),{x:u[0],y:u[1]},{...n,...p,farPlaneVertices:t.map(a)}))[2]}c.push(a(F(d,s,f,h,n.cameraPitch,l)))}}function j(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/r,s=Math.hypot(o,c)*r,f=a();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*r,f}function F(e,t,a,i,n,o){let c=r(e);const s=j(e,t,a);if(b(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*a;c=m(t,s,e,a)}else c[2]=i;return c}function b(e,t,r,a){return e<t||r+a/2<P}function T(e,t,r,a,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=O(r,l,f,i);if(c=e.error,n=e.transformedPoint,g(c<=1,s===o))break;f=v(f,c,r,t),l=L(f,a,i),s++}return n}function L(e,t,r){return M(e.map(t),r).map(({x:e,y:t})=>[e,t,1])}function O(e,t,r,a){const{cameraLocation:n}=a,o=R(e,t,r),{x:c,y:s}=M(new i(o,n.spatialReference),a);return{transformedPoint:o,error:z(e,[c,s,1])}}function z(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function D(t,r){const a=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=r;if(h(a,n),u(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const s=c(n.y,n.spatialReference),f=y({...r,scalingFactor:s}),l=M(f.map(e=>new i(e,n.spatialReference)),r),{vfov:p}=d(r.horizontalFieldOfView,r.verticalFieldOfView,r.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:p,farPlaneVertices:f,scalingFactor:s,pixelsToTransform:a.map(e=>[e.x,e.y,1]),vecToPoint:w(n.spatialReference),pixelDepths:a.map(e=>E(e)?e.depth:void 0)}}function E(e){return"depth"in e&&"number"==typeof e.depth}async function B(e,r,a){const{cameraLocation:o,farDistance:m,imageHeight:h,imageWidth:u,verticalFieldOfView:y,horizonPitch:d,horizonRoll:w,horizonYaw:g}=r,x=c(o.y,o.spatialReference),v=m*x,R=new Array,[M,P,A]=o.toArray(),V=Array.isArray(e)?e:[e];for(const c of V){let e,V;const j=E(c),b=j?c.depth*x:v;if(s(c))e=c.heading,V=c.pitch;else{const t=f({x:c.x,y:c.y},u,h),r=l(t.heading,t.pitch,[d,w,g],!0);e=r[0],V=r[1]}const T=[M+Math.sin(t(e))*Math.sin(t(V))*b,P+Math.cos(t(e))*Math.sin(t(V))*b,A+-Math.cos(t(V))*(j?c.depth:m)];if(j){R.push(new i(T,o.spatialReference));continue}let L=r.averageElevation;if(a){L=(await n(new i(T,o.spatialReference),{heading:e,pitch:V},{...r,...a,farPlaneVertices:p(m,m).map(([e,t])=>new i([o.x+e,o.y+t],o.spatialReference))}))[2]}R.push(new i(F(T,o.toArray(),x,L,V,y),o.spatialReference))}return Array.isArray(e)?R:R[0]}export{A as imageToWorld,B as imageToWorldPanoramic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{a as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function q(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function U(t,n=!0){return q(t,k.OPK,n)}function C(t,n=!0){return q(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Rt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Rt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t}),ct=t=>null!=t&&"queryExtent"in t;function st(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function lt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ft);return null!=s&&ut(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ft(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ut(t){return null!=t[1]&&null!=t[5]}function ht(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...gt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function mt(t,n,a,e){return jt(e)?U([e.omega,e.phi,e.kappa]):Ot(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function pt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=Pt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function gt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=lt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??mt(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const vt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>O(t?.elevationSource)&&null!=t?.extent,dt=t=>b(t?.elevationSource),xt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return dt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):vt(e)?e:Mt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},wt=t=>R(t?.heading)&&R(t?.pitch),yt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function bt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const jt=t=>2===t?.type,Ot=t=>1===t?.type;function zt(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function Pt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Rt(t,n,a,e=!1){return Ft(J(t,n),a,e)}function Ft(t,a,i=!1){const o=i?l(e(),q(a,k.YPR)):q(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Rt as adjustHorizonAngles,Ft as adjustHorizonAnglesVec3,bt as computeFarplaneVertices,K as computeHFOVAndVFOV,st as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,J as createMeshSpaceVector,q as createRotationMatrix,C as createRotationMatrixFromHPR,U as createRotationMatrixFromOPK,Pt as extractHorizonAngles,lt as getAffinesAndFocalLength,pt as getImageToWorldPanoramicProperties,ht as getImageToWorldProperties,Q as getInitialAngle,xt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,gt as getWorldToImageProperties,wt as hasAngles,Ot as hasHeadingPitchRoll,jt as hasOmegaPhiKappa,ct as isElevationSampler,vt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,dt as isUpdateUsingConstantElevation,ut as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,yt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
|
|
2
|
+
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as r,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as l,multiply as f}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as u,mul as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as m,sub as p,add as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as v}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectAsync as d}from"../../../geometry/projectionUtils.js";import{earth as x}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{a as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as j,isElevationSource as O}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as z}from"../core/utils.js";import{getElevationSampler as P}from"./updateElevationUtils.js";import{isNumber as R}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,f,m]=a;S(e,o,r,c);const p=S(s,l,f,m),g=H(e,o,r,c),v=H(s,l,f,m),M=u(i(),g),d=h(i(),M,v),[x,w,y,b]=D(t,d);return[x/b,w/b,p?0:y/b]}function S(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function V(t){return 0===t?1:t}function D(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=V(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function H(t,n,a,e){const r=I(s([...e,1]),u(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),c=r[0],l=r[1],f=r[2],h=i();return h[0]=c*t[0],h[1]=l*n[0],h[2]=f*a[0],h[3]=0,h[4]=c*t[1],h[5]=l*n[1],h[6]=f*a[1],h[7]=0,h[8]=c*t[2],h[9]=l*n[2],h[10]=f*a[2],h[11]=0,h[12]=c,h[13]=l,h[14]=f,h[15]=1,h}function L(t,n,a,e,i=r()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function N(t,n,a){const e=r();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function A(t,n){const[a,e,i]=t,o=r();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function I(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function Y(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function U(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=Y(n[t],e,r,i);f(o,c,o)}return o}function q(t,n=!0){return U(t,k.OPK,n)}function C(t,n=!0){return U(t,k.HPR,n)}function K(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function T(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/m,g=o/m,v=r/m,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(i/(m*M))+h,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function X(t,n,a,e,i=F/2){const{heading:o,pitch:r}=G(t,i),c=e?Pt(o,r,e):[o,r];return{heading:o,pitch:r,...Z(c[0],c[1],n,a)}}function Z(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e)}}function G(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function J(t,n){return[Math.sin(a(t))*Math.sin(a(n)),Math.cos(a(t))*Math.sin(a(n)),Math.cos(a(180-n))]}function $(t,n,a,e=F/2){const i=a?Pt(t,n,a,!0):[t,n];return m(c(),J(i[0],i[1]),e)}function B(t,n,a,e,i=F/2){const{heading:o,pitch:r}=W(t,n,a);return $(o,r,e,i)}async function Q(t,a,e){const i=await d(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function _(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const tt=t=>t.toArray(),nt=(...t)=>t.some(t=>t);function at(t,n){if(nt(0===t.length,t.some(({x:t,y:n})=>nt(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function et(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function it(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function ot(t,n){return w(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/x.radius))):1}const rt=t=>n=>new M({x:n[0],y:n[1],z:n[2],spatialReference:t});function ct(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(y(r(),a,[n,i,0]),e,t))}function st({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(lt);return null!=s&&ft(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function lt(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function ft(t){return null!=t[1]&&null!=t[5]}function ut(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=Ot(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...pt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ht(t,n,a,e){return bt(e)?q([e.omega,e.phi,e.kappa]):jt(e)?C([e.heading,e.pitch,e.roll]):C([t,n,a??0])}function mt(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=Ot(t,t.location.spatialReference),l=(c.z??0)-i;let f=-e,u=0,h=0;if(t?.matrix){const{matrix:n}=t;[u,h,f]=zt(n)}return{averageElevation:l,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s,horizonYaw:f,horizonPitch:u,horizonRoll:h}}function pt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=st({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??ht(l,u,h,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const gt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,vt=t=>O(t?.elevationSource)&&null!=t?.extent,Mt=t=>b(t?.elevationSource),dt=async(t,n,a,e,i)=>{const o=z(t),r=n-a/o;return Mt(e)?(e.elevationSource=new j({constantElevation:e.elevationSource.constantElevation/o}),e):gt(e)?e:vt(e)?{elevationSample:await P({...v(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new j({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},xt=t=>R(t?.heading)&&R(t?.pitch),wt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function yt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:c,scalingFactor:s,verticalFieldOfView:f}=t,u=e();l(u,c);const h=2*Math.tan(a(f)/2)*i*s,m=2*Math.tan(a(o)/2)*i*s,v=A([0,0,-1],u),M=L([n.x,n.y,n.z],v,t.farDistance*s,s),d=A([0,1,0],u),x=A([1,0,0],u),w=N(d,h/2,s),y=N(x,m/2,s),b=p(r(),w,y),j=g(r(),w,y);return[g(r(),M,b),g(r(),M,j),p(r(),M,b),p(r(),M,j)]}const bt=t=>2===t?.type,jt=t=>1===t?.type;function Ot(t,n,a=!0){const e=z(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,b(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}function zt(t){return[n(Math.asin(-t[6])),n(Math.atan(t[7]/t[8])),n(Math.atan2(t[3],t[0]))]}function Pt(t,n,a,e=!1){return Rt(J(t,n),a,e)}function Rt(t,a,i=!1){const o=i?l(e(),U(a,k.YPR)):U(a,k.YPR),r=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=t[0]*o[3]+t[1]*o[4]+t[2]*o[5],s=t[0]*o[6]+t[1]*o[7]+t[2]*o[8],f=n(Math.acos(-s));return[n(Math.atan2(r,c)),f]}export{Pt as adjustHorizonAngles,Rt as adjustHorizonAnglesVec3,yt as computeFarplaneVertices,K as computeHFOVAndVFOV,ct as computeNewReferenceCoordinates,$ as convertHeadingPitchToSphereVertex,Z as convertOrientationToPixelLocation,B as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,G as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,Ot as convertToSRUnits,J as createMeshSpaceVector,U as createRotationMatrix,C as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,zt as extractHorizonAngles,st as getAffinesAndFocalLength,mt as getImageToWorldPanoramicProperties,ut as getImageToWorldProperties,Q as getInitialAngle,dt as getUpdateElevationProps,ot as getWebMercatorScalingFactor,pt as getWorldToImageProperties,xt as hasAngles,jt as hasHeadingPitchRoll,bt as hasOmegaPhiKappa,gt as isUpdateElevationWithElevationSampler,vt as isUpdateElevationWithElevationSource,Mt as isUpdateUsingConstantElevation,ft as isValidAffines,H as linearEquationSolve,T as ltpToGeographic,nt as or,tt as pointToArray,E as projectiveTransform,wt as reducerFn,_ as rotatePixel,L as scaleAndAddWithFactor,N as scaleWithFactor,A as transformMat3,I as transformMat4,at as validatePixelsToTransform,et as validatePointsToTransform,it as validateRotationMatrix,rt as vecToPoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../../../geometry/Point.js";import{GeospatialPDFWorkerClient as n}from"../../geospatialPDF/GeospatialPDFWorkerClient.js";import a from"./BaseRaster.js";import o from"../../support/PixelBlock.js";import h from"../../support/RasterInfo.js";let l=class extends a{constructor(){super(...arguments),this._workerClient=new n,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(t,e,i,s={}){const r=this._extent,n=this._ctm,a=this.getTileExtentPDF(t,e,i);if(!a.intersects(r))return null;return p(await this._workerClient.render(a,this._tileSize,this._tileSize,n,this._neatlineRing,s))}async _open(t){if(!this.url)throw new e("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const i=await this._workerClient.loadPDF({url:this.url,page:this.page},t);this.frame=i.frame;const s=this.frame.outerExtentMediabox;if(!s)throw new e("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=i.fullExtent,this._extent=s,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const r=m(this.frame.ctm,this._extent);this._width=r[0],this._height=r[1];const n={x:s.width/this._width,y:s.height/this._height},a=new h({width:this._width,height:this._height,pixelType:"u8",extent:s,pixelSize:n,spatialReference:s.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(a,this._tileSize,this._tileSize),this._set("rasterInfo",a),this.updateTileInfo()}getTileExtentPDF(t,e,i){const s=this._extent,n=2**t,a=s.width/this._width*n,o=s.height/this._height*n,h=new r({x:s.xmin,y:s.ymax});return this.getTileExtent({x:a,y:o},e,i,h,s.spatialReference,[512,512])}};function p(t){return new o({width:t.width,height:t.height,pixelType:"u8",pixels:[t.red,t.green,t.blue],mask:t.mask})}function m(t,
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../../../geometry/Point.js";import{GeospatialPDFWorkerClient as n}from"../../geospatialPDF/GeospatialPDFWorkerClient.js";import a from"./BaseRaster.js";import o from"../../support/PixelBlock.js";import h from"../../support/RasterInfo.js";let l=class extends a{constructor(){super(...arguments),this._workerClient=new n,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(t,e,i,s={}){const r=this._extent,n=this._ctm,a=this.getTileExtentPDF(t,e,i);if(!a.intersects(r))return null;return p(await this._workerClient.render(a,this._tileSize,this._tileSize,n,this._neatlineRing,s))}async _open(t){if(!this.url)throw new e("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const i=await this._workerClient.loadPDF({url:this.url,page:this.page},t);this.frame=i.frame;const s=this.frame.outerExtentMediabox;if(!s)throw new e("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=i.fullExtent,this._extent=s,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const r=m(this.frame.ctm,this._extent);this._width=r[0],this._height=r[1];const n={x:s.width/this._width,y:s.height/this._height},a=new h({width:this._width,height:this._height,pixelType:"u8",extent:s,pixelSize:n,spatialReference:s.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(a,this._tileSize,this._tileSize),this._set("rasterInfo",a),this.updateTileInfo()}getTileExtentPDF(t,e,i){const s=this._extent,n=2**t,a=s.width/this._width*n,o=s.height/this._height*n,h=new r({x:s.xmin,y:s.ymax});return this.getTileExtent({x:a,y:o},e,i,h,s.spatialReference,[512,512])}};function p(t){return new o({width:t.width,height:t.height,pixelType:"u8",pixels:[t.red,t.green,t.blue],mask:t.mask})}function m(t,i){const[s,r,n,a]=t,o=s*a-r*n;if(!Number.isFinite(o)||0===o)throw new e("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");const h=10*Math.hypot(a,r)/Math.abs(o),l=10*Math.hypot(n,s)/Math.abs(o),p=Math.max(1,Math.ceil(i.width*h)),m=Math.max(1,Math.ceil(i.height*l));if(!Number.isFinite(p)||!Number.isFinite(m))throw new e("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[p,m]}t([i({type:String,json:{write:!0}})],l.prototype,"datasetFormat",void 0),t([i({constructOnly:!0})],l.prototype,"page",void 0),t([i({readOnly:!0})],l.prototype,"tileType",void 0),l=t([s("esri.layers.raster.datasets.GeospatialPDFRaster")],l);export{l as default};
|
package/layers/raster/types.d.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ClonableMixin } from "../../core/Clonable.js";
|
|
2
|
+
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
|
|
4
|
+
export interface TimeSeriesCalculationProperties extends Partial<Pick<TimeSeriesCalculation, "name" | "title" | "type">> {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The calculation method by which to derive a data value for a time series. By default,
|
|
8
|
+
* each time series info includes the raw values returned from each field.
|
|
9
|
+
*
|
|
10
|
+
* @since 5.2
|
|
11
|
+
*/
|
|
12
|
+
export type TimeSeriesCalculationMethod = "change-from-first" | "change-from-previous" | "percent-change-from-first" | "percent-change-from-previous";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Defines a calculation method that can be used to derive data values for a time series.
|
|
16
|
+
*
|
|
17
|
+
* @since 5.2
|
|
18
|
+
*/
|
|
19
|
+
export default class TimeSeriesCalculation extends TimeSeriesCalculationSuperclass {
|
|
20
|
+
constructor(properties?: TimeSeriesCalculationProperties);
|
|
21
|
+
/**
|
|
22
|
+
* A unique identifier for the calculation method within the time series.
|
|
23
|
+
*
|
|
24
|
+
* @since 5.2
|
|
25
|
+
*/
|
|
26
|
+
accessor name: string | null | undefined;
|
|
27
|
+
/** A user-friendly name for the calculation method. */
|
|
28
|
+
accessor title: string | null | undefined;
|
|
29
|
+
/** The method by which to calculate a time series data value. */
|
|
30
|
+
accessor type: TimeSeriesCalculationMethod | null | undefined;
|
|
31
|
+
}
|
|
32
|
+
declare const TimeSeriesCalculationSuperclass: typeof JSONSupport & typeof ClonableMixin
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as o,subclass as i}from"../../core/accessorSupport/decorators.js";let s=class extends(r(t)){constructor(e){super(e),this.name=null,this.type=null,this.title=null}};e([o({type:String,json:{write:{isRequired:!0}}})],s.prototype,"name",void 0),e([o({type:["change-from-first","change-from-previous","percent-change-from-first","percent-change-from-previous"],json:{write:{isRequired:!0}}})],s.prototype,"type",void 0),e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),s=e([i("esri.layers.support.TimeSeriesCalculation")],s);const p=s;export{p as default};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import type TimeSeriesCalculation from "./TimeSeriesCalculation.js";
|
|
1
2
|
import type TimeSeriesFieldTimeMapping from "./TimeSeriesFieldTimeMapping.js";
|
|
2
3
|
import type TimeExtent from "../../time/TimeExtent.js";
|
|
3
4
|
import type { ClonableMixin } from "../../core/Clonable.js";
|
|
4
5
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
5
6
|
import type { TimeSeriesFieldTimeMappingProperties } from "./TimeSeriesFieldTimeMapping.js";
|
|
6
7
|
import type { TimeExtentProperties } from "../../time/TimeExtent.js";
|
|
8
|
+
import type { TimeSeriesCalculationProperties } from "./TimeSeriesCalculation.js";
|
|
7
9
|
|
|
8
10
|
/** @since 5.1 */
|
|
9
11
|
export interface TimeSeriesInfoProperties extends Partial<Pick<TimeSeriesInfo, "name" | "timeInterval" | "timeIntervalUnits" | "timeValueUnits" | "title">> {
|
|
12
|
+
/**
|
|
13
|
+
* Additional calculation methods that can be used to create time series data values. Value at instant
|
|
14
|
+
* behavior is implicit.
|
|
15
|
+
*
|
|
16
|
+
* @default null
|
|
17
|
+
* @since 5.2
|
|
18
|
+
*/
|
|
19
|
+
calculationMethods?: TimeSeriesCalculationProperties[] | null;
|
|
10
20
|
/** The mapping between field names and time values for the time series configuration. */
|
|
11
21
|
fieldTimeMappings?: TimeSeriesFieldTimeMappingProperties[] | null;
|
|
12
22
|
/**
|
|
@@ -96,6 +106,15 @@ export interface TimeSeriesInfoProperties extends Partial<Pick<TimeSeriesInfo, "
|
|
|
96
106
|
*/
|
|
97
107
|
export default class TimeSeriesInfo extends TimeSeriesInfoSuperclass {
|
|
98
108
|
constructor(properties?: TimeSeriesInfoProperties);
|
|
109
|
+
/**
|
|
110
|
+
* Additional calculation methods that can be used to create time series data values. Value at instant
|
|
111
|
+
* behavior is implicit.
|
|
112
|
+
*
|
|
113
|
+
* @default null
|
|
114
|
+
* @since 5.2
|
|
115
|
+
*/
|
|
116
|
+
get calculationMethods(): TimeSeriesCalculation[] | null | undefined;
|
|
117
|
+
set calculationMethods(value: TimeSeriesCalculationProperties[] | null | undefined);
|
|
99
118
|
/** The mapping between field names and time values for the time series configuration. */
|
|
100
119
|
get fieldTimeMappings(): TimeSeriesFieldTimeMapping[] | null | undefined;
|
|
101
120
|
set fieldTimeMappings(value: TimeSeriesFieldTimeMappingProperties[] | null | undefined);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import s from"./TimeSeriesCalculation.js";import p from"./TimeSeriesFieldTimeMapping.js";import n from"../../time/TimeExtent.js";let l=class extends(e(i)){constructor(t){super(t),this.name=null,this.fieldTimeMappings=null,this.timeExtent=null,this.timeInterval=null,this.timeIntervalUnits=null,this.timeValueUnits=null,this.title=null,this.calculationMethods=null,this.type="time-series-fields"}};t([o({type:String,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),t([o({type:[p],json:{write:{isRequired:!0}}})],l.prototype,"fieldTimeMappings",void 0),t([o({type:n,json:{write:!0}})],l.prototype,"timeExtent",void 0),t([o({type:Number,json:{write:{isRequired:!0}}})],l.prototype,"timeInterval",void 0),t([o({type:String,json:{write:{isRequired:!0}}})],l.prototype,"timeIntervalUnits",void 0),t([o({type:String,json:{write:{isRequired:!0}}})],l.prototype,"timeValueUnits",void 0),t([o({type:String,json:{write:!0}})],l.prototype,"title",void 0),t([o({type:[s],json:{write:!0}})],l.prototype,"calculationMethods",void 0),t([o({type:String,readOnly:!0,json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),l=t([r("esri.layers.support.TimeSeriesInfo")],l);export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{JSONMap as e}from"../../core/jsonMap.js";import{excludeTables as r}from"../../core/accessorSupport/layerContainerType.js";import n from"../../geometry/Extent.js";import i from"../../geometry/SpatialReference.js";import{w as
|
|
2
|
+
import{JSONMap as e}from"../../core/jsonMap.js";import{excludeTables as r}from"../../core/accessorSupport/layerContainerType.js";import n from"../../geometry/Extent.js";import i from"../../geometry/SpatialReference.js";import a from"./TimeInfo.js";import{w as o}from"../../chunks/persistableUrlUtils.js";import t from"../../symbols/support/ElevationInfo.js";import s from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as l}from"../../webdoc/support/opacityUtils.js";const p={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:r}}},y={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},d={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:r}}},m={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:o}}},c={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:r}}},f={value:null,type:t,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:r}}};function w(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:{enabled:!0,layerContainerTypes:r},read:!0},u={type:Number,json:{origins:{"web-document":g,"portal-item":{write:{layerContainerTypes:r}}}}},b={...u,json:{...u.json,origins:{"web-document":{...g,write:{enabled:!0,layerContainerTypes:r,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?l(r.layerDefinition.drawingInfo.transparency):void 0:l(r.drawingInfo.transparency)}}},j={type:n,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,r)=>{const a=n.fromJSON(e);return null!=r.spatialReference&&"object"==typeof r.spatialReference&&(a.spatialReference=i.fromJSON(r.spatialReference)),a}}}},read:!1}},v={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},I={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:r}}},T={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:r}}},C={json:{write:{ignoreOrigin:!0,layerContainerTypes:r},origins:{"web-map":{read:!1,write:!1}}}},D={type:s,json:{name:"attributeTableInfo",write:!0}},N=new e({High:"high",Medium:"medium",Low:"low",None:"none"}),O={type:N.apiValues,json:{name:"layerDefinition.barrierWeight",default:"high",read:N.read,write:N.write,origins:{service:{read:!1}}}};function h(e){return{name:"layerDefinition.timeInfo",read:!0,write:{enabled:!0,overridePolicy(r,n){return{enabled:!0,ignoreOrigin:!!e&&this.originIdOf(n)<3}}}}}function S(e){const r=e?.alwaysWriteNonItemOrigin,n=e?.webDocumentOrigin??"web-document",i={[n]:h(r),"portal-item":h(r)};return e?.disableServiceOrigin&&(i.service={read:!1,write:!1}),{type:a,json:{name:e?.name,origins:i}}}export{D as attributeTableTemplate,O as barrierWeight,f as elevationInfo,v as id,d as labelsVisible,c as legendEnabled,C as listMode,T as maxScale,I as minScale,u as opacity,b as opacityDrawingInfo,y as popupEnabled,w as readOnlyService,j as sceneLayerFullExtent,p as screenSizePerspectiveEnabled,S as timeInfo,m as url};
|
|
@@ -6,15 +6,39 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type TimeSeriesInfo from "./TimeSeriesInfo.js";
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Options for creating a time series Arcade expression.
|
|
11
|
+
*
|
|
12
|
+
* @since 5.2
|
|
13
|
+
*/
|
|
14
|
+
export interface CreateTimeSeriesExpressionOptions {}
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* Creates an [Arcade expression](https://developers.arcgis.com/javascript/latest/arcade/) that resolves values from a time series data series using the
|
|
11
18
|
* current [Map element](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) time.
|
|
12
19
|
*
|
|
13
20
|
* @param dataSeriesInfo - The data series definition used to build the expression.
|
|
21
|
+
* @param options - Options used to create the expression.
|
|
14
22
|
* @returns An [Arcade expression](https://developers.arcgis.com/javascript/latest/arcade/) string.
|
|
15
23
|
* @since 5.1
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import TimeSeriesInfo from "@arcgis/core/layers/support/TimeSeriesInfo.js";
|
|
27
|
+
* import { createTimeSeriesExpression } from "@arcgis/core/layers/support/timeSeriesUtils.js";
|
|
28
|
+
*
|
|
29
|
+
* const info = new TimeSeriesInfo({
|
|
30
|
+
* name: "visitationNumbers",
|
|
31
|
+
* fieldTimeMappings: [
|
|
32
|
+
* { fieldName: "visitationNumbers_2020", timeValue: "2020" },
|
|
33
|
+
* { fieldName: "visitationNumbers_2021", timeValue: "2021" },
|
|
34
|
+
* ],
|
|
35
|
+
* timeValueUnits: "years",
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const expression = createTimeSeriesExpression(info, { calculationMethod: "change-from-previous" });
|
|
39
|
+
* ```
|
|
16
40
|
*/
|
|
17
|
-
export function createTimeSeriesExpression(dataSeriesInfo: TimeSeriesInfo): string;
|
|
41
|
+
export function createTimeSeriesExpression(dataSeriesInfo: TimeSeriesInfo, options?: CreateTimeSeriesExpressionOptions): string;
|
|
18
42
|
|
|
19
43
|
/**
|
|
20
44
|
* Maps a data series time value unit to the corresponding Arcade string that dictates time formatting.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e){const
|
|
2
|
+
function e(e,n){const{calculationMethod:t}=n??{},a=e.fieldTimeMappings??[];if(!a.length)return"return null;";const u=r(e.timeValueUnits??"years");if(!t){const e=a.map(({fieldName:e,timeValue:r})=>` "${r}", $feature.${e},`);return`var timeFormat = "${u}";\n\nvar hasCurrentStart = HasValue($view, ["timeProperties", "currentStart"]);\nvar hasCurrentEnd = HasValue($view, ["timeProperties", "currentEnd"]);\n\nif (!hasCurrentStart && !hasCurrentEnd) {\n return $feature.${a[0].fieldName};\n}\n\nvar currentTime = DefaultValue($view.timeProperties.currentEnd, $view.timeProperties.currentStart);\nvar formattedCurrentTime = Text(currentTime, timeFormat);\n\nreturn Decode(formattedCurrentTime,\n${e.join("\n")}\n null\n);`}const i=a.map(({timeValue:e},r)=>` "${e}", ${r},`),s="percent-change-from-first"===t||"percent-change-from-previous"===t,c=`${"change-from-first"===t||"percent-change-from-first"===t?"var comparisonValue = fieldValues[0];":"if (currentIndex == 0) {\n return null;\n}\nvar comparisonValue = fieldValues[currentIndex - 1];"}\n\nif (IsEmpty(comparisonValue)${s?" || comparisonValue == 0":""}) {\n return null;\n}\n\nreturn ${s?"Round(((currentValue - comparisonValue) / comparisonValue) * 100, 2)":"currentValue - comparisonValue"};`;return`var timeFormat = "${u}";\nvar fieldValues = [\n${a.map(({fieldName:e})=>` $feature.${e},`).join("\n")}\n];\n\nfunction getCurrentIndex() {\n var hasCurrentStart = HasValue($view, ["timeProperties", "currentStart"]);\n var hasCurrentEnd = HasValue($view, ["timeProperties", "currentEnd"]);\n\n if (!hasCurrentStart && !hasCurrentEnd) {\n return ${a.length>1?1:"null"};\n }\n\n var currentTime = DefaultValue($view.timeProperties.currentEnd, $view.timeProperties.currentStart);\n var formattedCurrentTime = Text(currentTime, timeFormat);\n\n return Decode(formattedCurrentTime,\n${i.join("\n")}\n null\n );\n}\n\nvar currentIndex = getCurrentIndex();\nif (currentIndex == null) {\n return null;\n}\n\nvar currentValue = fieldValues[currentIndex];\nif (IsEmpty(currentValue)) {\n return null;\n}\n\n${c}`}function r(e){switch(e){case"centuries":case"decades":case"years":default:return"Y";case"months":return"Y-M";case"weeks":case"days":return"Y-M-D";case"hours":case"minutes":return"Y-M-D-H-mm";case"seconds":return"Y-M-D-H-mm-ss"}}export{e as createTimeSeriesExpression,r as getArcadeTimeFormatString};
|
package/layers/types.d.ts
CHANGED
|
@@ -398,6 +398,7 @@ export interface QueryCapabilities {
|
|
|
398
398
|
* for the individual features contributing to each [aggregated](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
399
399
|
* statistics query result.
|
|
400
400
|
*
|
|
401
|
+
* @internal
|
|
401
402
|
* @since 5.1
|
|
402
403
|
* @see [Query.returnStatisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
403
404
|
* @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.126",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.126",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.80",
|
|
26
26
|
"@vaadin/grid": "~25.3.0",
|
|
@@ -286,7 +286,10 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
|
|
|
286
286
|
* featureContentCollection.includeDefaultActions = false;
|
|
287
287
|
*/
|
|
288
288
|
accessor includeDefaultActions: boolean;
|
|
289
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* Indicates whether to initially display a list of features, or the content for one feature.
|
|
291
|
+
* By default, a list is displayed when the associated view has `focusRegionEnabled` enabled; otherwise, the content for one feature is displayed.
|
|
292
|
+
*/
|
|
290
293
|
accessor initialDisplayMode: InitialDisplayOptions;
|
|
291
294
|
/**
|
|
292
295
|
* Geometry used to show the location of the feature. This is automatically set when selecting a feature. If displaying content not related to features in the map, such as the results from a task, then you must set this property before setting [open](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#open) to `true`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as i}from"../core/deprecate.js";import r from"../core/Error.js";import{EventedAccessor as s}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as o,logOnError as l,isAbortError as u}from"../core/promiseUtils.js";import h from"../core/ReactiveSet.js";import{watch as c,when as p,sync as d}from"../core/reactiveUtils.js";import{addMany as g}from"../core/SetUtils.js";import{property as m,subclass as f}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import{project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as v}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as w}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as b}from"../layers/LayerConstants.js";import{ActionsCollection as I,zoomToAggregatedFeatures as C,browseAggregatedFeatures as P,zoomToFeature as S}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./FeatureContent.js";import x from"./support/FeatureAbilities.js";import{getDisplayedSymbol as j}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U=()=>[S.clone()],T=()=>[C.clone(),P.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let V=class extends(O(s)){constructor(e){super(e),this._pendingPromises=new h,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new x,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new I,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.streamingFeatures=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),p(()=>!this.waitingForResult,()=>this._waitingForResultChange(),d),p(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new I;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:a,selectedFeature:n}=this,o=a?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(o)??o;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this.diagnostics=null,this.featureStream=null,this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new I;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():U()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this.diagnostics=null,this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._setStreamingFeatures(!0),this._consumeFeatureStream(e,t).catch(()=>{})}get initialDisplayMode(){return this._get("initialDisplayMode")??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?v(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){const e=this._get("promises")||[];return e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),e}set promises(e){Array.isArray(e)&&e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),g(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(this.streamingFeatures||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({diagnostics:null,featureStream:null,promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}async fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new r("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:i});const s={},a=i.fetchPopupFeatures(e,{diagnostics:s,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this.featureStream=a,this.diagnostics=s}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i>0&&e.length>0,a=null!=this._activeFeatureStream&&e.length>0,n=s||a;"list"!==this.initialDisplayMode?n&&-1===r?this.selectedFeatureIndex=0:n&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!n||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:s}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{u(e)||a.getLogger(this).error(e)}):Promise.reject(new r("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,n=Math.min(a+r,s.length);for(let o=a;o<n;o++){const t=s[o];t&&(t.graphic??=e[o])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=w(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await j(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,a=this.map,n=this.timeZone,o=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:o,map:a,view:r,timeZone:n});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,r=i?.geometry?.type,s=this.location;if(r&&"mesh"!==r&&t&&s&&i){if("point"===r){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let r=i.geometry;const a=this._getHighlightLayer(i),n=i.getObjectId();if(!a||!this.view)return;if(null!=n){const i=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[n],s.returnGeometry=!0;const{features:o}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;r=o[0]?.geometry}if(!r||"mesh"===r.type)return;r=_(r,t),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:o},{proximityGetNearestCoordinate:l}]=M;if(!o(r,s)){const e=l(r,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(n){u(n)||a.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=w(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||b:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:a}=this;if(!s||!r||!a)return;const n=this._getHighlightLayer(i);if(!n)return;const o=this._getHighlightLayerView(s,n);if(!o)return;this._highlightPromises[e]=o;const l=await o;if(!(l&&R(l)&&this._highlightPromises[e]===o&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_setStreamingFeatures(e){this._set("streamingFeatures",e)}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([m({type:I})],V.prototype,"actions",void 0),e([m({readOnly:!0})],V.prototype,"active",null),e([m()],V.prototype,"activeFeature",void 0),e([m({readOnly:!0})],V.prototype,"allActions",null),e([m()],V.prototype,"aggregatedFeaturesEnabled",void 0),e([m({value:null})],V.prototype,"content",null),e([m({type:I,readOnly:!0})],V.prototype,"defaultActions",null),e([m({type:Boolean})],V.prototype,"defaultPopupTemplateEnabled",void 0),e([m()],V.prototype,"diagnostics",void 0),e([m({readOnly:!0})],V.prototype,"effectiveHeading",null),e([m({readOnly:!0})],V.prototype,"featureCount",null),e([m()],V.prototype,"featurePage",void 0),e([m({value:[]})],V.prototype,"features",null),e([m()],V.prototype,"featureStream",null),e([m()],V.prototype,"featuresPerPage",void 0),e([m()],V.prototype,"featureMenuOpen",void 0),e([m({type:x})],V.prototype,"featureItemAbilities",void 0),e([m({readOnly:!0})],V.prototype,"featureItems",void 0),e([m()],V.prototype,"heading",void 0),e([m()],V.prototype,"highlightEnabled",void 0),e([m()],V.prototype,"includeDefaultActions",void 0),e([m()],V.prototype,"initialDisplayMode",null),e([m({type:y})],V.prototype,"location",null),e([m()],V.prototype,"map",null),e([m()],V.prototype,"open",void 0),e([m({readOnly:!0})],V.prototype,"streamingFeatures",void 0),e([m({readOnly:!0})],V.prototype,"pendingPromisesCount",null),e([m({readOnly:!0})],V.prototype,"promiseCount",null),e([m()],V.prototype,"promises",null),e([m({value:null,readOnly:!0})],V.prototype,"selectedFeature",null),e([m({value:-1})],V.prototype,"selectedFeatureIndex",null),e([m({readOnly:!0})],V.prototype,"selectedFeatureItem",null),e([m({type:F})],V.prototype,"spatialReference",null),e([m({readOnly:!0})],V.prototype,"state",null),e([m()],V.prototype,"timeZone",null),e([m()],V.prototype,"updateLocationEnabled",void 0),e([m()],V.prototype,"view",void 0),e([m({readOnly:!0})],V.prototype,"waitingForContents",null),e([m({readOnly:!0})],V.prototype,"waitingForResult",null),e([m()],V.prototype,"zoomFactor",void 0),V=e([f("esri.popup.FeatureContentCollection")],V);const D=V;export{D as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as i}from"../core/deprecate.js";import r from"../core/Error.js";import{EventedAccessor as s}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as n,logOnError as l,isAbortError as u}from"../core/promiseUtils.js";import h from"../core/ReactiveSet.js";import{watch as c,when as p,sync as d}from"../core/reactiveUtils.js";import{addMany as g}from"../core/SetUtils.js";import{property as m,subclass as f}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import{project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as v}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as w}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as b}from"../layers/LayerConstants.js";import{ActionsCollection as I,zoomToAggregatedFeatures as C,browseAggregatedFeatures as P,zoomToFeature as S}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./FeatureContent.js";import x from"./support/FeatureAbilities.js";import{getDisplayedSymbol as j}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U=()=>[S.clone()],T=()=>[C.clone(),P.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let V=class extends(O(s)){constructor(e){super(e),this._pendingPromises=new h,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new x,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new I,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.streamingFeatures=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),p(()=>!this.waitingForResult,()=>this._waitingForResultChange(),d),p(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new I;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:a,selectedFeature:o}=this,n=a?r.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(n)??n;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this.diagnostics=null,this.featureStream=null,this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new I;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():U()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this.diagnostics=null,this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._setStreamingFeatures(!0),this._consumeFeatureStream(e,t).catch(()=>{})}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?v(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){const e=this._get("promises")||[];return e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),e}set promises(e){Array.isArray(e)&&e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),g(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(this.streamingFeatures||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({diagnostics:null,featureStream:null,promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}async fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new r("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:i});const s={},a=i.fetchPopupFeatures(e,{diagnostics:s,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this.featureStream=a,this.diagnostics=s}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i>0&&e.length>0,a=null!=this._activeFeatureStream&&e.length>0,o=s||a;"list"!==this.initialDisplayMode?o&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!o||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:s}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{u(e)||a.getLogger(this).error(e)}):Promise.reject(new r("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,o=Math.min(a+r,s.length);for(let n=a;n<o;n++){const t=s[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=w(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await j(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,a=this.map,o=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:n,map:a,view:r,timeZone:o});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,r=i?.geometry?.type,s=this.location;if(r&&"mesh"!==r&&t&&s&&i){if("point"===r){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let r=i.geometry;const a=this._getHighlightLayer(i),o=i.getObjectId();if(!a||!this.view)return;if(null!=o){const i=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;r=n[0]?.geometry}if(!r||"mesh"===r.type)return;r=_(r,t),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=M;if(!n(r,s)){const e=l(r,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(o){u(o)||a.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=w(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||b:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:a}=this;if(!s||!r||!a)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(s,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&R(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_setStreamingFeatures(e){this._set("streamingFeatures",e)}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([m()],V.prototype,"_initialDisplayMode",void 0),e([m({type:I})],V.prototype,"actions",void 0),e([m({readOnly:!0})],V.prototype,"active",null),e([m()],V.prototype,"activeFeature",void 0),e([m({readOnly:!0})],V.prototype,"allActions",null),e([m()],V.prototype,"aggregatedFeaturesEnabled",void 0),e([m({value:null})],V.prototype,"content",null),e([m({type:I,readOnly:!0})],V.prototype,"defaultActions",null),e([m({type:Boolean})],V.prototype,"defaultPopupTemplateEnabled",void 0),e([m()],V.prototype,"diagnostics",void 0),e([m({readOnly:!0})],V.prototype,"effectiveHeading",null),e([m({readOnly:!0})],V.prototype,"featureCount",null),e([m()],V.prototype,"featurePage",void 0),e([m({value:[]})],V.prototype,"features",null),e([m()],V.prototype,"featureStream",null),e([m()],V.prototype,"featuresPerPage",void 0),e([m()],V.prototype,"featureMenuOpen",void 0),e([m({type:x})],V.prototype,"featureItemAbilities",void 0),e([m({readOnly:!0})],V.prototype,"featureItems",void 0),e([m()],V.prototype,"heading",void 0),e([m()],V.prototype,"highlightEnabled",void 0),e([m()],V.prototype,"includeDefaultActions",void 0),e([m()],V.prototype,"initialDisplayMode",null),e([m({type:y})],V.prototype,"location",null),e([m()],V.prototype,"map",null),e([m()],V.prototype,"open",void 0),e([m({readOnly:!0})],V.prototype,"streamingFeatures",void 0),e([m({readOnly:!0})],V.prototype,"pendingPromisesCount",null),e([m({readOnly:!0})],V.prototype,"promiseCount",null),e([m()],V.prototype,"promises",null),e([m({value:null,readOnly:!0})],V.prototype,"selectedFeature",null),e([m({value:-1})],V.prototype,"selectedFeatureIndex",null),e([m({readOnly:!0})],V.prototype,"selectedFeatureItem",null),e([m({type:F})],V.prototype,"spatialReference",null),e([m({readOnly:!0})],V.prototype,"state",null),e([m()],V.prototype,"timeZone",null),e([m()],V.prototype,"updateLocationEnabled",void 0),e([m()],V.prototype,"view",void 0),e([m({readOnly:!0})],V.prototype,"waitingForContents",null),e([m({readOnly:!0})],V.prototype,"waitingForResult",null),e([m()],V.prototype,"zoomFactor",void 0),V=e([f("esri.popup.FeatureContentCollection")],V);const D=V;export{D as default};
|
package/popup/types.d.ts
CHANGED
|
@@ -45,11 +45,22 @@ export interface DockOptionsBreakpoint {
|
|
|
45
45
|
height?: number;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated since 5.2. Only for internal use
|
|
50
|
+
* @since 5.0
|
|
51
|
+
*/
|
|
49
52
|
export interface FetchFeaturesOptions {
|
|
50
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* The view click event that is passed into the fetchFeatures method.
|
|
55
|
+
*
|
|
56
|
+
* @deprecated since 5.2. Only for internal use
|
|
57
|
+
*/
|
|
51
58
|
event?: ClickEvent;
|
|
52
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* An AbortSignal to cancel the fetch operation.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated since 5.2. Only for internal use
|
|
63
|
+
*/
|
|
53
64
|
signal?: AbortSignal;
|
|
54
65
|
}
|
|
55
66
|
|