@arcgis/core 6.0.0-next.40 → 6.0.0-next.41
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/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/059cda6f11a91dbc9e28.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +1 -0
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +1 -0
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +1 -0
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +1 -0
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 46504fc81f357bc7465a.js} +1 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +1 -0
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 54de7dc0597fc80d7a52.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 6738b3d6bce34a1e8be2.js} +1 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 8b0efcc30184593a0812.js} +21 -21
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +1 -0
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → b386e921c273de3ac7a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +1 -0
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → efc1a90742813b55602e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +1 -0
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +7 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{getReferenceEllipsoidFromWKID as n}from"../../geometry/ellipsoidUtils.js";import r from"../../geometry/Extent.js";import i from"../../geometry/Point.js";import a from"../../geometry/support/WKIDUnitConversion.js";import{isAxesOrderReversedForWkid as o}from"../ogc/crsUtils.js";import{visitXML as s}from"../ogc/xmlUtils.js";import c from"./LOD.js";import l from"./TileInfo.js";const u=90.71428571428571;function d(e){let t=e.replaceAll(/ows:/gi,``);return new DOMParser().parseFromString(t,`text/xml`)}function f(e){let n=e.documentElement;if(!g(`Contents`,n))throw new t(`wmtslayer:wmts-capabilities-xml-is-not-valid`,`the wmts get capabilities response is not compliant`)}function p(e,n){let r=e.documentElement,i=new Map,a=new Map,o=g(`Contents`,r);if(!o)throw new t(`wmtslayer:wmts-capabilities-xml-is-not-valid`,`Can't retrieve xml capabilities element`);let s=(g(`OperationsMetadata`,r)?.querySelector(`[name='GetTile']`))?.getElementsByTagName(`Get`),c=s&&Array.prototype.slice.call(s),l=n.url?.indexOf(`https`),u=l!==void 0&&l>-1,d=n.serviceMode,f,p=n?.url,m;c?.length&&c.some(e=>{let t=g(`Constraint`,e);return!t||b(`AllowedValues`,`Value`,d,t)?(p=e.attributes[0].nodeValue,!0):(!t||b(`AllowedValues`,`Value`,`RESTful`,t)||b(`AllowedValues`,`Value`,`REST`,t)?m=e.attributes[0].nodeValue:(!t||b(`AllowedValues`,`Value`,`KVP`,t))&&(f=e.attributes[0].nodeValue),!1)}),p||(m?(p=m,d=`RESTful`):f?(p=f,d=`KVP`):p=g(`ServiceMetadataURL`,r)?.getAttribute(`xlink:href`));let h=p.indexOf(`1.0.0/`);h===-1&&d===`RESTful`?p+=`/`:h>-1&&(p=p.slice(0,h)),d===`KVP`&&(p+=h>-1?``:`?`),u&&(p=p.replace(/^http:/i,`https:`));let v=y(`ServiceIdentification>ServiceTypeVersion`,r),S=y(`ServiceIdentification>AccessConstraints`,r),C=S&&/^none$/i.test(S)?null:S,w=_(`Layer`,o),T=_(`TileMatrixSet`,o);return{copyright:C,dimensionMap:a,layerMap:i,layers:w.map(e=>{let t=y(`Identifier`,e);return i.set(t,e),x(t,e,T,u,v)}),serviceMode:d,tileUrl:p}}function m(e){for(let t of e.layers)for(let e of t.tileMatrixSets??[]){let{tileInfo:t}=e;if(t&&t.dpi!==96){for(let n of t.lods??[])n.scale=n.scale*96/t.dpi,n.resolution=R(t.spatialReference?.wkid,n.scale*u/96,e.id);t.dpi=96}}}function h(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let n=0;n<t.childNodes.length;n++){let r=t.childNodes[n];if(h(r)&&r.nodeName===e)return r}return null}function _(e,t){let n=[];for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];h(i)&&i.nodeName===e&&n.push(i)}return n}function v(t,n){let r=[];for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e];h(i)&&i.nodeName===t&&r.push(i)}return r.map(e=>e.textContent).filter(e)}function y(e,t){return e.split(`>`).forEach(e=>{t&&=g(e,t)}),t&&t.textContent}function b(e,t,n,r){let i=Array.prototype.slice.call(r.childNodes),a;return i.some(r=>{if(r.nodeName.includes(e)){let e=g(t,r)?.textContent;if(e===n||n.split(`:`)&&n.split(`:`)[1]===e)return a=r,!0}return!1}),a}function x(e,t,n,r,i){let a=y(`Abstract`,t),o=v(`Format`,t);return{id:e,fullExtent:E(t),fullExtents:D(t),description:a,formats:o,styles:O(t,r),title:y(`Title`,t),tileMatrixSets:k(i,t,n)}}function S(e,t){let n=[],r=e.layerMap?.get(t);if(!r)return null;let i=_(`ResourceURL`,r),a=_(`Dimension`,r),o,s,c,l;return a.length&&(o=y(`Identifier`,a[0]),s=v(`Default`,a[0])||v(`Value`,a[0])),a.length>1&&(c=y(`Identifier`,a[1]),l=v(`Default`,a[1])||v(`Value`,a[1])),e.dimensionMap.set(t,{dimensions:s,dimensions2:l}),i.forEach(e=>{let t=e.getAttribute(`template`);if(e.getAttribute(`resourceType`)===`tile`){if(o&&s.length){if(t.includes(`{`+o+`}`))t=t.replace(`{`+o+`}`,`{dimensionValue}`);else{let e=t.toLowerCase().indexOf(`{`+o.toLowerCase()+`}`);e>-1&&(t=t.slice(0,e)+`{dimensionValue}`+t.slice(e+o.length+2))}}if(c&&l.length){if(t.includes(`{`+c+`}`))t=t.replace(`{`+c+`}`,`{dimensionValue2}`);else{let e=t.toLowerCase().indexOf(`{`+c.toLowerCase()+`}`);e>-1&&(t=t.slice(0,e)+`{dimensionValue2}`+t.slice(e+c.length+2))}}n.push({template:t,format:e.getAttribute(`format`),resourceType:`tile`})}}),n}function C(e,t,n,r,i,a,o,s){let c=w(e,t,r);if(!(c?.length>0))return``;let{dimensionMap:l}=e,u=l.get(t).dimensions?.[0],d=l.get(t).dimensions2?.[0];return c[o%c.length].template.replaceAll(/\{Style\}/gi,i??``).replaceAll(/\{TileMatrixSet\}/gi,n??``).replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,``+o).replaceAll(/\{TileCol\}/gi,``+s).replaceAll(/\{dimensionValue\}/gi,u).replaceAll(/\{dimensionValue2\}/gi,d)}function w(e,t,n){let r=S(e,t),i=r?.filter(e=>e.format===n);return(i?.length?i:r)??[]}function T(e,t,n,r){let{dimensionMap:i}=e,a=S(e,t),o=``;if(a&&a.length>0){let e=i.get(t).dimensions?.[0],s=i.get(t).dimensions2?.[0];o=a[0].template,o.endsWith(`.xxx`)&&(o=o.slice(0,-4)),o=o.replaceAll(/\{Style\}/gi,r),o=o.replaceAll(/\{TileMatrixSet\}/gi,n),o=o.replaceAll(/\{TileMatrix\}/gi,`{level}`),o=o.replaceAll(/\{TileRow\}/gi,`{row}`),o=o.replaceAll(/\{TileCol\}/gi,`{col}`),o=o.replaceAll(/\{dimensionValue\}/gi,e),o=o.replaceAll(/\{dimensionValue2\}/gi,s)}return o}function E(e){let t=g(`WGS84BoundingBox`,e),n=t?y(`LowerCorner`,t).split(` `):[`-180`,`-90`],r=t?y(`UpperCorner`,t).split(` `):[`180`,`90`];return{xmin:parseFloat(n[0]),ymin:parseFloat(n[1]),xmax:parseFloat(r[0]),ymax:parseFloat(r[1]),spatialReference:{wkid:4326}}}function D(e){let t=[];return s(e,{BoundingBox:e=>{if(!e.getAttribute(`crs`))return;let n=e.getAttribute(`crs`).toLowerCase(),r=j(n),i=n.includes(`epsg`)&&o(r.wkid),a,c,l,u;s(e,{LowerCorner:e=>{[a,c]=e.textContent.split(` `).map(e=>Number.parseFloat(e)),i&&([a,c]=[c,a])},UpperCorner:e=>{[l,u]=e.textContent.split(` `).map(e=>Number.parseFloat(e)),i&&([l,u]=[u,l])}}),t.push({xmin:a,ymin:c,xmax:l,ymax:u,spatialReference:r})}}),t}function O(e,t){return _(`Style`,e).map(e=>{let n=g(`LegendURL`,e),r=g(`Keywords`,e),i=r?v(`Keyword`,r):[],a=n?.getAttribute(`xlink:href`);return t&&(a=a?.replace(/^http:/i,`https:`)),{abstract:y(`Abstract`,e),id:y(`Identifier`,e),isDefault:e.getAttribute(`isDefault`)===`true`,keywords:i,legendUrl:a,title:y(`Title`,e)}})}function k(e,t,n){return _(`TileMatrixSetLink`,t).map(t=>A(e,t,n))}function A(e,t,n){let r=g(`TileMatrixSet`,t).textContent,i=v(`TileMatrix`,t),a=n.find(e=>{let t=g(`Identifier`,e)?.textContent;return!!(t===r||r.split(`:`)&&r.split(`:`)[1]===t)}),o=g(`TileMatrixSetLimits`,t),s=o&&_(`TileMatrixLimits`,o),c=new Map;if(s?.length)for(let e of s){let t=g(`TileMatrix`,e).textContent,n=+g(`MinTileRow`,e).textContent,r=+g(`MaxTileRow`,e).textContent,i=+g(`MinTileCol`,e).textContent,a=+g(`MaxTileCol`,e).textContent;c.set(t,{minCol:i,maxCol:a,minRow:n,maxRow:r})}let u=y(`SupportedCRS`,a).toLowerCase(),d=M(a,u),f=d.spatialReference,p=g(`TileMatrix`,a),m=[parseInt(y(`TileWidth`,p),10),parseInt(y(`TileHeight`,p),10)],h=[];return i.length?i.forEach((e,t)=>{let n=b(`TileMatrix`,`Identifier`,e,a);h.push(L(n,u,t,r,c))}):_(`TileMatrix`,a).forEach((e,t)=>{h.push(L(e,u,t,r,c))}),{id:r,fullExtent:P(e,a,d,m,h[0]).toJSON(),tileInfo:new l({dpi:96,spatialReference:f,size:m,origin:d,lods:h}).toJSON()}}function j(e){e=e.toLowerCase();let t=parseInt(e.split(`:`).pop(),10);(t===900913||t===3857)&&(t=102100);let n=I(e);return n!=null&&(t=n),{wkid:t}}function M(e,t){return N(g(`TileMatrix`,e),t)}function N(e,t){let n=j(t),[r,a]=y(`TopLeftCorner`,e).split(` `).map(e=>parseFloat(e));return t.includes(`epsg`)&&o(n.wkid)?new i({x:a,y:r,spatialReference:n}):new i({x:r,y:a,spatialReference:n})}function P(e,t,n,i,a){let o=g(`BoundingBox`,t),s,c;o&&(s=y(`LowerCorner`,o).split(` `),c=y(`UpperCorner`,o).split(` `));let l,u,d,f;if(s&&s.length>1&&c&&c.length>1)l=parseFloat(s[0]),d=parseFloat(s[1]),u=parseFloat(c[0]),f=parseFloat(c[1]);else{let e=g(`TileMatrix`,t),r=parseInt(y(`MatrixWidth`,e),10),o=parseInt(y(`MatrixHeight`,e),10);l=n.x,f=n.y,u=l+r*i[0]*a.resolution,d=f-o*i[1]*a.resolution}return F(e,n.spatialReference,n)?new r(d,l,f,u,n.spatialReference):new r(l,d,u,f,n.spatialReference)}function F(e,t,n){return e===`1.0.0`&&o(t.wkid)&&!(n.spatialReference.isGeographic&&n.x<-90&&n.y>=-90)}function I(e){return e.includes(`crs84`)||e.includes(`crs:84`)?4326:e.includes(`crs83`)||e.includes(`crs:83`)?4269:e.includes(`crs27`)||e.includes(`crs:27`)?4267:null}function L(e,t,n,r,i){let a=j(t),o=y(`Identifier`,e),s=parseFloat(y(`ScaleDenominator`,e)),l=R(a.wkid,s,r);s*=96/u;let d=+y(`MatrixWidth`,e),f=+y(`MatrixHeight`,e),{maxCol:p=d-1,maxRow:m=f-1,minCol:h=0,minRow:g=0}=i.get(o)??{},{x:_,y:v}=N(e,t);return new c({cols:[h,p],level:n,levelValue:o,origin:[_,v],scale:s,resolution:l,rows:[g,m]})}function R(e,t,r){let i;return i=a.hasOwnProperty(``+e)?a.values[a[e]]:r===`default028mm`?6370997*Math.PI/180:n(e).metersPerDegree,t*7/25e3/i}export{C as getTileUrlFromResourceUrls,T as getTileUrlTemplateFromResourceUrls,w as getTileUrlTemplates,p as parseCapabilities,m as parseResourceInfo,d as parseText,f as validateCapabilities};
|
|
2
|
+
import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{getReferenceEllipsoidFromWKID as n}from"../../geometry/ellipsoidUtils.js";import r from"../../geometry/Extent.js";import i from"../../geometry/Point.js";import a from"../../geometry/support/WKIDUnitConversion.js";import{isAxesOrderReversedForWkid as o}from"../ogc/crsUtils.js";import{visitXML as s}from"../ogc/xmlUtils.js";import c from"./LOD.js";import l from"./TileInfo.js";const u=90.71428571428571;function d(e){let t=e.replaceAll(/ows:/gi,``);return new DOMParser().parseFromString(t,`text/xml`)}function f(e){let n=e.documentElement;if(!g(`Contents`,n))throw new t(`wmtslayer:wmts-capabilities-xml-is-not-valid`,`the wmts get capabilities response is not compliant`)}function p(e,n){let r=e.documentElement,i=new Map,a=new Map,o=g(`Contents`,r);if(!o)throw new t(`wmtslayer:wmts-capabilities-xml-is-not-valid`,`Can't retrieve xml capabilities element`);let s=(g(`OperationsMetadata`,r)?.querySelector(`[name='GetTile']`))?.getElementsByTagName(`Get`),c=s&&Array.prototype.slice.call(s),l=n.url?.indexOf(`https`),u=l!==void 0&&l>-1,d=n.serviceMode,f,p=n?.url,m;c?.length&&c.some(e=>{let t=g(`Constraint`,e);return!t||b(`AllowedValues`,`Value`,d,t)?(p=e.attributes[0].nodeValue,!0):(!t||b(`AllowedValues`,`Value`,`RESTful`,t)||b(`AllowedValues`,`Value`,`REST`,t)?m=e.attributes[0].nodeValue:(!t||b(`AllowedValues`,`Value`,`KVP`,t))&&(f=e.attributes[0].nodeValue),!1)}),p||(m?(p=m,d=`RESTful`):f?(p=f,d=`KVP`):p=g(`ServiceMetadataURL`,r)?.getAttribute(`xlink:href`));let h=p.indexOf(`1.0.0/`);h===-1&&d===`RESTful`?p+=`/`:h>-1&&(p=p.slice(0,h)),d===`KVP`&&(p+=h>-1?``:`?`),u&&(p=p.replace(/^http:/i,`https:`));let v=y(`ServiceIdentification>ServiceTypeVersion`,r),S=y(`ServiceIdentification>AccessConstraints`,r),C=S&&/^none$/i.test(S)?null:S,w=_(`Layer`,o),T=_(`TileMatrixSet`,o);return{copyright:C,dimensionMap:a,layerMap:i,layers:w.map(e=>{let t=y(`Identifier`,e);return i.set(t,e),x(t,e,T,u,v)}),serviceMode:d,tileUrl:p}}function m(e){for(let t of e.layers)for(let e of t.tileMatrixSets??[]){let{tileInfo:t}=e;if(t&&t.dpi!==96){for(let n of t.lods??[])n.scale=n.scale*96/t.dpi,n.resolution=R(t.spatialReference?.wkid,n.scale*u/96,e.id);t.dpi=96}}}function h(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let n=0;n<t.childNodes.length;n++){let r=t.childNodes[n];if(h(r)&&r.nodeName===e)return r}return null}function _(e,t){let n=[];for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];h(i)&&i.nodeName===e&&n.push(i)}return n}function v(t,n){let r=[];for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e];h(i)&&i.nodeName===t&&r.push(i)}return r.map(e=>e.textContent).filter(e)}function y(e,t){return e.split(`>`).forEach(e=>{t&&=g(e,t)}),t&&t.textContent}function b(e,t,n,r){let i=Array.prototype.slice.call(r.childNodes),a;return i.some(r=>{if(r.nodeName.includes(e)){let e=g(t,r)?.textContent;if(e===n||n.split(`:`)&&n.split(`:`)[1]===e)return a=r,!0}return!1}),a}function x(e,t,n,r,i){let a=y(`Abstract`,t),o=v(`Format`,t);return{id:e,fullExtent:E(t),fullExtents:D(t),description:a,formats:o,styles:O(t,r),title:y(`Title`,t),tileMatrixSets:k(i,t,n)}}function S(e,t){let n=[],r=e.layerMap?.get(t);if(!r)return null;let i=_(`ResourceURL`,r),a=_(`Dimension`,r),o,s,c,l;return a.length&&(o=y(`Identifier`,a[0]),s=v(`Default`,a[0])||v(`Value`,a[0])),a.length>1&&(c=y(`Identifier`,a[1]),l=v(`Default`,a[1])||v(`Value`,a[1])),e.dimensionMap.set(t,{dimensions:s,dimensions2:l}),i.forEach(e=>{let t=e.getAttribute(`template`);if(e.getAttribute(`resourceType`)===`tile`){if(o&&s.length){if(t.includes(`{`+o+`}`))t=t.replace(`{`+o+`}`,`{dimensionValue}`);else{let e=t.toLowerCase().indexOf(`{`+o.toLowerCase()+`}`);e>-1&&(t=t.slice(0,e)+`{dimensionValue}`+t.slice(e+o.length+2))}}if(c&&l.length){if(t.includes(`{`+c+`}`))t=t.replace(`{`+c+`}`,`{dimensionValue2}`);else{let e=t.toLowerCase().indexOf(`{`+c.toLowerCase()+`}`);e>-1&&(t=t.slice(0,e)+`{dimensionValue2}`+t.slice(e+c.length+2))}}n.push({template:t,format:e.getAttribute(`format`),resourceType:`tile`})}}),n}function C(e,t,n,r,i,a,o,s){let c=w(e,t,r);if(!(c?.length>0))return``;let{dimensionMap:l}=e,u=l.get(t).dimensions?.[0],d=l.get(t).dimensions2?.[0];return c[o%c.length].template.replaceAll(/\{Style\}/gi,i??``).replaceAll(/\{TileMatrixSet\}/gi,n??``).replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,``+o).replaceAll(/\{TileCol\}/gi,``+s).replaceAll(/\{dimensionValue\}/gi,u).replaceAll(/\{dimensionValue2\}/gi,d)}function w(e,t,n){let r=S(e,t),i=r?.filter(e=>e.format===n);return(i?.length?i:r)??[]}function T(e,t,n,r){let{dimensionMap:i}=e,a=S(e,t),o=``;if(a&&a.length>0){let e=i.get(t).dimensions?.[0],s=i.get(t).dimensions2?.[0];o=a[0].template,o.endsWith(`.xxx`)&&(o=o.slice(0,-4)),o=o.replaceAll(/\{Style\}/gi,r),o=o.replaceAll(/\{TileMatrixSet\}/gi,n),o=o.replaceAll(/\{TileMatrix\}/gi,`{level}`),o=o.replaceAll(/\{TileRow\}/gi,`{row}`),o=o.replaceAll(/\{TileCol\}/gi,`{col}`),o=o.replaceAll(/\{dimensionValue\}/gi,e),o=o.replaceAll(/\{dimensionValue2\}/gi,s)}return o}function E(e){let t=g(`WGS84BoundingBox`,e),n=t?y(`LowerCorner`,t).split(` `):[`-180`,`-90`],r=t?y(`UpperCorner`,t).split(` `):[`180`,`90`];return{xmin:parseFloat(n[0]),ymin:parseFloat(n[1]),xmax:parseFloat(r[0]),ymax:parseFloat(r[1]),spatialReference:{wkid:4326}}}function D(e){let t=[];return s(e,{BoundingBox:e=>{if(!e.getAttribute(`crs`))return;let n=e.getAttribute(`crs`).toLowerCase(),r=j(n),i=n.includes(`epsg`)&&o(r.wkid),a,c,l,u;s(e,{LowerCorner:e=>{[a,c]=e.textContent.split(` `).map(e=>Number.parseFloat(e)),i&&([a,c]=[c,a])},UpperCorner:e=>{[l,u]=e.textContent.split(` `).map(e=>Number.parseFloat(e)),i&&([l,u]=[u,l])}}),t.push({xmin:a,ymin:c,xmax:l,ymax:u,spatialReference:r})}}),t}function O(e,t){return _(`Style`,e).map(e=>{let n=g(`LegendURL`,e),r=g(`Keywords`,e),i=r?v(`Keyword`,r):[],a=n?.getAttribute(`xlink:href`);return t&&(a=a?.replace(/^http:/i,`https:`)),{abstract:y(`Abstract`,e),id:y(`Identifier`,e),isDefault:e.getAttribute(`isDefault`)===`true`,keywords:i,legendUrl:a,title:y(`Title`,e)}})}function k(e,t,n){return _(`TileMatrixSetLink`,t).map(t=>A(e,t,n))}function A(e,t,n){let r=g(`TileMatrixSet`,t).textContent,i=v(`TileMatrix`,t),a=n.find(e=>{let t=g(`Identifier`,e)?.textContent;return!!(t===r||r.split(`:`)&&r.split(`:`)[1]===t)}),o=g(`TileMatrixSetLimits`,t),s=o&&_(`TileMatrixLimits`,o),c=new Map;if(s?.length)for(let e of s){let t=g(`TileMatrix`,e).textContent,n=+g(`MinTileRow`,e).textContent,r=+g(`MaxTileRow`,e).textContent,i=+g(`MinTileCol`,e).textContent,a=+g(`MaxTileCol`,e).textContent;c.set(t,{minCol:i,maxCol:a,minRow:n,maxRow:r})}let u=y(`SupportedCRS`,a).toLowerCase(),d=M(a,u),f=d.spatialReference,p=g(`TileMatrix`,a),m=[parseInt(y(`TileWidth`,p),10),parseInt(y(`TileHeight`,p),10)],h=[];return i.length?i.forEach((e,t)=>{let n=b(`TileMatrix`,`Identifier`,e,a);h.push(L(n,u,t,r,c))}):_(`TileMatrix`,a).forEach((e,t)=>{h.push(L(e,u,t,r,c))}),{id:r,fullExtent:P(e,a,d,m,h[0]).toJSON(),tileInfo:new l({dpi:96,spatialReference:f,size:m,origin:d,lods:h}).toJSON()}}function j(e){e=e.toLowerCase();let t=parseInt(e.split(`:`).pop(),10);(t===900913||t===3857)&&(t=102100);let n=I(e);return n!=null&&(t=n),{wkid:t}}function M(e,t){return N(g(`TileMatrix`,e),t)}function N(e,t){let n=j(t),[r,a]=y(`TopLeftCorner`,e).split(` `).map(e=>parseFloat(e));return t.includes(`epsg`)&&o(n.wkid)?new i({x:a,y:r,spatialReference:n}):new i({x:r,y:a,spatialReference:n})}function P(e,t,n,i,a){let o=g(`BoundingBox`,t),s,c;o&&(s=y(`LowerCorner`,o).split(` `),c=y(`UpperCorner`,o).split(` `));let l,u,d,f;if(s&&s.length>1&&c&&c.length>1)l=parseFloat(s[0]),d=parseFloat(s[1]),u=parseFloat(c[0]),f=parseFloat(c[1]);else{let e=g(`TileMatrix`,t),r=parseInt(y(`MatrixWidth`,e),10),o=parseInt(y(`MatrixHeight`,e),10);l=n.x,f=n.y,u=l+r*i[0]*a.resolution,d=f-o*i[1]*a.resolution}return F(e,n.spatialReference,n)?new r({xmin:d,ymin:l,xmax:f,ymax:u,spatialReference:n.spatialReference}):new r({xmin:l,ymin:d,xmax:u,ymax:f,spatialReference:n.spatialReference})}function F(e,t,n){return e===`1.0.0`&&o(t.wkid)&&!(n.spatialReference.isGeographic&&n.x<-90&&n.y>=-90)}function I(e){return e.includes(`crs84`)||e.includes(`crs:84`)?4326:e.includes(`crs83`)||e.includes(`crs:83`)?4269:e.includes(`crs27`)||e.includes(`crs:27`)?4267:null}function L(e,t,n,r,i){let a=j(t),o=y(`Identifier`,e),s=parseFloat(y(`ScaleDenominator`,e)),l=R(a.wkid,s,r);s*=96/u;let d=+y(`MatrixWidth`,e),f=+y(`MatrixHeight`,e),{maxCol:p=d-1,maxRow:m=f-1,minCol:h=0,minRow:g=0}=i.get(o)??{},{x:_,y:v}=N(e,t);return new c({cols:[h,p],level:n,levelValue:o,origin:[_,v],scale:s,resolution:l,rows:[g,m]})}function R(e,t,r){let i;return i=a.hasOwnProperty(``+e)?a.values[a[e]]:r===`default028mm`?6370997*Math.PI/180:n(e).metersPerDegree,t*7/25e3/i}export{C as getTileUrlFromResourceUrls,T as getTileUrlTemplateFromResourceUrls,w as getTileUrlTemplates,p as parseCapabilities,m as parseResourceInfo,d as parseText,f as validateCapabilities};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import r from"../../geometry/SpatialReference.js";import{projectExecute as i}from"../../geometry/operators/projectOperator.js";import a from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as s}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as c}from"../../symbols/support/utils.js";const l=`application/x-mpegURL`,u={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function d(e,t=1e4){if(!e||!e.length)return[];let n=[],r=[];for(let t=0;t<e.length;t++){let r=e[t],i=r?.text?JSON.parse(r.text):null;i?.source===`EsriVideoServer`&&(n=[...i.data])}let i=n.find(e=>e.tagId===t);return Array.isArray(i?.value)&&(r=[...i.value]),r}function f(e){let{duration:t,end:n,start:r,timezone:i=`UTC`}=e||{};return[t,n,r].some(e=>typeof e!=`number`||e<0)?null:new o({duration:t||null,end:new Date(Number(n)),start:new Date(Number(r)),timezone:i})}function p(e,t,n){let r=e.clone();r.m=n;let i=t.findIndex(e=>e.m>=n),a=i===-1?[...t]:t.slice(0,i);return a.push(r),a}function m(e){if(!e?.size)return new a;let t=k(e),n=_(e),r=T(e),i=O(t,n);return new a({frameCenter:n,frameOutline:r,lineOfSight:i,sensorLocation:t})}function h(e){return e?.size?e.get(u.EsriGroundControlPoints)?.value??null??null:null}function g(e){return e?.size?e.get(u.EsriHorizonPixelPack)?.value??null:null}function _(e){return C(e)??w(e)}function v(e){if(!e)return l;let t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case`mp4`:return`video/mp4`;case`webm`:return`video/webm`;default:return l}}function y(e){let t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||`Video Layer`})):[]}function b(e,t,n){if(!e)return null;let r=e.clone();switch(r.type){case`simple-fill`:c(r,n),r.outline.color=t;break;case`simple-line`:c(r,t);break;case`simple-marker`:c(r,t),r?.outline?.color&&(r.outline.color=t);break;case`cim`:s(r,t)}return r}function x(e){let{cameraAzimuth:t,platformHeading:n,source:r=null,symbolOffset:i=0}=e||{},a=0;if(!r)return a;a=r===`platformHeading`?n+i:n+t+i;let o=a>360?a-360:a;return Math.round(Math.abs(o))}function S(t,n,a){if(!n||n.length<3)return null;let o=[...n].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),s=Array.from(new Set(o.map(e=>e.x))).sort((e,t)=>e-t),c=Array.from(new Set(o.map(e=>e.y))),l=-1;for(let e=s.length-2;e>=0;e--)if(t.x>=s[e]&&t.x<=s[e+1]){l=e;break}let u=-1;for(let e=c.length-2;e>=0;e--)if(t.y>=c[e]&&t.y<=c[e+1]){u=e;break}if(l<0||u<0||l>=s.length-1||u>=c.length-1)return null;let d=s[l],f=s[l+1],p=c[u],m=c[u+1],h=(e,t)=>{let r=n.find(n=>n.x===e&&n.y===t);if(!r)throw Error(`Control point not found for x: ${e}, y: ${t}`);return r},g=h(d,p),_=h(f,p),v=h(d,m),y=h(f,m),b=t.x,x=t.y,S,C;if(A(g.x,g.y,_.x,_.y,y.x,y.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(_.lon,_.lat,r.WGS84),o=new e(y.lon,y.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,_,y],S=[s,c,l]}else if(A(g.x,g.y,y.x,y.y,v.x,v.y,b,x)){let t=new e(g.lon,g.lat,r.WGS84),n=new e(y.lon,y.lat,r.WGS84),o=new e(v.lon,v.lat,r.WGS84),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,y,v],S=[s,c,l]}else return null;let[w,T,E]=C,[D,O,k]=S,j=(T.y-E.y)*(w.x-E.x)+(E.x-T.x)*(w.y-E.y),M=((T.y-E.y)*(b-E.x)+(E.x-T.x)*(x-E.y))/j,N=((E.y-w.y)*(b-E.x)+(w.x-E.x)*(x-E.y))/j,P=1-M-N;return[M*D.x+N*O.x+P*k.x,M*D.y+N*O.y+P*k.y]}function C(t){return!t||!t.has(u.EsriFrameCenterLatitude)||!t.has(u.EsriFrameCenterLongitude)?null:new e({x:t.get(u.EsriFrameCenterLongitude).value,y:t.get(u.EsriFrameCenterLatitude).value,z:t.get(u.FrameCenterAboveEllipsoid)?.value??t.get(u.FrameCenterElevation)?.value})}function w(t){return!t||!t.has(u.FrameCenterLatitude)||!t.has(u.FrameCenterLongitude)?null:new e({x:t.get(u.FrameCenterLongitude)?.value,y:t.get(u.FrameCenterLatitude)?.value,z:t.get(u.FrameCenterElevation)?.value})}function T(e){if(!e)return null;let n=e.get(u.EsriFrameOutline)?.value;return n?t.fromJSON(n.geometry):E(e)??D(e)}function E(e){if(!e.has(u.EsriCornerLatitudePt1)||!e.has(u.EsriCornerLongitudePt1)||!e.has(u.EsriCornerLatitudePt2)||!e.has(u.EsriCornerLongitudePt2)||!e.has(u.EsriCornerLatitudePt3)||!e.has(u.EsriCornerLongitudePt3)||!e.has(u.EsriCornerLatitudePt4)||!e.has(u.EsriCornerLongitudePt4))return null;let n=[e.get(u.EsriCornerLongitudePt1)?.value,e.get(u.EsriCornerLatitudePt1)?.value],r=[e.get(u.EsriCornerLongitudePt2)?.value,e.get(u.EsriCornerLatitudePt2)?.value],i=[e.get(u.EsriCornerLongitudePt3)?.value,e.get(u.EsriCornerLatitudePt3)?.value],a=[e.get(u.EsriCornerLongitudePt4)?.value,e.get(u.EsriCornerLatitudePt4)?.value];return new t({rings:[[n,r,i,a]]})}function D(e){if(!e.has(u.OffsetCorner1Latitude)||!e.has(u.OffsetCorner1Longitude)||!e.has(u.OffsetCorner2Latitude)||!e.has(u.OffsetCorner2Longitude)||!e.has(u.OffsetCorner3Latitude)||!e.has(u.OffsetCorner3Longitude)||!e.has(u.OffsetCorner4Latitude)||!e.has(u.OffsetCorner4Longitude)||!e.has(u.FrameCenterLatitude)||!e.has(u.FrameCenterLongitude))return null;let n=e.get(u.FrameCenterLatitude)?.value,r=e.get(u.FrameCenterLongitude)?.value,i=n+e.get(u.OffsetCorner1Latitude)?.value,a=r+e.get(u.OffsetCorner1Longitude)?.value,o=n+e.get(u.OffsetCorner2Latitude)?.value,s=r+e.get(u.OffsetCorner2Longitude)?.value,c=n+e.get(u.OffsetCorner3Latitude)?.value,l=r+e.get(u.OffsetCorner3Longitude)?.value,d=n+e.get(u.OffsetCorner4Latitude)?.value,f=r+e.get(u.OffsetCorner4Longitude)?.value;return new t({rings:[[[a,i],[s,o],[l,c],[f,d]]]})}function O(e,t){if(!e||!t)return null;let r=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new n({hasZ:!0,hasM:!1,paths:[[r,i]]})}function k(t){if(!t?.size)return null;if(t.has(u.EsriSensorPosition)){let n=t.get(u.EsriSensorPosition)?.value;if(n)return e.fromJSON(n.geometry)}return t.has(u.SensorLongitude)&&t.has(u.SensorLatitude)?new e({x:t.get(u.SensorLongitude)?.value,y:t.get(u.SensorLatitude)?.value,z:t.get(u.SensorTrueAltitude)?.value}):null}function A(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}export{S as computeVideoToMapBaricentric,_ as getFrameCenter,g as getFrameHorizonPoints,h as getGroundControlPoints,O as getLineOfSight,p as getSensorTrailPoints,y as getServiceLayersInfo,b as getStyledTelemetrySymbol,x as getSymbolDisplayAngle,m as getTelemetryData,d as getVideoMetadataFromCueList,v as getVideoMimeType,f as readVideoTimeExtent,u as videoMetadataEntryId};
|
|
2
|
+
import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import r from"../../geometry/SpatialReference.js";import{projectExecute as i}from"../../geometry/operators/projectOperator.js";import a from"../support/TelemetryData.js";import o from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as s}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as c}from"../../symbols/support/utils.js";const l=`application/x-mpegURL`,u={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function d(e,t=1e4){if(!e||!e.length)return[];let n=[],r=[];for(let t=0;t<e.length;t++){let r=e[t],i=r?.text?JSON.parse(r.text):null;i?.source===`EsriVideoServer`&&(n=[...i.data])}let i=n.find(e=>e.tagId===t);return Array.isArray(i?.value)&&(r=[...i.value]),r}function f(e){let{duration:t,end:n,start:r,timezone:i=`UTC`}=e||{};return[t,n,r].some(e=>typeof e!=`number`||e<0)?null:new o({duration:t||null,end:new Date(Number(n)),start:new Date(Number(r)),timezone:i})}function p(e,t,n){let r=e.clone();r.m=n;let i=t.findIndex(e=>e.m>=n),a=i===-1?[...t]:t.slice(0,i);return a.push(r),a}function m(e){if(!e?.size)return new a;let t=k(e),n=_(e),r=T(e),i=O(t,n);return new a({frameCenter:n,frameOutline:r,lineOfSight:i,sensorLocation:t})}function h(e){return e?.size?e.get(u.EsriGroundControlPoints)?.value??null??null:null}function g(e){return e?.size?e.get(u.EsriHorizonPixelPack)?.value??null:null}function _(e){return C(e)??w(e)}function v(e){if(!e)return l;let t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case`mp4`:return`video/mp4`;case`webm`:return`video/webm`;default:return l}}function y(e){let t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||`Video Layer`})):[]}function b(e,t,n){if(!e)return null;let r=e.clone();switch(r.type){case`simple-fill`:c(r,n),r.outline.color=t;break;case`simple-line`:c(r,t);break;case`simple-marker`:c(r,t),r?.outline?.color&&(r.outline.color=t);break;case`cim`:s(r,t)}return r}function x(e){let{cameraAzimuth:t,platformHeading:n,source:r=null,symbolOffset:i=0}=e||{},a=0;if(!r)return a;a=r===`platformHeading`?n+i:n+t+i;let o=a>360?a-360:a;return Math.round(Math.abs(o))}function S(t,n,a){if(!n||n.length<3)return null;let o=[...n].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),s=Array.from(new Set(o.map(e=>e.x))).sort((e,t)=>e-t),c=Array.from(new Set(o.map(e=>e.y))),l=-1;for(let e=s.length-2;e>=0;e--)if(t.x>=s[e]&&t.x<=s[e+1]){l=e;break}let u=-1;for(let e=c.length-2;e>=0;e--)if(t.y>=c[e]&&t.y<=c[e+1]){u=e;break}if(l<0||u<0||l>=s.length-1||u>=c.length-1)return null;let d=s[l],f=s[l+1],p=c[u],m=c[u+1],h=(e,t)=>{let r=n.find(n=>n.x===e&&n.y===t);if(!r)throw Error(`Control point not found for x: ${e}, y: ${t}`);return r},g=h(d,p),_=h(f,p),v=h(d,m),y=h(f,m),b=t.x,x=t.y,S,C;if(A(g.x,g.y,_.x,_.y,y.x,y.y,b,x)){let t=new e({x:g.lon,y:g.lat,spatialReference:r.WGS84}),n=new e({x:_.lon,y:_.lat,spatialReference:r.WGS84}),o=new e({x:y.lon,y:y.lat,spatialReference:r.WGS84}),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,_,y],S=[s,c,l]}else if(A(g.x,g.y,y.x,y.y,v.x,v.y,b,x)){let t=new e({x:g.lon,y:g.lat,spatialReference:r.WGS84}),n=new e({x:y.lon,y:y.lat,spatialReference:r.WGS84}),o=new e({x:v.lon,y:v.lat,spatialReference:r.WGS84}),s=i(t,a),c=i(n,a),l=i(o,a);C=[g,y,v],S=[s,c,l]}else return null;let[w,T,E]=C,[D,O,k]=S,j=(T.y-E.y)*(w.x-E.x)+(E.x-T.x)*(w.y-E.y),M=((T.y-E.y)*(b-E.x)+(E.x-T.x)*(x-E.y))/j,N=((E.y-w.y)*(b-E.x)+(w.x-E.x)*(x-E.y))/j,P=1-M-N;return[M*D.x+N*O.x+P*k.x,M*D.y+N*O.y+P*k.y]}function C(t){return!t||!t.has(u.EsriFrameCenterLatitude)||!t.has(u.EsriFrameCenterLongitude)?null:new e({x:t.get(u.EsriFrameCenterLongitude).value,y:t.get(u.EsriFrameCenterLatitude).value,z:t.get(u.FrameCenterAboveEllipsoid)?.value??t.get(u.FrameCenterElevation)?.value})}function w(t){return!t||!t.has(u.FrameCenterLatitude)||!t.has(u.FrameCenterLongitude)?null:new e({x:t.get(u.FrameCenterLongitude)?.value,y:t.get(u.FrameCenterLatitude)?.value,z:t.get(u.FrameCenterElevation)?.value})}function T(e){if(!e)return null;let n=e.get(u.EsriFrameOutline)?.value;return n?t.fromJSON(n.geometry):E(e)??D(e)}function E(e){if(!e.has(u.EsriCornerLatitudePt1)||!e.has(u.EsriCornerLongitudePt1)||!e.has(u.EsriCornerLatitudePt2)||!e.has(u.EsriCornerLongitudePt2)||!e.has(u.EsriCornerLatitudePt3)||!e.has(u.EsriCornerLongitudePt3)||!e.has(u.EsriCornerLatitudePt4)||!e.has(u.EsriCornerLongitudePt4))return null;let n=[e.get(u.EsriCornerLongitudePt1)?.value,e.get(u.EsriCornerLatitudePt1)?.value],r=[e.get(u.EsriCornerLongitudePt2)?.value,e.get(u.EsriCornerLatitudePt2)?.value],i=[e.get(u.EsriCornerLongitudePt3)?.value,e.get(u.EsriCornerLatitudePt3)?.value],a=[e.get(u.EsriCornerLongitudePt4)?.value,e.get(u.EsriCornerLatitudePt4)?.value];return new t({rings:[[n,r,i,a]]})}function D(e){if(!e.has(u.OffsetCorner1Latitude)||!e.has(u.OffsetCorner1Longitude)||!e.has(u.OffsetCorner2Latitude)||!e.has(u.OffsetCorner2Longitude)||!e.has(u.OffsetCorner3Latitude)||!e.has(u.OffsetCorner3Longitude)||!e.has(u.OffsetCorner4Latitude)||!e.has(u.OffsetCorner4Longitude)||!e.has(u.FrameCenterLatitude)||!e.has(u.FrameCenterLongitude))return null;let n=e.get(u.FrameCenterLatitude)?.value,r=e.get(u.FrameCenterLongitude)?.value,i=n+e.get(u.OffsetCorner1Latitude)?.value,a=r+e.get(u.OffsetCorner1Longitude)?.value,o=n+e.get(u.OffsetCorner2Latitude)?.value,s=r+e.get(u.OffsetCorner2Longitude)?.value,c=n+e.get(u.OffsetCorner3Latitude)?.value,l=r+e.get(u.OffsetCorner3Longitude)?.value,d=n+e.get(u.OffsetCorner4Latitude)?.value,f=r+e.get(u.OffsetCorner4Longitude)?.value;return new t({rings:[[[a,i],[s,o],[l,c],[f,d]]]})}function O(e,t){if(!e||!t)return null;let r=[e.x,e.y,e.z??0],i=[t.x,t.y,t.z??0];return new n({hasZ:!0,hasM:!1,paths:[[r,i]]})}function k(t){if(!t?.size)return null;if(t.has(u.EsriSensorPosition)){let n=t.get(u.EsriSensorPosition)?.value;if(n)return e.fromJSON(n.geometry)}return t.has(u.SensorLongitude)&&t.has(u.SensorLatitude)?new e({x:t.get(u.SensorLongitude)?.value,y:t.get(u.SensorLatitude)?.value,z:t.get(u.SensorTrueAltitude)?.value}):null}function A(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}export{S as computeVideoToMapBaricentric,_ as getFrameCenter,g as getFrameHorizonPoints,h as getGroundControlPoints,O as getLineOfSight,p as getSensorTrailPoints,y as getServiceLayersInfo,b as getStyledTelemetrySymbol,x as getSymbolDisplayAngle,m as getTelemetryData,d as getVideoMetadataFromCueList,v as getVideoMimeType,f as readVideoTimeExtent,u as videoMetadataEntryId};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.41",
|
|
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,11 +20,11 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.21.5",
|
|
23
|
-
"@arcgis/toolkit": "6.0.0-next.
|
|
23
|
+
"@arcgis/toolkit": "6.0.0-next.41",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.1",
|
|
26
26
|
"@vaadin/grid": "~25.3.5",
|
|
27
|
-
"@zip.js/zip.js": "~2.
|
|
27
|
+
"@zip.js/zip.js": "~2.25.0",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
29
|
"marked": "~18.2.0",
|
|
30
30
|
"tslib": "^2.8.1"
|
package/portal/PortalItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import n from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as i,fixJson as a}from"../core/lang.js";import{Loadable as o}from"../core/Loadable.js";import{isDataProtocol as s,makeAbsolute as c}from"../core/urlUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import p from"./Portal.js";import m from"./PortalItemResource.js";import h from"./PortalRating.js";import{a as g}from"../chunks/persistableUrlUtils.js";import{reader as _}from"../core/accessorSupport/decorators/reader.js";var v;const y=new Set([`3DTiles Service`,`CSV`,`Feature Collection`,`Feature Service`,`Feed`,`GeoJson`,`Group Layer`,`Image Service`,`KML`,`Knowledge Graph Layer`,`Map Service`,`Media Layer`,`PDF`,`Scene Service`,`Stream Service`,`Video Service`,`Vector Tile Service`,`WCS`,`WFS`,`WMS`,`WMTS`]),b=new Set([`KML`,`GeoJson`,`CSV`,`PDF`]);let x=v=class extends r(o){static from(e){return d(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){let e=this.type,t=this.typeKeywords||[],n=e;return e===`Feature Service`||e===`Feature Collection`?n=t.includes(`Table`)?`Table`:t.includes(`Route Layer`)?`Route Layer`:t.includes(`Markup`)?`Markup`:`Feature Layer`:e===`Image Service`?n=t.includes(`Elevation 3D Layer`)?`Elevation Layer`:t.includes(`Tiled Imagery`)?`Tiled Imagery Layer`:`Imagery Layer`:e===`Scene Service`?n=`Scene Layer`:e===`Video Service`?n=`Video Layer`:e===`Scene Package`?n=`Scene Layer Package`:e===`Stream Service`?n=`Feature Layer`:e===`Geoprocessing Service`?n=t.includes(`Web Tool`)?`Tool`:`Geoprocessing Service`:e===`Geoenrichment Service`?n=`GeoEnrichment Service`:e===`Geocoding Service`?n=`Locator`:e===`Microsoft Powerpoint`?n=`Microsoft PowerPoint`:e===`GeoJson`?n=`GeoJSON`:e===`Globe Service`?n=`Globe Layer`:e===`Vector Tile Service`?n=`Tile Layer`:e===`netCDF`?n=`NetCDF`:e===`Map Service`?n=!t.includes(`Spatiotemporal`)&&(t.includes(`Hosted Service`)||t.includes(`Tiled`))&&!t.includes(`Relational`)?`Tile Layer`:`Map Image Layer`:e?.toLowerCase().includes(`add in`)?n=e.replaceAll(/(add in)/gi,`Add-In`):e===`datastore catalog service`?n=`Big Data File Share`:e===`Compact Tile Package`?n=`Tile Package (tpkx)`:e===`Raster function template`?n=`Raster Function Template`:e===`OGCFeatureServer`?n=`OGC Feature Layer`:e===`web mapping application`&&t.includes(`configurableApp`)?n=`Instant App`:e===`Insights Page`?n=`Insights Report`:e===`Excalibur Imagery Project`?n=`Excalibur Project`:e===`3DTiles Service`?n=`3D tiles layer`:e===`3DTiles Package`&&(n=`3D tiles package`),n}readExtent(e){return e&&e.length?new f(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){let e=this.type?.toLowerCase()||``,n=this.typeKeywords||[],r=!1,i=!1,a,o=!1,s=!1,c=!1,l=!1,u=!1,d=!1;return e.indexOf(`service`)>0||e===`feature collection`||e===`kml`||e===`wms`||e===`wmts`||e===`wfs`?(r=n.includes(`Hosted Service`),e===`feature service`||e===`feature collection`||e===`kml`||e===`wfs`?(i=n.includes(`Table`),o=n.includes(`Route Layer`),s=n.includes(`Markup`),c=n.includes(`Spatiotemporal`),l=n.includes(`UtilityNetwork`),a=c&&i?`spatiotemporaltable`:i?`table`:o?`routelayer`:s?`markup`:c?`spatiotemporal`:l?`utilitynetwork`:r?`featureshosted`:`features`):e===`map service`||e===`wms`||e===`wmts`?(c=n.includes(`Spatiotemporal`),u=n.includes(`Relational`),a=c||u?`mapimages`:r||n.includes(`Tiled`)||e===`wmts`?`maptiles`:`mapimages`):a=e===`scene service`?n.includes(`Line`)?`sceneweblayerline`:n.includes(`3DObject`)?`sceneweblayermultipatch`:n.includes(`Point`)?`sceneweblayerpoint`:n.includes(`IntegratedMesh`)?`sceneweblayermesh`:n.includes(`PointCloud`)?`sceneweblayerpointcloud`:n.includes(`Polygon`)?`sceneweblayerpolygon`:n.includes(`Building`)?`sceneweblayerbuilding`:n.includes(`Voxel`)?`sceneweblayervoxel`:`sceneweblayer`:e===`image service`?n.includes(`Elevation 3D Layer`)?`elevationlayer`:n.includes(`Tiled Imagery`)?`tiledimagerylayer`:`imagery`:e===`stream service`?`streamlayer`:e===`vector tile service`?`vectortile`:e===`datastore catalog service`?`datastorecollection`:e===`geocoding service`?`geocodeservice`:e===`video service`?n.includes(`Live Stream`)?`livestreamvideolayer`:`videolayer`:e===`geoprocessing service`?n.includes(`Web Tool`)?`tool`:`layers`:e===`geodata service`?`geodataservice`:e===`3dtiles service`?n.includes(`3DObject`)?`3dobjecttileslayer`:n.includes(`IntegratedMesh`)?`integratedmeshtileslayer`:n.includes(`GaussianSplat`)?`gaussiansplatlayer`:`3dtileslayer`:`layers`):e===`web map`||e===`cityengine web scene`?a=`maps`:e===`web scene`?a=n.includes(`ViewingMode-Local`)?`webscenelocal`:`websceneglobal`:e===`web mapping application`&&n.includes(`configurableApp`)?a=`instantapps`:e===`web mapping application`||e===`mobile application`||e===`application`||e===`operation view`||e===`desktop application`?a=`apps`:e===`map document`||e===`map package`||e===`published map`||e===`scene document`||e===`globe document`||e===`basemap package`||e===`mobile basemap package`||e===`mobile map package`||e===`project package`||e===`project template`||e===`pro map`||e===`layout`||e===`layer`&&n.includes(`ArcGIS Pro`)||e===`explorer map`&&n.indexOf(`Explorer Document`)?a=`mapsgray`:e===`service definition`||e===`shapefile`||e===`cad drawing`||e===`geojson`||e===`netcdf`||e===`administrative report`?a=`datafiles`:e===`360 vr experience`?a=`360vr`:e===`explorer add in`||e===`desktop add in`||e===`windows viewer add in`||e===`windows viewer configuration`?a=`appsgray`:e===`arcgis pro add in`||e===`arcgis pro configuration`?a=`addindesktop`:e===`pdf`?a=`pdf`:e===`microsoft word`?a=`word`:e===`microsoft excel`?a=`excel`:e===`microsoft powerpoint`?a=`ppt`:e===`rule package`||e===`file geodatabase`||e===`sqlite geodatabase`||e===`csv collection`||e===`kml collection`||e===`windows mobile package`||e===`map template`||e===`desktop application template`||e===`gml`||e===`arcpad package`||e===`code sample`||e===`document link`||e===`earth configuration`||e===`operations dashboard add in`||e===`rules package`||e===`workflow manager package`||e===`explorer map`&&n.includes(`Explorer Mapping Application`)||n.includes(`Document`)?a=`datafilesgray`:e===`network analysis service`||e===`geoprocessing service`||e===`geodata service`||e===`geometry service`||e===`geoprocessing package`||e===`locator package`||e===`geoprocessing sample`||e===`workflow manager service`?a=`toolsgray`:e===`layer`||e===`layer package`||e===`explorer layer`?a=`layersgray`:e===`analysis model`?a=`analysismodel`:e===`scene package`?a=`scenepackage`:e===`3dtiles package`?a=`3dtileslayerpackage`:e===`3dtiles service`?a=`3dtileslayer`:e===`mobile scene package`?a=`mobilescenepackage`:e===`tile package`||e===`compact tile package`?a=`tilepackage`:e===`task file`?a=`taskfile`:e===`report template`?a=`report-template`:e===`statistical data collection`?a=`statisticaldatacollection`:e===`insights workbook`?a=`workbook`:e===`insights model`?a=`insightsmodel`:e===`insights page`?a=`insightspage`:e===`insights theme`?a=`insightstheme`:e===`hub initiative`?a=`hubinitiative`:e===`hub page`?a=`hubpage`:e===`hub site application`?a=`hubsite`:e===`hub event`?a=`hubevent`:e===`hub project`?a=`hubproject`:e===`relational database connection`?a=`relationaldatabaseconnection`:e===`big data file share`?a=`datastorecollection`:e===`image collection`?a=`imagecollection`:e===`desktop style`?a=`desktopstyle`:e===`style`?a=n.includes(`Dictionary`)?`dictionarystyle`:`style`:e===`dashboard`?a=`dashboard`:e===`raster function template`?a=`rasterprocessingtemplate`:e===`vector tile package`?a=`vectortilepackage`:e===`ortho mapping project`?a=`orthomappingproject`:e===`ortho mapping template`?a=`orthomappingtemplate`:e===`solution`?a=`solutions`:e===`geopackage`?a=`geopackage`:e===`deep learning package`?a=`deeplearningpackage`:e===`real time analytic`?a=`realtimeanalytics`:e===`reality mapping project`?a=`realitymappingproject`:e===`big data analytic`?a=`bigdataanalytics`:e===`feed`?a=`feed`:e===`excalibur imagery project`?a=`excaliburimageryproject`:e===`notebook`?a=`notebook`:e===`storymap`?a=`storymap`:e===`survey123 add in`?a=`survey123addin`:e===`mission`?a=`mission`:e===`mission report`?a=`missionreport`:e===`mission template`?a=`missiontemplate`:e===`quickcapture project`?a=`quickcaptureproject`:e===`pro report`?a=`proreport`:e===`pro report template`?a=`proreporttemplate`:e===`urban model`?a=`urbanmodel`:e===`urban project`?a=`urbanproject`:e===`web experience`?a=`experiencebuilder`:e===`web experience template`?a=`webexperiencetemplate`:e===`experience builder widget`?a=`experiencebuilderwidget`:e===`experience builder widget package`?a=`experiencebuilderwidgetpackage`:e===`workflow`?a=`workflow`:e===`kernel gateway connection`?a=`kernelgatewayconnection`:e===`insights script`?a=`insightsscript`:e===`hub initiative template`?a=`hubinitiativetemplate`:e===`storymap theme`?a=`storymaptheme`:e===`knowledge graph`?a=`knowledgegraph`:e===`knowledge graph layer`?a=`knowledgegraphlayer`:e===`knowledge studio project`?a=`knowledgestudio`:e===`native application`?a=`nativeapp`:e===`native application installer`?a=`nativeappinstaller`:e===`web link chart`?a=`linkchart`:e===`knowledge graph web investigation`?a=`investigation`:e===`ogcfeatureserver`?a=`features`:e===`pro presentation`?a=`propresentation`:e===`pro project`?a=`proproject`:e===`insights workbook package`?a=`insightsworkbookpackage`:e===`apache parquet`?a=`apacheparquet`:e===`notebook code snippet library`?a=`notebookcodesnippets`:e===`suitability model`?a=`suitabilitymodel`:e===`esri classifier definition`?a=`classifierdefinition`:e===`esri classification schema`?a=`classificationschema`:e===`insights data engineering workbook`?a=`dataengineeringworkbook`:e===`insights data engineering model`?a=`dataengineeringmodel`:e===`deep learning studio project`?a=`deeplearningproject`:e===`discussion`?a=`discussion`:e===`allsource project`?a=`allsourceproject`:e===`api key`?a=`apikey`:e===`data pipeline`?a=`datapipelines`:e===`group layer`?(d=n.includes(`Map`),a=d?`layergroup2d`:`layergroup`):a=e===`media layer`?`onlinemedialayer`:e===`form`?n.includes(`Survey123`)?`survey`:`datafilesgray`:e===`csv`?`csv`:e===`image`?`image`:e===`xr experience`?`xrexperience`:`maps`,a?t(`esri/images/portal/`+a+`16.png`):null}get isLayer(){return this.type!=null&&y.has(this.type)}get itemCdnUrl(){return g(this.itemUrl)}get itemPageUrl(){let e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){let e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get loaded(){return super.loaded}get thumbnailUrl(){let e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){let e=this.portal?.restUrl;if(!e)return null;let t=this.owner||this.portal?.user?.id;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){let t=this.portal??=p.getDefault(),n=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e==null?null:e.signal,query:{token:this.apiKey}}):{}).then(e=>{this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(n),Promise.resolve(this)}async addRating(e){let t={method:`post`,query:{}},n=e instanceof h?e.rating:e;return n!=null&&!isNaN(n)&&typeof e==`number`&&(t.query.rating=n),this.portal?(await this.portal.request(this.itemUrl+`/addRating`,t),new h({rating:n,created:new Date})):null}clone(){let e={access:this.access,accessInformation:this.accessInformation,applicationProxies:i(this.applicationProxies),avgRating:this.avgRating,categories:i(this.categories),classification:i(this.classification),created:i(this.created),culture:this.culture,description:this.description,extent:i(this.extent),groupCategories:i(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:i(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:i(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:i(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:i(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus=`loaded`);let t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set(`isOrgItem`,this.isOrgItem),t}createPostQuery(){let e=this.toJSON();for(let t of[`tags`,`typeKeywords`,`categories`])e[t]=e[t]?.join(`, `);for(let t of[`extent`,`classification`]){let n=e[t];n&&(e[t]=JSON.stringify(n))}return e}async deleteRating(){await this.portal.request(this.itemUrl+`/deleteRating`,{method:`post`})}fetchData(e=`json`,t){return this.portal.request(this.itemUrl+`/data`,{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){let t=await this.portal.request(this.itemUrl+`/rating`,{query:{token:this.apiKey},...e});return t.rating==null?null:(t.created=new Date(t.created),new h(t))}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+`/relatedItems`,{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??``,{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,`appProxies`)&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{let t=e?.data,n={method:`post`};n.query=this.createPostQuery();for(let e in n.query)n.query[e]===null&&(n.query[e]=``);return n.query.clearEmptyFields=!0,t!=null&&(typeof t==`string`?n.query.text=t:typeof t==`object`&&(n.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,n).then(()=>this.reload())}):Promise.reject(new n(`portal:item-does-not-exist`,`The item does not exist yet and cannot be updated`))}async copy(e){if(!this.id)throw new n(`portal:item-does-not-exist`,`The item does not exist yet`);await this.load();let{portal:t,itemUrl:r}=this;await t.signIn();let{copyResources:i,folder:a,tags:o,title:s}=e||{},c={method:`post`,query:{copyPrivateResources:i===`all`,folder:typeof a==`string`?a:a?.id,includeResources:!!i,tags:o?.join(`,`),title:s}},{itemId:l}=await t.request(`${r}/copy`,c);return new v({id:l,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{let t=e.thumbnail,n=e.filename,r={method:`post`};if(typeof t==`string`)r.query=s(t)?{data:t}:{url:c(t)},n!=null&&(r.query.filename=n);else{let e=new FormData;n==null?e.append(`file`,t):e.append(`file`,t,n),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new n(`portal:item-does-not-exist`,`The item does not exist yet and cannot be updated`))}async fetchResources(e={},t){let{fetchResources:n}=await import(`./support/resourceUtils.js`);return n(this,e,t)}async addResource(e,t,n){let{addOrUpdateResources:r}=await import(`./support/resourceUtils.js`);return e.portalItem=this,await r(this,[{resource:e,content:t,compress:n?.compress,access:n?.access}],`add`,n),e}async removeResource(e,t){let{removeResource:r}=await import(`./support/resourceUtils.js`);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new n(`removeresource:portal-item-mismatch`,`The portal item associated with the provided resource does not match the item`);return r(this,e,t)}async removeAllResources(e){let{removeAllResources:t}=await import(`./support/resourceUtils.js`);return t(this,e)}resourceFromPath(e){return new m({portalItem:this,path:e})}toJSON(){let e=this.extent,t={accessInformation:this.accessInformation,categories:i(this.categories),classification:i(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:i(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:i(this.typeKeywords),url:this.url};return a(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw Error(`JSON object is already hydrated`);return new v({sourceJSON:e})}_getPostQuery(){let e=this.toJSON();for(let t in e)t===`tags`&&e[t]!==null&&(e[t]=e[t].join(`, `)),t===`typeKeywords`&&e[t]!==null&&(e[t]=e[t].join(`, `)),t===`extent`&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([l({type:[`private`,`shared`,`org`,`public`]})],x.prototype,`access`,void 0),e([l()],x.prototype,`accessInformation`,void 0),e([l({type:String})],x.prototype,`apiKey`,void 0),e([l({json:{read:{source:`appProxies`}}})],x.prototype,`applicationProxies`,void 0),e([l()],x.prototype,`avgRating`,void 0),e([l()],x.prototype,`categories`,void 0),e([l()],x.prototype,`classification`,void 0),e([l({type:Date})],x.prototype,`created`,void 0),e([l()],x.prototype,`culture`,void 0),e([l()],x.prototype,`description`,void 0),e([l({readOnly:!0})],x.prototype,`displayName`,null),e([l({type:f})],x.prototype,`extent`,void 0),e([_(`extent`)],x.prototype,`readExtent`,null),e([l()],x.prototype,`groupCategories`,void 0),e([l({readOnly:!0})],x.prototype,`iconUrl`,null),e([l()],x.prototype,`id`,void 0),e([l({readOnly:!0})],x.prototype,`isLayer`,null),e([l({type:Boolean,readOnly:!0})],x.prototype,`isOrgItem`,void 0),e([l()],x.prototype,`itemControl`,void 0),e([l({readOnly:!0})],x.prototype,`itemPageUrl`,null),e([l({readOnly:!0})],x.prototype,`itemUrl`,null),e([l()],x.prototype,`licenseInfo`,void 0),e([l({type:Date})],x.prototype,`modified`,void 0),e([l()],x.prototype,`name`,void 0),e([l()],x.prototype,`numComments`,void 0),e([l()],x.prototype,`numRatings`,void 0),e([l()],x.prototype,`numViews`,void 0),e([l()],x.prototype,`owner`,void 0),e([l()],x.prototype,`ownerFolder`,void 0),e([l({type:p})],x.prototype,`portal`,void 0),e([l()],x.prototype,`screenshots`,void 0),e([l()],x.prototype,`size`,void 0),e([l()],x.prototype,`snippet`,void 0),e([l()],x.prototype,`sourceJSON`,void 0),e([l({type:String})],x.prototype,`sourceUrl`,void 0),e([l({type:String})],x.prototype,`spatialReference`,void 0),e([l()],x.prototype,`tags`,void 0),e([l()],x.prototype,`thumbnail`,void 0),e([l({readOnly:!0})],x.prototype,`thumbnailUrl`,null),e([l()],x.prototype,`title`,void 0),e([l()],x.prototype,`type`,void 0),e([l()],x.prototype,`typeKeywords`,void 0),e([l({type:String,json:{read(e,t){if(b.has(t.type)){let t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],x.prototype,`url`,void 0),e([l({readOnly:!0})],x.prototype,`userItemUrl`,null),x=v=e([u(`esri.portal.PortalItem`)],x);export{x as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import n from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as i,fixJson as a}from"../core/lang.js";import{Loadable as o}from"../core/Loadable.js";import{isDataProtocol as s,makeAbsolute as c}from"../core/urlUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import p from"./Portal.js";import m from"./PortalItemResource.js";import h from"./PortalRating.js";import{a as g}from"../chunks/persistableUrlUtils.js";import{reader as _}from"../core/accessorSupport/decorators/reader.js";var v;const y=new Set([`3DTiles Service`,`CSV`,`Feature Collection`,`Feature Service`,`Feed`,`GeoJson`,`Group Layer`,`Image Service`,`KML`,`Knowledge Graph Layer`,`Map Service`,`Media Layer`,`PDF`,`Scene Service`,`Stream Service`,`Video Service`,`Vector Tile Service`,`WCS`,`WFS`,`WMS`,`WMTS`]),b=new Set([`KML`,`GeoJson`,`CSV`,`PDF`]);let x=v=class extends r(o){static from(e){return d(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){let e=this.type,t=this.typeKeywords||[],n=e;return e===`Feature Service`||e===`Feature Collection`?n=t.includes(`Table`)?`Table`:t.includes(`Route Layer`)?`Route Layer`:t.includes(`Markup`)?`Markup`:`Feature Layer`:e===`Image Service`?n=t.includes(`Elevation 3D Layer`)?`Elevation Layer`:t.includes(`Tiled Imagery`)?`Tiled Imagery Layer`:`Imagery Layer`:e===`Scene Service`?n=`Scene Layer`:e===`Video Service`?n=`Video Layer`:e===`Scene Package`?n=`Scene Layer Package`:e===`Stream Service`?n=`Feature Layer`:e===`Geoprocessing Service`?n=t.includes(`Web Tool`)?`Tool`:`Geoprocessing Service`:e===`Geoenrichment Service`?n=`GeoEnrichment Service`:e===`Geocoding Service`?n=`Locator`:e===`Microsoft Powerpoint`?n=`Microsoft PowerPoint`:e===`GeoJson`?n=`GeoJSON`:e===`Globe Service`?n=`Globe Layer`:e===`Vector Tile Service`?n=`Tile Layer`:e===`netCDF`?n=`NetCDF`:e===`Map Service`?n=!t.includes(`Spatiotemporal`)&&(t.includes(`Hosted Service`)||t.includes(`Tiled`))&&!t.includes(`Relational`)?`Tile Layer`:`Map Image Layer`:e?.toLowerCase().includes(`add in`)?n=e.replaceAll(/(add in)/gi,`Add-In`):e===`datastore catalog service`?n=`Big Data File Share`:e===`Compact Tile Package`?n=`Tile Package (tpkx)`:e===`Raster function template`?n=`Raster Function Template`:e===`OGCFeatureServer`?n=`OGC Feature Layer`:e===`web mapping application`&&t.includes(`configurableApp`)?n=`Instant App`:e===`Insights Page`?n=`Insights Report`:e===`Excalibur Imagery Project`?n=`Excalibur Project`:e===`3DTiles Service`?n=`3D tiles layer`:e===`3DTiles Package`&&(n=`3D tiles package`),n}readExtent(e){return e&&e.length?new f({xmin:e[0][0],ymin:e[0][1],xmax:e[1][0],ymax:e[1][1]}):null}get iconUrl(){let e=this.type?.toLowerCase()||``,n=this.typeKeywords||[],r=!1,i=!1,a,o=!1,s=!1,c=!1,l=!1,u=!1,d=!1;return e.indexOf(`service`)>0||e===`feature collection`||e===`kml`||e===`wms`||e===`wmts`||e===`wfs`?(r=n.includes(`Hosted Service`),e===`feature service`||e===`feature collection`||e===`kml`||e===`wfs`?(i=n.includes(`Table`),o=n.includes(`Route Layer`),s=n.includes(`Markup`),c=n.includes(`Spatiotemporal`),l=n.includes(`UtilityNetwork`),a=c&&i?`spatiotemporaltable`:i?`table`:o?`routelayer`:s?`markup`:c?`spatiotemporal`:l?`utilitynetwork`:r?`featureshosted`:`features`):e===`map service`||e===`wms`||e===`wmts`?(c=n.includes(`Spatiotemporal`),u=n.includes(`Relational`),a=c||u?`mapimages`:r||n.includes(`Tiled`)||e===`wmts`?`maptiles`:`mapimages`):a=e===`scene service`?n.includes(`Line`)?`sceneweblayerline`:n.includes(`3DObject`)?`sceneweblayermultipatch`:n.includes(`Point`)?`sceneweblayerpoint`:n.includes(`IntegratedMesh`)?`sceneweblayermesh`:n.includes(`PointCloud`)?`sceneweblayerpointcloud`:n.includes(`Polygon`)?`sceneweblayerpolygon`:n.includes(`Building`)?`sceneweblayerbuilding`:n.includes(`Voxel`)?`sceneweblayervoxel`:`sceneweblayer`:e===`image service`?n.includes(`Elevation 3D Layer`)?`elevationlayer`:n.includes(`Tiled Imagery`)?`tiledimagerylayer`:`imagery`:e===`stream service`?`streamlayer`:e===`vector tile service`?`vectortile`:e===`datastore catalog service`?`datastorecollection`:e===`geocoding service`?`geocodeservice`:e===`video service`?n.includes(`Live Stream`)?`livestreamvideolayer`:`videolayer`:e===`geoprocessing service`?n.includes(`Web Tool`)?`tool`:`layers`:e===`geodata service`?`geodataservice`:e===`3dtiles service`?n.includes(`3DObject`)?`3dobjecttileslayer`:n.includes(`IntegratedMesh`)?`integratedmeshtileslayer`:n.includes(`GaussianSplat`)?`gaussiansplatlayer`:`3dtileslayer`:`layers`):e===`web map`||e===`cityengine web scene`?a=`maps`:e===`web scene`?a=n.includes(`ViewingMode-Local`)?`webscenelocal`:`websceneglobal`:e===`web mapping application`&&n.includes(`configurableApp`)?a=`instantapps`:e===`web mapping application`||e===`mobile application`||e===`application`||e===`operation view`||e===`desktop application`?a=`apps`:e===`map document`||e===`map package`||e===`published map`||e===`scene document`||e===`globe document`||e===`basemap package`||e===`mobile basemap package`||e===`mobile map package`||e===`project package`||e===`project template`||e===`pro map`||e===`layout`||e===`layer`&&n.includes(`ArcGIS Pro`)||e===`explorer map`&&n.indexOf(`Explorer Document`)?a=`mapsgray`:e===`service definition`||e===`shapefile`||e===`cad drawing`||e===`geojson`||e===`netcdf`||e===`administrative report`?a=`datafiles`:e===`360 vr experience`?a=`360vr`:e===`explorer add in`||e===`desktop add in`||e===`windows viewer add in`||e===`windows viewer configuration`?a=`appsgray`:e===`arcgis pro add in`||e===`arcgis pro configuration`?a=`addindesktop`:e===`pdf`?a=`pdf`:e===`microsoft word`?a=`word`:e===`microsoft excel`?a=`excel`:e===`microsoft powerpoint`?a=`ppt`:e===`rule package`||e===`file geodatabase`||e===`sqlite geodatabase`||e===`csv collection`||e===`kml collection`||e===`windows mobile package`||e===`map template`||e===`desktop application template`||e===`gml`||e===`arcpad package`||e===`code sample`||e===`document link`||e===`earth configuration`||e===`operations dashboard add in`||e===`rules package`||e===`workflow manager package`||e===`explorer map`&&n.includes(`Explorer Mapping Application`)||n.includes(`Document`)?a=`datafilesgray`:e===`network analysis service`||e===`geoprocessing service`||e===`geodata service`||e===`geometry service`||e===`geoprocessing package`||e===`locator package`||e===`geoprocessing sample`||e===`workflow manager service`?a=`toolsgray`:e===`layer`||e===`layer package`||e===`explorer layer`?a=`layersgray`:e===`analysis model`?a=`analysismodel`:e===`scene package`?a=`scenepackage`:e===`3dtiles package`?a=`3dtileslayerpackage`:e===`3dtiles service`?a=`3dtileslayer`:e===`mobile scene package`?a=`mobilescenepackage`:e===`tile package`||e===`compact tile package`?a=`tilepackage`:e===`task file`?a=`taskfile`:e===`report template`?a=`report-template`:e===`statistical data collection`?a=`statisticaldatacollection`:e===`insights workbook`?a=`workbook`:e===`insights model`?a=`insightsmodel`:e===`insights page`?a=`insightspage`:e===`insights theme`?a=`insightstheme`:e===`hub initiative`?a=`hubinitiative`:e===`hub page`?a=`hubpage`:e===`hub site application`?a=`hubsite`:e===`hub event`?a=`hubevent`:e===`hub project`?a=`hubproject`:e===`relational database connection`?a=`relationaldatabaseconnection`:e===`big data file share`?a=`datastorecollection`:e===`image collection`?a=`imagecollection`:e===`desktop style`?a=`desktopstyle`:e===`style`?a=n.includes(`Dictionary`)?`dictionarystyle`:`style`:e===`dashboard`?a=`dashboard`:e===`raster function template`?a=`rasterprocessingtemplate`:e===`vector tile package`?a=`vectortilepackage`:e===`ortho mapping project`?a=`orthomappingproject`:e===`ortho mapping template`?a=`orthomappingtemplate`:e===`solution`?a=`solutions`:e===`geopackage`?a=`geopackage`:e===`deep learning package`?a=`deeplearningpackage`:e===`real time analytic`?a=`realtimeanalytics`:e===`reality mapping project`?a=`realitymappingproject`:e===`big data analytic`?a=`bigdataanalytics`:e===`feed`?a=`feed`:e===`excalibur imagery project`?a=`excaliburimageryproject`:e===`notebook`?a=`notebook`:e===`storymap`?a=`storymap`:e===`survey123 add in`?a=`survey123addin`:e===`mission`?a=`mission`:e===`mission report`?a=`missionreport`:e===`mission template`?a=`missiontemplate`:e===`quickcapture project`?a=`quickcaptureproject`:e===`pro report`?a=`proreport`:e===`pro report template`?a=`proreporttemplate`:e===`urban model`?a=`urbanmodel`:e===`urban project`?a=`urbanproject`:e===`web experience`?a=`experiencebuilder`:e===`web experience template`?a=`webexperiencetemplate`:e===`experience builder widget`?a=`experiencebuilderwidget`:e===`experience builder widget package`?a=`experiencebuilderwidgetpackage`:e===`workflow`?a=`workflow`:e===`kernel gateway connection`?a=`kernelgatewayconnection`:e===`insights script`?a=`insightsscript`:e===`hub initiative template`?a=`hubinitiativetemplate`:e===`storymap theme`?a=`storymaptheme`:e===`knowledge graph`?a=`knowledgegraph`:e===`knowledge graph layer`?a=`knowledgegraphlayer`:e===`knowledge studio project`?a=`knowledgestudio`:e===`native application`?a=`nativeapp`:e===`native application installer`?a=`nativeappinstaller`:e===`web link chart`?a=`linkchart`:e===`knowledge graph web investigation`?a=`investigation`:e===`ogcfeatureserver`?a=`features`:e===`pro presentation`?a=`propresentation`:e===`pro project`?a=`proproject`:e===`insights workbook package`?a=`insightsworkbookpackage`:e===`apache parquet`?a=`apacheparquet`:e===`notebook code snippet library`?a=`notebookcodesnippets`:e===`suitability model`?a=`suitabilitymodel`:e===`esri classifier definition`?a=`classifierdefinition`:e===`esri classification schema`?a=`classificationschema`:e===`insights data engineering workbook`?a=`dataengineeringworkbook`:e===`insights data engineering model`?a=`dataengineeringmodel`:e===`deep learning studio project`?a=`deeplearningproject`:e===`discussion`?a=`discussion`:e===`allsource project`?a=`allsourceproject`:e===`api key`?a=`apikey`:e===`data pipeline`?a=`datapipelines`:e===`group layer`?(d=n.includes(`Map`),a=d?`layergroup2d`:`layergroup`):a=e===`media layer`?`onlinemedialayer`:e===`form`?n.includes(`Survey123`)?`survey`:`datafilesgray`:e===`csv`?`csv`:e===`image`?`image`:e===`xr experience`?`xrexperience`:`maps`,a?t(`esri/images/portal/`+a+`16.png`):null}get isLayer(){return this.type!=null&&y.has(this.type)}get itemCdnUrl(){return g(this.itemUrl)}get itemPageUrl(){let e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){let e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get loaded(){return super.loaded}get thumbnailUrl(){let e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){let e=this.portal?.restUrl;if(!e)return null;let t=this.owner||this.portal?.user?.id;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){let t=this.portal??=p.getDefault(),n=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e==null?null:e.signal,query:{token:this.apiKey}}):{}).then(e=>{this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(n),Promise.resolve(this)}async addRating(e){let t={method:`post`,query:{}},n=e instanceof h?e.rating:e;return n!=null&&!isNaN(n)&&typeof e==`number`&&(t.query.rating=n),this.portal?(await this.portal.request(this.itemUrl+`/addRating`,t),new h({rating:n,created:new Date})):null}clone(){let e={access:this.access,accessInformation:this.accessInformation,applicationProxies:i(this.applicationProxies),avgRating:this.avgRating,categories:i(this.categories),classification:i(this.classification),created:i(this.created),culture:this.culture,description:this.description,extent:i(this.extent),groupCategories:i(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:i(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:i(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:i(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:i(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus=`loaded`);let t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set(`isOrgItem`,this.isOrgItem),t}createPostQuery(){let e=this.toJSON();for(let t of[`tags`,`typeKeywords`,`categories`])e[t]=e[t]?.join(`, `);for(let t of[`extent`,`classification`]){let n=e[t];n&&(e[t]=JSON.stringify(n))}return e}async deleteRating(){await this.portal.request(this.itemUrl+`/deleteRating`,{method:`post`})}fetchData(e=`json`,t){return this.portal.request(this.itemUrl+`/data`,{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){let t=await this.portal.request(this.itemUrl+`/rating`,{query:{token:this.apiKey},...e});return t.rating==null?null:(t.created=new Date(t.created),new h(t))}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+`/relatedItems`,{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??``,{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,`appProxies`)&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{let t=e?.data,n={method:`post`};n.query=this.createPostQuery();for(let e in n.query)n.query[e]===null&&(n.query[e]=``);return n.query.clearEmptyFields=!0,t!=null&&(typeof t==`string`?n.query.text=t:typeof t==`object`&&(n.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,n).then(()=>this.reload())}):Promise.reject(new n(`portal:item-does-not-exist`,`The item does not exist yet and cannot be updated`))}async copy(e){if(!this.id)throw new n(`portal:item-does-not-exist`,`The item does not exist yet`);await this.load();let{portal:t,itemUrl:r}=this;await t.signIn();let{copyResources:i,folder:a,tags:o,title:s}=e||{},c={method:`post`,query:{copyPrivateResources:i===`all`,folder:typeof a==`string`?a:a?.id,includeResources:!!i,tags:o?.join(`,`),title:s}},{itemId:l}=await t.request(`${r}/copy`,c);return new v({id:l,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{let t=e.thumbnail,n=e.filename,r={method:`post`};if(typeof t==`string`)r.query=s(t)?{data:t}:{url:c(t)},n!=null&&(r.query.filename=n);else{let e=new FormData;n==null?e.append(`file`,t):e.append(`file`,t,n),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new n(`portal:item-does-not-exist`,`The item does not exist yet and cannot be updated`))}async fetchResources(e={},t){let{fetchResources:n}=await import(`./support/resourceUtils.js`);return n(this,e,t)}async addResource(e,t,n){let{addOrUpdateResources:r}=await import(`./support/resourceUtils.js`);return e.portalItem=this,await r(this,[{resource:e,content:t,compress:n?.compress,access:n?.access}],`add`,n),e}async removeResource(e,t){let{removeResource:r}=await import(`./support/resourceUtils.js`);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new n(`removeresource:portal-item-mismatch`,`The portal item associated with the provided resource does not match the item`);return r(this,e,t)}async removeAllResources(e){let{removeAllResources:t}=await import(`./support/resourceUtils.js`);return t(this,e)}resourceFromPath(e){return new m({portalItem:this,path:e})}toJSON(){let e=this.extent,t={accessInformation:this.accessInformation,categories:i(this.categories),classification:i(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:i(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:i(this.typeKeywords),url:this.url};return a(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw Error(`JSON object is already hydrated`);return new v({sourceJSON:e})}_getPostQuery(){let e=this.toJSON();for(let t in e)t===`tags`&&e[t]!==null&&(e[t]=e[t].join(`, `)),t===`typeKeywords`&&e[t]!==null&&(e[t]=e[t].join(`, `)),t===`extent`&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([l({type:[`private`,`shared`,`org`,`public`]})],x.prototype,`access`,void 0),e([l()],x.prototype,`accessInformation`,void 0),e([l({type:String})],x.prototype,`apiKey`,void 0),e([l({json:{read:{source:`appProxies`}}})],x.prototype,`applicationProxies`,void 0),e([l()],x.prototype,`avgRating`,void 0),e([l()],x.prototype,`categories`,void 0),e([l()],x.prototype,`classification`,void 0),e([l({type:Date})],x.prototype,`created`,void 0),e([l()],x.prototype,`culture`,void 0),e([l()],x.prototype,`description`,void 0),e([l({readOnly:!0})],x.prototype,`displayName`,null),e([l({type:f})],x.prototype,`extent`,void 0),e([_(`extent`)],x.prototype,`readExtent`,null),e([l()],x.prototype,`groupCategories`,void 0),e([l({readOnly:!0})],x.prototype,`iconUrl`,null),e([l()],x.prototype,`id`,void 0),e([l({readOnly:!0})],x.prototype,`isLayer`,null),e([l({type:Boolean,readOnly:!0})],x.prototype,`isOrgItem`,void 0),e([l()],x.prototype,`itemControl`,void 0),e([l({readOnly:!0})],x.prototype,`itemPageUrl`,null),e([l({readOnly:!0})],x.prototype,`itemUrl`,null),e([l()],x.prototype,`licenseInfo`,void 0),e([l({type:Date})],x.prototype,`modified`,void 0),e([l()],x.prototype,`name`,void 0),e([l()],x.prototype,`numComments`,void 0),e([l()],x.prototype,`numRatings`,void 0),e([l()],x.prototype,`numViews`,void 0),e([l()],x.prototype,`owner`,void 0),e([l()],x.prototype,`ownerFolder`,void 0),e([l({type:p})],x.prototype,`portal`,void 0),e([l()],x.prototype,`screenshots`,void 0),e([l()],x.prototype,`size`,void 0),e([l()],x.prototype,`snippet`,void 0),e([l()],x.prototype,`sourceJSON`,void 0),e([l({type:String})],x.prototype,`sourceUrl`,void 0),e([l({type:String})],x.prototype,`spatialReference`,void 0),e([l()],x.prototype,`tags`,void 0),e([l()],x.prototype,`thumbnail`,void 0),e([l({readOnly:!0})],x.prototype,`thumbnailUrl`,null),e([l()],x.prototype,`title`,void 0),e([l()],x.prototype,`type`,void 0),e([l()],x.prototype,`typeKeywords`,void 0),e([l({type:String,json:{read(e,t){if(b.has(t.type)){let t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],x.prototype,`url`,void 0),e([l({readOnly:!0})],x.prototype,`userItemUrl`,null),x=v=e([u(`esri.portal.PortalItem`)],x);export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{parseUrl as e}from"../utils.js";import{executePivotQuery as t}from"./operations/queryPivot.js";import n from"../support/FeatureSet.js";import r from"../support/PivotQuery.js";async function i(i,a,o){let
|
|
2
|
+
import{parseUrl as e}from"../utils.js";import{executePivotQuery as t}from"./operations/queryPivot.js";import n from"../support/FeatureSet.js";import r from"../support/PivotQuery.js";async function i(i,a,o,s){let c=e(i),l={...o},{data:u}=await t(c,r.from(a),l,s);return n.fromJSON(u)}export{i as executePivotQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{queryLikeToQueryStringParameters as a}from"./queryUtils.js";function o(e){let
|
|
2
|
+
import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{queryLikeToQueryStringParameters as a}from"./queryUtils.js";function o(e,t){let n=a(e,void 0,t),r=n.outPivots;if(r?.length){for(let e of r)e.pivotType===`Pivot`&&e.pivotParameters.outStatistic?e.pivotParameters.outStatistic=JSON.stringify(e.pivotParameters.outStatistic):e.pivotType===`Unpivot`&&(e.unPivotParameters.sourceFields=e.unPivotParameters.sourceFields.join(`,`));n.outPivots=JSON.stringify(r)}return n}async function s(e,t,n,r){return await c(e,t,n,r)}async function c(a,s,c={},l){let u=typeof a==`string`?t(a):a,[d]=await r([s.geometry],c);d!=null&&(s=s.clone(),s.geometry=d);let f=i({...u.query,f:`json`,...o(s,l)});return e(n(u.path,`queryPivot`),{...c,query:{...f,...c.query}})}export{s as executePivotQuery,o as queryToQueryStringParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{sqlAnd as e}from"../../../core/sql.js";import{getJsonType as t}from"../../../geometry/support/jsonTypeUtils.js";import{srToRESTValue as n}from"../../../geometry/support/spatialReferenceUtils.js";import{timeExtentToQueryParameter as r}from"../../support/timeUtils.js";function i(e,t){if(t&&e.type===`extent`)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&e.type===`point`)return`${e.x},${e.y}`;let n=e.toJSON();return delete n.spatialReference,JSON.stringify(n)}function a(a,o,s){let{geometry:c}=a,l=
|
|
2
|
+
import{sqlAnd as e}from"../../../core/sql.js";import{getJsonType as t}from"../../../geometry/support/jsonTypeUtils.js";import{srToRESTValue as n}from"../../../geometry/support/spatialReferenceUtils.js";import{timeExtentToQueryParameter as r}from"../../support/timeUtils.js";function i(e,t){if(t&&e.type===`extent`)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&e.type===`point`)return`${e.x},${e.y}`;let n=e.toJSON();return delete n.spatialReference,JSON.stringify(n)}function a(a,o,s){let{geometry:c}=a,l=s?.encodingCapabilities?.supportsCompactGeometry??!1,u=s?.encodingCapabilities?.supportsDefaultSpatialReference,d=a.toJSON(),f=d,p,m,h;if(c&&(m=c.spatialReference,h=n(m),f.geometryType=t(c),f.geometry=i(c,l),f.inSR=h),d.groupByFieldsForStatistics&&(f.groupByFieldsForStatistics=d.groupByFieldsForStatistics.join(`,`)),d.objectIds)switch(s?.uniqueIdFields?.length){case void 0:f.objectIds=d.objectIds.join(`,`);break;case 1:f.uniqueIds=JSON.stringify(d.objectIds),delete f.objectIds;break;default:f.uniqueIds=JSON.stringify(d.objectIds.map(e=>JSON.parse(e))),delete f.objectIds}if(d.orderByFields&&(f.orderByFields=d.orderByFields.join(`,`)),d.outFields&&(d.returnDistinctValues||!(o?.returnCountOnly||o?.returnExtentOnly||o?.returnIdsOnly))?f.outFields=d.outFields.includes(`*`)?`*`:d.outFields.join(`,`):delete f.outFields,d.outSR?(f.outSR=n(d.outSR),p=a.outSpatialReference):c&&(d.returnGeometry||d.returnCentroid)&&(f.outSR=f.inSR,p=m),d.returnGeometry&&delete d.returnGeometry,d.outStatistics&&(f.outStatistics=JSON.stringify(d.outStatistics)),d.outDistance&&(f.outDistance=JSON.stringify(d.outDistance)),d.fullText&&(f.fullText=JSON.stringify(d.fullText)),d.pixelSize&&(f.pixelSize=JSON.stringify(d.pixelSize)),d.quantizationParameters&&(u&&m!=null&&a.quantizationParameters?.extent!=null&&m.equals(a.quantizationParameters.extent.spatialReference)&&delete d.quantizationParameters.extent.spatialReference,f.quantizationParameters=JSON.stringify(d.quantizationParameters)),d.parameterValues&&(f.parameterValues=JSON.stringify(d.parameterValues)),d.rangeValues&&(f.rangeValues=JSON.stringify(d.rangeValues)),d.dynamicDataSource){if(`definitionExpression`in d.dynamicDataSource&&d.dynamicDataSource.definitionExpression){let{definitionExpression:e,...t}=d.dynamicDataSource;f.layer=JSON.stringify({query:e,source:t})}else f.layer=JSON.stringify({source:d.dynamicDataSource});delete d.dynamicDataSource}if(a.timeExtent){let t=s?.timeInformation;if(t){let n=t.getExpression(a.timeExtent);switch(n?.type){case`time`:f.time=n.value;break;case`where`:n.value&&(f.where=e(f.where,n.value))}}else f.time=r(a.timeExtent);delete d.timeExtent}return u&&m!=null&&p!=null&&m.equals(p)&&(f.defaultSR=f.inSR,delete f.inSR,delete f.outSR),f}const o=`json`;export{i as encodeGeometry,a as queryLikeToQueryStringParameters,o as safeExtentResultFormat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import o from"../../geometry/SpatialReference.js";import{fromJSON as s}from"../../geometry/support/jsonUtils.js";import{geometryTypes as c}from"../../geometry/support/typeUtils.js";import l from"./PivotDefinition.js";import u from"./QuantizationParameters.js";import{spatialRelKebabDict as d}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import p from"./UnPivotDefinition.js";import m from"../../time/TimeExtent.js";import{enumeration as h}from"../../core/accessorSupport/decorators/enumeration.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";const _={key:`type`,base:null,typeMap:{pivot:l,"un-pivot":p}};let v=class extends t(n){constructor(e){super(e),this.cacheHint=void 0,this.
|
|
2
|
+
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import o from"../../geometry/SpatialReference.js";import{fromJSON as s}from"../../geometry/support/jsonUtils.js";import{geometryTypes as c}from"../../geometry/support/typeUtils.js";import l from"./PivotDefinition.js";import u from"./QuantizationParameters.js";import{spatialRelKebabDict as d}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import p from"./UnPivotDefinition.js";import m from"../../time/TimeExtent.js";import{enumeration as h}from"../../core/accessorSupport/decorators/enumeration.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";const _={key:`type`,base:null,typeMap:{pivot:l,"un-pivot":p}};let v=class extends t(n){constructor(e){super(e),this.cacheHint=void 0,this.geometry=null,this.groupByFieldsForStatistics=null,this.num=void 0,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.outPivots=null,this.quantizationParameters=null,this.sourceSpatialReference=null,this.spatialRelationship=`intersects`,this.start=void 0,this.where=void 0}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where=`1=1`}};e([r({type:Boolean,json:{write:!0}})],v.prototype,`cacheHint`,void 0),e([r({types:c,json:{read:s,write:!0}})],v.prototype,`geometry`,void 0),e([r({type:[String],json:{write:!0}})],v.prototype,`groupByFieldsForStatistics`,void 0),e([r({type:Number,json:{read:{source:`resultRecordCount`}}})],v.prototype,`num`,void 0),e([r({type:[String],json:{write:!0}})],v.prototype,`orderByFields`,void 0),e([r({type:[String],json:{write:!0}})],v.prototype,`outFields`,void 0),e([r({type:o,json:{name:`outSR`,write:!0}})],v.prototype,`outSpatialReference`,void 0),e([r({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],v.prototype,`outStatistics`,void 0),e([r({types:[_],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outPivots!=null&&this.outPivots.length>0}}}}})],v.prototype,`outPivots`,void 0),e([r({type:u,json:{write:!0}})],v.prototype,`quantizationParameters`,void 0),e([r({type:o,json:{write:!0}})],v.prototype,`sourceSpatialReference`,void 0),e([h(d,{ignoreUnknown:!1,name:`spatialRel`})],v.prototype,`spatialRelationship`,void 0),e([r({type:Number,json:{read:{source:`resultOffset`}}})],v.prototype,`start`,void 0),e([g(`start`),g(`num`)],v.prototype,`writeStart`,null),e([r({type:m,json:{write:!0}})],v.prototype,`timeExtent`,void 0),e([r({type:String,json:{write:!0}})],v.prototype,`where`,void 0),v=e([i(`esri.rest.support.PivotQuery`)],v),v.from=a(v);export{v as default};
|
package/rest/support/Query.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as i,cast as a,subclass as o}from"../../core/accessorSupport/decorators.js";import{ensureClass as s}from"../../core/accessorSupport/ensureType.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import{dynamicDataSourceTypes as f}from"../layerSources/typeUtils.js";import p from"./FullTextSearch.js";import m from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as g}from"./spatialRelationships.js";import _ from"./StatisticDefinition.js";import v from"../../time/TimeExtent.js";import{writer as y}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as b}from"../../core/accessorSupport/decorators/enumeration.js";var x;const S=new t({esriSRUnit_Meter:`meters`,esriSRUnit_Kilometer:`kilometers`,esriSRUnit_Foot:`feet`,esriSRUnit_StatuteMile:`miles`,esriSRUnit_NauticalMile:`nautical-miles`,esriSRUnit_USNauticalMile:`us-nautical-miles`});let C=class extends n{static{x=this}static from(e){return s(x,e)}constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as i,cast as a,subclass as o}from"../../core/accessorSupport/decorators.js";import{ensureClass as s}from"../../core/accessorSupport/ensureType.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import{dynamicDataSourceTypes as f}from"../layerSources/typeUtils.js";import p from"./FullTextSearch.js";import m from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as g}from"./spatialRelationships.js";import _ from"./StatisticDefinition.js";import v from"../../time/TimeExtent.js";import{writer as y}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as b}from"../../core/accessorSupport/decorators/enumeration.js";var x;const S=new t({esriSRUnit_Meter:`meters`,esriSRUnit_Kilometer:`kilometers`,esriSRUnit_Foot:`feet`,esriSRUnit_StatuteMile:`miles`,esriSRUnit_NauticalMile:`nautical-miles`,esriSRUnit_USNauticalMile:`us-nautical-miles`});let C=class extends n{static{x=this}static from(e){return s(x,e)}constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.datumTransformation=null,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship=`intersects`,this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(e){return typeof e==`number`||typeof e==`object`?e:null}writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeParameterValues(e,t){if(e){let n={};for(let t in e){let r=e[t];n[t]=Array.isArray(r)?r.map(e=>e instanceof Date?e.getTime():e):r instanceof Date?r.getTime():r}t.parameterValues=n}}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where=`1=1`}writeWhere(e,t){t.where=e||`1=1`}clone(){return new x(r({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,datumTransformation:this.datumTransformation,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment==null?null:new Date(this.historicMoment),maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};e([i({json:{write:!0}})],C.prototype,`aggregateIds`,void 0),e([i({type:Boolean,json:{write:!0}})],C.prototype,`cacheHint`,void 0),e([i({json:{write:!0}})],C.prototype,`datumTransformation`,void 0),e([a(`datumTransformation`)],C.prototype,`castDatumTransformation`,null),e([i({type:Number,json:{write:{overridePolicy(e){return{enabled:!!e}}}}})],C.prototype,`distance`,void 0),e([i({types:f,json:{write:!0}})],C.prototype,`dynamicDataSource`,void 0),e([i({type:String,json:{write:!0}})],C.prototype,`formatOf3DObjects`,void 0),e([i({type:[p],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],C.prototype,`fullText`,void 0),e([i({type:String,json:{write:!0}})],C.prototype,`gdbVersion`,void 0),e([i({types:d,json:{read:u,write:!0}})],C.prototype,`geometry`,void 0),e([i({type:Number,json:{write:!0}})],C.prototype,`geometryPrecision`,void 0),e([i({type:[String],json:{write:!0}})],C.prototype,`groupByFieldsForStatistics`,void 0),e([i({type:String,json:{write:!0}})],C.prototype,`having`,void 0),e([i({type:Date})],C.prototype,`historicMoment`,void 0),e([y(`historicMoment`)],C.prototype,`writeHistoricMoment`,null),e([i({type:Number,json:{write:!0}})],C.prototype,`maxAllowableOffset`,void 0),e([i({type:Number,cast(e){return e<1?1:e>x.MAX_MAX_RECORD_COUNT_FACTOR?x.MAX_MAX_RECORD_COUNT_FACTOR:e},json:{write:{overridePolicy(e){return{enabled:e>1}}}}})],C.prototype,`maxRecordCountFactor`,void 0),e([i({type:[`xyFootprint`],json:{write:!0}})],C.prototype,`multipatchOption`,void 0),e([i({type:Number,json:{read:{source:`resultRecordCount`}}})],C.prototype,`num`,void 0),e([i({json:{write:!0}})],C.prototype,`objectIds`,void 0),e([i({type:[String],json:{write:!0}})],C.prototype,`orderByFields`,void 0),e([i({type:[String],json:{write:!0}})],C.prototype,`outFields`,void 0),e([i({type:l,json:{name:`outSR`,write:!0}})],C.prototype,`outSpatialReference`,void 0),e([i({type:[_],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],C.prototype,`outStatistics`,void 0),e([i({json:{write:!0}})],C.prototype,`parameterValues`,void 0),e([y(`parameterValues`)],C.prototype,`writeParameterValues`,null),e([i({type:c,json:{write:!0}})],C.prototype,`pixelSize`,void 0),e([i({type:h,json:{write:!0}})],C.prototype,`quantizationParameters`,void 0),e([i({type:[Object],json:{write:!0}})],C.prototype,`rangeValues`,void 0),e([i({type:String,json:{read:{source:`relationParam`},write:{target:`relationParam`,overridePolicy(){return{enabled:this.spatialRelationship===`relation`}}}}})],C.prototype,`relationParameter`,void 0),e([i({type:String,json:{write:!0}})],C.prototype,`resultType`,void 0),e([i({type:Boolean,json:{name:`returnAggIds`,write:{overridePolicy(e){return{enabled:e&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],C.prototype,`returnStatisticsAggregatedIds`,void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],C.prototype,`returnCentroid`,void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],C.prototype,`returnDistinctValues`,void 0),e([i({type:Boolean,json:{default:!0,write:!0}})],C.prototype,`returnExceededLimitFeatures`,void 0),e([i({type:Boolean,json:{default:!0,write:!0}})],C.prototype,`returnExceededLimitGeometries`,void 0),e([i({type:Boolean,json:{write:!0}})],C.prototype,`returnGeometry`,void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],C.prototype,`returnQueryGeometry`,void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],C.prototype,`returnM`,void 0),e([i({type:Boolean,json:{write:{overridePolicy(e){return{enabled:e}}}}})],C.prototype,`returnZ`,void 0),e([i({type:Boolean,json:{write:!0}})],C.prototype,`returnTrueCurves`,void 0),e([i({type:l,json:{write:!0}})],C.prototype,`sourceSpatialReference`,void 0),e([b(g,{ignoreUnknown:!1,name:`spatialRel`})],C.prototype,`spatialRelationship`,void 0),e([i({type:Number,json:{read:{source:`resultOffset`}}})],C.prototype,`start`,void 0),e([y(`start`),y(`num`)],C.prototype,`writeStart`,null),e([i({type:String,json:{write:!0}})],C.prototype,`sqlFormat`,void 0),e([i({type:String,json:{write:!0}})],C.prototype,`text`,void 0),e([i({type:v,json:{write:!0}})],C.prototype,`timeExtent`,void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],C.prototype,`timeReferenceUnknownClient`,void 0),e([b(S,{ignoreUnknown:!1}),i({json:{write:{overridePolicy(e){return{enabled:!!e&&!!this.distance}}}}})],C.prototype,`units`,void 0),e([i({type:m,json:{write:!0}})],C.prototype,`outDistance`,void 0),e([i({type:String,json:{write:{overridePolicy(e){return{enabled:e!=null||this.start!=null&&this.start>0}}}}})],C.prototype,`where`,void 0),e([y(`where`)],C.prototype,`writeWhere`,null),C=x=e([o(`esri.rest.support.Query`)],C);export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import r from"../../../../geometry/Point.js";import{estimateStatisticsFromHistograms as i}from"../../../../layers/raster/functions/stretchUtils.js";import a from"../../../../rest/support/ImageHistogramParameters.js";import o from"./RasterLayerAdapter.js";let s=class extends o{generateRasterInfo(e){try{return this.layer.generateRasterInfo(e?.rasterFunction,{signal:e?.signal})}catch{return Promise.resolve(this.layer.serviceRasterInfo)}}async estimateStatisticsHistograms(e){let{layer:t}=this,n=t.mosaicRule?.multidimensionalDefinition?.[0]?.variableName??``,o=`${e?.rasterFunction?.functionName??`default`}${n}`,s=this._statsCache.get(o);if(s)return s;let{width:c,height:l,pixelSize:u}=t.rasterInfo,d=1;for(;c>2e3||l>2e3;)c/=2,l/=2,d*=2;let f=e?.rasterFunction??t.rasterFunction,{fullExtent:p,mosaicRule:m}=t,h=new r(u.x*d,u.y*d,p.spatialReference),g=new a({geometry:p,pixelSize:h,rasterFunction:f,mosaicRule:m}),_;if(t.capabilities.operations.supportsComputeStatisticsHistograms)_=await t.computeStatisticsHistograms(g,e);else{let{histograms:n}=await t.computeHistograms(g,e);_={statistics:i(n),histograms:n}}return _&&this._statsCache.put(o,_),_}supportsMultidirectionalHillshade(){return this.layer.version>=10.81}load(e){return this.addResolvingPromise(this.layer.load(e).then(async()=>{let t=e?.signal;this.rasterInfo=await this.generateRasterInfo({rasterFunction:this.rasterFunction,signal:t})})),Promise.resolve(this)}};e([t()],s.prototype,`layer`,void 0),s=e([n(`esri.smartMapping.raster.support.adapters.ImageryLayerAdapter`)],s);const c=s;export{c as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import r from"../../../../geometry/Point.js";import{estimateStatisticsFromHistograms as i}from"../../../../layers/raster/functions/stretchUtils.js";import a from"../../../../rest/support/ImageHistogramParameters.js";import o from"./RasterLayerAdapter.js";let s=class extends o{generateRasterInfo(e){try{return this.layer.generateRasterInfo(e?.rasterFunction,{signal:e?.signal})}catch{return Promise.resolve(this.layer.serviceRasterInfo)}}async estimateStatisticsHistograms(e){let{layer:t}=this,n=t.mosaicRule?.multidimensionalDefinition?.[0]?.variableName??``,o=`${e?.rasterFunction?.functionName??`default`}${n}`,s=this._statsCache.get(o);if(s)return s;let{width:c,height:l,pixelSize:u}=t.rasterInfo,d=1;for(;c>2e3||l>2e3;)c/=2,l/=2,d*=2;let f=e?.rasterFunction??t.rasterFunction,{fullExtent:p,mosaicRule:m}=t,h=new r({x:u.x*d,y:u.y*d,spatialReference:p.spatialReference}),g=new a({geometry:p,pixelSize:h,rasterFunction:f,mosaicRule:m}),_;if(t.capabilities.operations.supportsComputeStatisticsHistograms)_=await t.computeStatisticsHistograms(g,e);else{let{histograms:n}=await t.computeHistograms(g,e);_={statistics:i(n),histograms:n}}return _&&this._statsCache.put(o,_),_}supportsMultidirectionalHillshade(){return this.layer.version>=10.81}load(e){return this.addResolvingPromise(this.layer.load(e).then(async()=>{let t=e?.signal;this.rasterInfo=await this.generateRasterInfo({rasterFunction:this.rasterFunction,signal:t})})),Promise.resolve(this)}};e([t()],s.prototype,`layer`,void 0),s=e([n(`esri.smartMapping.raster.support.adapters.ImageryLayerAdapter`)],s);const c=s;export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./FillSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;let u=l=class extends a{constructor(
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./FillSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;let u=l=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-fill`,this.url=null,this.xscale=1,this.yscale=1,this.source=null}normalizeCtorArgs(e){return e&&typeof e!=`string`&&e.imageData==null?e:e?{url:e}:{}}get width(){return this._get(`width`)??12}set width(e){this._set(`width`,e)}get height(){return this._get(`height`)??12}set height(e){this._set(`height`,e)}get xoffset(){return this._get(`xoffset`)??0}set xoffset(e){this._set(`xoffset`,e)}get yoffset(){return this._get(`yoffset`)??0}set yoffset(e){this._set(`yoffset`,e)}clone(){let e=new l({color:t(this.color),height:this.height,outline:t(this.outline),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set(`source`,t(this.source)),e}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};e([r({json:{write:!1}})],u.prototype,`color`,void 0),e([c({esriPFS:`picture-fill`},{readOnly:!0})],u.prototype,`type`,void 0),e([r(o)],u.prototype,`url`,void 0),e([r({type:Number,json:{write:!0}})],u.prototype,`xscale`,void 0),e([r({type:Number,json:{write:!0}})],u.prototype,`yscale`,void 0),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`width`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`height`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`xoffset`,null),e([r({type:Number,cast:n,json:{write:!0}})],u.prototype,`yoffset`,null),e([r(s)],u.prototype,`source`,void 0),u=l=e([i(`esri.symbols.PictureFillSymbol`)],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./MarkerSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";var u;let d=u=class extends a{constructor(
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import{toPt as n}from"../core/screenUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./MarkerSymbol.js";import{urlPropertyDefinition as o,sourcePropertyDefinition as s}from"./support/urlUtils.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";var u;let d=u=class extends a{constructor(e){super(e),this.color=null,this.type=`picture-marker`,this.url=null,this.source=null}normalizeCtorArgs(e){return e&&typeof e!=`string`&&e.imageData==null?e:e?{url:e}:{}}get height(){return this._get(`height`)??12}set height(e){this._set(`height`,e)}readHeight(e,t){return t.size||e}get width(){return this._get(`width`)??12}set width(e){this._set(`width`,e)}readWidth(e,t){return t.size||e}get size(){return this._get(`size`)??null}set size(e){this._set(`size`,e)}clone(){let e=new u({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set(`source`,t(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};e([r({json:{write:!1}})],d.prototype,`color`,void 0),e([c({esriPMS:`picture-marker`},{readOnly:!0})],d.prototype,`type`,void 0),e([r(o)],d.prototype,`url`,void 0),e([r(s)],d.prototype,`source`,void 0),e([r({type:Number,cast:n,json:{write:!0}})],d.prototype,`height`,null),e([l(`height`,[`height`,`size`])],d.prototype,`readHeight`,null),e([r({type:Number,cast:n,json:{write:!0}})],d.prototype,`width`,null),e([r({json:{write:!1}})],d.prototype,`size`,null),d=u=e([i(`esri.symbols.PictureMarkerSymbol`)],d);export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./FillSymbol.js";import s from"./SimpleLineSymbol.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;const u=new n({esriSFSSolid:`solid`,esriSFSNull:`none`,esriSFSHorizontal:`horizontal`,esriSFSVertical:`vertical`,esriSFSForwardDiagonal:`forward-diagonal`,esriSFSBackwardDiagonal:`backward-diagonal`,esriSFSCross:`cross`,esriSFSDiagonalCross:`diagonal-cross`});let d=l=class extends o{constructor(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./FillSymbol.js";import s from"./SimpleLineSymbol.js";import{enumeration as c}from"../core/accessorSupport/decorators/enumeration.js";var l;const u=new n({esriSFSSolid:`solid`,esriSFSNull:`none`,esriSFSHorizontal:`horizontal`,esriSFSVertical:`vertical`,esriSFSForwardDiagonal:`forward-diagonal`,esriSFSBackwardDiagonal:`backward-diagonal`,esriSFSCross:`cross`,esriSFSDiagonalCross:`diagonal-cross`});let d=l=class extends o{constructor(e){super(e),this.color=new t([0,0,0,.25]),this.outline=new s,this.type=`simple-fill`,this.style=`solid`}normalizeCtorArgs(e){return e&&typeof e!=`string`?e:e?{style:e}:{}}clone(){return new l({color:r(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};e([i({type:t})],d.prototype,`color`,void 0),e([i()],d.prototype,`outline`,void 0),e([c({esriSFS:`simple-fill`},{readOnly:!0})],d.prototype,`type`,void 0),e([i({type:u.apiValues,json:{read:u.read,write:u.write}})],d.prototype,`style`,void 0),d=l=e([a(`esri.symbols.SimpleFillSymbol`)],d);export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as t}from"../core/jsonMap.js";import{clone as n}from"../core/lang.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../core/jsonMap.js";import{clone as n}from"../core/lang.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./LineSymbol.js";import o from"./LineSymbolMarker.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";var c;const l=new t({esriSLSSolid:`solid`,esriSLSDash:`dash`,esriSLSDot:`dot`,esriSLSDashDot:`dash-dot`,esriSLSDashDotDot:`long-dash-dot-dot`,esriSLSNull:`none`,esriSLSShortDash:`short-dash`,esriSLSShortDot:`short-dot`,esriSLSShortDashDot:`short-dash-dot`,esriSLSShortDashDotDot:`short-dash-dot-dot`,esriSLSLongDash:`long-dash`,esriSLSLongDashDot:`long-dash-dot`});let u=c=class extends a{constructor(e){super(e),this.type=`simple-line`,this.style=`solid`,this.cap=`round`,this.join=`round`,this.marker=null,this.miterLimit=2}normalizeCtorArgs(e){return e&&typeof e!=`string`?e:e==null?{}:{style:e}}clone(){return new c({color:n(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};e([s({esriSLS:`simple-line`},{readOnly:!0})],u.prototype,`type`,void 0),e([r({type:l.apiValues,json:{read:l.read,write:l.write}})],u.prototype,`style`,void 0),e([r({type:[`butt`,`round`,`square`],json:{write:{overridePolicy:(e,t,n)=>({enabled:e!==`round`&&n?.origin==null})}}})],u.prototype,`cap`,void 0),e([r({type:[`miter`,`round`,`bevel`],json:{write:{overridePolicy:(e,t,n)=>({enabled:e!==`round`&&n?.origin==null})}}})],u.prototype,`join`,void 0),e([r({types:{key:`type`,base:null,defaultKeyValue:`line-marker`,typeMap:{"line-marker":o}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],u.prototype,`marker`,void 0),e([r({type:Number,json:{read:!1,write:!1}})],u.prototype,`miterLimit`,void 0),u=c=e([i(`esri.symbols.SimpleLineSymbol`)],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{JSONMap as n}from"../core/jsonMap.js";import{clone as r}from"../core/lang.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"./MarkerSymbol.js";import s from"./SimpleLineSymbol.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";var u;const d=new n({esriSMSCircle:`circle`,esriSMSSquare:`square`,esriSMSCross:`cross`,esriSMSX:`x`,esriSMSDiamond:`diamond`,esriSMSTriangle:`triangle`,esriSMSPath:`path`});let f=u=class extends o{constructor(e){super(e),this.color=new t([255,255,255,.25]),this.type=`simple-marker`,this.style=`circle`,this.outline=new s}normalizeCtorArgs(e){return e&&typeof e!=`string`?e:e?{style:e}:{}}writeColor(e,t){e&&this.style!==`x`&&this.style!==`cross`&&(t.color=e.toJSON()),e===null&&(t.color=null)}get size(){return this._get(`size`)??12}set size(e){this._set(`size`,e)}set path(e){this.style=`path`,this._set(`path`,e)}clone(){return new u({angle:this.angle,color:r(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};e([i({type:t})],f.prototype,`color`,void 0),e([c(`color`)],f.prototype,`writeColor`,null),e([l({esriSMS:`simple-marker`},{readOnly:!0})],f.prototype,`type`,void 0),e([i()],f.prototype,`size`,null),e([i({type:d.apiValues,json:{read:d.read,write:d.write}})],f.prototype,`style`,void 0),e([i({type:String,json:{write:!0}})],f.prototype,`path`,null),e([i({types:{key:`type`,base:null,defaultKeyValue:`simple-line`,typeMap:{"simple-line":s}},json:{default:null,write:!0}})],f.prototype,`outline`,void 0),f=u=e([a(`esri.symbols.SimpleMarkerSymbol`)],f);export{f as default};
|
package/symbols/TextSymbol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as n}from"../core/lang.js";import{toPt as r}from"../core/screenUtils.js";import{property as i,cast as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Font.js";import c from"./Symbol.js";import{horizontalAlignmentProperty as l,verticalAlignmentProperty as u,lineHeightProperty as d}from"./support/textUtils.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";var m;let h=m=class extends c{constructor(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as n}from"../core/lang.js";import{toPt as r}from"../core/screenUtils.js";import{property as i,cast as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Font.js";import c from"./Symbol.js";import{horizontalAlignmentProperty as l,verticalAlignmentProperty as u,lineHeightProperty as d}from"./support/textUtils.js";import{enumeration as f}from"../core/accessorSupport/decorators/enumeration.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";var m;let h=m=class extends c{constructor(e){super(e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new s,this.horizontalAlignment=`center`,this.kerning=!0,this.haloColor=null,this.rightToLeft=null,this.rotated=!1,this.text=``,this.type=`text`,this.verticalAlignment=`baseline`,this.angle=0,this.width=null,this.lineHeight=1}normalizeCtorArgs(e){return e&&typeof e!=`string`?e:e?{text:e}:{}}get haloSize(){return this._get(`haloSize`)??null}set haloSize(e){this._set(`haloSize`,e)}get xoffset(){return this._get(`xoffset`)??0}set xoffset(e){this._set(`xoffset`,e)}get yoffset(){return this._get(`yoffset`)??0}set yoffset(e){this._set(`yoffset`,e)}get lineWidth(){return this._get(`lineWidth`)??192}set lineWidth(e){this._set(`lineWidth`,e)}writeLineWidth(e,t,n,r){!r||typeof r==`string`?t[n]=e:r.origin}castLineWidth(e){return r(e)}writeLineHeight(e,t,n,r){!r||typeof r==`string`?t[n]=e:r.origin}clone(){return new m({angle:this.angle,backgroundColor:n(this.backgroundColor),borderLineColor:n(this.borderLineColor),borderLineSize:this.borderLineSize,color:n(this.color),font:this.font&&this.font.clone(),haloColor:n(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};e([i({type:t,json:{write:!0}})],h.prototype,`backgroundColor`,void 0),e([i({type:t,json:{write:!0}})],h.prototype,`borderLineColor`,void 0),e([i({type:Number,json:{write:!0},cast:r})],h.prototype,`borderLineSize`,void 0),e([i({type:s,json:{write:!0}})],h.prototype,`font`,void 0),e([i({...l,json:{write:!0}})],h.prototype,`horizontalAlignment`,void 0),e([i({type:Boolean,json:{write:!0}})],h.prototype,`kerning`,void 0),e([i({type:t,json:{write:!0}})],h.prototype,`haloColor`,void 0),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`haloSize`,null),e([i({type:Boolean,json:{write:!0}})],h.prototype,`rightToLeft`,void 0),e([i({type:Boolean,json:{write:!0}})],h.prototype,`rotated`,void 0),e([i({type:String,json:{write:!0}})],h.prototype,`text`,void 0),e([f({esriTS:`text`},{readOnly:!0})],h.prototype,`type`,void 0),e([i({...u,json:{write:!0}})],h.prototype,`verticalAlignment`,void 0),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`xoffset`,null),e([i({type:Number,cast:r,json:{write:!0}})],h.prototype,`yoffset`,null),e([i({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],h.prototype,`angle`,void 0),e([i({type:Number,json:{write:!0}})],h.prototype,`width`,void 0),e([i({type:Number})],h.prototype,`lineWidth`,null),e([p(`lineWidth`)],h.prototype,`writeLineWidth`,null),e([a(`lineWidth`)],h.prototype,`castLineWidth`,null),e([i(d)],h.prototype,`lineHeight`,void 0),e([p(`lineHeight`)],h.prototype,`writeLineHeight`,null),h=m=e([o(`esri.symbols.TextSymbol`)],h);export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{CanvasDrawHelper as e,Transformation as t}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as n,CIMSymbolInflatedSizeHelper as r}from"./CIMSymbolHelper.js";import{normalizeDashTemplate as i}from"./dashUtils.js";import{createPointSymbolHaloSilhouette as a}from"./pointSymbolHaloUtils.js";import{rasterizeFillStyle as o,rasterizeDash1D as s,rasterizeGradient as c,createHaloImage as l,createAlphaMaskRings as u,applyAlphaMask as d,createHaloSDF as f}from"./rasterizingUtils.js";import p from"./Rect.js";import{getSDFInfo as m,buildSDF as h}from"./SDFHelper.js";import{resampleHermite as g}from"./utils.js";import{rasterizedVectorMarkerMinSize as _,patternFillRasterizationScale as v}from"../../views/2d/engine/webgl/definitions.js";class y{constructor(e){this._resourceManager=e,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||=document.createElement(`canvas`),this._cachedRasterizationCanvas}rasterizeJSONResource(e){switch(e.type){case`dash`:{let t=i(e.dashTemplate),[n,r,a]=s(t);return{size:[r,a],image:new Uint32Array(n.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case`fill-style`:{let[t,n,r,i]=o(this._canvas,e,v);return{size:[n,r],image:new Uint32Array(t.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case`sdf`:return x(e);case`CIMGradientFill`:case`CIMGradientStroke`:case`CIMHatchFill`:case`CIMPictureMarker`:case`CIMVectorMarker`:return this._rasterizeCIMJSONResource(e);case`cim-point-symbol-halo`:return this._rasterizeCIMPointSymbolHalo(e)}}_rasterizeCIMJSONResource(e){switch(e.type){case`CIMGradientFill`:case`CIMGradientStroke`:{let[t,n,r]=c(this._canvas,e);return{size:[n,r],image:new Uint32Array(t.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,samplingMode:e.gradientType===`Discrete`||e.colorRamp.type===`CIMFixedColorRamp`?`Nearest`:`Linear`}}case`CIMHatchFill`:{let t=n.fromCIMHatchFill(e,v);return this._rasterizeCIMVectorMarker(t)}case`CIMPictureMarker`:{let t=n.fromCIMInsidePolygon(e);return this._rasterizeCIMVectorMarker(t)}case`CIMVectorMarker`:{if(e.markerPlacement?.type===`CIMMarkerPlacementInsidePolygon`){let t=n.fromCIMInsidePolygon(e);return this._rasterizeCIMVectorMarker(t)}let t=m(e);return t&&!e.avoidSDFRasterization?x(t):this._rasterizeCIMVectorMarker(e,!1,_)}}}_rasterizeCIMVectorMarker(e,t=!0,r){let i=t?p.fromExtent(e.frame):null,[a,o,s,c,l]=n.rasterize(this._canvas,e,i,this._resourceManager,!0,r);return a?{size:[o,s],image:new Uint32Array(a.buffer),sdf:!1,simplePattern:!1,anchorX:c,anchorY:l}:null}_rasterizeCIMPointSymbolHalo(i){let{symbol:o}=i,s=o.haloSize??0;if(s<=0)return null;let c=a({...o,haloSize:0,haloSymbol:void 0}),p=r.getPointSymbolHaloPadding(o,this._resourceManager),[m,h,g,v,y,x]=n.rasterize(this._canvas,c,null,this._resourceManager,!1,_,p);if(!m)return null;let S=s*x,C=o.haloSymbol?.symbolLayers?.filter(e=>e.enable!==!1)??[],w=C.length===1&&C[0].type===`CIMSolidFill`;if(!i.sdf&&w)return{size:[h,g],image:new Uint32Array(l(m,h,g,S).buffer),sdf:!1,simplePattern:!1,anchorX:v,anchorY:y};if(!i.sdf){let n=l(m,h,g,S),r=u(n,h,g);if(r.length===0||!o.haloSymbol)return null;let i=-v*h,a=-y*g,s=t.createScale(x,-x);s.translate(h*.5-i,g*.5+a);let c=s.invert(),f={type:`polygon`,rings:r.map(e=>e.map(e=>c.transform(e)))},p=this._canvas.getContext(`2d`,{willReadFrequently:!0});p.clearRect(0,0,h,g),new e(p,this._resourceManager,s,!0).drawSymbol(o.haloSymbol,f);let _=p.getImageData(0,0,h,g).data,C=b(o.haloSymbol)?_:d(_,n);return{size:[h,g],image:new Uint32Array(C.buffer),sdf:!1,simplePattern:!1,anchorX:v,anchorY:y}}let{image:T,encodingRadius:E}=f(m,h,g,S);return{size:[h,g],image:new Uint32Array(T.buffer),sdf:!0,simplePattern:!1,anchorX:v,anchorY:y,sdfPaddingRatio:0,sdfDecodeCoeff:2*E/g}}rasterizeImageResource(e,t,n,r){this._canvas.width=e,this._canvas.height=t;let
|
|
2
|
+
import{CanvasDrawHelper as e,Transformation as t}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as n,CIMSymbolInflatedSizeHelper as r}from"./CIMSymbolHelper.js";import{normalizeDashTemplate as i}from"./dashUtils.js";import{createPointSymbolHaloSilhouette as a}from"./pointSymbolHaloUtils.js";import{rasterizeFillStyle as o,rasterizeDash1D as s,rasterizeGradient as c,createHaloImage as l,createAlphaMaskRings as u,applyAlphaMask as d,createHaloSDF as f}from"./rasterizingUtils.js";import p from"./Rect.js";import{getSDFInfo as m,buildSDF as h}from"./SDFHelper.js";import{resampleHermite as g}from"./utils.js";import{rasterizedVectorMarkerMinSize as _,patternFillRasterizationScale as v}from"../../views/2d/engine/webgl/definitions.js";class y{constructor(e){this._resourceManager=e,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||=document.createElement(`canvas`),this._cachedRasterizationCanvas}rasterizeJSONResource(e){switch(e.type){case`dash`:{let t=i(e.dashTemplate),[n,r,a]=s(t);return{size:[r,a],image:new Uint32Array(n.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case`fill-style`:{let[t,n,r,i]=o(this._canvas,e,v);return{size:[n,r],image:new Uint32Array(t.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case`sdf`:return x(e);case`CIMGradientFill`:case`CIMGradientStroke`:case`CIMHatchFill`:case`CIMPictureMarker`:case`CIMVectorMarker`:return this._rasterizeCIMJSONResource(e);case`cim-point-symbol-halo`:return this._rasterizeCIMPointSymbolHalo(e)}}_rasterizeCIMJSONResource(e){switch(e.type){case`CIMGradientFill`:case`CIMGradientStroke`:{let[t,n,r]=c(this._canvas,e);return{size:[n,r],image:new Uint32Array(t.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,samplingMode:e.gradientType===`Discrete`||e.colorRamp.type===`CIMFixedColorRamp`?`Nearest`:`Linear`}}case`CIMHatchFill`:{let t=n.fromCIMHatchFill(e,v);return this._rasterizeCIMVectorMarker(t)}case`CIMPictureMarker`:{let t=n.fromCIMInsidePolygon(e);return this._rasterizeCIMVectorMarker(t)}case`CIMVectorMarker`:{if(e.markerPlacement?.type===`CIMMarkerPlacementInsidePolygon`){let t=n.fromCIMInsidePolygon(e);return this._rasterizeCIMVectorMarker(t)}let t=m(e);return t&&!e.avoidSDFRasterization?x(t):this._rasterizeCIMVectorMarker(e,!1,_)}}}_rasterizeCIMVectorMarker(e,t=!0,r){let i=t?p.fromExtent(e.frame):null,[a,o,s,c,l]=n.rasterize(this._canvas,e,i,this._resourceManager,!0,r);return a?{size:[o,s],image:new Uint32Array(a.buffer),sdf:!1,simplePattern:!1,anchorX:c,anchorY:l}:null}_rasterizeCIMPointSymbolHalo(i){let{symbol:o}=i,s=o.haloSize??0;if(s<=0)return null;let c=a({...o,haloSize:0,haloSymbol:void 0}),p=r.getPointSymbolHaloPadding(o,this._resourceManager),[m,h,g,v,y,x]=n.rasterize(this._canvas,c,null,this._resourceManager,!1,_,p);if(!m)return null;let S=s*x,C=o.haloSymbol?.symbolLayers?.filter(e=>e.enable!==!1)??[],w=C.length===1&&C[0].type===`CIMSolidFill`;if(!i.sdf&&w)return{size:[h,g],image:new Uint32Array(l(m,h,g,S).buffer),sdf:!1,simplePattern:!1,anchorX:v,anchorY:y};if(!i.sdf){let n=l(m,h,g,S),r=u(n,h,g);if(r.length===0||!o.haloSymbol)return null;let i=-v*h,a=-y*g,s=t.createScale(x,-x);s.translate(h*.5-i,g*.5+a);let c=s.invert(),f={type:`polygon`,rings:r.map(e=>e.map(e=>c.transform(e)))},p=this._canvas.getContext(`2d`,{willReadFrequently:!0});p.clearRect(0,0,h,g),new e(p,this._resourceManager,s,!0).drawSymbol(o.haloSymbol,f);let _=p.getImageData(0,0,h,g).data,C=b(o.haloSymbol)?_:d(_,n);return{size:[h,g],image:new Uint32Array(C.buffer),sdf:!1,simplePattern:!1,anchorX:v,anchorY:y}}let{image:T,encodingRadius:E}=f(m,h,g,S);return{size:[h,g],image:new Uint32Array(T.buffer),sdf:!0,simplePattern:!1,anchorX:v,anchorY:y,sdfPaddingRatio:0,sdfDecodeCoeff:2*E/g}}rasterizeImageResource(e,t,n,r,i){i??=512,this._canvas.width=e,this._canvas.height=t;let a=this._canvas.getContext(`2d`,{willReadFrequently:!0});n instanceof ImageData?a.putImageData(n,0,0):(n.setAttribute(`width`,`${e}px`),n.setAttribute(`height`,`${t}px`),a.drawImage(n,0,0,e,t));let o=a.getImageData(0,0,e,t),s=new Uint8Array(o.data);if(r){for(let e of r)if(e&&e.oldColor&&e.oldColor.length===4&&e.newColor&&e.newColor.length===4){let[t,n,r,i]=e.oldColor,[a,o,c,l]=e.newColor;if(t===a&&n===o&&r===c&&i===l)continue;for(let e=0;e<s.length;e+=4)t===s[e]&&n===s[e+1]&&r===s[e+2]&&i===s[e+3]&&(s[e]=a,s[e+1]=o,s[e+2]=c,s[e+3]=l)}}let c;for(let e=0;e<s.length;e+=4)c=s[e+3]/255,s[e]=s[e]*c,s[e+1]=s[e+1]*c,s[e+2]=s[e+2]*c;let l=s,u=e,d=t;if(u>=i||d>=i){let n=u/d;n>1?(u=i,d=Math.round(i/n)):(d=i,u=Math.round(i*n)),l=new Uint8Array(4*u*d);let r=new Uint8ClampedArray(l.buffer);g(s,e,t,r,u,d,!1)}return{size:[u,d],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}function b(e){return e.symbolLayers?.some(e=>{if(e.enable===!1||e.type!==`CIMCharacterMarker`&&e.type!==`CIMPictureMarker`&&e.type!==`CIMVectorMarker`)return!1;let t=e.markerPlacement;return t?.type!==`CIMMarkerPlacementInsidePolygon`&&!(t?.type===`CIMMarkerPlacementPolygonCenter`&&t.clipAtBoundary)})??!1}function x(e){if(!e)return null;let{data:t,width:n,height:r,sdfPaddingRatio:i,sdfDecodeCoeff:a}=h(e);return t?{size:[n,r],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,sdfPaddingRatio:i,sdfDecodeCoeff:a,anchorX:0,anchorY:0}:null}export{y as default};
|
package/symbols/cim/utils.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function n(e){return typeof e==`function`}function r(e,t,r,i){return n(e)?e(t,r,i):e}function i(e){return[e.r,e.g,e.b,e.a]}function a(e){let t=e.length;for(;t--;)if(!` /-,
|
|
3
|
-
`.includes(e.charAt(t)))return!1;return!0}function o(e,t){let n=[],r=0,i=-1;do if(i=e.indexOf(`[`,r),i>=r){if(i>r){let t=e.slice(r,i);n.push([t,null,a(t)])}if(r=i+1,i=e.indexOf(`]`,r),i>=r){if(i>r){let a=t[e.slice(r,i)];a&&n.push([null,a,!1])}r=i+1}}while(i!==-1);if(r<e.length){let t=e.slice(r);n.push([t,null,a(t)])}return n}function s(e,t,n){let r=``,i=null;for(let n of t){let[t,a,o]=n;if(t!=null&&t!==``)o?i=t:(i!=null&&(r+=i,i=null),r+=t);else{let t=e.readAttribute(a);t!=null&&t!==``&&(i!==null&&(r+=i,i=null),r+=t)}}return l(r,n)}function c(e,t,n,r){let i=``,a=null;for(let r of t){let[t,o,s]=r;if(t!=null&&t!==``)s?a=t:(a!=null&&(i+=a,a=null),i+=t);else{let t=o;n!=null&&(t=B(o,n));let r=e.attributes[t];r!=null&&r!==``&&(a!=null&&(i+=a,a=null),i+=r)}}return l(i,r)}function l(e,t){switch(typeof e!=`string`&&(e=String(e)),t){case`LowerCase`:return e.toLowerCase();case`Allcaps`:return e.toUpperCase();default:return e}}function u(e,t,n,r,i,a,o=!0){let s=t/i,c=n/a,l=Math.ceil(s/2),u=Math.ceil(c/2);for(let n=0;n<a;n++)for(let d=0;d<i;d++){let f=(d+(o?a-n-1:n)*i)*4,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=(n+.5)*c;for(let r=Math.floor(n*c);r<(n+1)*c;r++){let n=Math.abs(b-(r+.5))/u,i=(d+.5)*s,a=n*n;for(let n=Math.floor(d*s);n<(d+1)*s;n++){let o=Math.abs(i-(n+.5))/l,s=Math.sqrt(a+o*o);s>=-1&&s<=1&&(p=2*s*s*s-3*s*s+1,p>0&&(o=4*(n+r*t),y+=p*e[o+3],h+=p,e[o+3]<255&&(p=p*e[o+3]/250),g+=p*e[o],_+=p*e[o+1],v+=p*e[o+2],m+=p))}}r[f]=g/m,r[f+1]=_/m,r[f+2]=v/m,r[f+3]=y/h}}function d(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function f(e){return e.data?.symbol??null}function p(e){return e.type===`CIMVectorMarker`||e.type===`CIMPictureMarker`||e.type===`CIMBarChartMarker`||e.type===`CIMCharacterMarker`||e.type===`CIMPieChartMarker`||e.type===`CIMStackedBarChartMarker`}function m(e){return e.type===`CIMGradientStroke`||e.type===`CIMPictureStroke`||e.type===`CIMSolidStroke`}function h(e){return e!=null&&(e.type===`CIMGradientFill`||e.type===`CIMHatchFill`||e.type===`CIMPictureFill`||e.type===`CIMSolidFill`||e.type===`CIMWaterFill`)}function g(e){return e!=null&&(e.type===`CIMMarkerPlacementAlongLineRandomSize`||e.type===`CIMMarkerPlacementAlongLineSameSize`||e.type===`CIMMarkerPlacementAlongLineVariableSize`||e.type===`CIMMarkerPlacementAtExtremities`||e.type===`CIMMarkerPlacementAtMeasuredUnits`||e.type===`CIMMarkerPlacementAtRatioPositions`||e.type===`CIMMarkerPlacementOnLine`||e.type===`CIMMarkerPlacementOnVertices`)}const _=(e,t=0)=>e==null||isNaN(e)?t:e,v=(e,t)=>e??t,y=(e,t)=>e??t,b=e=>e.tintColor?d(e.tintColor):[255,255,255,1];function x(e){if(!e)return`normal`;switch(e.toLowerCase()){case`italic`:return`italic`;case`oblique`:return`oblique`;default:return`normal`}}function S(e){if(!e)return`normal`;switch(e.toLowerCase()){case`bold`:return`bold`;case`bolder`:return`bolder`;case`lighter`:return`lighter`;default:return`normal`}}function C(e){return e.underline?`underline`:e.strikethrough?`line-through`:`none`}function w(e){if(!e)return null;switch(e.type){case`CIMPolygonSymbol`:if(e.symbolLayers)for(let t of e.symbolLayers){let e=w(t);if(e!=null)return e}break;case`CIMTextSymbol`:return w(e.symbol);case`CIMSolidFill`:return e.color}return null}function T(e){if(e)switch(e.type){case`CIMPolygonSymbol`:case`CIMLineSymbol`:{let t=e.symbolLayers;if(t)for(let e of t){let t=T(e);if(t!=null)return t}break}case`CIMTextSymbol`:return T(e.symbol);case`CIMSolidStroke`:return e.color}}function E(e){for(let t of e)if(t.enable)switch(t.type){case`CIMSolidStroke`:case`CIMGradientStroke`:case`CIMPictureStroke`:return!0}return!1}function D(e){if(e)switch(e.type){case`CIMPolygonSymbol`:case`CIMLineSymbol`:if(e.symbolLayers)for(let t of e.symbolLayers){let e=D(t);if(e!==void 0)return e}break;case`CIMTextSymbol`:return D(e.symbol);case`CIMSolidStroke`:case`CIMGradientStroke`:case`CIMPictureStroke`:return e.width}}function O(t){let n=0;for(let r of t??[])r.enable!==!1&&m(r)&&(n=Math.max(n,_(r.width,e[r.type].width)));return n}function k(e){switch(e){case`Left`:default:return`left`;case`Right`:return`right`;case`Center`:return`center`;case`Justify`:return`justify`}}function A(e){switch(e){default:return`bottom`;case`Top`:return`top`;case`Center`:return`middle`;case`Baseline`:return`baseline`;case`Bottom`:return`bottom`}}function j(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:typeof e[t]==`string`?`esriFieldTypeString`:`esriFieldTypeDouble`}))}const M=e=>e.includes(`data:image/svg+xml`);function N(e){if(!e)return null;switch(e.type){case`CIMPointSymbol`:return`esriGeometryPoint`;case`CIMTextSymbol`:return`esriGeometryPoint`;case`CIMLineSymbol`:return`esriGeometryPolyline`;case`CIMPolygonSymbol`:return`esriGeometryPolygon`;default:return null}}function P(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function F(e,t,n,r,i,a,o=!0){let{infos:s}=a,c=1,l=0,u=0,d=0,f=1;for(let{absoluteAnchorPoint:e,offsetX:t,offsetY:n,rotation:r,size:i,frameHeight:a,rotateClockWise:p,scaleSymbolsProportionally:m}of s){f=e?1:c;let s=K(t,n,l,f,u),h=G(t,n,l,f,d);u=s,d=h,a&&(m||o)&&(c*=i/a),l=q(r,p,l)}let p=K(r,i,l,f,u),m=G(r,i,l,f,d);return{size:e*c,rotation:q(t,n,l),offsetX:p,offsetY:m}}function I(e){if(e==null)return!1;if(Array.isArray(e))return e.every(e=>I(e));switch(typeof e){case`string`:return!!e;case`number`:return!isNaN(e)}}function L(n,r){if(r===`color`||r===`outlinecolor`||r===`backgroundcolor`||r===`borderlinecolor`||r===`tintcolor`)return[...t[r]];let i=e[n];if(!i)throw Error(`InternalError: default value for type ${n}.`);return i[r]}function R(e){if(e==null)return`Normal`;switch(e.type){case`CIMTextSymbol`:return e.textCase??`Normal`;case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:{let t=e.symbolLayers;if(!t)return`Normal`;for(let e of t)if(e.type===`CIMVectorMarker`)return R(e)}break;case`CIMVectorMarker`:{let t=e.markerGraphics;if(!t)return`Normal`;for(let e of t)if(e.symbol)return R(e.symbol)}}return`Normal`}function z(t){if(t)switch(t.type){case`CIMTextSymbol`:return t.height;case`CIMPointSymbol`:{let n=0;if(t.symbolLayers){for(let r of t.symbolLayers)if(r)switch(r.type){case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:case`CIMObjectMarker3D`:case`CIMglTFMarker3D`:{let t=r.size??e.CIMVectorMarker.size;t>n&&(n=t);break}}}return n}case`CIMLineSymbol`:case`CIMPolygonSymbol`:{let n=0;if(t.symbolLayers){for(let r of t.symbolLayers)if(r)switch(r.type){case`CIMSolidStroke`:case`CIMPictureStroke`:case`CIMGradientStroke`:{let e=r.width;e!=null&&e>n&&(n=e);break}case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:case`CIMObjectMarker3D`:case`CIMglTFMarker3D`:if(r.markerPlacement&&g(r.markerPlacement)){let t=r.size??e.CIMVectorMarker.size;t>n&&(n=t)}break;case`CIMPictureFill`:{let e=r.height;e!=null&&e>n&&(n=e)}}}return n}}}function B(e,t){if(t!==null){let n=t.get(e);return n?n.name:e}return e}function V(e){return e.map(e=>({...e,propertyName:P(e.propertyName)}))}function H(e){let t={};for(let n in e){let r=e[n];t[P(n)]=r}return t}function U(e){if(!e)return 0;let t=0;for(let n of e)t+=W(n);return t}function W(e){if(!e)return 0;if(Z(e))return e.inflateSize??256;if(Q(e))return Math.abs(e.inflateSize);switch(e.type){case`CIMGeometricEffectArrow`:return Math.abs(e.width*.5);case`CIMGeometricEffectBuffer`:return Math.abs(e.size);case`CIMGeometricEffectCircularSector`:return Math.abs(e.radius??25);case`CIMGeometricEffectControlMeasureLine`:return 500;case`CIMGeometricEffectExtension`:return Math.abs(e.length);case`CIMGeometricEffectJog`:return Math.abs(e.length*.5);case`CIMGeometricEffectMove`:return Math.max(Math.abs(_(e.offsetX)),Math.abs(_(e.offsetY)));case`CIMGeometricEffectOffset`:return Math.abs(e.offset);case`CIMGeometricEffectOffsetTangent`:return Math.abs(e.offset);case`CIMGeometricEffectRadial`:return Math.abs(e.length??5);case`CIMGeometricEffectRegularPolygon`:return Math.abs(e.radius);case`CIMGeometricEffectRotate`:return 0;case`CIMGeometricEffectScale`:return 0;case`CIMGeometricEffectTaperedPolygon`:return Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth))*.5;case`CIMGeometricEffectWave`:return Math.abs(e.amplitude);case`CIMGeometricEffectDonut`:return Math.abs(e.width);default:return 0}}function G(e,t,n,r,i){let a=n*Math.PI/180;if(a){let n=Math.cos(a);return(Math.sin(a)*e+n*t)*r+i}return t*r+i}function K(e,t,n,r,i){let a=n*Math.PI/180;if(a){let n=Math.cos(a),o=Math.sin(a);return(n*e-o*t)*r+i}return e*r+i}function q(e,t,n){return t?n-e:n+e}function J(e,t,n){let r=n===`Color`||n===`TintColor`||n===`ToColor`,i=n===`Rotation`||n===`Angle`||n===`ToRotation`,a=t[P(n)];if(a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]/255]:i&&(a*=Math.PI/180)),a??(a=L(t.type,n.toLowerCase()),a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]]:i&&(a*=Math.PI/180))),t.primitiveName!=null){let o=e[t.primitiveName];if(o!=null){let e=o[n];e==null||(typeof e==`string`||typeof e==`number`||Array.isArray(e)?(a=e,a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]/255]:i&&(a*=Math.PI/180))):(a={valueExpressionInfo:e,defaultValue:a},a!=null&&(r?a={type:`Process`,op:`ArcadeColor`,value:a}:i&&(a={type:`Process`,op:`Divide`,left:a,right:180/Math.PI}))))}}if(a==null)throw Error(`Failed to derive a value or an expression for "${n}".`);return a}function Y(e,t,n){if(t[P(n)]!=null)return!0;if(t.primitiveName!=null){let r=e[t.primitiveName];if(r!=null&&r[n]!=null)return!0}return!1}function X(e,t){return Math.max(Math.min((e??t)/100,1),0)}function Z(e){return e.type.startsWith(`Private`)}function Q(e){return e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`}function $(e){return e!=null&&ee(e)?e:void 0}function ee(e){return`setControlPoint`in e&&`getControlPoint`in e&&`setControlPointAt`in e&&`getControlPointAt`in e}export{l as adjustTextCase,o as analyzeTextParts,F as applyParentTransform,$ as asCIMGeometryCursor,c as assignTextValuesFromFeature,j as attributesToFields,i as colorToArray,r as evaluateValueOrFunction,C as fromCIMFontDecoration,k as fromCIMHorizontalAlignment,A as fromCIMVerticalAlignment,L as getDefaultCIMValue,U as getEffectsInflateSize,y as getEnum,B as getFieldName,w as getFillColor,x as getFontStyle,S as getFontWeight,O as getMaxStrokeWidth,_ as getNumericValue,J as getProcessParam,X as getRelativeGradientSize,z as getSize,T as getStrokeColor,D as getStrokeWidth,R as getTextCasing,s as getTextValuesFromFeatureHandle,b as getTintColor,v as getValue,Y as hasProcessParam,E as hasStrokeLayer,h as isCIMFill,p as isCIMMarker,g as isCIMMarkerStrokePlacement,m as isCIMStroke,n as isFeatureValueFn,Z as isPrivateGeometricEffect,M as isSVGImage,I as isValidCIMValue,N as mapCIMSymbolToGeometryType,d as normalizeAlpha,V as normalizePrimitiveOverrideProps,u as resampleHermite,f as toCIMSymbolJSON,H as toLowerCaseProps,P as uncapitalize};
|
|
3
|
+
`.includes(e.charAt(t)))return!1;return!0}function o(e,t){let n=[],r=0,i=-1;do if(i=e.indexOf(`[`,r),i>=r){if(i>r){let t=e.slice(r,i);n.push([t,null,a(t)])}if(r=i+1,i=e.indexOf(`]`,r),i>=r){if(i>r){let a=t[e.slice(r,i)];a&&n.push([null,a,!1])}r=i+1}}while(i!==-1);if(r<e.length){let t=e.slice(r);n.push([t,null,a(t)])}return n}function s(e,t,n){let r=``,i=null;for(let n of t){let[t,a,o]=n;if(t!=null&&t!==``)o?i=t:(i!=null&&(r+=i,i=null),r+=t);else{let t=e.readAttribute(a);t!=null&&t!==``&&(i!==null&&(r+=i,i=null),r+=t)}}return l(r,n)}function c(e,t,n,r){let i=``,a=null;for(let r of t){let[t,o,s]=r;if(t!=null&&t!==``)s?a=t:(a!=null&&(i+=a,a=null),i+=t);else{let t=o;n!=null&&(t=B(o,n));let r=e.attributes[t];r!=null&&r!==``&&(a!=null&&(i+=a,a=null),i+=r)}}return l(i,r)}function l(e,t){switch(typeof e!=`string`&&(e=String(e)),t){case`LowerCase`:return e.toLowerCase();case`Allcaps`:return e.toUpperCase();default:return e}}function u(e,t,n,r,i,a,o=!0){let s=t/i,c=n/a,l=Math.ceil(s/2),u=Math.ceil(c/2);for(let n=0;n<a;n++)for(let d=0;d<i;d++){let f=(d+(o?a-n-1:n)*i)*4,p=0,m=0,h=0,g=0,_=0,v=0,y=(n+.5)*c;for(let r=Math.floor(n*c);r<(n+1)*c;r++){let n=Math.abs(y-(r+.5))/u,i=(d+.5)*s,a=n*n;for(let n=Math.floor(d*s);n<(d+1)*s;n++){let o=Math.abs(i-(n+.5))/l,s=Math.sqrt(a+o*o);s>=-1&&s<=1&&(p=2*s*s*s-3*s*s+1,p>0&&(o=4*(n+r*t),h+=p*e[o],g+=p*e[o+1],_+=p*e[o+2],v+=p*e[o+3],m+=p))}}r[f]=h/m,r[f+1]=g/m,r[f+2]=_/m,r[f+3]=v/m}}function d(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function f(e){return e.data?.symbol??null}function p(e){return e.type===`CIMVectorMarker`||e.type===`CIMPictureMarker`||e.type===`CIMBarChartMarker`||e.type===`CIMCharacterMarker`||e.type===`CIMPieChartMarker`||e.type===`CIMStackedBarChartMarker`}function m(e){return e.type===`CIMGradientStroke`||e.type===`CIMPictureStroke`||e.type===`CIMSolidStroke`}function h(e){return e!=null&&(e.type===`CIMGradientFill`||e.type===`CIMHatchFill`||e.type===`CIMPictureFill`||e.type===`CIMSolidFill`||e.type===`CIMWaterFill`)}function g(e){return e!=null&&(e.type===`CIMMarkerPlacementAlongLineRandomSize`||e.type===`CIMMarkerPlacementAlongLineSameSize`||e.type===`CIMMarkerPlacementAlongLineVariableSize`||e.type===`CIMMarkerPlacementAtExtremities`||e.type===`CIMMarkerPlacementAtMeasuredUnits`||e.type===`CIMMarkerPlacementAtRatioPositions`||e.type===`CIMMarkerPlacementOnLine`||e.type===`CIMMarkerPlacementOnVertices`)}const _=(e,t=0)=>e==null||isNaN(e)?t:e,v=(e,t)=>e??t,y=(e,t)=>e??t,b=e=>e.tintColor?d(e.tintColor):[255,255,255,1];function x(e){if(!e)return`normal`;switch(e.toLowerCase()){case`italic`:return`italic`;case`oblique`:return`oblique`;default:return`normal`}}function S(e){if(!e)return`normal`;switch(e.toLowerCase()){case`bold`:return`bold`;case`bolder`:return`bolder`;case`lighter`:return`lighter`;default:return`normal`}}function C(e){return e.underline?`underline`:e.strikethrough?`line-through`:`none`}function w(e){if(!e)return null;switch(e.type){case`CIMPolygonSymbol`:if(e.symbolLayers)for(let t of e.symbolLayers){let e=w(t);if(e!=null)return e}break;case`CIMTextSymbol`:return w(e.symbol);case`CIMSolidFill`:return e.color}return null}function T(e){if(e)switch(e.type){case`CIMPolygonSymbol`:case`CIMLineSymbol`:{let t=e.symbolLayers;if(t)for(let e of t){let t=T(e);if(t!=null)return t}break}case`CIMTextSymbol`:return T(e.symbol);case`CIMSolidStroke`:return e.color}}function E(e){for(let t of e)if(t.enable)switch(t.type){case`CIMSolidStroke`:case`CIMGradientStroke`:case`CIMPictureStroke`:return!0}return!1}function D(e){if(e)switch(e.type){case`CIMPolygonSymbol`:case`CIMLineSymbol`:if(e.symbolLayers)for(let t of e.symbolLayers){let e=D(t);if(e!==void 0)return e}break;case`CIMTextSymbol`:return D(e.symbol);case`CIMSolidStroke`:case`CIMGradientStroke`:case`CIMPictureStroke`:return e.width}}function O(t){let n=0;for(let r of t??[])r.enable!==!1&&m(r)&&(n=Math.max(n,_(r.width,e[r.type].width)));return n}function k(e){switch(e){case`Left`:default:return`left`;case`Right`:return`right`;case`Center`:return`center`;case`Justify`:return`justify`}}function A(e){switch(e){default:return`bottom`;case`Top`:return`top`;case`Center`:return`middle`;case`Baseline`:return`baseline`;case`Bottom`:return`bottom`}}function j(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:typeof e[t]==`string`?`esriFieldTypeString`:`esriFieldTypeDouble`}))}const M=e=>e.includes(`data:image/svg+xml`);function N(e){if(!e)return null;switch(e.type){case`CIMPointSymbol`:return`esriGeometryPoint`;case`CIMTextSymbol`:return`esriGeometryPoint`;case`CIMLineSymbol`:return`esriGeometryPolyline`;case`CIMPolygonSymbol`:return`esriGeometryPolygon`;default:return null}}function P(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function F(e,t,n,r,i,a,o=!0){let{infos:s}=a,c=1,l=0,u=0,d=0,f=1;for(let{absoluteAnchorPoint:e,offsetX:t,offsetY:n,rotation:r,size:i,frameHeight:a,rotateClockWise:p,scaleSymbolsProportionally:m}of s){f=e?1:c;let s=K(t,n,l,f,u),h=G(t,n,l,f,d);u=s,d=h,a&&(m||o)&&(c*=i/a),l=q(r,p,l)}let p=K(r,i,l,f,u),m=G(r,i,l,f,d);return{size:e*c,rotation:q(t,n,l),offsetX:p,offsetY:m}}function I(e){if(e==null)return!1;if(Array.isArray(e))return e.every(e=>I(e));switch(typeof e){case`string`:return!!e;case`number`:return!isNaN(e)}}function L(n,r){if(r===`color`||r===`outlinecolor`||r===`backgroundcolor`||r===`borderlinecolor`||r===`tintcolor`)return[...t[r]];let i=e[n];if(!i)throw Error(`InternalError: default value for type ${n}.`);return i[r]}function R(e){if(e==null)return`Normal`;switch(e.type){case`CIMTextSymbol`:return e.textCase??`Normal`;case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:{let t=e.symbolLayers;if(!t)return`Normal`;for(let e of t)if(e.type===`CIMVectorMarker`)return R(e)}break;case`CIMVectorMarker`:{let t=e.markerGraphics;if(!t)return`Normal`;for(let e of t)if(e.symbol)return R(e.symbol)}}return`Normal`}function z(t){if(t)switch(t.type){case`CIMTextSymbol`:return t.height;case`CIMPointSymbol`:{let n=0;if(t.symbolLayers){for(let r of t.symbolLayers)if(r)switch(r.type){case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:case`CIMObjectMarker3D`:case`CIMglTFMarker3D`:{let t=r.size??e.CIMVectorMarker.size;t>n&&(n=t);break}}}return n}case`CIMLineSymbol`:case`CIMPolygonSymbol`:{let n=0;if(t.symbolLayers){for(let r of t.symbolLayers)if(r)switch(r.type){case`CIMSolidStroke`:case`CIMPictureStroke`:case`CIMGradientStroke`:{let e=r.width;e!=null&&e>n&&(n=e);break}case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:case`CIMObjectMarker3D`:case`CIMglTFMarker3D`:if(r.markerPlacement&&g(r.markerPlacement)){let t=r.size??e.CIMVectorMarker.size;t>n&&(n=t)}break;case`CIMPictureFill`:{let e=r.height;e!=null&&e>n&&(n=e)}}}return n}}}function B(e,t){if(t!==null){let n=t.get(e);return n?n.name:e}return e}function V(e){return e.map(e=>({...e,propertyName:P(e.propertyName)}))}function H(e){let t={};for(let n in e){let r=e[n];t[P(n)]=r}return t}function U(e){if(!e)return 0;let t=0;for(let n of e)t+=W(n);return t}function W(e){if(!e)return 0;if(Z(e))return e.inflateSize??256;if(Q(e))return Math.abs(e.inflateSize);switch(e.type){case`CIMGeometricEffectArrow`:return Math.abs(e.width*.5);case`CIMGeometricEffectBuffer`:return Math.abs(e.size);case`CIMGeometricEffectCircularSector`:return Math.abs(e.radius??25);case`CIMGeometricEffectControlMeasureLine`:return 500;case`CIMGeometricEffectExtension`:return Math.abs(e.length);case`CIMGeometricEffectJog`:return Math.abs(e.length*.5);case`CIMGeometricEffectMove`:return Math.max(Math.abs(_(e.offsetX)),Math.abs(_(e.offsetY)));case`CIMGeometricEffectOffset`:return Math.abs(e.offset);case`CIMGeometricEffectOffsetTangent`:return Math.abs(e.offset);case`CIMGeometricEffectRadial`:return Math.abs(e.length??5);case`CIMGeometricEffectRegularPolygon`:return Math.abs(e.radius);case`CIMGeometricEffectRotate`:return 0;case`CIMGeometricEffectScale`:return 0;case`CIMGeometricEffectTaperedPolygon`:return Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth))*.5;case`CIMGeometricEffectWave`:return Math.abs(e.amplitude);case`CIMGeometricEffectDonut`:return Math.abs(e.width);default:return 0}}function G(e,t,n,r,i){let a=n*Math.PI/180;if(a){let n=Math.cos(a);return(Math.sin(a)*e+n*t)*r+i}return t*r+i}function K(e,t,n,r,i){let a=n*Math.PI/180;if(a){let n=Math.cos(a),o=Math.sin(a);return(n*e-o*t)*r+i}return e*r+i}function q(e,t,n){return t?n-e:n+e}function J(e,t,n){let r=n===`Color`||n===`TintColor`||n===`ToColor`,i=n===`Rotation`||n===`Angle`||n===`ToRotation`,a=t[P(n)];if(a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]/255]:i&&(a*=Math.PI/180)),a??(a=L(t.type,n.toLowerCase()),a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]]:i&&(a*=Math.PI/180))),t.primitiveName!=null){let o=e[t.primitiveName];if(o!=null){let e=o[n];e==null||(typeof e==`string`||typeof e==`number`||Array.isArray(e)?(a=e,a!=null&&(r?a=[a[0]/255,a[1]/255,a[2]/255,a[3]/255]:i&&(a*=Math.PI/180))):(a={valueExpressionInfo:e,defaultValue:a},a!=null&&(r?a={type:`Process`,op:`ArcadeColor`,value:a}:i&&(a={type:`Process`,op:`Divide`,left:a,right:180/Math.PI}))))}}if(a==null)throw Error(`Failed to derive a value or an expression for "${n}".`);return a}function Y(e,t,n){if(t[P(n)]!=null)return!0;if(t.primitiveName!=null){let r=e[t.primitiveName];if(r!=null&&r[n]!=null)return!0}return!1}function X(e,t){return Math.max(Math.min((e??t)/100,1),0)}function Z(e){return e.type.startsWith(`Private`)}function Q(e){return e.type===`CIMSimpleLineCallout`||e.type===`CIMBackgroundCallout`||e.type===`CIMBalloonCallout`||e.type===`CIMPointSymbolCallout`}function $(e){return e!=null&&ee(e)?e:void 0}function ee(e){return`setControlPoint`in e&&`getControlPoint`in e&&`setControlPointAt`in e&&`getControlPointAt`in e}export{l as adjustTextCase,o as analyzeTextParts,F as applyParentTransform,$ as asCIMGeometryCursor,c as assignTextValuesFromFeature,j as attributesToFields,i as colorToArray,r as evaluateValueOrFunction,C as fromCIMFontDecoration,k as fromCIMHorizontalAlignment,A as fromCIMVerticalAlignment,L as getDefaultCIMValue,U as getEffectsInflateSize,y as getEnum,B as getFieldName,w as getFillColor,x as getFontStyle,S as getFontWeight,O as getMaxStrokeWidth,_ as getNumericValue,J as getProcessParam,X as getRelativeGradientSize,z as getSize,T as getStrokeColor,D as getStrokeWidth,R as getTextCasing,s as getTextValuesFromFeatureHandle,b as getTintColor,v as getValue,Y as hasProcessParam,E as hasStrokeLayer,h as isCIMFill,p as isCIMMarker,g as isCIMMarkerStrokePlacement,m as isCIMStroke,n as isFeatureValueFn,Z as isPrivateGeometricEffect,M as isSVGImage,I as isValidCIMValue,N as mapCIMSymbolToGeometryType,d as normalizeAlpha,V as normalizePrimitiveOverrideProps,u as resampleHermite,f as toCIMSymbolJSON,H as toLowerCaseProps,P as uncapitalize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as n,sync as r}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{set as o,subtract as s,copy as c}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{addPadding as u}from"./viewpointUtils.js";import d from"./ViewState.js";var f,p;let m=f=class extends t{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new f({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};e([i()],m.prototype,`left`,void 0),e([i()],m.prototype,`top`,void 0),e([i()],m.prototype,`right`,void 0),e([i()],m.prototype,`bottom`,void 0),m=f=e([a(`esri.views.2d.PaddedViewState.Padding`)],m);let h=p=class extends d{constructor(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as n,sync as r}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{set as o,subtract as s,copy as c}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{addPadding as u}from"./viewpointUtils.js";import d from"./ViewState.js";var f,p;let m=f=class extends t{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new f({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};e([i()],m.prototype,`left`,void 0),e([i()],m.prototype,`top`,void 0),e([i()],m.prototype,`right`,void 0),e([i()],m.prototype,`bottom`,void 0),m=f=e([a(`esri.views.2d.PaddedViewState.Padding`)],m);let h=p=class extends d{constructor(e){super(e),this.paddedViewState=new d,this._updateContent=(()=>{let e=l();return()=>{let t=this._get(`size`),n=this._get(`padding`);if(!t||!n)return;let r=this.paddedViewState;o(e,n.left+n.right,n.top+n.bottom),s(e,t,e),c(r.size,e);let i=r.viewpoint;i&&(this.viewpoint=i)}})(),this.addHandles(n(()=>[this.size,this.padding],()=>this._updateContent(),r)),this.padding=new m,this.size=[0,0]}get padding(){return this._get(`padding`)}set padding(e){this._set(`padding`,e||new m)}set viewpoint(e){if(e){this.paddedViewState.viewpoint=e;let t=e,n=this._get(`padding`);n&&(t=u(e.clone(),e,this._get(`size`),n));let{targetGeometry:r,rotation:i,scale:a}=t,{x:o,y:s,spatialReference:c}=r,l=this._viewpoint2D;l.center[0]=o,l.center[1]=s,l.rotation=i,l.scale=a,l.spatialReference=c,this._update()}}clone(){return new p({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};e([i()],h.prototype,`paddedViewState`,void 0),e([i({type:m})],h.prototype,`padding`,null),e([i()],h.prototype,`viewpoint`,null),h=p=e([a(`esri.views.2d.PaddedViewState`)],h);const g=h;export{g as default};
|
package/views/2d/ViewState.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Viewpoint.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{toRadian as a}from"../../core/libs/gl-matrix-2/math/common.js";import{set as o,invert as s}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as u,identity as d,translate as f,rotate as p,multiply as m}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../core/libs/gl-matrix-2/factories/mat3f32.js";import{copy as g,transformMat2d as _}from"../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as v}from"../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVec2 as b}from"../../core/libs/gl-matrix-2/types/vec2.js";import x from"../../geometry/Extent.js";import S from"../../geometry/Point.js";import{getClosestDenormalizedXToReference as C}from"../../geometry/support/normalizeUtils.js";import{copy as w,getWorldWidth as T,getMatrix as E,getResolution as D,getExtent as O,getTransform as k,getTransformNoRotation as A,getWorldScreenWidth as j}from"./viewpointUtils.js";var M;const N=[0,0];let P=M=class extends n{constructor(e){super(e),this._viewpoint2D={center:y(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new x,this.id=0,this.inverseTransform=l(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=l(),this.transformNoRotation=l(),this.displayMat3=h(),this.displayViewMat3=h(),this.viewMat3=h(),this.viewMat2d=c(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set(`pixelRatio`,e),this._update()}set size(e){this._set(`size`,e),this._update()}set viewpoint(e){if(e){let t=this._viewpoint2D,n=e.targetGeometry;t.center[0]=n.x,t.center[1]=n.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=n.spatialReference}this._update()}get visibleArea(){let[e,t]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,t),this.toMap([0,0],e,t),this.toMap([0,0],e,0)]}copy(e){let t=this.size,n=this.viewpoint;return!n||!t?(this.viewpoint=e.viewpoint.clone(),this._set(`size`,[e.size[0],e.size[1]])):(this.viewpoint=w(n,e.viewpoint),this._set(`size`,g(t,e.size))),this._set(`pixelRatio`,e.pixelRatio),this}clone(){return new M({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,n){return b(t)?_(e,t,this.inverseTransform):(N[0]=t,N[1]=n,_(e,N,this.inverseTransform))}toScreen(e,t,n){return b(t)?_(e,t,this.transform):(N[0]=t,N[1]=n,_(e,N,this.transform))}toScreenNoRotation(e,t,n){return b(t)?_(e,t,this.transformNoRotation):(N[0]=t,N[1]=n,_(e,N,this.transformNoRotation))}wrapMapCoordinate(e,t){g(e,t);let[n]=t,[r]=this.center,{extent:i,spatialReference:a}=this,{xmin:o,xmax:s}=i;if(a.isWrappable){let e=T(a)/2;o=Math.max(o,r-e),s=Math.min(s,r+e)}return(n<o||n>s)&&(e[0]=C(n,r,a)),e}getScreenTransform(e,t){let{center:n}=this._viewpoint2D,r=this._get(`pixelRatio`)||1,i=this._get(`size`);return E(e,n,i,t,0,r),e}_update(){let{center:e,spatialReference:n,scale:r,rotation:i}=this._viewpoint2D,c=this._get(`pixelRatio`)||1,l=this._get(`size`),h=new t({targetGeometry:new S(e[0],e[1],n),scale:r,rotation:i});if(this._set(`viewpoint`,h),!l||!n||!r)return;let _=D(h);this.spatialReference=n,g(this.center,e);let y=l[0]===0?0:2/l[0],b=l[1]===0?0:-2/l[1];u(this.displayMat3,y,0,0,0,b,0,-1,1,1);let x=d(this.viewMat3),C=v(l[0]/2,l[1]/2),w=v(-l[0]/2,-l[1]/2),T=a(i);return f(x,x,C),p(x,x,T),f(x,x,w),m(this.displayViewMat3,this.displayMat3,x),o(this.viewMat2d,x[0],x[1],x[3],x[4],x[6],x[7]),O(this.extent,h,l),k(this.transform,h,l,c),s(this.inverseTransform,this.transform),A(this.transformNoRotation,h,l,c),this.worldScreenWidth=j(n,_),this.resolution=_,this.rotation=i,this.scale=r,this._set(`id`,this.id+1),this.notifyChange(`visibleArea`),this}};e([r({readOnly:!0})],P.prototype,`id`,void 0),e([r({value:1,json:{write:!0}})],P.prototype,`pixelRatio`,null),e([r()],P.prototype,`resolution`,void 0),e([r()],P.prototype,`rotation`,void 0),e([r()],P.prototype,`scale`,void 0),e([r({json:{write:!0}})],P.prototype,`size`,null),e([r()],P.prototype,`spatialReference`,void 0),e([r({type:t,json:{write:!0}})],P.prototype,`viewpoint`,null),e([r({readOnly:!0})],P.prototype,`visibleArea`,null),P=M=e([i(`esri.views.2d.ViewState`)],P);const F=P;export{F as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Viewpoint.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{toRadian as a}from"../../core/libs/gl-matrix-2/math/common.js";import{set as o,invert as s}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as u,identity as d,translate as f,rotate as p,multiply as m}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../core/libs/gl-matrix-2/factories/mat3f32.js";import{copy as g,transformMat2d as _}from"../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as v}from"../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVec2 as b}from"../../core/libs/gl-matrix-2/types/vec2.js";import x from"../../geometry/Extent.js";import S from"../../geometry/Point.js";import{getClosestDenormalizedXToReference as C}from"../../geometry/support/normalizeUtils.js";import{copy as w,getWorldWidth as T,getMatrix as E,getResolution as D,getExtent as O,getTransform as k,getTransformNoRotation as A,getWorldScreenWidth as j}from"./viewpointUtils.js";var M;const N=[0,0];let P=M=class extends n{constructor(e){super(e),this._viewpoint2D={center:y(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new x,this.id=0,this.inverseTransform=l(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=l(),this.transformNoRotation=l(),this.displayMat3=h(),this.displayViewMat3=h(),this.viewMat3=h(),this.viewMat2d=c(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set(`pixelRatio`,e),this._update()}set size(e){this._set(`size`,e),this._update()}set viewpoint(e){if(e){let t=this._viewpoint2D,n=e.targetGeometry;t.center[0]=n.x,t.center[1]=n.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=n.spatialReference}this._update()}get visibleArea(){let[e,t]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,t),this.toMap([0,0],e,t),this.toMap([0,0],e,0)]}copy(e){let t=this.size,n=this.viewpoint;return!n||!t?(this.viewpoint=e.viewpoint.clone(),this._set(`size`,[e.size[0],e.size[1]])):(this.viewpoint=w(n,e.viewpoint),this._set(`size`,g(t,e.size))),this._set(`pixelRatio`,e.pixelRatio),this}clone(){return new M({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,n){return b(t)?_(e,t,this.inverseTransform):(N[0]=t,N[1]=n,_(e,N,this.inverseTransform))}toScreen(e,t,n){return b(t)?_(e,t,this.transform):(N[0]=t,N[1]=n,_(e,N,this.transform))}toScreenNoRotation(e,t,n){return b(t)?_(e,t,this.transformNoRotation):(N[0]=t,N[1]=n,_(e,N,this.transformNoRotation))}wrapMapCoordinate(e,t){g(e,t);let[n]=t,[r]=this.center,{extent:i,spatialReference:a}=this,{xmin:o,xmax:s}=i;if(a.isWrappable){let e=T(a)/2;o=Math.max(o,r-e),s=Math.min(s,r+e)}return(n<o||n>s)&&(e[0]=C(n,r,a)),e}getScreenTransform(e,t){let{center:n}=this._viewpoint2D,r=this._get(`pixelRatio`)||1,i=this._get(`size`);return E(e,n,i,t,0,r),e}_update(){let{center:e,spatialReference:n,scale:r,rotation:i}=this._viewpoint2D,c=this._get(`pixelRatio`)||1,l=this._get(`size`),h=new t({targetGeometry:new S({x:e[0],y:e[1],spatialReference:n}),scale:r,rotation:i});if(this._set(`viewpoint`,h),!l||!n||!r)return;let _=D(h);this.spatialReference=n,g(this.center,e);let y=l[0]===0?0:2/l[0],b=l[1]===0?0:-2/l[1];u(this.displayMat3,y,0,0,0,b,0,-1,1,1);let x=d(this.viewMat3),C=v(l[0]/2,l[1]/2),w=v(-l[0]/2,-l[1]/2),T=a(i);return f(x,x,C),p(x,x,T),f(x,x,w),m(this.displayViewMat3,this.displayMat3,x),o(this.viewMat2d,x[0],x[1],x[3],x[4],x[6],x[7]),O(this.extent,h,l),k(this.transform,h,l,c),s(this.inverseTransform,this.transform),A(this.transformNoRotation,h,l,c),this.worldScreenWidth=j(n,_),this.resolution=_,this.rotation=i,this.scale=r,this._set(`id`,this.id+1),this.notifyChange(`visibleArea`),this}};e([r({readOnly:!0})],P.prototype,`id`,void 0),e([r({value:1,json:{write:!0}})],P.prototype,`pixelRatio`,null),e([r()],P.prototype,`resolution`,void 0),e([r()],P.prototype,`rotation`,void 0),e([r()],P.prototype,`scale`,void 0),e([r({json:{write:!0}})],P.prototype,`size`,null),e([r()],P.prototype,`spatialReference`,void 0),e([r({type:t,json:{write:!0}})],P.prototype,`viewpoint`,null),e([r({readOnly:!0})],P.prototype,`visibleArea`,null),P=M=e([i(`esri.views.2d.ViewState`)],P);const F=P;export{F as default};
|