@arcgis/core 5.0.0-next.7 → 5.0.0-next.8
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/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{8f56f298e7c1a283f407.js → 0030d68d9edf42b4af57.js} +1 -1
- package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
- package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
- package/assets/esri/core/workers/chunks/05429f9d292a7a714309.js +316 -0
- package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
- package/assets/esri/core/workers/chunks/{9486032af3e934d85582.js → 0a5d74414dd02a2fb8e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
- package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
- package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
- package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
- package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
- package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
- package/assets/esri/core/workers/chunks/{020c8913d8e35d63080b.js → 1d15d1b20dc10fde6def.js} +1 -1
- package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
- package/assets/esri/core/workers/chunks/20975513be0a3a1da286.js +1 -0
- package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fac5a12e878cd745354.js → 28020063048e644f17a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 2a8dff8521e1e6a10cf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
- package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
- package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
- package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
- package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
- package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +1 -0
- package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa54b6f2aba6952af149.js → 38cc18fd93c18815ded0.js} +1 -1
- package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 3afb83f5de033dda89ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
- package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
- package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
- package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
- package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
- package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 59d3cac32ad6dad941dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
- package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +1 -0
- package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
- package/assets/esri/core/workers/chunks/{fd2efd1d1cf9d95a87e6.js → 63a6f3e70d2b6ea57e40.js} +1 -1
- package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4e4da69969499a89a2c.js → 695cdef5057e5461078a.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
- package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
- package/assets/esri/core/workers/chunks/{811d4c46c75cf6a63e78.js → 6bb7dbc46787b8e34bd9.js} +1 -1
- package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
- package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd1930f08e1fc8b30b14.js → 6ee2f0f708494102a493.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
- package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
- package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +1 -0
- package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
- package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
- package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
- package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
- package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
- package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +1 -0
- package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
- package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
- package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
- package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
- package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
- package/assets/esri/core/workers/chunks/{6f4bd0ee85e7e5a74340.js → a31635a6366347dcef0f.js} +1 -1
- package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
- package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → a876d6159ca120c1567e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1fe816b6990918c13c7.js → afc13d5b842275db7dbc.js} +1 -1
- package/assets/esri/core/workers/chunks/aff8e40a641c6822af1d.js +1 -0
- package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b0365cbc3d2a41969e3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
- package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +1 -0
- package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → b708792c84620b73c847.js} +1 -1
- package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
- package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
- package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
- package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
- package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +1 -0
- package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
- package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
- package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
- package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
- package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
- package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → d88f2fe680b8d5603ef8.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
- package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
- package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
- package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
- package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
- package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
- package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
- package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ffd4710d168c2fcfd96.js → ebf23b46db56aaa88841.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
- package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
- package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
- package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
- package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
- package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → fef45bc59c71f88c60b5.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/QueueProcessor.js +1 -1
- package/core/SetUtils.js +1 -1
- package/core/has.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/identity/Credential.js +1 -1
- package/identity/IdentityManager.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +67 -27
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/support/fieldConfigUtils.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/layers/support/source/DataLayerSource.js +1 -1
- package/package.json +3 -3
- package/popup/FieldInfo.js +1 -1
- package/processRequest.js +5 -0
- package/request.js +1 -1
- package/requestConfig.js +5 -0
- package/requestQueue.js +5 -0
- package/rest/query/executeForCount.js +1 -1
- package/rest/query/executeForExtent.js +1 -1
- package/rest/query/executeForIds.js +1 -1
- package/rest/query/executeQueryJSON.js +1 -1
- package/rest/query/executeQueryPBF.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/BaseImageMeasureResultValue.js +5 -0
- package/rest/support/ImageAreaResult.js +1 -1
- package/rest/support/ImageDistanceResult.js +1 -1
- package/rest/support/ImageHeightResult.js +1 -1
- package/rest/support/ImageMeasureResultAngleValue.js +5 -0
- package/rest/support/ImageMeasureResultAreaValue.js +5 -0
- package/rest/support/ImageMeasureResultLengthValue.js +5 -0
- package/rest/support/ImageWithType.js +5 -0
- package/rest/support/imageMeasureUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
- package/views/3d/glTF/DefaultLoadingContext.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
- package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/fetchTile.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/MultipointDrawAction.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/input/CursorUpdateEvents.js +5 -0
- package/views/draw/input/DrawCompleteEvent.js +5 -0
- package/views/draw/input/VertexAddEvent.js +5 -0
- package/views/draw/input/VertexRemoveEvent.js +5 -0
- package/views/draw/input/VertexUpdateEvent.js +5 -0
- package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
- package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
- package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
- package/widgets/Sketch/VisibleElements.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
- package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
- package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
- package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
- package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
- package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
- package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
- package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
- package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
- package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
- package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
- package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
- package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
- package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
- package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
- package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
- package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
- package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
- package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
- package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
- package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
- package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
- package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
- package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
- package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
- package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
- package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +0 -1
- package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
- package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
- package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
- package/views/3d/support/StreamDataLoader.js +0 -5
- package/views/3d/support/StreamDataRequester.js +0 -5
- package/views/3d/support/downloadSlots.js +0 -5
- package/views/draw/input/DrawEvents.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{equals as t}from"../../../core/arrayUtils.js";import{neverReached as
|
|
5
|
+
import{equals as t,pushIfSome as e}from"../../../core/arrayUtils.js";import{neverReached as r}from"../../../core/compilerUtils.js";import{Evented as i}from"../../../core/Evented.js";import s from"../../../geometry/Multipoint.js";import n from"../../../geometry/Polygon.js";import o from"../../../geometry/Polyline.js";import{getEndpoint as h,isCoordinate as a,isBezierCurve as c,isCircularArc as l,isEllipticArc4 as p}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as u}from"../coordinateHelper.js";import{unnormalize as g,getUnnormalizationInfo as f}from"./unnormalizationHelper.js";class m{constructor(t){this.part=t,this.leftSegment=null,this.rightSegment=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(t){this._pos=t,this.part.unnormalizeVertexPositions()}}class d{constructor(t,e,r){this.part=t,this.leftVertex=e,this.rightVertex=r,this.type="line",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return[...this.rightVertex.pos]}}class v{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="bezier",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){return{b:[[...this.rightVertex.pos],[...this.curveDefinition.controlPoint1],[...this.curveDefinition.controlPoint2]]}}}class y{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="circular-arc",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{interiorPoint:e}=this.curveDefinition;return{c:[[...t],[...e]]}}}class x{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-4",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i}=this.curveDefinition;return{a:[[...t],[...e],r,i]}}}class V{constructor(t,e,r,i){this.part=t,this.leftVertex=e,this.rightVertex=r,this.curveDefinition=i,this.type="elliptic-arc-7",e.rightSegment=this,r.leftSegment=this}toCurveOrCoordinate(){const t=this.rightVertex.pos,{centerPoint:e,sweep:r,orientation:i,rotation:s,semiMajorAxisLength:n,minorMajorAxisRatio:o}=this.curveDefinition;return{a:[[...t],e,r,i,s,n,o]}}}class w{constructor(t,e,r=!1){this._spatialReference=t,this._viewingMode=e,this.autoClose=r,this.vertices=[],this.segments=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||g(this.vertices,f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,e){const{vertices:r}=this;if(0===r.length)return;const i=r[0];let s=null,n=t,o=e;do{s=n,s.index=o++,n=s.rightSegment?s.rightSegment.rightVertex:null}while(null!=n&&n!==i);s.leftSegment&&s!==r[r.length-1]&&this.swapVertices(r.indexOf(s),r.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return null!=this.getFirstVertex()?.leftSegment}swapVertices(t,e){const{vertices:r}=this,i=r[t];r[t]=r[e],r[e]=i}*iterateVertices(){const t=this.getFirstVertex();let e=t;if(e)do{yield e,e=e.rightSegment?.rightVertex}while(e!==t&&null!=e)}}class P extends i{constructor(t,e){super(),this.type=t,this.coordinateHelper=e,this._geometry=null,this._dirty=!0,this.parts=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"multipoint":this._geometry=this._toMultipoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:r(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVerticesUnordered(){return Array.from(this.iterateVerticesUnordered())}*iterateVerticesUnordered(){for(const t of this.parts)for(const e of t.vertices)yield e}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.parts)yield*t.iterateVertices()}notifyChanges(t){this._dirty=!0,this.emit("change",t)}getPartialGeometry(t,e,r){const{parts:i,hasCurves:s}=M(this,{startingVertex:t,endingVertexInclusive:e,geometryType:r});return R(i,s,r,this.coordinateHelper)}_toPoint(){const{parts:t,coordinateHelper:e}=this;return t.at(0)?.vertices.length?e.vectorToPoint(t[0].vertices[0].pos):null}_toMultipoint(){const t=[],{coordinateHelper:e,parts:r,spatialReference:i}=this;for(const s of r){const r=s.getFirstVertex();r&&t.push(e.arrayToVector(r.pos))}return new s({hasM:e.hasM(),hasZ:e.hasZ(),spatialReference:i,points:t})}_toPolyline(){const t=[];let e=!1;for(const r of this.parts){if(r.vertices.length<1)continue;const i=r.vertices[0],s=[];s.push(i.pos);let n=i.rightSegment;for(;n;)e||="line"!==n.type,s.push(n.toCurveOrCoordinate()),n=n.rightVertex.rightSegment;t.push(s)}return new o({paths:e?void 0:t,curvePaths:e?t:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[];let r=!1;for(const i of this.parts){if(i.vertices.length<1)continue;const s=i.vertices[0],n=[];n.push(s.pos);let o=s.rightSegment;for(;o&&(r||="line"!==o.type,n.push(o.toCurveOrCoordinate()),o=o.rightVertex.rightSegment,o?.leftVertex!==s););if(i.autoClose&&n.length>1){const e=n.at(-1),r=h(n[0]),i=h(e);2===n.length&&a(e)||t(r,i)||n.push(r)}e.push(n)}return new n({rings:r?void 0:e,curveRings:r?e:void 0,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,e,r){const i=t.spatialReference,s=u(t.hasZ,t.hasM,i),n=new P(t.type,s);switch(t.type){case"polygon":S(n,t,e,r?.allowCurves??!1);break;case"polyline":b(n,t,e,r?.allowCurves??!1);break;case"point":H(n,t,e);break;case"multipoint":j(n,t,e);break;case"mesh":H(n,t.origin,e),n._geometry=t,n._dirty=!1}return n}}function _(t,e,r,i){const s=new m(t);t.vertices.push(s);const n=h(i);return s.pos=e.arrayToVector(n),s.index=t.vertices.length-1,r&&t.segments.push(C(t,r,s,i)),s}function C(t,e,r,i){if(a(i))return new d(t,e,r);if(c(i)){const[,s,n]=i.b;return new v(t,e,r,{controlPoint1:[...s],controlPoint2:[...n]})}if(l(i)){const[,s]=i.c;return new y(t,e,r,{interiorPoint:[...s]})}if(p(i)){const[,s,n,o]=i.a;return new x(t,e,r,{centerPoint:[...s],sweep:n,orientation:o})}const[,s,n,o,h,u,g]=i.a;return new V(t,e,r,{centerPoint:[...s],sweep:n,orientation:o,rotation:h,semiMajorAxisLength:u,minorMajorAxisRatio:g})}function R(t,e,r,i){const{spatialReference:a}=i;if("point"===r){const e=t.at(0)?.at(0);return e?i.arrayToPoint(h(e)):null}return"polygon"===r?new n({rings:e?void 0:t,curveRings:e?t:void 0,spatialReference:a,hasZ:i.hasZ(),hasM:i.hasM()}):"multipoint"===r?new s({spatialReference:a,points:t.flatMap(t=>t.map(t=>h(t))),hasM:i.hasM(),hasZ:i.hasZ()}):new o({paths:e?void 0:t,curvePaths:e?t:void 0,spatialReference:a,hasZ:i.hasZ(),hasM:i.hasM()})}function M(r,i){const s="polygon"===(i?.geometryType??r.type),n=[];let o=!1,c=!1,l=!1;for(const p of r.parts){let r=null;if(l)break;if(p.vertices.length<1)continue;if(i?.startingVertex){if(p!==i.startingVertex.part&&!c)continue;c=!0}const u=p===i?.startingVertex?.part?i.startingVertex:p.vertices.at(0),g=[];if(e(g,u?.pos),u===i?.endingVertexInclusive){l=!0,r=u,n.push(g);break}let f=u?.rightSegment;for(;f;){if(o||="line"!==f.type,g.push(f.toCurveOrCoordinate()),r=f.rightVertex,f.rightVertex===i?.endingVertexInclusive){l=!0;break}if(f=f.rightVertex.rightSegment,f?.leftVertex===u)break}const m=g.at(-1),d=p.getFirstVertex(),v=p.getLastVertex();s&&p.autoClose&&m&&r===v&&u===d&&(g.length>2||2===g.length&&!a(m))&&u?.pos&&!t(h(m),u.pos)&&g.push([...u.pos]),n.push(g)}return{parts:n,hasCurves:o}}function S(e,r,i,s){const n=r.spatialReference,o=e.coordinateHelper,{rings:a,curveRings:c}=r,l=c&&s?c:a;for(let p=0;p<l.length;++p){const r=l[p],s=new w(n,i);if(s.index=p,e.parts.push(s),r.length<1)continue;let a=null,c=null;for(let t=0;t<r.length-1;++t)c=_(s,o,c,r[t]),a??=c;r.length>1&&t(h(r[r.length-1]),a?.pos)?c&&a&&s.segments.push(C(s,c,a,r[r.length-1])):c=_(s,o,c,r[r.length-1])}}function b(t,e,r,i){const s=e.spatialReference,n=t.coordinateHelper,{curvePaths:o,paths:h}=e,a=o&&i?o:h;for(let c=0;c<a.length;++c){const e=a[c],i=new w(s,r);if(i.index=c,t.parts.push(i),e.length<1)continue;let o=null;for(let t=0;t<e.length;++t)o=_(i,n,o,e[t])}}function H(t,e,r){const i=e.spatialReference,s=t.coordinateHelper,n=new w(i,r);n.index=0;const o=new m(n);o.index=0,o.pos=s.pointToVector(e),n.vertices.push(o),t.parts.push(n)}function j(t,e,r){const i=e.spatialReference,{coordinateHelper:s,parts:n}=t,o=e.points.map(t=>s.arrayToVector(t));for(let h=0;h<o.length;h++){const t=new w(i,r);t.index=h,n.push(t);const e=new m(t);e.pos=o[h],e.index=0,t.vertices.push(e)}}function k(t){return"mesh"===t.type}export{v as BezierSegment,y as CircularArcSegment,P as EditGeometry,x as EllipticArc4Segment,V as EllipticArc7Segment,d as LineSegment,w as Part,m as Vertex,C as createConnectingSegment,k as isMeshEditGeometry,R as partialCoordsToGeometry,M as toPartialCoords};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{getEndpoint as e}from"../../../../geometry/support/curves/curveUtils.js";import{Vertex as t,createConnectingSegment as s,LineSegment as i}from"../EditGeometry.js";import{AppendVertex as r}from"./AppendVertex.js";class d extends r{apply(){let r="redo";const{_part:d,_editGeometry:n,_posOrCurveDef:l}=this;if(null==this._addedVertex&&(r="apply",this._addedVertex=new t(d)),!n.parts.includes(d)){this._partAdded=!0;const e=n.parts.at(-1)?.index??-1;d.index=e+1,n.parts.push(d)}const h=d.getLastVertex(),a=n.coordinateHelper.arrayToVector(e(l));if(null==h)this._addedVertex.leftSegment=null,this._addedVertex.rightSegment=null,d.vertices.push(this._addedVertex),this._addedVertex.pos=a,this._addedVertex.index=0;else{let e=null;h.rightSegment&&(this._originalSegment=h.rightSegment,e=this._originalSegment.rightVertex,d.segments.splice(d.segments.indexOf(this._originalSegment),1)),d.vertices.push(this._addedVertex),this._addedVertex.pos=a,this._left=s(d,h,this._addedVertex,l),d.segments.push(this._left),h.rightSegment=this._left,null!=e&&(this._right=new i(this._part,this._addedVertex,e),this._part.segments.push(this._right),e.leftSegment=this._right),d.updateVertexIndex(this._addedVertex,h.index+1)}n.notifyChanges({operation:r,addedVertices:[this._addedVertex]})}undo(){const{_part:e,_addedVertex:t,_left:s,_right:i,_originalSegment:r}=this;if(null!=t){if(e.vertices.splice(e.vertices.indexOf(t),1),null!=s){const t=e.segments.indexOf(s);t>-1&&e.segments.splice(t,1),s.leftVertex.rightSegment=null}if(null!=i){const t=e.segments.indexOf(i);t>-1&&e.segments.splice(t,1),i.rightVertex.leftSegment=null}if(null!=r&&(e.segments.includes(r)||e.segments.push(r),r.leftVertex.rightSegment=r,r.rightVertex.leftSegment=r),null!=s?e.updateVertexIndex(s.leftVertex,s.leftVertex.index):e.updateVertexIndex(t,0),this._partAdded&&0===this._part.vertices.length){const e=this._editGeometry.parts.indexOf(this._part);e>-1&&this._editGeometry.parts.splice(e)}this._editGeometry.notifyChanges({operation:"undo",removedVertices:[t]})}}accumulate(){return!1}}export{d as ReplayableAppendVertex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{initial as n,on as l,watch as d,sync as p,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as H}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as b}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return this._snappingComplexityExceeded||!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get _snappingComplexityExceeded(){return!(!this._layerView||!("snappingComplexityExceeded"in this._layerView))&&this._layerView.snappingComplexityExceeded}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating||this._tilesOfInterest.updating}get _outFields(){const{view:e,_layerView:t,layerSource:i}=this,{layer:r}=i,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=r,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,i=s.get(e)?.name??e,r=s.get(t)?.name??t;i&&d.push(i),r&&d.push(r)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(r))){const e=r.fieldsIndex.get("assetGroup")?.name,t=r.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(r&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:i}=this._layer,r=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...i,token:t}:i,viewType:r}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new b;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new b;break;case"3d":{const{resourceController:i}=t,r=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new b({schedule:e=>i.immediate.schedule(e),hasZ:r.hasZ&&(r.returnZ??!0),elevationAlignPointsInFeatures:async(e,i)=>{const s=await t.whenLayerView(r);return o(i),s.elevationAlignPointsInFeatures(e,i)},queryForSymbologySnapping:async(e,i)=>{const s=await t.whenLayerView(r);return o(i),s.queryForSymbologySnapping(e,i)}}),this._updatingHandles.add(()=>r.elevationInfo,()=>a(e.notifyElevationSourceChange()),n),this._updatingHandles.add(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),n),this._updatingHandles.add(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),n),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:i}=r;_(t,i)&&a(e.notifyElevationSourceChange())}),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([r(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),n),this.addHandles([d(()=>this.configuration,t=>a(e.configure(t,null)),p),d(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),u),d(()=>this._isSuspended,t=>a(e.setSuspended(t)),u)]),this._updatingHandles.add(()=>this._outFields,t=>a(e.updateOutFields(t)),n),null!=t&&this.addHandles(d(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,i=>{i&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(r(this._debug),"debug")):!i&&this._debug&&this.removeHandles("debug")},n)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){if(this._isSuspended)return[];const{coordinateHelper:i,point:r}=e;this._tilesOfInterest.pointOfInterest=i.arrayToPoint(r);const s=this._memoizedMakeGetGroundElevation(this.view,i.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>H(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:r}=this;if(!this._loadWhereModuleTask&&!r){const e=i(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!r)return[];try{return r.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c()],O.prototype,"_snappingComplexityExceeded",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new g(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles.map(e=>e.toJSON()),tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal))}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class g extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
|
package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as a}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new a,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}_hasAttributesForTile(e,t){if(e){const s=this._tiles.get(e);if(s)return!s.objectIds.size||i(t,s.attributeKeys)}return!1}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new y(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.key.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const{features:i}=await t(e,s);for(const r of i){const e=h(this._tmpBoundingRect,r.geometry);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(r);const s=r.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.key.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);if(this._hasAttributesForTile(e.id,s))return new v(e);const i=this._createTileTree(e,this.tileInfo);return this._simplify(i,t,null,0,1),this._collectMissingTiles(e,i,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){let r=this._tileFeatureCounts.get(e.id);return null!=r||(r=await f(t,s,i),this._tileFeatureCounts.set(e.id,r)),r}_createTileTree(e,t){const s=new g(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.key;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new g(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,i){const r=this._tiles.has(e.id)&&!this._hasAttributesForTile(e.id,i);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let n=0;n<e.children.length;n++){const s=e.children[n];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&n)>>1),(e.col<<1)+(1&n),o):this._collectMissingTilesRecurse(s,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class y{constructor(e,t,s){this.key=e,this.objectIds=t,this.attributeKeys=s}}class g extends d{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(e,t,s);this._tileInfo.updateTileInfo(r,1)&&(null==this._extent||l(this._extent,r.extent))&&(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
|
package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,w=6e5,x=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as c}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as d}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import F from"../../../../../layers/graphics/OptimizedFeatureSet.js";import{isHostedAgolService as b}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as T}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as P,executeQueryPBF as v,executeQuery as I}from"../../../../../rest/query/operations/query.js";import O from"../../../../../rest/support/Query.js";import{PendingFeatureTile as S}from"./PendingFeatureTile.js";let j=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!b(this.url))return;const e=s(async e=>{try{const t=await P(this.url,new O({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<C}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(q/(i*i))<M}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new S(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:x,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:c}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!c||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?d(e):e;if(this.store.featureStore.forEach(e=>{r===d(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}async _queryFeatures(e,t){return 0===e.num?new F:this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,s=await v(this.url,e,new T({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:x,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,s=await I(this.url,e,i,{query:this._configuration.customParameters,timeout:x,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(c(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new O({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?O.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||w);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],j.prototype,"url",void 0),e([h({constructOnly:!0})],j.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],j.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],j.prototype,"capabilities",void 0),e([h({constructOnly:!0})],j.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],j.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],j.prototype,"store",void 0),e([h({readOnly:!0})],j.prototype,"_minimumVerticesPerFeature",null),e([h()],j.prototype,"_mandatoryOutFields",null),e([h()],j.prototype,"outFields",null),e([h()],j.prototype,"suspended",void 0),e([h()],j.prototype,"_historicMoment",void 0),e([h()],j.prototype,"filter",null),e([h()],j.prototype,"customParameters",null),e([h({readOnly:!0})],j.prototype,"_configuration",null),e([h()],j.prototype,"tileInfo",null),e([h()],j.prototype,"tileSize",null),e([h()],j.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],j.prototype,"updating",null),e([h({readOnly:!0})],j.prototype,"availability",void 0),e([h()],j.prototype,"hasZ",null),j=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],j);const w=2e3,x=6e5,C=1e6,q=25,M=1;export{j as FeatureServiceTiledFetcher};
|
package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null,this.updating=!1}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),e([t()],a.prototype,"updating",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../Basemap.js";import n from"../../Ground.js";import a from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as s,Null as l,Integer as y}from"../../core/accessorSupport/ensureType.js";import{isCollection as o}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import i from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as u}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as c}from"../../layers/mixins/operationalLayers.js";import f from"../../layers/support/Sublayer.js";import{
|
|
5
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../Basemap.js";import n from"../../Ground.js";import a from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as s,Null as l,Integer as y}from"../../core/accessorSupport/ensureType.js";import{isCollection as o}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import i from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as u}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as c}from"../../layers/mixins/operationalLayers.js";import f from"../../layers/support/Sublayer.js";import{JoinTableDataSourceClass as m,DataLayerSource as d}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as b}from"../../layers/support/source/MapLayerSource.js";import w from"../InitialViewProperties.js";import{ScanContext as j,sorted as N}from"./utils.js";import{webSceneAnalysisRegistry as g}from"../support/analysisUtils.js";import v from"../support/SlideElements.js";async function T(r){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new j,!1);return await P(null,{typeName:"json",type:r},void 0,t)}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}async function q(e,t,r,n){switch(t.typeName){case"array":await R(e,t,r,n);break;case"union":await M(e,t,r,n);break;case"json":await P(e,t,r,n);break;case"native":await h(e,t,r,n);break;case"enum":await k(e,t,r,n)}}async function h(e,t,r,n){const a=r??t;n.addProperty({name:e,type:O(n,t),default:a.default,required:a.isRequired,nullable:a.nullable})}async function k(e,t,r,n){const a=r??t;n.currentClass?.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`,default:a.default,required:a.isRequired,nullable:a.nullable}):n.addProperty({name:e,type:O(n,t),enum:N(t.values).map(e=>"string"==typeof e?`"${e}"`:`${e}`).join("|"),default:a.default,required:a.isRequired,nullable:a.nullable})}async function R(e,t,r,n){t.elementType.isRequired=t.isRequired,await q(`${e}[]`,t.elementType,r??t.elementType,n)}function S(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;if(s&&Array.isArray(s)&&1===s.length&&"string"==typeof s[0])return a?s[0]:D(r,s[0])}return t}async function M(e,t,r,n){const a=[],s=r??t;for(const l of t.types)if("native"!==l.type.typeName&&t.key){const a=`${e}<${S(l.type,l.value)}>`;await q(a,l.type,r??t,n)}else a.push(l.type);if(a.length){const t=N(a.map(e=>O(n,e)));n.addProperty({type:t.join("|"),name:e,default:s.default,required:s.isRequired,nullable:s.nullable})}}async function C(e,t){return e.type===a&&"layers"===t?_("web-scene/operational-layers","operational-layers"):e.type===a&&"tables"===t?_("web-scene/tables","tables"):e.type!==r||"baseLayers"!==t&&"baseMapLayers"!==t?e.type===r&&"groundLayers"===t?_("web-scene/basemap-ground-layers","basemap-ground-layers"):e.type===r&&"elevationLayers"===t||e.type===n&&"layers"===t?_("web-scene/ground","ground"):e.type===i&&"layers"===t?_("web-scene/operational-layers","operational-layers",e=>e!==i):e.type!==v&&e.type!==w||"analyses"!==t?e.type!==m||"leftTableSource"!==t&&"rightTableSource"!==t?null:V({},{key:"type",base:null,typeMap:{"data-layer":d,"map-layer":b}}):{typeName:"array",elementType:{typeName:"union",key:"type",types:await Promise.all(Object.entries(g).map(async([e,t])=>({type:{typeName:"json",type:await t()},value:e})))}}:_("web-scene/basemap-base-layers","basemap-base-layers")}async function L(e,t,r){const n=I(r),a=await C(e,t);return a?(a.isRequired=n.isRequired,a.nullable=n.nullable,a.default=n.default,a):n}async function P(e,t,r,n){const a=t.type.__accessorMetadata__,s=n.getDeclaredClass(t.type);if(!a)return e&&n.addProperty({name:e,type:"unknown"}),null;let l=s,y=null;t.layerContainerType&&(l+=`--${t.layerContainerType}`);const o=e?.match(/<([^>]+)>$/);o&&(l+=`--${o[1]}`,y=o[1]);const i=r??t;t.type===f&&(l+=`--${n.currentClass?.name}`,y=n.currentClass?.name);const p=n.seen.get(l);if(p&&e)return n.addProperty({name:e,type:p,required:i.isRequired,default:i.default,nullable:i.nullable}),p;const u={type:t.type,name:s,id:l,properties:[]};e&&(n.addProperty({name:e,type:u,required:i.isRequired,default:i.default,nullable:i.nullable}),u.typeValue=y),n.push(e,u);for(const c in a){const e=a[c],r=F(e);if(!r?.enabled)continue;if(r.layerContainerTypes&&t.layerContainerType&&!r.layerContainerTypes.includes(t.layerContainerType))continue;if(t.type===f){const e="esri/layers/TileLayer"===n.stack[n.stack.length-2].klass.name;if(e&&f.test.isMapImageLayerOverridePolicy(r.overridePolicy)||!e&&f.test.isTileImageLayerOverridePolicy(r.overridePolicy))continue}const s=r.target;if("string"==typeof s||null==s){const r=await L(t,c,e);if(!r)continue;await q("string"==typeof s?s:c,r,void 0,n)}else await $(t,s,n)}return n.pop()}async function $(e,t,r){for(const n in t){let a=await C(e,n);if(!a){const e=t[n];a=e.types?V({default:e.default,write:e},e.types):J(e.type),a.default=e.default,a.isRequired=e.isRequired,a.nullable=e.allowNull,a=E(a)}await q(n,a,void 0,r)}}async function _(e,t,r){const n={typeName:"union",key:"layerType",types:[]};for(const a in c[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===a)continue;const s=await u[a]();s&&(r&&!r(s)||s!==p&&n.types.push({type:{typeName:"json",layerContainerType:t,type:s},value:a}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function O(e,t){switch(t.typeName){case"array":return`${O(e,t.elementType)}[]`;case"union":return`${N(t.types.map(t=>O(e,t.type))).join(" | ")}`;case"native":switch(t.type){case Number:return"number";case y:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.getDeclaredClass(t.type);case"enum":return"string"}}function A(e){const t=e.prototype.itemType?.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:J(t)};if(t.typeMap){const e=[];for(const r in t.typeMap){const n=t.typeMap[r];e.push({type:J(n),value:K(n)?null:r})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function x(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;return s&&Array.isArray(s)&&"string"==typeof s[0]?a||r.type.map(e=>D(r,e)):null}function E(e){if("array"===e.typeName)return e.elementType=E(e.elementType),e;const t=x(e);return t?{typeName:"union",key:"type",nullable:e.nullable,isRequired:e.isRequired,types:t.map(t=>({value:t,type:e}))}:e}function I(e){const t=U(e);return t?.types?V(t,t.types):!t?.type&&e.types?V(t,e.types):E(G(e))}function V(e,t){if(Array.isArray(t))return{typeName:"array",elementType:V(e,t[0])};const r=[];for(const n in t.typeMap){const e=t.typeMap[n];r.push({type:J(e),value:K(e)?null:n})}return{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:r,nullable:e?.write?.allowNull,isRequired:e?.write?.isRequired,default:e?.default}}function B(e){return null!=e&&e.isJSONMapWriter}function D(e,t){const r=F(e);if(r&&B(r.writer)){const e={value:""};return r.writer?.(t,e,"value"),e.value}return t}function G(e){const t=U(e),r=F(e),n=t?.type,a=J(n||e.type);return t&&void 0!==t.default&&"function"!=typeof t.default&&(a.default=D(e,t.default)),r?.allowNull&&(a.nullable=!0),r?.isRequired&&(a.isRequired=!0),a}function J(e){if(!e)return{typeName:"native",type:null};if(s(e))return W(e);if(Array.isArray(e)){if("string"==typeof e[0]||"number"==typeof e[0])return{typeName:"enum",values:e};if(e.length>1){const t=[];let r;for(const n of e)n!==l?t.push({type:J(n),value:null}):r=!0;return 1===t.length?{...t[0].type,nullable:r}:{typeName:"union",key:null,types:t,nullable:r}}return{typeName:"array",elementType:J(e[0])}}return o(e)?A(e):K(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:J(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map(e=>({type:W(e),value:null}))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function K(e){return e===String||e===Boolean||e===Number||e===y||e===Object||e===l}function U(e){if(!e.json)return null;const t=e.json.origins,r=e.json,n=t?.["web-scene"],a=t?.["web-document"];return n||a||r||null}function F(e){if(!e.json)return null;const t=e.json.origins,r=e.json.write,n=t?.["web-scene"]?.write,a=t?.["web-document"]?.write;return n||a||r||null}export{T as scan};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import"../../intl.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import n from"../../core/Logger.js";import{watch as a,initial as h,when as c}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../geometry/Point.js";import{load as v}from"../../geometry/projectionUtils.js";import u from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as f}from"../../symbols/support/typeUtils.js";import g from"./support/Conversion.js";import{isValidPoint as w,isSupportedNotation as _}from"./support/coordinateConversionUtils.js";import y from"./support/Format.js";import{generateDefaultFormats as C,setDefaultPatterns as b}from"./support/formatUtils.js";import{GoTo as L}from"../support/GoTo.js";import{fetchMessageBundle as M}from"../../intl/messages.js";import{onLocaleChange as P,getLocale as j}from"../../intl/locale.js";const S=new p([0,0,500]),H="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",x={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},E="esri/images/search/search-symbol-32.png";let T=class extends(L(r)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new i,this.formats=new i,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new i,this.locationSymbol=new u({url:e(E),width:24,height:24}),this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this)}initialize(){const t=async()=>this.messages=await M("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(C()),t().then(()=>{if(!this.destroyed&&(b(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(a(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),x.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),x.formats),this.addHandles(P(()=>{t().then(()=>{b(this.messages,this.formats)})})),v().then(()=>{this.formatterAvailable=!0}).catch(t=>{n.getLogger(this).error(new s("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(a(()=>this.view,this._handleViewChange,h),x.viewChange)),0===this.conversions.length)){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);this.conversions.add(new g({format:t}))}})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(t){return this._castToConversions(t)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!w(e))throw new s("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new s("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new s("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||S){return(await W(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new s("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_castToConversions(t){const e=new i;return t.forEach(t=>{let o=null;if(t instanceof g)o=t;else if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new g({format:e}))}o&&e.add(o)}),e}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(x.view),this.removeHandles(x.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>W(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(a(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)})}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){n.getLogger(this).error(new s("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(x.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(x.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),x.cursor),this.addHandles(this.view.on("click",this._onClick),x.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],x.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===j()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new g({format:o}))})}catch(e){n.getLogger(this).warn(new s("coordinate-conversion:session-storage-read-error","Could not get widget state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:j()}))}catch(e){n.getLogger(this).error(new s("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||_(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(c(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!U(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),x.view)}};async function W(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function U(t){return F.includes(t)}t([d({type:i.ofType(g)})],T.prototype,"conversions",void 0),t([l("conversions")],T.prototype,"castConversions",null),t([d({type:p})],T.prototype,"currentLocation",null),t([d({type:i.ofType(y)})],T.prototype,"formats",void 0),t([d()],T.prototype,"messages",void 0),t([d()],T.prototype,"mode",null),t([d()],T.prototype,"filteredFormats",void 0),t([d({readOnly:!0})],T.prototype,"state",null),t([d({types:f})],T.prototype,"locationSymbol",void 0),t([d({readOnly:!0,dependsOn:["storageType"]})],T.prototype,"storage",null),t([d()],T.prototype,"storageEnabled",void 0),t([d()],T.prototype,"storageType",void 0),t([d({readOnly:!0})],T.prototype,"waitingForConversions",null),t([d()],T.prototype,"view",void 0),T=t([m("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],T);const A=T;export{A as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import"../../intl.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import n from"../../core/Logger.js";import{watch as a,initial as h,when as c}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../geometry/Point.js";import{load as v}from"../../geometry/projectionUtils.js";import u from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as f}from"../../symbols/support/typeUtils.js";import g from"./support/Conversion.js";import{isValidPoint as w,isSupportedNotation as _}from"./support/coordinateConversionUtils.js";import y from"./support/Format.js";import{generateDefaultFormats as C,setDefaultPatterns as b}from"./support/formatUtils.js";import{GoTo as L}from"../support/GoTo.js";import{fetchMessageBundle as M}from"../../intl/messages.js";import{onLocaleChange as P,getLocale as j}from"../../intl/locale.js";const S=new p([0,0,500]),H="xy",F=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",x={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},E="esri/images/search/search-symbol-32.png";let T=class extends(L(r)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new i,this.formats=new i,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new i,this.locationSymbol=new u({url:e(E),width:24,height:24}),this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this)}initialize(){const t=async()=>this.messages=await M("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(C()),t().then(()=>{if(!this.destroyed&&(b(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(a(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),x.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),x.formats),this.addHandles(P(()=>{t().then(()=>{b(this.messages,this.formats)})})),v().then(()=>{this.formatterAvailable=!0}).catch(t=>{n.getLogger(this).error(new s("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(a(()=>this.view,this._handleViewChange,h),x.viewChange)),0===this.conversions.length)){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);this.conversions.add(new g({format:t}))}})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(t){return this._castToConversions(t)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){const{storageType:t}=this;return"session"===t?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){if(this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),!t)return;const e=t.clone();e.hasZ&&(e.z=void 0),this._locationGraphic=new o({geometry:e,symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic)}async convert(t,e){if(!w(e))throw new s("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new s("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new s("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||S){return(await W(t,e)).displayCoordinate}resume(){"capture"===this.mode?this._startCaptureMode():this._startLiveMode()}reverseConvert(t,e){return e.reverseConvert(t)}async updateConversions(t,e){if("point"!==e?.type)throw this._clearConversions(this.conversions),new s("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_castToConversions(t){const e=new i;return t.forEach(t=>{let o=null;if(t instanceof g)o=t;else if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new g({format:e}))}o&&e.add(o)}),e}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(x.view),this.removeHandles(x.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>W(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(a(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)})}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){n.getLogger(this).error(new s("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(x.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(x.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),x.cursor),this.addHandles(this.view.on("click",this._onClick),x.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(x.view),this.view&&(this.removeHandles(x.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],x.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t);this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===j()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new g({format:o}))})}catch(e){n.getLogger(this).warn(new s("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:j()}))}catch(e){n.getLogger(this).error(new s("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||_(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(c(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!U(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),x.view)}};async function W(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function U(t){return F.includes(t)}t([d({type:i.ofType(g)})],T.prototype,"conversions",void 0),t([l("conversions")],T.prototype,"castConversions",null),t([d({type:p})],T.prototype,"currentLocation",null),t([d({type:i.ofType(y)})],T.prototype,"formats",void 0),t([d()],T.prototype,"messages",void 0),t([d()],T.prototype,"mode",null),t([d()],T.prototype,"filteredFormats",void 0),t([d({readOnly:!0})],T.prototype,"state",null),t([d({types:f})],T.prototype,"locationSymbol",void 0),t([d({readOnly:!0,dependsOn:["storageType"]})],T.prototype,"storage",null),t([d()],T.prototype,"storageEnabled",void 0),t([d()],T.prototype,"storageType",void 0),t([d({readOnly:!0})],T.prototype,"waitingForConversions",null),t([d()],T.prototype,"view",void 0),T=t([m("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],T);const A=T;export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Logger.js";import{maybeProperty as o}from"../core/maybe.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as s}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./CoordinateConversion/CoordinateConversionViewModel.js";import l from"./CoordinateConversion/support/Conversion.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as d}from"./support/Heading.js";import{legacyIcon as u}from"./support/legacyIcon.js";import{accessibleHandler as h}from"./support/decorators/accessibleHandler.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import{isRTL as v,storeNode as g}from"./support/widgetUtils.js";import"@arcgis/toolkit/dom";const b="esri-coordinate-conversion",y={base:b,captureMode:`${b}--capture-mode`,noBasemap:`${b}--no-basemap`,popup:`${b}__popup`,clipboardPopup:`${b}__clipboard-popup`,conversionList:`${b}__conversion-list`,conversionRow:`${b}__row`,coordDisplay:`${b}__display`,expandButton:`${b}__expand-button`,expanded:`${b}__conversions-view--expanded`,expandDown:`${b}__conversions-view--expand-down`,expandUp:`${b}__conversions-view--expand-up`,conversionsView:`${b}__conversions-view`,rowSelect:`${b}__select-row`,toolDisplay:`${b}__tools`,modeToggle:`${b}__mode-toggle`,rowButton:`${b}__row-button`,coordinateInput:`${b}__input-coordinate`,inputForm:`${b}__input-form`,inputFormGroup:`${b}__input-group`,inputSelect:`${b}__input-select`,sectionHeading:`${b}__heading`,patternInput:`${b}__pattern-input`,settings:`${b}__settings`,settingsFormGroup:`${b}__settings-group`,settingsFormGroupHorizontal:`${b}__settings-group-horizontal`,previewCoordinate:`${b}__preview-coordinate`},C={settingsButton:!0,inputButton:!0,captureButton:!0,expandButton:!0},w=750,f=2500;let T=class extends r{constructor(e,t){super(e,t),this._popupMessage=null,this._popupTimeoutId=void 0,this._clipboardPopupTimeoutId=void 0,this._coordinateInput=null,this._badInput=!1,this._goToEnabled=!1,this._conversionFormat=null,this._settingsFormat=null,this._previewConversion=null,this._expanded=!1,this._clipboardPopupVisible=!1,this._popupVisible=!1,this._settingsVisible=!1,this._inputVisible=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.orientation="auto",this.viewModel=new a,this.visibleElements={...C}}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conversions(){return this.viewModel.conversions}set conversions(e){this.viewModel.conversions=e}get currentLocation(){return this.viewModel.currentLocation}set currentLocation(e){this.viewModel.currentLocation=e}get formats(){return this.viewModel.formats}set formats(e){this.viewModel.formats=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"coordinate-system"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get mode(){return this.viewModel.mode}set mode(e){this.viewModel.mode=e}set multipleConversions(e){!1===e&&(this._expanded=!1,this.conversions.splice(1,this.conversions.length-1)),this._set("multipleConversions",e)}get multipleConversions(){const e=this._get("multipleConversions");return"boolean"!=typeof e||e}get locationSymbol(){return this.viewModel.locationSymbol}set locationSymbol(e){this.viewModel.locationSymbol=e}get storageEnabled(){return this.viewModel.storageEnabled}set storageEnabled(e){this.viewModel.storageEnabled=e}get storageType(){return this.viewModel.storageType}set storageType(e){this.viewModel.storageType=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...C,...e}}reverseConvert(e,t){return this.viewModel.reverseConvert(e,t)}render(){const e=this.viewModel?.state,t="disabled"===e?m("div",{key:"esri-coordinate__no-basemap"},this.messages?.noBasemap):null,o=!t&&this._inputVisible?this._renderInputForm():null,i=!t&&this._settingsVisible?this._renderSettings():null,s=t||o||i?null:this._renderConversionsView(),n=this._popupVisible?this._renderPopup():null,r={[y.captureMode]:"capture"===this.mode,[c.disabled]:"loading"===e,[y.noBasemap]:"disabled"===e};return m("div",{class:this.classes(y.base,c.widget,r)},n,t,s,i,o)}_addConversion(e){const t=e.target,o=t.selectedOption.value,i=x(t);if(null==o||null==i)return;const s=new l({format:o});t.value="default",i>=0?(this.conversions.removeAt(i),this.conversions.add(s,i)):this.conversions.add(s)}_findSettingsFormat(){return this._settingsFormat||this.conversions.reduceRight((e,t)=>{const o=t.format;return o?.hasDisplayProperties?o:e},null)||this.formats.find(e=>e.hasDisplayProperties)}_hidePopup(){this._popupTimeoutId&&(clearTimeout(this._popupTimeoutId),this._popupTimeoutId=void 0),this._popupVisible=!1,this._popupMessage=null,this.scheduleRender()}_hideClipboardPopup(){this._clipboardPopupTimeoutId&&(clearTimeout(this._clipboardPopupTimeoutId),this._clipboardPopupTimeoutId=void 0),this._clipboardPopupVisible=!1,this.scheduleRender()}_onConvertComplete(){this._inputVisible=!1,this._coordinateInput.value=""}_onCopy(e){const t=P(e.currentTarget)?.displayCoordinate;null!=t&&(e.clipboardData?.setData("text/plain",t),this._showClipboardPopup(),e.preventDefault())}_processUserInput(e){const i=o(e,"key"),s=this.viewModel;if("Enter"!==i&&i)this._badInput&&(this._badInput=!1);else{const e=this._conversionFormat||this.conversions.at(0).format;if(!e)return;const o=this._coordinateInput.value;this._reverseConvert(o,e).then(e=>{"capture"===this.mode?s.resume():this.mode="capture",this.currentLocation=e,s.setLocation(e),this._onConvertComplete()}).catch(e=>{t.getLogger(this).error(e),this._showPopup(this.messages?.invalidCoordinate),this._badInput=!0})}}async _reverseConvert(e,o){const i=this.viewModel,s=await o.reverseConvert(e);return this._goToEnabled&&s&&i.goToLocation(s).catch(e=>{t.getLogger(this).warn(e),this._showPopup(this.messages?.locationOffBasemap)}),s}_setInputFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._conversionFormat=t)}_setPreviewConversion(){const e=this._findSettingsFormat(),t=this.viewModel;if(e){const o=this.conversions.find(t=>t.format===e);this._previewConversion=new l({format:e,position:{location:this.currentLocation,coordinate:o?.position?.coordinate}}),this._previewConversion.position?.coordinate||t.previewConversion(this._previewConversion)}}_setSettingsFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._settingsFormat=t,this._setPreviewConversion())}_showClipboardPopup(){this._clipboardPopupVisible?clearTimeout(this._clipboardPopupTimeoutId):this._clipboardPopupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hideClipboardPopup()},w)}_showPopup(e,t=f){this._popupMessage=e,this._popupVisible?clearTimeout(this._popupTimeoutId):this._popupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hidePopup()},t)}_toggleGoTo(){this._goToEnabled=!this._goToEnabled}_updateCurrentPattern(e){e.stopPropagation();const t=e.target,o=this._findSettingsFormat();o&&(o.currentPattern=t.value)}_renderConversion(e,t){const{messages:o}=this;if(!o)return m("li",null);const{format:i}=e,s=i?.label??"",n=`${this.id}__list-item-${t}`,r=`${s} ${o.conversionOutputSuffix}`,a=0===t,l=a||this._expanded,p=a?this._renderFirstConversion(e):this._renderTools(t,e,n),c=a&&!e.displayCoordinate?o.noLocation:e.displayCoordinate,d=m("div",{"aria-label":c,class:y.coordDisplay,"data-conversion":e,role:"listitem",tabIndex:0,title:c??""},c),u=this._renderOptions(this.formats.filter(e=>e!==i));return l?m("li",{"aria-label":r,class:y.conversionRow,id:n,key:e,role:"group",tabIndex:0,title:r},m("calcite-select",{"aria-controls":n,bind:this,class:y.rowSelect,"data-index":t,label:o.selectFormat,scale:"s",onCalciteSelectChange:this._addConversion},m("calcite-option",{label:s.toUpperCase(),selected:!0},s.toUpperCase()),u),d,p):null}_renderCopyButton(e){const t=this._clipboardPopupVisible&&this._renderClipboardPopup(),{messagesCommon:o}=this;return o?m("li",{"aria-label":o.copy,bind:this,class:this.classes(c.widgetButton,y.rowButton),"data-conversion":e,onclick:this._copyCoordinateOutput,oncopy:this._onCopy,onkeydown:this._copyCoordinateOutput,role:"button",tabIndex:0,title:o.copy},t,m("span",{"aria-hidden":"true",class:u.duplicate})):m("li",null)}_renderFirstConversion(e){const t=this.id,{messages:o,messagesCommon:i,multipleConversions:s,visibleElements:n}=this;if(!i||!o)return m("ul",null);const r="live"===this.mode?o.captureMode:o.liveMode,a=this._expanded?i.collapse:i.expand,l=e.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(e):null,p=s&&n.expandButton&&this._renderIconButton({iconType:this._expanded?"chevron-down":"chevron-up",clickFunction:this._toggleExpand,classes:[y.expandButton],attributes:{"aria-controls":`${t}__${y.conversionList}`,label:a}}),c=!s&&n.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[y.modeToggle],attributes:{label:r}});return m("ul",{class:y.toolDisplay},l,p,c)}_renderInputForm(){const e=this._conversionFormat||this.conversions.at(0).format,t=this.formats.findIndex(t=>t.name===e?.name),o=this.id,i=`${o}__${y.coordinateInput}`,s=`${o}__${y.coordinateInput}__header`,n=this._renderOptions(this.formats,!0,t),{messages:r,messagesCommon:a,headingLevel:l}=this;if(!a||!r)return m("div",null);const p=this._renderIconButton({iconType:v(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleInputVisibility,attributes:{label:a.back}});return m("div",{"aria-labelledby":s,class:y.inputForm,key:"esri-coordinate-conversion__input-form",role:"search"},m("div",{class:y.sectionHeading},p,m(d,{class:c.heading,id:s,level:l},r.inputCoordTitle)),m("div",{class:y.inputFormGroup},m("calcite-select",{"aria-controls":i,bind:this,class:y.inputSelect,label:r.selectFormat,scale:"s",onCalciteSelectChange:this._setInputFormat},n),m("calcite-input",{afterCreate:g,"aria-labelledby":s,bind:this,class:y.coordinateInput,"data-format":e,"data-node-ref":"_coordinateInput",id:i,onkeydown:this._processUserInput,placeholder:r.inputCoordTitle,required:!0,scale:"s",spellcheck:!1,status:this._badInput?"invalid":"idle"})),m("div",{class:y.inputFormGroup},m("calcite-label",{layout:"inline",scale:"s"},m("calcite-checkbox",{bind:this,checked:this._goToEnabled,onCalciteCheckboxChange:this._toggleGoTo}),r.goTo),m("calcite-button",{appearance:"outline",bind:this,kind:"neutral",onclick:this._processUserInput,type:"button",width:"auto"},r.convert)))}_renderConversionsView(){const{messages:e}=this;if(!e)return m("div",null);const t=`${this.id}__${y.conversionList}`,o=this._renderPrimaryTools(),i=this._renderOptions(this.formats),s=this.conversions.map((e,t)=>this._renderConversion(e,t)).toArray(),n=this._expanded?m("div",{class:y.conversionRow},m("calcite-select",{"aria-controls":t,bind:this,"data-index":-1,label:e.addConversion,scale:"s",onCalciteSelectChange:this._addConversion},m("calcite-option",{disabled:!0,selected:!0,value:"default"},e.addConversion),i),o):null,r={[y.expanded]:this._expanded,[y.expandUp]:"expand-up"===this.orientation,[y.expandDown]:"expand-down"===this.orientation};return m("div",{class:this.classes(y.conversionsView,r),key:"esri-coordinate-conversion__main-view"},m("ul",{"aria-expanded":this._expanded?"true":"false",class:y.conversionList,id:t},s),n)}_renderOptions(e,t,o){const i=this.conversions.at(0),s=i.format?.name;return e.map((e,n)=>{const r=!(t||!i)&&(s===e.name||this.conversions.map(e=>e.format?.name).includes(e.name));return m("calcite-option",{disabled:r,key:e.name??"unnamed-format",label:e.label.toUpperCase(),selected:n===o,value:e},e.label)}).toArray()}_renderPopup(){return m("div",{class:y.popup,role:"alert"},this._popupMessage)}_renderClipboardPopup(){const{messages:e}=this;return e?m("div",{class:this.classes(y.popup,y.clipboardPopup),role:"alert"},e.copySuccessMessage):m("div",null)}_renderPrimaryTools(){const{messages:e,visibleElements:t}=this;if(!e)return m("ul",null);const o="live"===this.mode?e.captureMode:e.liveMode,i=t.inputButton&&this._renderIconButton({iconType:"pencil",clickFunction:this._toggleInputVisibility,attributes:{label:e.inputCoordTitle}}),s=t.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[y.modeToggle],attributes:{label:o}}),n=t.settingsButton&&this._renderIconButton({iconType:"gear",clickFunction:this._toggleSettingsVisibility,attributes:{label:e.settingsTitle}});return m("ul",{class:y.toolDisplay},i,s,n)}_renderSettings(){const e=this.id,t=`${e}__${y.patternInput}`,o=`${e}__${y.patternInput}__header`,i=`${e}__${y.previewCoordinate}`,s=this.formats.filter(e=>e.hasDisplayProperties),n=this._findSettingsFormat(),r=n?s.indexOf(n):-1,a=this._renderOptions(s,!0,r),l=n?.currentPattern,{messages:p,messagesCommon:u,headingLevel:h}=this;if(!u||!p)return m("div",null);const _=this._renderIconButton({iconType:v(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleSettingsVisibility,attributes:{label:u.back}}),g=this._renderIconButton({iconType:"reset",clickFunction:this._setDefaultPattern,attributes:{label:p.defaultPattern}});return m("div",{"aria-labelledby":o,class:y.settings,key:y.settings},m("div",{class:y.sectionHeading},_,m(d,{class:c.heading,id:o,level:h},p.settingsTitle)),m("div",{class:y.settingsFormGroup},m("label",{for:t},p.changeCoordinateDisplay),m("calcite-select",{bind:this,label:p.selectFormat,width:"full",onCalciteSelectChange:this._setSettingsFormat},a),m("div",{class:y.settingsFormGroupHorizontal},m("calcite-input",{"aria-controls":i,bind:this,class:y.patternInput,id:t,spellcheck:!1,type:"text",value:l,onCalciteInputInput:this._updateCurrentPattern}),g)),m("div",{class:y.settingsFormGroup},m("label",null,u.preview,m("div",{class:y.previewCoordinate,id:i,tabIndex:0},this._previewConversion?.displayCoordinate))))}_renderIconButton(e){const{iconType:t,clickFunction:o,classes:i,attributes:s}=e;return m("calcite-button",{appearance:"transparent",bind:this,class:this.classes(i),iconStart:t,kind:"neutral",onclick:o,onkeydown:o,...s})}_renderTools(e,t,o){const i=t.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(t):null,{messages:s}=this;if(!s)return m("ul",null);const n=this._renderIconButton({iconType:"x",clickFunction:this._removeConversion,attributes:{"aria-controls":o,label:s.removeConversion,"data-index":e}});return m("ul",{class:y.toolDisplay,role:"listitem"},i,m("li",{class:this.classes(y.rowButton)},n))}_copyCoordinateOutput(e){const t=e.target;if(!("createTextRange"in document.body)){const e=window.getSelection(),o=document.createRange();o.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(o)}document.execCommand("copy")}_removeConversion(e){const t=x(e.currentTarget);null!=t&&this.conversions.removeAt(t)}_setDefaultPattern(e){e.stopPropagation();const t=this._findSettingsFormat();t&&(t.currentPattern=t.defaultPattern)}_toggleExpand(){this._expanded=!this._expanded}_toggleInputVisibility(){this._inputVisible=!this._inputVisible,this._popupVisible&&this._hidePopup(),this._inputVisible?this.viewModel.pause():this.viewModel.resume()}_toggleMode(){this.mode="live"===this.mode?"capture":"live"}_toggleSettingsVisibility(){this._settingsVisible=!this._settingsVisible,this._popupVisible&&this._hidePopup(),this._settingsVisible?(this._setPreviewConversion(),this.viewModel.pause()):this.viewModel.resume()}};e([i()],T.prototype,"conversions",null),e([i()],T.prototype,"currentLocation",null),e([i()],T.prototype,"formats",null),e([i()],T.prototype,"goToOverride",null),e([i()],T.prototype,"headingLevel",void 0),e([i()],T.prototype,"icon",null),e([i()],T.prototype,"label",null),e([i(),_("esri/widgets/CoordinateConversion/t9n/CoordinateConversion")],T.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],T.prototype,"messagesCommon",void 0),e([i()],T.prototype,"mode",null),e([i()],T.prototype,"orientation",void 0),e([i()],T.prototype,"multipleConversions",null),e([i()],T.prototype,"locationSymbol",null),e([i()],T.prototype,"storageEnabled",null),e([i()],T.prototype,"storageType",null),e([i()],T.prototype,"view",null),e([i({type:a})],T.prototype,"viewModel",void 0),e([i()],T.prototype,"visibleElements",void 0),e([s("visibleElements")],T.prototype,"castVisibleElements",null),e([h()],T.prototype,"_copyCoordinateOutput",null),e([h()],T.prototype,"_removeConversion",null),e([h()],T.prototype,"_setDefaultPattern",null),e([h()],T.prototype,"_toggleExpand",null),e([h()],T.prototype,"_toggleInputVisibility",null),e([h()],T.prototype,"_toggleMode",null),e([h()],T.prototype,"_toggleSettingsVisibility",null),T=e([n("esri.widgets.CoordinateConversion")],T);const I=T;function x(e){return e["data-index"]}function P(e){return e["data-conversion"]}export{I as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import o from"../core/Logger.js";import{maybeProperty as i}from"../core/maybe.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import l from"./CoordinateConversion/CoordinateConversionViewModel.js";import p from"./CoordinateConversion/support/Conversion.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u}from"./support/Heading.js";import{legacyIcon as h}from"./support/legacyIcon.js";import{accessibleHandler as _}from"./support/decorators/accessibleHandler.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import{isRTL as g,storeNode as b}from"./support/widgetUtils.js";import"@arcgis/toolkit/dom";const y="esri-coordinate-conversion",C={base:y,captureMode:`${y}--capture-mode`,noBasemap:`${y}--no-basemap`,popup:`${y}__popup`,clipboardPopup:`${y}__clipboard-popup`,conversionList:`${y}__conversion-list`,conversionRow:`${y}__row`,coordDisplay:`${y}__display`,expandButton:`${y}__expand-button`,expanded:`${y}__conversions-view--expanded`,expandDown:`${y}__conversions-view--expand-down`,expandUp:`${y}__conversions-view--expand-up`,conversionsView:`${y}__conversions-view`,rowSelect:`${y}__select-row`,toolDisplay:`${y}__tools`,modeToggle:`${y}__mode-toggle`,rowButton:`${y}__row-button`,coordinateInput:`${y}__input-coordinate`,inputForm:`${y}__input-form`,inputFormGroup:`${y}__input-group`,inputSelect:`${y}__input-select`,sectionHeading:`${y}__heading`,patternInput:`${y}__pattern-input`,settings:`${y}__settings`,settingsFormGroup:`${y}__settings-group`,settingsFormGroupHorizontal:`${y}__settings-group-horizontal`,previewCoordinate:`${y}__preview-coordinate`},w={settingsButton:!0,inputButton:!0,captureButton:!0,expandButton:!0},f=750,T=2500;let I=class extends a{constructor(e,i){super(e,i),this._popupMessage=null,this._popupTimeoutId=void 0,this._clipboardPopupTimeoutId=void 0,this._coordinateInput=null,this._badInput=!1,this._goToEnabled=!1,this._conversionFormat=null,this._settingsFormat=null,this._previewConversion=null,this._expanded=!1,this._clipboardPopupVisible=!1,this._popupVisible=!1,this._settingsVisible=!1,this._inputVisible=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.orientation="auto",this.viewModel=new l,this.visibleElements={...w},t(o.getLogger(this),"CoordinateConversion","arcgis-coordinate-conversion",{version:"4.34"})}loadDependencies(){return c({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conversions(){return this.viewModel.conversions}set conversions(e){this.viewModel.conversions=e}get currentLocation(){return this.viewModel.currentLocation}set currentLocation(e){this.viewModel.currentLocation=e}get formats(){return this.viewModel.formats}set formats(e){this.viewModel.formats=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"coordinate-system"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get mode(){return this.viewModel.mode}set mode(e){this.viewModel.mode=e}set multipleConversions(e){!1===e&&(this._expanded=!1,this.conversions.splice(1,this.conversions.length-1)),this._set("multipleConversions",e)}get multipleConversions(){const e=this._get("multipleConversions");return"boolean"!=typeof e||e}get locationSymbol(){return this.viewModel.locationSymbol}set locationSymbol(e){this.viewModel.locationSymbol=e}get storageEnabled(){return this.viewModel.storageEnabled}set storageEnabled(e){this.viewModel.storageEnabled=e}get storageType(){return this.viewModel.storageType}set storageType(e){this.viewModel.storageType=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...w,...e}}reverseConvert(e,t){return this.viewModel.reverseConvert(e,t)}render(){const e=this.viewModel?.state,t="disabled"===e?v("div",{key:"esri-coordinate__no-basemap"},this.messages?.noBasemap):null,o=!t&&this._inputVisible?this._renderInputForm():null,i=!t&&this._settingsVisible?this._renderSettings():null,s=t||o||i?null:this._renderConversionsView(),n=this._popupVisible?this._renderPopup():null,r={[C.captureMode]:"capture"===this.mode,[d.disabled]:"loading"===e,[C.noBasemap]:"disabled"===e};return v("div",{class:this.classes(C.base,d.widget,r)},n,t,s,i,o)}_addConversion(e){const t=e.target,o=t.selectedOption.value,i=P(t);if(null==o||null==i)return;const s=new p({format:o});t.value="default",i>=0?(this.conversions.removeAt(i),this.conversions.add(s,i)):this.conversions.add(s)}_findSettingsFormat(){return this._settingsFormat||this.conversions.reduceRight((e,t)=>{const o=t.format;return o?.hasDisplayProperties?o:e},null)||this.formats.find(e=>e.hasDisplayProperties)}_hidePopup(){this._popupTimeoutId&&(clearTimeout(this._popupTimeoutId),this._popupTimeoutId=void 0),this._popupVisible=!1,this._popupMessage=null,this.scheduleRender()}_hideClipboardPopup(){this._clipboardPopupTimeoutId&&(clearTimeout(this._clipboardPopupTimeoutId),this._clipboardPopupTimeoutId=void 0),this._clipboardPopupVisible=!1,this.scheduleRender()}_onConvertComplete(){this._inputVisible=!1,this._coordinateInput.value=""}_onCopy(e){const t=M(e.currentTarget)?.displayCoordinate;null!=t&&(e.clipboardData?.setData("text/plain",t),this._showClipboardPopup(),e.preventDefault())}_processUserInput(e){const t=i(e,"key"),s=this.viewModel;if("Enter"!==t&&t)this._badInput&&(this._badInput=!1);else{const e=this._conversionFormat||this.conversions.at(0).format;if(!e)return;const t=this._coordinateInput.value;this._reverseConvert(t,e).then(e=>{"capture"===this.mode?s.resume():this.mode="capture",this.currentLocation=e,s.setLocation(e),this._onConvertComplete()}).catch(e=>{o.getLogger(this).error(e),this._showPopup(this.messages?.invalidCoordinate),this._badInput=!0})}}async _reverseConvert(e,t){const i=this.viewModel,s=await t.reverseConvert(e);return this._goToEnabled&&s&&i.goToLocation(s).catch(e=>{o.getLogger(this).warn(e),this._showPopup(this.messages?.locationOffBasemap)}),s}_setInputFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._conversionFormat=t)}_setPreviewConversion(){const e=this._findSettingsFormat(),t=this.viewModel;if(e){const o=this.conversions.find(t=>t.format===e);this._previewConversion=new p({format:e,position:{location:this.currentLocation,coordinate:o?.position?.coordinate}}),this._previewConversion.position?.coordinate||t.previewConversion(this._previewConversion)}}_setSettingsFormat(e){const t=e.target.selectedOption.value;null!=t&&(this._settingsFormat=t,this._setPreviewConversion())}_showClipboardPopup(){this._clipboardPopupVisible?clearTimeout(this._clipboardPopupTimeoutId):this._clipboardPopupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hideClipboardPopup()},f)}_showPopup(e,t=T){this._popupMessage=e,this._popupVisible?clearTimeout(this._popupTimeoutId):this._popupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hidePopup()},t)}_toggleGoTo(){this._goToEnabled=!this._goToEnabled}_updateCurrentPattern(e){e.stopPropagation();const t=e.target,o=this._findSettingsFormat();o&&(o.currentPattern=t.value)}_renderConversion(e,t){const{messages:o}=this;if(!o)return v("li",null);const{format:i}=e,s=i?.label??"",n=`${this.id}__list-item-${t}`,r=`${s} ${o.conversionOutputSuffix}`,a=0===t,l=a||this._expanded,p=a?this._renderFirstConversion(e):this._renderTools(t,e,n),c=a&&!e.displayCoordinate?o.noLocation:e.displayCoordinate,d=v("div",{"aria-label":c,class:C.coordDisplay,"data-conversion":e,role:"listitem",tabIndex:0,title:c??""},c),u=this._renderOptions(this.formats.filter(e=>e!==i));return l?v("li",{"aria-label":r,class:C.conversionRow,id:n,key:e,role:"group",tabIndex:0,title:r},v("calcite-select",{"aria-controls":n,bind:this,class:C.rowSelect,"data-index":t,label:o.selectFormat,scale:"s",onCalciteSelectChange:this._addConversion},v("calcite-option",{label:s.toUpperCase(),selected:!0},s.toUpperCase()),u),d,p):null}_renderCopyButton(e){const t=this._clipboardPopupVisible&&this._renderClipboardPopup(),{messagesCommon:o}=this;return o?v("li",{"aria-label":o.copy,bind:this,class:this.classes(d.widgetButton,C.rowButton),"data-conversion":e,onclick:this._copyCoordinateOutput,oncopy:this._onCopy,onkeydown:this._copyCoordinateOutput,role:"button",tabIndex:0,title:o.copy},t,v("span",{"aria-hidden":"true",class:h.duplicate})):v("li",null)}_renderFirstConversion(e){const t=this.id,{messages:o,messagesCommon:i,multipleConversions:s,visibleElements:n}=this;if(!i||!o)return v("ul",null);const r="live"===this.mode?o.captureMode:o.liveMode,a=this._expanded?i.collapse:i.expand,l=e.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(e):null,p=s&&n.expandButton&&this._renderIconButton({iconType:this._expanded?"chevron-down":"chevron-up",clickFunction:this._toggleExpand,classes:[C.expandButton],attributes:{"aria-controls":`${t}__${C.conversionList}`,label:a}}),c=!s&&n.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[C.modeToggle],attributes:{label:r}});return v("ul",{class:C.toolDisplay},l,p,c)}_renderInputForm(){const e=this._conversionFormat||this.conversions.at(0).format,t=this.formats.findIndex(t=>t.name===e?.name),o=this.id,i=`${o}__${C.coordinateInput}`,s=`${o}__${C.coordinateInput}__header`,n=this._renderOptions(this.formats,!0,t),{messages:r,messagesCommon:a,headingLevel:l}=this;if(!a||!r)return v("div",null);const p=this._renderIconButton({iconType:g(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleInputVisibility,attributes:{label:a.back}});return v("div",{"aria-labelledby":s,class:C.inputForm,key:"esri-coordinate-conversion__input-form",role:"search"},v("div",{class:C.sectionHeading},p,v(u,{class:d.heading,id:s,level:l},r.inputCoordTitle)),v("div",{class:C.inputFormGroup},v("calcite-select",{"aria-controls":i,bind:this,class:C.inputSelect,label:r.selectFormat,scale:"s",onCalciteSelectChange:this._setInputFormat},n),v("calcite-input",{afterCreate:b,"aria-labelledby":s,bind:this,class:C.coordinateInput,"data-format":e,"data-node-ref":"_coordinateInput",id:i,onkeydown:this._processUserInput,placeholder:r.inputCoordTitle,required:!0,scale:"s",spellcheck:!1,status:this._badInput?"invalid":"idle"})),v("div",{class:C.inputFormGroup},v("calcite-label",{layout:"inline",scale:"s"},v("calcite-checkbox",{bind:this,checked:this._goToEnabled,onCalciteCheckboxChange:this._toggleGoTo}),r.goTo),v("calcite-button",{appearance:"outline",bind:this,kind:"neutral",onclick:this._processUserInput,type:"button",width:"auto"},r.convert)))}_renderConversionsView(){const{messages:e}=this;if(!e)return v("div",null);const t=`${this.id}__${C.conversionList}`,o=this._renderPrimaryTools(),i=this._renderOptions(this.formats),s=this.conversions.map((e,t)=>this._renderConversion(e,t)).toArray(),n=this._expanded?v("div",{class:C.conversionRow},v("calcite-select",{"aria-controls":t,bind:this,"data-index":-1,label:e.addConversion,scale:"s",onCalciteSelectChange:this._addConversion},v("calcite-option",{disabled:!0,selected:!0,value:"default"},e.addConversion),i),o):null,r={[C.expanded]:this._expanded,[C.expandUp]:"expand-up"===this.orientation,[C.expandDown]:"expand-down"===this.orientation};return v("div",{class:this.classes(C.conversionsView,r),key:"esri-coordinate-conversion__main-view"},v("ul",{"aria-expanded":this._expanded?"true":"false",class:C.conversionList,id:t},s),n)}_renderOptions(e,t,o){const i=this.conversions.at(0),s=i.format?.name;return e.map((e,n)=>{const r=!(t||!i)&&(s===e.name||this.conversions.map(e=>e.format?.name).includes(e.name));return v("calcite-option",{disabled:r,key:e.name??"unnamed-format",label:e.label.toUpperCase(),selected:n===o,value:e},e.label)}).toArray()}_renderPopup(){return v("div",{class:C.popup,role:"alert"},this._popupMessage)}_renderClipboardPopup(){const{messages:e}=this;return e?v("div",{class:this.classes(C.popup,C.clipboardPopup),role:"alert"},e.copySuccessMessage):v("div",null)}_renderPrimaryTools(){const{messages:e,visibleElements:t}=this;if(!e)return v("ul",null);const o="live"===this.mode?e.captureMode:e.liveMode,i=t.inputButton&&this._renderIconButton({iconType:"pencil",clickFunction:this._toggleInputVisibility,attributes:{label:e.inputCoordTitle}}),s=t.captureButton&&this._renderIconButton({iconType:"live"===this.mode?"pin-tear":"pin-tear-f",clickFunction:this._toggleMode,classes:[C.modeToggle],attributes:{label:o}}),n=t.settingsButton&&this._renderIconButton({iconType:"gear",clickFunction:this._toggleSettingsVisibility,attributes:{label:e.settingsTitle}});return v("ul",{class:C.toolDisplay},i,s,n)}_renderSettings(){const e=this.id,t=`${e}__${C.patternInput}`,o=`${e}__${C.patternInput}__header`,i=`${e}__${C.previewCoordinate}`,s=this.formats.filter(e=>e.hasDisplayProperties),n=this._findSettingsFormat(),r=n?s.indexOf(n):-1,a=this._renderOptions(s,!0,r),l=n?.currentPattern,{messages:p,messagesCommon:c,headingLevel:h}=this;if(!c||!p)return v("div",null);const _=this._renderIconButton({iconType:g(this.container)?"arrow-right":"arrow-left",clickFunction:this._toggleSettingsVisibility,attributes:{label:c.back}}),m=this._renderIconButton({iconType:"reset",clickFunction:this._setDefaultPattern,attributes:{label:p.defaultPattern}});return v("div",{"aria-labelledby":o,class:C.settings,key:C.settings},v("div",{class:C.sectionHeading},_,v(u,{class:d.heading,id:o,level:h},p.settingsTitle)),v("div",{class:C.settingsFormGroup},v("label",{for:t},p.changeCoordinateDisplay),v("calcite-select",{bind:this,label:p.selectFormat,width:"full",onCalciteSelectChange:this._setSettingsFormat},a),v("div",{class:C.settingsFormGroupHorizontal},v("calcite-input",{"aria-controls":i,bind:this,class:C.patternInput,id:t,spellcheck:!1,type:"text",value:l,onCalciteInputInput:this._updateCurrentPattern}),m)),v("div",{class:C.settingsFormGroup},v("label",null,c.preview,v("div",{class:C.previewCoordinate,id:i,tabIndex:0},this._previewConversion?.displayCoordinate))))}_renderIconButton(e){const{iconType:t,clickFunction:o,classes:i,attributes:s}=e;return v("calcite-button",{appearance:"transparent",bind:this,class:this.classes(i),iconStart:t,kind:"neutral",onclick:o,onkeydown:o,...s})}_renderTools(e,t,o){const i=t.displayCoordinate&&"capture"===this.mode?this._renderCopyButton(t):null,{messages:s}=this;if(!s)return v("ul",null);const n=this._renderIconButton({iconType:"x",clickFunction:this._removeConversion,attributes:{"aria-controls":o,label:s.removeConversion,"data-index":e}});return v("ul",{class:C.toolDisplay,role:"listitem"},i,v("li",{class:this.classes(C.rowButton)},n))}_copyCoordinateOutput(e){const t=e.target;if(!("createTextRange"in document.body)){const e=window.getSelection(),o=document.createRange();o.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(o)}document.execCommand("copy")}_removeConversion(e){const t=P(e.currentTarget);null!=t&&this.conversions.removeAt(t)}_setDefaultPattern(e){e.stopPropagation();const t=this._findSettingsFormat();t&&(t.currentPattern=t.defaultPattern)}_toggleExpand(){this._expanded=!this._expanded}_toggleInputVisibility(){this._inputVisible=!this._inputVisible,this._popupVisible&&this._hidePopup(),this._inputVisible?this.viewModel.pause():this.viewModel.resume()}_toggleMode(){this.mode="live"===this.mode?"capture":"live"}_toggleSettingsVisibility(){this._settingsVisible=!this._settingsVisible,this._popupVisible&&this._hidePopup(),this._settingsVisible?(this._setPreviewConversion(),this.viewModel.pause()):this.viewModel.resume()}};e([s()],I.prototype,"conversions",null),e([s()],I.prototype,"currentLocation",null),e([s()],I.prototype,"formats",null),e([s()],I.prototype,"goToOverride",null),e([s()],I.prototype,"headingLevel",void 0),e([s()],I.prototype,"icon",null),e([s()],I.prototype,"label",null),e([s(),m("esri/widgets/CoordinateConversion/t9n/CoordinateConversion")],I.prototype,"messages",void 0),e([s(),m("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([s()],I.prototype,"mode",null),e([s()],I.prototype,"orientation",void 0),e([s()],I.prototype,"multipleConversions",null),e([s()],I.prototype,"locationSymbol",null),e([s()],I.prototype,"storageEnabled",null),e([s()],I.prototype,"storageType",null),e([s()],I.prototype,"view",null),e([s({type:l})],I.prototype,"viewModel",void 0),e([s()],I.prototype,"visibleElements",void 0),e([n("visibleElements")],I.prototype,"castVisibleElements",null),e([_()],I.prototype,"_copyCoordinateOutput",null),e([_()],I.prototype,"_removeConversion",null),e([_()],I.prototype,"_setDefaultPattern",null),e([_()],I.prototype,"_toggleExpand",null),e([_()],I.prototype,"_toggleInputVisibility",null),e([_()],I.prototype,"_toggleMode",null),e([_()],I.prototype,"_toggleSettingsVisibility",null),I=e([r("esri.widgets.CoordinateConversion")],I);const x=I;function P(e){return e["data-index"]}function M(e){return e["data-conversion"]}export{x as default};
|