@arcgis/core 4.28.0-next.20230713 → 4.28.0-next.20230715
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/Basemap.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0b28b5eec6dc67be8ce9.js → 0121bfc81b794745e024.js} +1 -1
- package/assets/esri/core/workers/chunks/067d3d45caeaaba18d81.js +1 -0
- package/assets/esri/core/workers/chunks/080a13dc08a8db498ffa.js +1 -0
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/{c912466351e37db68b6c.js → 14ab33573bb02d6c6b1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4b066760e9aa85b7607.js → 1b948f8429d8f9b1bbfb.js} +1 -1
- package/assets/esri/core/workers/chunks/204ed2ebd2d3da659791.js +1 -0
- package/assets/esri/core/workers/chunks/{5d5d4a4fdf5ca8d7837f.js → 239d4176ff2d5142b7f1.js} +1 -1
- package/assets/esri/core/workers/chunks/23bb98aaa20b180ee680.js +1 -0
- package/assets/esri/core/workers/chunks/27cf3ef9566d5226b0df.js +1 -0
- package/assets/esri/core/workers/chunks/{1c86f80d73dee1a4d9b7.js → 2f1695e4807a534e1743.js} +1 -1
- package/assets/esri/core/workers/chunks/{60b422009f58d7bbb8c4.js → 3164b862a6b3f654fade.js} +1 -1
- package/assets/esri/core/workers/chunks/35f60625ada14eb801fd.js +1 -0
- package/assets/esri/core/workers/chunks/{4e4e62462deec25e82ce.js → 3a04bf1cdce263fe2191.js} +1 -1
- package/assets/esri/core/workers/chunks/41011207b6cc5eb6232f.js +1 -0
- package/assets/esri/core/workers/chunks/{8d50449c029c73136204.js → 432e3558db53574d21b4.js} +1 -1
- package/assets/esri/core/workers/chunks/4767f69b81d36dde9550.js +1 -0
- package/assets/esri/core/workers/chunks/{08ee2bd914867fd2cbd5.js → 490629c6f9fee501c9cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{044b15794b6403792f04.js → 4f079d0e69189c1d8bd9.js} +1 -1
- package/assets/esri/core/workers/chunks/4f1f4cc82fea0d1f79ec.js +1 -0
- package/assets/esri/core/workers/chunks/503a393327df755d8843.js +1 -0
- package/assets/esri/core/workers/chunks/50e05f479c7d414fc06b.js +1 -0
- package/assets/esri/core/workers/chunks/{3835a76c017431f19422.js → 51da3c5c50b153ce6bc7.js} +1 -1
- package/assets/esri/core/workers/chunks/54b97ca5f2164b941f5b.js +1 -0
- package/assets/esri/core/workers/chunks/5a3fb63dab89cf3418f7.js +1 -0
- package/assets/esri/core/workers/chunks/5ceaf1f05b219034a10c.js +1 -0
- package/assets/esri/core/workers/chunks/70aabffaaa0a1da8e609.js +1 -0
- package/assets/esri/core/workers/chunks/78cb95d1594a0cb0dd7a.js +1 -0
- package/assets/esri/core/workers/chunks/7f391ae5e0ea7812baca.js +1 -0
- package/assets/esri/core/workers/chunks/{1d2b8b937bbda91a6549.js → 82dfbc175b52c7a10475.js} +1 -1
- package/assets/esri/core/workers/chunks/{036cd65514eab1749363.js → 8467d05626a3a72462c9.js} +1 -1
- package/assets/esri/core/workers/chunks/9038b1317f1252e31f09.js +1 -0
- package/assets/esri/core/workers/chunks/929ddc4d9975ed893767.js +1 -0
- package/assets/esri/core/workers/chunks/{e86dcc239c6a57000afc.js → 94633cc9cfb089ef010e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f5f398374ff77fb17f0.js → 975eef6d20c17a0ed07b.js} +1 -1
- package/assets/esri/core/workers/chunks/{8913bddc76b82cb24664.js → 98cf4e744e8f2c3fc536.js} +1 -1
- package/assets/esri/core/workers/chunks/a00414550fa21c5662f3.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{4e2029c8cc8a5afe5759.js → a5348f117dacdcae99ee.js} +1 -1
- package/assets/esri/core/workers/chunks/b0f0a3178d88fa600a11.js +1 -0
- package/assets/esri/core/workers/chunks/b4446ce010bc4a5aa917.js +1 -0
- package/assets/esri/core/workers/chunks/b8a45b28a915a423d09d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb97d39b25b0b009d2f0.js → bd9e6f38c9ec4195322a.js} +1 -1
- package/assets/esri/core/workers/chunks/{30deb5a8e9a82186991d.js → c15c4bd52d4472ed50bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{55109f141c9f120833f6.js → c3d773c93efb41088c54.js} +1 -1
- package/assets/esri/core/workers/chunks/c518410b1214ffc58017.js +1 -0
- package/assets/esri/core/workers/chunks/d55faafe2ac914a3ebd1.js +1 -0
- package/assets/esri/core/workers/chunks/d5fd4780d57173f3e303.js +1 -0
- package/assets/esri/core/workers/chunks/da01e520a1ae0048e73e.js +1 -0
- package/assets/esri/core/workers/chunks/dd7603c9e5fd178c88f7.js +1 -0
- package/assets/esri/core/workers/chunks/ddcf58937924ab5a3d76.js +1 -0
- package/assets/esri/core/workers/chunks/e03a0f52d438f53a3057.js +1 -0
- package/assets/esri/core/workers/chunks/e433440fecd0114cb23d.js +1 -0
- package/assets/esri/core/workers/chunks/ea1560129e426980a4e2.js +1 -0
- package/assets/esri/core/workers/chunks/f73e2143f8d053aef092.js +1 -0
- package/assets/esri/core/workers/chunks/{0a0af540f4fe64c3d292.js → fa14238f1c308a74f843.js} +1 -1
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +3 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/RibbonLine.glsl.js +57 -72
- package/chunks/ar.js +1 -1
- package/chunks/ar2.js +1 -1
- package/chunks/bg_BG.js +1 -1
- package/chunks/bg_BG2.js +1 -1
- package/chunks/bs_BA.js +1 -1
- package/chunks/bs_BA2.js +1 -1
- package/chunks/ca_ES.js +1 -1
- package/chunks/ca_ES2.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/cs_CZ.js +1 -1
- package/chunks/cs_CZ2.js +1 -1
- package/chunks/da_DK.js +1 -1
- package/chunks/da_DK2.js +1 -1
- package/chunks/de_CH.js +1 -1
- package/chunks/de_CH2.js +1 -1
- package/chunks/de_DE.js +1 -1
- package/chunks/de_DE2.js +1 -1
- package/chunks/el_GR.js +1 -1
- package/chunks/el_GR2.js +1 -1
- package/chunks/en_CA.js +1 -1
- package/chunks/en_CA2.js +1 -1
- package/chunks/en_US.js +1 -1
- package/chunks/en_US2.js +1 -1
- package/chunks/es_ES.js +1 -1
- package/chunks/es_ES2.js +1 -1
- package/chunks/et_EE.js +1 -1
- package/chunks/et_EE2.js +1 -1
- package/chunks/fi_FI.js +1 -1
- package/chunks/fi_FI2.js +1 -1
- package/chunks/fr_FR.js +1 -1
- package/chunks/fr_FR2.js +1 -1
- package/chunks/he_IL.js +1 -1
- package/chunks/he_IL2.js +1 -1
- package/chunks/hr_HR.js +1 -1
- package/chunks/hr_HR2.js +1 -1
- package/chunks/hu_HU.js +1 -1
- package/chunks/hu_HU2.js +1 -1
- package/chunks/id_ID.js +1 -1
- package/chunks/id_ID2.js +1 -1
- package/chunks/it_IT.js +1 -1
- package/chunks/it_IT2.js +1 -1
- package/chunks/ja_JP.js +1 -1
- package/chunks/ja_JP2.js +1 -1
- package/chunks/ko_KR.js +1 -1
- package/chunks/ko_KR2.js +1 -1
- package/chunks/lt_LT.js +1 -1
- package/chunks/lt_LT2.js +1 -1
- package/chunks/lv_LV.js +1 -1
- package/chunks/lv_LV2.js +1 -1
- package/chunks/nb_NO.js +1 -1
- package/chunks/nb_NO2.js +1 -1
- package/chunks/nl_NL.js +1 -1
- package/chunks/nl_NL2.js +1 -1
- package/chunks/pl_PL.js +1 -1
- package/chunks/pl_PL2.js +1 -1
- package/chunks/pt_BR.js +1 -1
- package/chunks/pt_BR2.js +1 -1
- package/chunks/pt_PT.js +1 -1
- package/chunks/pt_PT2.js +1 -1
- package/chunks/ro_RO.js +1 -1
- package/chunks/ro_RO2.js +1 -1
- package/chunks/ru_RU.js +1 -1
- package/chunks/ru_RU2.js +1 -1
- package/chunks/sk_SK.js +1 -1
- package/chunks/sk_SK2.js +1 -1
- package/chunks/sl_SL.js +1 -1
- package/chunks/sl_SL2.js +1 -1
- package/chunks/sr_RS.js +1 -1
- package/chunks/sr_RS2.js +1 -1
- package/chunks/sv_SE.js +1 -1
- package/chunks/sv_SE2.js +1 -1
- package/chunks/th_TH.js +1 -1
- package/chunks/th_TH2.js +1 -1
- package/chunks/tr_TR.js +1 -1
- package/chunks/tr_TR2.js +1 -1
- package/chunks/uk_UA.js +1 -1
- package/chunks/uk_UA2.js +1 -1
- package/chunks/vi_VN.js +1 -1
- package/chunks/vi_VN2.js +1 -1
- package/chunks/zh_Hans.js +1 -1
- package/chunks/zh_Hans2.js +1 -1
- package/chunks/zh_Hant.js +1 -1
- package/chunks/zh_Hant2.js +1 -1
- package/config.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/image/apng.js +1 -1
- package/core/image/gif.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/staticWorkerMessages.js +5 -0
- package/geometry/projection.js +1 -1
- package/interfaces.d.ts +42 -2
- package/kernel.js +1 -1
- package/layers/support/ImageElement.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/support/BasemapStyle.js +5 -0
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/views/2d/GoToManager.js +5 -0
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/support/engineHelpers.js +1 -1
- package/views/2d/support/screenshotUtils.js +5 -0
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/settings.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightToolConfiguration.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/Slice/settings.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/MapView.js +1 -1
- package/views/Theme.js +5 -0
- package/views/View.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/support/colorUtils.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/support/chartUtils.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/assets/esri/core/workers/chunks/05f3374114bce72d3560.js +0 -1
- package/assets/esri/core/workers/chunks/10028df973ef7f9531c8.js +0 -1
- package/assets/esri/core/workers/chunks/1cbb03eec9dc23ef043b.js +0 -1
- package/assets/esri/core/workers/chunks/289061552a2a64bebd76.js +0 -1
- package/assets/esri/core/workers/chunks/308eeeaec591b4eea1de.js +0 -1
- package/assets/esri/core/workers/chunks/3155c750fc5a4e04a785.js +0 -1
- package/assets/esri/core/workers/chunks/346f67995b327bca8ee0.js +0 -1
- package/assets/esri/core/workers/chunks/3736e17dd6461f74cfaf.js +0 -1
- package/assets/esri/core/workers/chunks/37e60f9ca86f9d4bf4ea.js +0 -1
- package/assets/esri/core/workers/chunks/3a0b45ecc48e23a3a5d5.js +0 -1
- package/assets/esri/core/workers/chunks/417377c8e76944f428a7.js +0 -1
- package/assets/esri/core/workers/chunks/498dca81073e1fb477b9.js +0 -1
- package/assets/esri/core/workers/chunks/536962375ce4f1394481.js +0 -1
- package/assets/esri/core/workers/chunks/64bb4093c019a02d5309.js +0 -1
- package/assets/esri/core/workers/chunks/69de4733173ee2dee6e1.js +0 -1
- package/assets/esri/core/workers/chunks/6dcffe6683a798a42c78.js +0 -1
- package/assets/esri/core/workers/chunks/7a898d167029ee11a680.js +0 -1
- package/assets/esri/core/workers/chunks/7a973d70e6bc42d804ee.js +0 -1
- package/assets/esri/core/workers/chunks/7d9d2629af373c84624f.js +0 -1
- package/assets/esri/core/workers/chunks/885cb0da78e6853b23a4.js +0 -1
- package/assets/esri/core/workers/chunks/8e28862296972e9e6f82.js +0 -1
- package/assets/esri/core/workers/chunks/928431e1c449c6054547.js +0 -1
- package/assets/esri/core/workers/chunks/afdf30439d71a7cc19ae.js +0 -1
- package/assets/esri/core/workers/chunks/b1fa1571fd98d3b8dffe.js +0 -1
- package/assets/esri/core/workers/chunks/b20167d9163d0ee74b65.js +0 -1
- package/assets/esri/core/workers/chunks/b2a0e3e1dfccda7ed12e.js +0 -1
- package/assets/esri/core/workers/chunks/c09db831248054600e16.js +0 -1
- package/assets/esri/core/workers/chunks/dcccc9760998271254b5.js +0 -1
- package/assets/esri/core/workers/chunks/ddea45acae89759e57fa.js +0 -1
- package/assets/esri/core/workers/chunks/e039108eb3a592f6d8e3.js +0 -1
- package/assets/esri/core/workers/chunks/e70314ac10cc1f8f9f86.js +0 -1
- package/assets/esri/core/workers/chunks/f2d399b394a1a9156214.js +0 -1
- package/assets/esri/core/workers/chunks/f74d4e1eecec06f84ee2.js +0 -1
- package/assets/esri/core/workers/chunks/fb7eff7f76386f81d57b.js +0 -1
- package/assets/esri/core/workers/chunks/fe277d33b5b8a11c76df.js +0 -1
- package/core/analysisThemeUtils.js +0 -5
- package/views/support/createScreenshotPlan.js +0 -5
package/package.json
CHANGED
package/portal/Portal.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import{id as r}from"../kernel.js";import o from"../request.js";import s from"../core/Error.js";import{JSONSupportMixin as i}from"../core/JSONSupport.js";import a from"../core/Loadable.js";import{destroyMaybe as l,removeMaybe as u}from"../core/maybe.js";import{throwIfAborted as n,isAborted as p,createAbortError as d,throwIfAbortError as h}from"../core/promiseUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Extent.js";import{getLocale as S}from"../intl/locale.js";import{ensureDefaultPortalInstance as g}from"./portalDefault.js";import P from"./PortalQueryParams.js";import G from"./PortalQueryResult.js";import B from"./PortalUser.js";import{supportsApiKey as O}from"../support/apiKeyUtils.js";var D;let U;const b={PortalGroup:()=>import("./PortalGroup.js"),PortalItem:()=>import("./PortalItem.js"),PortalUser:()=>import("./PortalUser.js")};let Q=D=class extends(i(a)){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=t.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){C.unregister(this),this.defaultBasemap=l(this.defaultBasemap),this.defaultDevBasemap=l(this.defaultDevBasemap),this.defaultVectorBasemap=l(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=u(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const r of e)t.request.trustedServers.includes(r)||t.request.trustedServers.push(r);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=B.fromJSON(e),t.portal=this),t}load(e){const t=import("../Basemap.js").then((({default:t})=>{n(e),U=t})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e))).then((e=>{if(r){const e=r;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==D.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",q(new WeakRef(this))),C.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await import("../layers/ElevationLayer.js")).default;return e?e.map((e=>new t({id:e.id,url:e.url}))):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){const o=await this._fetchBasemaps3D(e,t);r.unshift(...o)}return r}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then((e=>e.categorySchema)):p(e)?Promise.reject(d()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new P;if(r.num=100,r.sortField="title",t&&t.length){const o=[];for(const e of t)o.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,e).then((e=>e.results))}return p(e)?Promise.reject(d()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return g((()=>new D))}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const o=this.restUrl+"/portals/self",s={authMode:e,query:{culture:S().toLowerCase()},...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(o,s)}queryPortal(e,t,r,o){const s=c(P,t),i=t=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...o}).then((e=>{const r=s.clone();return r.start=e.nextStart,new G({nextQueryParams:r,queryParams:s,total:e.total,results:D._resultsToTypedArray(t,{portal:this},e,o)})})).then((e=>Promise.all(e.results.map((t=>"function"==typeof t.when?t.when():e))).then((()=>e),(t=>(h(t),e)))));return r&&b[r]?b[r]().then((({default:e})=>(n(o),i(e)))):i()}signIn(){if(this.authMode===D.AUTH_MODE_ANONYMOUS)return Promise.reject(new s("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then((()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then((()=>null))):"loading"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate")))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate")))).then((e=>{e&&(this.sourceJSON=e,this.read(e))}));return r?r.getCredential(this.restUrl).then((t=>e(t))):e(this.credential)}normalizeUrl(e){const t=this.credential&&this.credential.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then((e=>{const t=D._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map((t=>"function"==typeof t.when?t.when():e))).then((()=>t),(()=>t))}))}request(e,t={}){const r={f:"json",...t.query},{authMode:s=(this.authMode===D.AUTH_MODE_ANONYMOUS?"anonymous":"auto"),body:i=null,cacheBust:a=!1,method:l="auto",responseType:u="json",signal:n}=t,p={authMode:s,body:i,cacheBust:a,method:l,query:r,responseType:u,timeout:0,signal:n};return o(this._normalizeSSL(e),p).then((e=>e.data))}toJSON(){throw new s("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new D({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new s("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,r){const o=new P;o.query=e||(t.apiKey&&O(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),o.disableExtraQuery=!0;const s=await this.queryGroups(o,r);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Map" -type:"Web Application"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const a=await i.queryItems(o,r);if(!a.total)return[];return a.results.filter((e=>"Web Map"===e.type)).map((e=>new U({portalItem:e})))}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];const o=new P({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,t);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Scene"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const a=await i.queryItems(o,t);if(!a.total)return[];return a.results.filter((e=>"Web Scene"===e.type)).map((e=>new U({portalItem:e})))}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=U.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,o){let s=[];if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(s=s.map((r=>{const o=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof o.load&&o.load(i),o})))}else s=[];return s}};Q.AUTH_MODE_ANONYMOUS="anonymous",Q.AUTH_MODE_AUTO="auto",Q.AUTH_MODE_IMMEDIATE="immediate",e([y()],Q.prototype,"access",void 0),e([y()],Q.prototype,"allSSL",void 0),e([y()],Q.prototype,"authMode",void 0),e([y()],Q.prototype,"authorizedCrossOriginDomains",void 0),e([m("authorizedCrossOriginDomains")],Q.prototype,"readAuthorizedCrossOriginDomains",null),e([y()],Q.prototype,"basemapGalleryGroupQuery",void 0),e([y({json:{name:"3DBasemapGalleryGroupQuery"}})],Q.prototype,"basemapGalleryGroupQuery3D",void 0),e([y()],Q.prototype,"bingKey",void 0),e([y()],Q.prototype,"canListApps",void 0),e([y()],Q.prototype,"canListData",void 0),e([y()],Q.prototype,"canListPreProvisionedItems",void 0),e([y()],Q.prototype,"canProvisionDirectPurchase",void 0),e([y()],Q.prototype,"canSearchPublic",void 0),e([y()],Q.prototype,"canShareBingPublic",void 0),e([y()],Q.prototype,"canSharePublic",void 0),e([y()],Q.prototype,"canSignInArcGIS",void 0),e([y()],Q.prototype,"canSignInIDP",void 0),e([y()],Q.prototype,"colorSetsGroupQuery",void 0),e([y()],Q.prototype,"commentsEnabled",void 0),e([y({type:Date})],Q.prototype,"created",void 0),e([y()],Q.prototype,"credential",void 0),e([y()],Q.prototype,"culture",void 0),e([y()],Q.prototype,"currentVersion",void 0),e([y()],Q.prototype,"customBaseUrl",void 0),e([y()],Q.prototype,"defaultBasemap",void 0),e([m("defaultBasemap")],Q.prototype,"readDefaultBasemap",null),e([y()],Q.prototype,"defaultDevBasemap",void 0),e([m("defaultDevBasemap")],Q.prototype,"readDefaultDevBasemap",null),e([y({type:v})],Q.prototype,"defaultExtent",void 0),e([y()],Q.prototype,"defaultVectorBasemap",void 0),e([m("defaultVectorBasemap")],Q.prototype,"readDefaultVectorBasemap",null),e([y()],Q.prototype,"description",void 0),e([y()],Q.prototype,"devBasemapGalleryGroupQuery",void 0),e([y()],Q.prototype,"eueiEnabled",void 0),e([y({readOnly:!0})],Q.prototype,"extraQuery",null),e([y()],Q.prototype,"featuredGroups",void 0),e([y()],Q.prototype,"featuredItemsGroupQuery",void 0),e([y()],Q.prototype,"galleryTemplatesGroupQuery",void 0),e([y()],Q.prototype,"livingAtlasGroupQuery",void 0),e([y()],Q.prototype,"hasCategorySchema",void 0),e([y()],Q.prototype,"helpBase",void 0),e([y()],Q.prototype,"helperServices",void 0),e([y()],Q.prototype,"helpMap",void 0),e([y()],Q.prototype,"homePageFeaturedContent",void 0),e([y()],Q.prototype,"homePageFeaturedContentCount",void 0),e([y()],Q.prototype,"httpPort",void 0),e([y()],Q.prototype,"httpsPort",void 0),e([y()],Q.prototype,"id",void 0),e([y()],Q.prototype,"ipCntryCode",void 0),e([y({readOnly:!0})],Q.prototype,"isOrganization",null),e([y()],Q.prototype,"isPortal",void 0),e([y()],Q.prototype,"isReadOnly",void 0),e([y({readOnly:!0})],Q.prototype,"itemPageUrl",null),e([y()],Q.prototype,"layerTemplatesGroupQuery",void 0),e([y()],Q.prototype,"maxTokenExpirationMinutes",void 0),e([y({type:Date})],Q.prototype,"modified",void 0),e([y()],Q.prototype,"name",void 0),e([y()],Q.prototype,"portalHostname",void 0),e([y()],Q.prototype,"portalMode",void 0),e([y()],Q.prototype,"portalProperties",void 0),e([y()],Q.prototype,"region",void 0),e([y({readOnly:!0})],Q.prototype,"restUrl",null),e([y()],Q.prototype,"rotatorPanels",void 0),e([y()],Q.prototype,"showHomePageDescription",void 0),e([y()],Q.prototype,"sourceJSON",void 0),e([y()],Q.prototype,"staticImagesUrl",void 0),e([y({json:{name:"2DStylesGroupQuery"}})],Q.prototype,"stylesGroupQuery2d",void 0),e([y({json:{name:"stylesGroupQuery"}})],Q.prototype,"stylesGroupQuery3d",void 0),e([y()],Q.prototype,"supportsHostedServices",void 0),e([y()],Q.prototype,"symbolSetsGroupQuery",void 0),e([y()],Q.prototype,"templatesGroupQuery",void 0),e([y()],Q.prototype,"thumbnail",void 0),e([y({readOnly:!0})],Q.prototype,"thumbnailUrl",null),e([y()],Q.prototype,"units",void 0),e([y()],Q.prototype,"url",void 0),e([y()],Q.prototype,"urlKey",void 0),e([m("urlKey")],Q.prototype,"readUrlKey",null),e([y()],Q.prototype,"user",void 0),e([m("user")],Q.prototype,"readUser",null),e([y()],Q.prototype,"use3dBasemaps",void 0),e([y()],Q.prototype,"useStandardizedQuery",void 0),e([y()],Q.prototype,"useVectorBasemaps",void 0),e([y()],Q.prototype,"vectorBasemapGalleryGroupQuery",void 0),Q=D=e([f("esri.portal.Portal")],Q);const j=Q,C=new FinalizationRegistry((e=>{e.remove()}));function q(e){const t=r;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}export{j as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import{id as r}from"../kernel.js";import o from"../request.js";import s from"../core/Error.js";import{JSONSupportMixin as i}from"../core/JSONSupport.js";import a from"../core/Loadable.js";import{destroyMaybe as l,removeMaybe as u}from"../core/maybe.js";import{throwIfAborted as n,isAborted as p,createAbortError as d,throwIfAbortError as h}from"../core/promiseUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Extent.js";import{getLocale as S}from"../intl/locale.js";import{ensureDefaultPortalInstance as g}from"./portalDefault.js";import P from"./PortalGroup.js";import G from"./PortalQueryParams.js";import B from"./PortalQueryResult.js";import O from"./PortalUser.js";import{supportsApiKey as D}from"../support/apiKeyUtils.js";var U;let b;const Q={PortalGroup:()=>Promise.resolve({default:P}),PortalItem:()=>import("./PortalItem.js"),PortalUser:()=>Promise.resolve({default:O})};let C=U=class extends(i(a)){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=t.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){q.unregister(this),this.defaultBasemap=l(this.defaultBasemap),this.defaultDevBasemap=l(this.defaultDevBasemap),this.defaultVectorBasemap=l(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=u(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const r of e)t.request.trustedServers.includes(r)||t.request.trustedServers.push(r);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=O.fromJSON(e),t.portal=this),t}load(e){const t=import("../Basemap.js").then((({default:t})=>{n(e),b=t})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e))).then((e=>{if(r){const e=r;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==U.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",w(new WeakRef(this))),q.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await import("../layers/ElevationLayer.js")).default;return e?e.map((e=>new t({id:e.id,url:e.url}))):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){const o=await this._fetchBasemaps3D(e,t);r.unshift(...o)}return r}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then((e=>e.categorySchema)):p(e)?Promise.reject(d()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new G;if(r.num=100,r.sortField="title",t&&t.length){const o=[];for(const e of t)o.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,e).then((e=>e.results))}return p(e)?Promise.reject(d()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return g((()=>new U))}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const o=this.restUrl+"/portals/self",s={authMode:e,query:{culture:S().toLowerCase()},...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(o,s)}queryPortal(e,t,r,o){const s=c(G,t),i=t=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...o}).then((e=>{const r=s.clone();return r.start=e.nextStart,new B({nextQueryParams:r,queryParams:s,total:e.total,results:U._resultsToTypedArray(t,{portal:this},e,o)})})).then((e=>Promise.all(e.results.map((t=>"function"==typeof t.when?t.when():e))).then((()=>e),(t=>(h(t),e)))));return r&&Q[r]?Q[r]().then((({default:e})=>(n(o),i(e)))):i()}signIn(){if(this.authMode===U.AUTH_MODE_ANONYMOUS)return Promise.reject(new s("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then((()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then((()=>null))):"loading"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate")))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate")))).then((e=>{e&&(this.sourceJSON=e,this.read(e))}));return r?r.getCredential(this.restUrl).then((t=>e(t))):e(this.credential)}normalizeUrl(e){const t=this.credential&&this.credential.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then((e=>{const t=U._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map((t=>"function"==typeof t.when?t.when():e))).then((()=>t),(()=>t))}))}request(e,t={}){const r={f:"json",...t.query},{authMode:s=(this.authMode===U.AUTH_MODE_ANONYMOUS?"anonymous":"auto"),body:i=null,cacheBust:a=!1,method:l="auto",responseType:u="json",signal:n}=t,p={authMode:s,body:i,cacheBust:a,method:l,query:r,responseType:u,timeout:0,signal:n};return o(this._normalizeSSL(e),p).then((e=>e.data))}toJSON(){throw new s("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new U({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new s("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,r){const o=new G;o.query=e||(t.apiKey&&D(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),o.disableExtraQuery=!0;const s=await this.queryGroups(o,r);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Map" -type:"Web Application"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const a=await i.queryItems(o,r);if(!a.total)return[];return a.results.filter((e=>"Web Map"===e.type)).map((e=>new b({portalItem:e})))}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];const o=new G({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,t);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Scene"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const a=await i.queryItems(o,t);if(!a.total)return[];return a.results.filter((e=>"Web Scene"===e.type)).map((e=>new b({portalItem:e})))}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=b.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,o){let s=[];if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(s=s.map((r=>{const o=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof o.load&&o.load(i),o})))}else s=[];return s}};C.AUTH_MODE_ANONYMOUS="anonymous",C.AUTH_MODE_AUTO="auto",C.AUTH_MODE_IMMEDIATE="immediate",e([y()],C.prototype,"access",void 0),e([y()],C.prototype,"allSSL",void 0),e([y()],C.prototype,"authMode",void 0),e([y()],C.prototype,"authorizedCrossOriginDomains",void 0),e([m("authorizedCrossOriginDomains")],C.prototype,"readAuthorizedCrossOriginDomains",null),e([y()],C.prototype,"basemapGalleryGroupQuery",void 0),e([y({json:{name:"3DBasemapGalleryGroupQuery"}})],C.prototype,"basemapGalleryGroupQuery3D",void 0),e([y()],C.prototype,"bingKey",void 0),e([y()],C.prototype,"canListApps",void 0),e([y()],C.prototype,"canListData",void 0),e([y()],C.prototype,"canListPreProvisionedItems",void 0),e([y()],C.prototype,"canProvisionDirectPurchase",void 0),e([y()],C.prototype,"canSearchPublic",void 0),e([y()],C.prototype,"canShareBingPublic",void 0),e([y()],C.prototype,"canSharePublic",void 0),e([y()],C.prototype,"canSignInArcGIS",void 0),e([y()],C.prototype,"canSignInIDP",void 0),e([y()],C.prototype,"colorSetsGroupQuery",void 0),e([y()],C.prototype,"commentsEnabled",void 0),e([y({type:Date})],C.prototype,"created",void 0),e([y()],C.prototype,"credential",void 0),e([y()],C.prototype,"culture",void 0),e([y()],C.prototype,"currentVersion",void 0),e([y()],C.prototype,"customBaseUrl",void 0),e([y()],C.prototype,"defaultBasemap",void 0),e([m("defaultBasemap")],C.prototype,"readDefaultBasemap",null),e([y()],C.prototype,"defaultDevBasemap",void 0),e([m("defaultDevBasemap")],C.prototype,"readDefaultDevBasemap",null),e([y({type:v})],C.prototype,"defaultExtent",void 0),e([y()],C.prototype,"defaultVectorBasemap",void 0),e([m("defaultVectorBasemap")],C.prototype,"readDefaultVectorBasemap",null),e([y()],C.prototype,"description",void 0),e([y()],C.prototype,"devBasemapGalleryGroupQuery",void 0),e([y()],C.prototype,"eueiEnabled",void 0),e([y({readOnly:!0})],C.prototype,"extraQuery",null),e([y()],C.prototype,"featuredGroups",void 0),e([y()],C.prototype,"featuredItemsGroupQuery",void 0),e([y()],C.prototype,"galleryTemplatesGroupQuery",void 0),e([y()],C.prototype,"livingAtlasGroupQuery",void 0),e([y()],C.prototype,"hasCategorySchema",void 0),e([y()],C.prototype,"helpBase",void 0),e([y()],C.prototype,"helperServices",void 0),e([y()],C.prototype,"helpMap",void 0),e([y()],C.prototype,"homePageFeaturedContent",void 0),e([y()],C.prototype,"homePageFeaturedContentCount",void 0),e([y()],C.prototype,"httpPort",void 0),e([y()],C.prototype,"httpsPort",void 0),e([y()],C.prototype,"id",void 0),e([y()],C.prototype,"ipCntryCode",void 0),e([y({readOnly:!0})],C.prototype,"isOrganization",null),e([y()],C.prototype,"isPortal",void 0),e([y()],C.prototype,"isReadOnly",void 0),e([y({readOnly:!0})],C.prototype,"itemPageUrl",null),e([y()],C.prototype,"layerTemplatesGroupQuery",void 0),e([y()],C.prototype,"maxTokenExpirationMinutes",void 0),e([y({type:Date})],C.prototype,"modified",void 0),e([y()],C.prototype,"name",void 0),e([y()],C.prototype,"portalHostname",void 0),e([y()],C.prototype,"portalMode",void 0),e([y()],C.prototype,"portalProperties",void 0),e([y()],C.prototype,"region",void 0),e([y({readOnly:!0})],C.prototype,"restUrl",null),e([y()],C.prototype,"rotatorPanels",void 0),e([y()],C.prototype,"showHomePageDescription",void 0),e([y()],C.prototype,"sourceJSON",void 0),e([y()],C.prototype,"staticImagesUrl",void 0),e([y({json:{name:"2DStylesGroupQuery"}})],C.prototype,"stylesGroupQuery2d",void 0),e([y({json:{name:"stylesGroupQuery"}})],C.prototype,"stylesGroupQuery3d",void 0),e([y()],C.prototype,"supportsHostedServices",void 0),e([y()],C.prototype,"symbolSetsGroupQuery",void 0),e([y()],C.prototype,"templatesGroupQuery",void 0),e([y()],C.prototype,"thumbnail",void 0),e([y({readOnly:!0})],C.prototype,"thumbnailUrl",null),e([y()],C.prototype,"units",void 0),e([y()],C.prototype,"url",void 0),e([y()],C.prototype,"urlKey",void 0),e([m("urlKey")],C.prototype,"readUrlKey",null),e([y()],C.prototype,"user",void 0),e([m("user")],C.prototype,"readUser",null),e([y()],C.prototype,"use3dBasemaps",void 0),e([y()],C.prototype,"useStandardizedQuery",void 0),e([y()],C.prototype,"useVectorBasemaps",void 0),e([y()],C.prototype,"vectorBasemapGalleryGroupQuery",void 0),C=U=e([f("esri.portal.Portal")],C);const j=C,q=new FinalizationRegistry((e=>{e.remove()}));function w(e){const t=r;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}export{j as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as r}from"../chunks/tslib.es6.js";import s from"../core/Accessor.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";import{getLocale as o,getLanguage as a}from"../intl/locale.js";const c=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let p=class extends s{constructor(r){super(r),this.id=null,this.language=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps"}getLanguageParamValue(){if(this.language)return this.language;const r=o().toLowerCase();switch(r){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const s=a(r);return"pt"===s?"pt-BR":s&&c.has(s)?s:"global"}};r([e()],p.prototype,"id",void 0),r([e()],p.prototype,"language",void 0),r([e()],p.prototype,"serviceUrl",void 0),p=r([t("esri.support.BasemapStyle")],p);const i=p;export{i as default};
|
package/support/basemapUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../Basemap.js";import r from"../config.js";import n from"../core/Collection.js";import a from"../core/Logger.js";import{Url as t,makeAbsolute as l,normalize as i}from"../core/urlUtils.js";import{ensureType as s}from"../core/accessorSupport/ensureType.js";import{esriBasemapDefinitions as u}from"./basemapDefinitions.js";const c=a.getLogger("esri.support.basemapUtils");function o(){return{}}function f(e){for(const r in e){const n=e[r];!1===n?.destroyed&&n.destroy(),delete e[r]}}function p(n,a){let t;if("string"==typeof n){
|
|
5
|
+
import e from"../Basemap.js";import r from"../config.js";import n from"../core/Collection.js";import a from"../core/Logger.js";import{Url as t,makeAbsolute as l,normalize as i}from"../core/urlUtils.js";import{ensureType as s}from"../core/accessorSupport/ensureType.js";import{esriBasemapDefinitions as u}from"./basemapDefinitions.js";const c=a.getLogger("esri.support.basemapUtils");function o(){return{}}function f(e){for(const r in e){const n=e[r];!1===n?.destroyed&&n.destroy(),delete e[r]}}function p(n,a){let t;if("string"==typeof n){const l=n in u,i=!l&&n.includes("/");if(!l&&!i){const e=Object.entries(u).filter((([e,n])=>r.apiKey&&!n.classic||!r.apiKey&&n.classic&&!n.deprecated)).map((([e])=>`"${e}"`)).join(", ");return c.warn(`Unable to find basemap definition for: ${n}. Try one of these: ${e}`),null}a&&(t=a[n]),t||(t=l?e.fromId(n):new e({style:{id:n}}),a&&(a[n]=t))}else t=s(e,n);return t?.destroyed&&(c.warn("The provided basemap is already destroyed",{basemap:t}),t=null),t}function y(e){return"Web Scene"===e.portalItem?.type}function m(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function d(e,r=null){const n=p(e);if(!n)return null;const a=n.clone();return r&&(a.baseLayers=g(a.baseLayers,r.baseLayers),a.referenceLayers=g(a.referenceLayers,r.referenceLayers)),a}let b;function L(e){if(b)return b(e);let r=null;const n=q(e),a=!n?.baseLayers.length;for(const t in u){const e=$(n,U(u[t]),{mustMatchReferences:a});if("equal"===e){r=t;break}"base-layers-equal"===e&&(r=t)}return r}function S(e){b=e}function v(e,r){if(e===r)return!0;return"equal"===$(q(e),q(r),{mustMatchReferences:!0})}function g(e,r){const a=new n;return e.forEach((e=>{const n=r.find((r=>A(j(e),j(r))))||e;a.includes(n)?a.push(e):a.push(n)})),a}function h(e){return!!e?.baseLayers.concat(e.referenceLayers).some(R)}function R(e){if(w(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const n=e.sourceNameToSource[r];if(w(n?.sourceUrl))return!0}return!1}function I(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const n=r.baseLayers.at(0);switch(n.loadStatus){case"not-loaded":n.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in n?n.supportedSpatialReferences:null)||["tileInfo"in n?n.tileInfo?.spatialReference:n.spatialReference]).filter(Boolean),t=e.spatialReference;return t?{spatialReference:a.find((e=>t.equals(e)))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const T=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function w(e){if(!e)return!1;const r=new t(l(e));return!!r.authority&&T.test(r.authority)}function q(e){return e?!e.loaded&&e.resourceInfo?U(e.resourceInfo.data):{baseLayers:x(e.baseLayers),referenceLayers:x(e.referenceLayers)}:null}function x(e){return(n.isCollection(e)?e.toArray():e).map(j)}function j(e){return{type:e.type,url:B("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function U(e){return e?{baseLayers:M((e.baseMapLayers??[]).filter((e=>!e.isReference))),referenceLayers:M((e.baseMapLayers??[]).filter((e=>e.isReference)))}:null}function M(e){return e.map((e=>k(e)))}function k(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;default:r="unknown"}return{type:r,url:B(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:null!=e.minScale?e.minScale:0,maxScale:null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function $(e,r,n){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!C(e.baseLayers,r.baseLayers))return"not-equal";return C(e.referenceLayers,r.referenceLayers)?"equal":n.mustMatchReferences?"not-equal":"base-layers-equal"}function C(e,r){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!A(e[n],r[n]))return!1;return!0}function A(e,r){if(e.type!==r.type||"scene"===e.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let n=0;n<e.sublayers.length;n++){const a=e.sublayers.at(n),t=r.sublayers.at(n);if(a?.id!==t?.id||a?.visible!==t?.visible)return!1}}return!0}function B(e){return e?i(e).replace(/^\s*https?:/i,"").toLowerCase():""}export{d as clonePreservingTiledLayers,v as contentEquals,o as createCache,f as destroyCache,p as ensureType,I as findSpatialReference,L as getWellKnownBasemapId,h as hasDeveloperBasemapLayer,y as isBasemap3D,m as isBasemapLayer,R as isDeveloperBasemapLayer,S as overrideGetWellKnownBasemapId};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20230715",a="e988a5736f7c52ccac4c2b98614749c50881439d";export{c as buildDate,a as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Color.js";import t from"../../core/Error.js";import{loadFont as
|
|
5
|
+
import e from"../../Color.js";import{getColorLuminance as t}from"../../core/colorUtils.js";import a from"../../core/Error.js";import{loadFont as n}from"../../core/fontUtils.js";import{pt2px as l,px2pt as o}from"../../core/screenUtils.js";import{getFill as i,getStroke as s,getPatternUrlWithColor as r}from"./gfxUtils.js";import{SymbolSizeDefaults as c,shapes as u,adjustColorBrightness as h}from"./previewUtils.js";import{renderSymbol as m}from"./renderUtils.js";import{BACKGROUND_PADDING as p}from"./textUtils.js";const d="picture-fill",f="picture-marker",y="simple-fill",g="simple-line",w="simple-marker",v="text",b="Aa",k=c.size,x=c.maxSize,z=c.maxOutlineSize,L=c.lineWidth,M=225,j=document.createElement("canvas");function C(e,t){const a=j.getContext("2d"),n=[];return t&&(t.weight&&n.push(t.weight),t.size&&n.push(t.size+"px"),t.family&&n.push(t.family)),a.font=n.join(" "),a.measureText(e).width}const S=7.2/2.54,F=72/2.54;function U(e){if(0===e.length)return 0;if(e.length>2){const t=o(1),a=parseFloat(e);switch(e.slice(-2)){case"px":return a;case"pt":return a*t;case"in":return 72*a*t;case"pc":return 12*a*t;case"mm":return a*S*t;case"cm":return a*F*t}}return parseFloat(e)}function E(e){const t=e?.size;return{width:null!=t&&"object"==typeof t&&"width"in t?l(t.width):null,height:null!=t&&"object"==typeof t&&"height"in t?l(t.height):null}}async function Z(e,t){const a=t.fill,n=e.color;if("pattern"===a?.type&&n&&e.type!==d){const e=await r(a.src,n.toCss(!0));a.src=e,t.fill=a}}async function q(e,t,a,l){if(!("font"in e)||!e.font||"text"!==t.shape.type)return;try{await n(e.font)}catch{}const{width:o}=E(l),i=/[\uE600-\uE6FF]/.test(t.shape.text);null!=o||i||(a[0]=C(t.shape.text,{weight:t.font?.weight,size:t.font?.size,family:t.font?.family}))}function D(e,t,a,n,o){if(null!=e.haloColor&&null!=e.haloSize){o.masking??=a.map((()=>[]));const i=l(e.haloSize);n[0]+=i,n[1]+=i,a.unshift([{...t,fill:null,stroke:{color:e.haloColor,width:2*i,join:"round",cap:"round"}}]),o.masking.unshift([{shape:{type:"rect",x:0,y:0,width:n[0]+2*p,height:n[1]+2*p},fill:[255,255,255],stroke:null},{...t,fill:[0,0,0,0],stroke:null}])}null==e.backgroundColor&&null==e.borderLineColor||(n[0]+=2*p,n[1]+=2*p,a.unshift([{shape:{type:"rect",x:0,y:0,width:n[0],height:n[1]},fill:e.backgroundColor,stroke:{color:e.borderLineColor,width:l(e.borderLineSize)}}]),o.masking?.unshift([]))}function O(e,t){return e>t?"dark":"light"}function T(e,t){const a="number"==typeof t?.size?t?.size:null,n=null!=a?l(a):null,o=null!=t?.maxSize?l(t.maxSize):null,r=null!=t?.rotation?t.rotation:"angle"in e?e.angle:null,c=i(e);let h=s(e);"dark"!==P(e,245)||t?.ignoreWhiteSymbols||(h={width:.75,...h,color:"#bdc3c7"});const m={shape:null,fill:c,stroke:h,offset:[0,0]};h?.width&&(h.width=Math.min(h.width,z));const p=h?.width||0;let M=null!=t?.size&&(null==t?.scale||t?.scale),j=0,S=0,F=!1;switch(e.type){case w:{const a=e.style,{width:i,height:s}=E(t),c=i===s&&null!=i?i:null!=n?n:Math.min(l(e.size),o||x);switch(j=c,S=c,a){case"circle":m.shape={type:"circle",cx:0,cy:0,r:.5*c},M||(j+=p,S+=p);break;case"cross":m.shape={type:"path",path:[{command:"M",values:[0,.5*S]},{command:"L",values:[j,.5*S]},{command:"M",values:[.5*j,0]},{command:"L",values:[.5*j,S]}]};break;case"diamond":m.shape={type:"path",path:[{command:"M",values:[0,.5*S]},{command:"L",values:[.5*j,0]},{command:"L",values:[j,.5*S]},{command:"L",values:[.5*j,S]},{command:"Z",values:[]}]},M||(j+=p,S+=p);break;case"square":m.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,0]},{command:"L",values:[j,S]},{command:"L",values:[0,S]},{command:"Z",values:[]}]},M||(j+=p,S+=p),r&&(F=!0);break;case"triangle":m.shape={type:"path",path:[{command:"M",values:[.5*j,0]},{command:"L",values:[j,S]},{command:"L",values:[0,S]},{command:"Z",values:[]}]},M||(j+=p,S+=p),r&&(F=!0);break;case"x":m.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,S]},{command:"M",values:[j,0]},{command:"L",values:[0,S]}]},r&&(F=!0);break;case"path":m.shape={type:"path",path:e.path||""},M||(j+=p,S+=p),r&&(F=!0),M=!0}break}case g:{const{width:e,height:a}=E(t),l=null!=a?a:null!=n?n:p,o=null!=e?e:L;h&&(h.width=l),j=o,S=l;const i=m?.stroke?.cap||"butt",s="round"===i;M=!0,m.stroke&&(m.stroke.cap="butt"===i?"square":i),m.shape={type:"path",path:[{command:"M",values:[s?l/2:0,S/2]},{command:"L",values:[s?j-l/2:j,S/2]}]};break}case d:case y:{const e="object"==typeof t?.symbolConfig&&!!t?.symbolConfig?.isSquareFill,{width:a,height:l}=E(t);j=!e&&a!==l||null==a?null!=n?n:k:a,S=!e&&a!==l||null==l?j:l,M||(j+=p,S+=p),M=!0,m.shape=e?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,0]},{command:"L",values:[j,S]},{command:"L",values:[0,S]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case f:{const a=Math.min(l(e.width),o||x),i=Math.min(l(e.height),o||x),{width:s,height:c}=E(t),u=s===c&&null!=s?s:null!=n?n:Math.max(a,i),h=a/i;j=h<=1?Math.ceil(u*h):u,S=h<=1?u:Math.ceil(u/h),m.shape={type:"image",x:-Math.round(j/2),y:-Math.round(S/2),width:j,height:S,src:e.url||""},r&&(F=!0);break}case v:{const a=e,i=t?.overrideText||a.text||b,s=a.font,{width:r,height:c}=E(t),u=null!=c?c:null!=n?n:Math.min(l(s.size),o||x),h=C(i,{weight:s.weight,size:u,family:s.family}),p=/[\uE600-\uE6FF]/.test(i);j=r??(p?u:h),S=u;let d=.25*U((s?u:0).toString());p&&(d+=5),m.shape={type:"text",text:i,x:a.xoffset||0,y:a.yoffset||d,align:"middle",alignBaseline:a.verticalAlignment,decoration:s&&s.decoration,rotated:a.rotated,kerning:a.kerning},m.font=s&&{size:u,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:m,size:[j,S],renderOptions:{node:t?.node,scale:M,opacity:t?.opacity,rotation:r,useRotationSize:F,effectView:t?.effectView,ariaLabel:t?.ariaLabel}}}async function A(e,t){const{shapeDescriptor:n,size:l,renderOptions:o}=T(e,t);if(!n.shape)throw new a("symbolPreview: renderPreviewHTML2D","symbol not supported.");await Z(e,n),await q(e,n,l,t);const i=[[n]];if("object"==typeof t?.symbolConfig&&t?.symbolConfig?.applyColorModulation){const e=.6*l[0];i.unshift([{...n,offset:[-e,0],fill:h(n.fill,-.3)}]),i.push([{...n,offset:[e,0],fill:h(n.fill,.3)}]),l[0]+=2*e,o.scale=!1}return"text"===e.type&&D(e,n,i,l,o),m(i,l,o)}function P(a,n=M){const l=i(a),o=s(a),r=!l||"type"in l?null:new e(l),c=o?.color?new e(o?.color):null,u=r?O(t(r),n):null,h=c?O(t(c),n):null;return h?u?u===h?u:n>=M?"light":"dark":h:u}export{P as getContrastingBackgroundTheme,T as getRenderSymbolParameters,A as previewSymbol2D};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import i from"../../core/Error.js";import e from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{whenOnce as s}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import m from"../ViewAnimation.js";import{create as c}from"./viewpointUtils.js";let h=class extends o{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,o){if(!t)return void e.getLogger(this).error("#goTo()","target cannot be null or undefined");this.view.animation&&(this.view.animation=null);const i=this._createAnimation();await s((()=>this.view.ready),o);const r={animate:!0,...o},n=c(t,this.view);return i?.update(n),this._gotoTask={},r.animate?this._gotoAnimated(n,r):this._gotoImmediate(n,r)}_gotoImmediate(t,o){const e=this._gotoTask,s=this.view.animation,n=t.then((t=>{if(r(o),e!==this._gotoTask)throw new i("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=s.target=t,s.finish()}));return this._cancellableGoTo(e,s,n)}_gotoAnimated(t,o){const e=this._gotoTask,s=this.view.animation;if(!s)return Promise.resolve();const n=t.then((t=>{if(r(o),e!==this._gotoTask)throw new i("view:goto-interrupted","Goto was interrupted");return s.update(t),this.view.animationManager.animate(s,this.view.viewpoint,o),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(e,s,n)}_createAnimation(){return this.view.animation&&!this.view.animation.done||(this.view.animation=new m),this.view.animation}_cancellableGoTo(t,o,i){const e=()=>t===this._gotoTask;return i.finally((()=>{e()&&(o.done||o.stop(),this.view.animation=null)}))}};t([n({constructOnly:!0})],h.prototype,"view",void 0),h=t([a("esri.views.2d.GoToManager")],h);export{h as GoToManager};
|
package/views/2d/engine/Stage.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{
|
|
5
|
+
import e from"../../../core/Error.js";import{on as t}from"../../../core/events.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{signal as i}from"../../../core/signal.js";import{c as n}from"../../../chunks/mat3f32.js";import a from"../../../symbols/cim/CIMResourceManager.js";import{Container as o}from"./Container.js";import{BufferPool as h}from"./webgl/BufferPool.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{Profiler as c}from"./webgl/Profiler.js";import{Timeline as p}from"../support/Timeline.js";import{resampleHermite as u}from"../../support/screenshotUtils.js";import{createContextForView as m}from"../../webgl/contextUtils.js";import{TextureWrapMode as f,SizedPixelFormat as _,PixelFormat as g,RenderbufferFormat as b,PixelType as w}from"../../webgl/enums.js";import{FramebufferObject as R}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as y}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as x}from"../../webgl/RenderingContext.js";import{TextureDescriptor as P}from"../../webgl/TextureDescriptor.js";import C from"../../webgl/capabilities/isWebGL2Context.js";import{createEmptyImageData as j}from"../../../core/imageUtils.js";const T=2e3;class v extends o{constructor(r,n){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=i(!1),this.stage=this,this._stationary=!0;const{canvas:o=document.createElement("canvas"),alpha:d=!0,stencil:u=!0,contextOptions:f={}}=n;this._canvas=o;const _=m("2d",o,{alpha:d,antialias:!1,depth:!0,stencil:u});this.context=new x(_??null,f),this.resourceManager=new a,this.painter=new l(this.context,this,this.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),r.appendChild(this._debugOutput));const g=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:n.timeline||new p,renderingOptions:n.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return g()}},this._taskHandle=s({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=t(o,"webglcontextlost",(t=>{this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})})),this._bufferPool=new h,o.setAttribute("style","width: 100%; height:100%; display:block;"),r.appendChild(o)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{dvs:n()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._renderChildren(this.children,e);for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,t.drawPhase=d.MAP,this.painter.beforeRenderLayers(r,this.backgroundColor);for(const s of e)s.processRender(t);this.painter.prepareDisplay(t,this.backgroundColor,this.state.padding),this.painter.renderLayers(r),t.drawPhase=d.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const s of e)s.processRender(t);this.painter.renderLayers(r);if(this._isLabelDrawPhaseRequired(e)){t.drawPhase=d.LABEL,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG,this.painter.beforeRenderLayers(r);for(const r of e)r.processRender(t);this.painter.renderLayers(r)}t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._resizeCanvas(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e,t,r){const s=Math.round(this.state.size[0]*e.resolutionScale),i=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,a=this.context,o=this._state.clone();if(null!=r){const e=o.viewpoint;o.viewpoint.rotation=r,o.viewpoint=e}const h={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:o,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},d=C(a.gl),l=new P(s,i);l.wrapMode=f.CLAMP_TO_EDGE,l.internalFormat=d?_.RGBA8:g.RGBA,l.isImmutable=d;const c=new R(a,l,new y(b.DEPTH_STENCIL,s,i)),p=a.getBoundFramebufferObject(),m=a.getViewport();a.bindFramebuffer(c),a.setViewport(0,0,s,i),this._renderChildren(t??this.children,h);const w=this._readbackScreenshot(c,{...e.cropArea,y:i-(e.cropArea.y+e.cropArea.height)});a.bindFramebuffer(p),a.setViewport(m.x,m.y,m.width,m.height),this.requestRender();const x=await w;let j;return 1===e.outputScale?j=x:(j=new ImageData(Math.round(x.width*e.outputScale),Math.round(x.height*e.outputScale)),u(x,j,!0)),c.dispose(),j}async _readbackScreenshot(e,t){const r=j(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,g.RGBA,w.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const t=this._canvas,r=t.style,{state:{size:s},pixelRatio:i}=e,n=s[0],a=s[1],o=Math.round(n*i),h=Math.round(a*i);t.width===o&&t.height===h||(t.width=o,t.height=h),r.width=n+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}_isLabelDrawPhaseRequired(e){let t=!1;for(const r of e){if(!(r instanceof o)){t=t||!1;break}if("hasLabels"in r&&r.hasLabels)return!0;t=t||this._isLabelDrawPhaseRequired(r.children)}return t}}export{T as EXTRA_RENDER_TIME,v as Stage};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Logger.js";import{isPowerOfTwo as s}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as o}from"../../../../core/perspectiveUtils.js";import{watch as n,when as a,initial as m}from"../../../../core/reactiveUtils.js";import{c as h}from"../../../../chunks/mat3f64.js";import{s as l}from"../../../../chunks/vec2.js";import{a as c}from"../../../../chunks/vec2f64.js";import{DisplayObject as p}from"../DisplayObject.js";import{play as u}from"./animatedFormats/utils.js";import{BufferObject as d}from"../../../webgl/BufferObject.js";import{ContextType as f}from"../../../webgl/contextUtils.js";import{TextureWrapMode as w,Usage as g}from"../../../webgl/enums.js";import{Texture as v}from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";import{VertexArrayObject as y}from"../../../webgl/VertexArrayObject.js";const j=h();class _ extends p{constructor(s){super(),this.elementView=s,this.isWrapAround=!1,this.perspectiveTransform=c(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(n((()=>this.elementView.element.opacity),(e=>this.opacity=e),m),n((()=>[this.elementView.coords]),(()=>{this.requestRender()}),m),a((()=>this.elementView.element.loaded),(()=>{const e=this.elementView.element;this.ready(),"video"===e.type&&null!=e.content&&this._handles.push(t(e.content,"play",(()=>this.requestRender())))}),m)),s.element.load().catch((t=>{r.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:s,error:t}))}))}destroy(){this._handles.forEach((e=>e.remove())),this.texture=i(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,i=r instanceof HTMLVideoElement,o=e?r.naturalWidth:i?r.videoWidth:r.width,n=e?r.naturalHeight:i?r.videoHeight:r.height;if(this._updatePerspectiveTransform(o,n),this.texture)i&&!r.paused&&(this.texture.setData(r),this.requestRender(),(t.type===f.WEBGL2||s(o)&&s(n))&&this.texture.generateMipmap());else{const e=new x;if(e.wrapMode=w.CLAMP_TO_EDGE,e.preMultiplyAlpha=!0,e.width=o,e.height=n,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new v(t,e,r),this.requestRender()};"
|
|
5
|
+
import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Logger.js";import{isPowerOfTwo as s}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as o}from"../../../../core/perspectiveUtils.js";import{watch as n,when as a,initial as m}from"../../../../core/reactiveUtils.js";import{c as h}from"../../../../chunks/mat3f64.js";import{s as l}from"../../../../chunks/vec2.js";import{a as c}from"../../../../chunks/vec2f64.js";import{DisplayObject as p}from"../DisplayObject.js";import{play as u}from"./animatedFormats/utils.js";import{BufferObject as d}from"../../../webgl/BufferObject.js";import{ContextType as f}from"../../../webgl/contextUtils.js";import{TextureWrapMode as w,Usage as g}from"../../../webgl/enums.js";import{Texture as v}from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";import{VertexArrayObject as y}from"../../../webgl/VertexArrayObject.js";const j=h();class _ extends p{constructor(s){super(),this.elementView=s,this.isWrapAround=!1,this.perspectiveTransform=c(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(n((()=>this.elementView.element.opacity),(e=>this.opacity=e),m),n((()=>[this.elementView.coords]),(()=>{this.requestRender()}),m),a((()=>this.elementView.element.loaded),(()=>{const e=this.elementView.element;this.ready(),"video"===e.type&&null!=e.content&&this._handles.push(t(e.content,"play",(()=>this.requestRender())))}),m)),s.element.load().catch((t=>{r.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:s,error:t}))}))}destroy(){this._handles.forEach((e=>e.remove())),this.texture=i(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,i=r instanceof HTMLVideoElement,o=e?r.naturalWidth:i?r.videoWidth:r.width,n=e?r.naturalHeight:i?r.videoHeight:r.height;if(this._updatePerspectiveTransform(o,n),this.texture)i&&!r.paused&&(this.texture.setData(r),this.requestRender(),(t.type===f.WEBGL2||s(o)&&s(n))&&this.texture.generateMipmap());else{const e=new x;if(e.wrapMode=w.CLAMP_TO_EDGE,e.preMultiplyAlpha=!0,e.width=o,e.height=n,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new v(t,e,r),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.push(u(r,this.elementView.element.animationOptions||{},null,s))}else this.texture=new v(t,e,r);(t.type===f.WEBGL2||s(o)&&s(n))&&this.texture.generateMipmap(),i&&!r.paused&&this.requestRender()}}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(null==r)return;const[s,i,o,n]=r.rings[0],a=this._vertices,{x:m,y:h}=e,l=0!==t;l?a.set([i[0]-m,i[1]-h,s[0]-m,s[1]-h,o[0]-m,o[1]-h,n[0]-m,n[1]-h,n[0]-m,n[1]-h,i[0]+t-m,i[1]-h,i[0]+t-m,i[1]-h,s[0]+t-m,s[1]-h,o[0]+t-m,o[1]-h,n[0]+t-m,n[1]-h]):a.set([i[0]-m,i[1]-h,s[0]-m,s[1]-h,o[0]-m,o[1]-h,n[0]-m,n[1]-h]),this.isWrapAround=l}getVAO(e,t,r){if(null==this.elementView.coords)return null;const s=this._vertices;if(this._vao)this._geometryVbo.setData(s);else{this._geometryVbo=d.createVertex(e,g.DYNAMIC_DRAW,s);const i=d.createVertex(e,g.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new y(e,r,t,{geometry:this._geometryVbo,tex:i})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;o(j,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),l(this.perspectiveTransform,j[6]/j[8]*e,j[7]/j[8]*t)}}export{_ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{makeHandle as t}from"../../../../../core/handleUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import{imageTypeToCanvas as r}from"../../../../../geometry/support/meshUtils/exporters/gltf/imageutils.js";import{AnimatedSymbolRepeatType as i}from"../../../../../symbols/cim/enums.js";import{getMaterialGroup as a,getRandomValue as n}from"../grouping.js";function
|
|
5
|
+
import{makeHandle as t}from"../../../../../core/handleUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import{imageTypeToCanvas as r}from"../../../../../geometry/support/meshUtils/exporters/gltf/imageutils.js";import{AnimatedSymbolRepeatType as i}from"../../../../../symbols/cim/enums.js";import{getMaterialGroup as a,getRandomValue as n}from"../grouping.js";function o(t){return e(t.frameDurations.reduce(((t,e)=>t+e),0))}function s(t){const{width:e,height:r}=t,i=t.frameDurations.reverse(),a=e=>{const r=t.frameDurations.length-1-e;return t.getFrame(r)};return{frameCount:t.frameCount,duration:t.duration,frameDurations:i,getFrame:a,width:e,height:r}}function m(t,r){const{width:i,height:a,getFrame:n}=t,o=r/t.duration,s=t.frameDurations.map((t=>e(t*o)));return{frameCount:t.frameCount,duration:t.duration,frameDurations:s,getFrame:n,width:i,height:a}}function u(t,r){const{width:i,height:a,getFrame:n}=t,o=t.frameDurations.slice(),s=o.shift();return o.unshift(e(s+r)),{frameCount:t.frameCount,duration:t.duration+r,frameDurations:o,getFrame:n,width:i,height:a}}function h(t,r){const{width:i,height:a,getFrame:n}=t,o=t.frameDurations.slice(),s=o.pop();return o.push(e(s+r)),{frameCount:t.frameCount,duration:t.duration+r,frameDurations:o,getFrame:n,width:i,height:a}}class c{constructor(t,e,r,i){this._animation=t,this._repeatType=r,this._onFrameData=i,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let a=0;for(;e>a;)a+=this.timeToFrame,this.nextFrame();const n=this._animation.getFrame(this._currentFrame);this._onFrameData(n)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case i.None:this._currentFrame-=this._direction;break;case i.Loop:this._currentFrame=0;break;case i.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(-1===this._currentFrame)switch(this._repeatType){case i.None:this._currentFrame-=this._direction;break;case i.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case i.Oscillate:this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const t=this._animation.getFrame(this._currentFrame);this._onFrameData(t)}}function f(t,r,f,l){let d,{repeatType:g}=r;if(null==g&&(g=i.Loop),!0===r.reverseAnimation&&(t=s(t)),null!=r.duration&&(t=m(t,e(1e3*r.duration))),null!=r.repeatDelay){const a=1e3*r.repeatDelay;g===i.Loop?t=h(t,e(a)):g===i.Oscillate&&(t=u(h(t,e(a/2)),e(a/2)))}if(null!=r.startTimeOffset)d=e(1e3*r.startTimeOffset);else if(null!=r.randomizeStartTime){const i=a(f),s=82749913,m=null!=r.randomizeStartSeed?r.randomizeStartSeed:s,u=n(i,m);d=e(u*o(t))}else d=e(0);return new c(t,d,g,l)}function l(e,r,i,a){const n=null==r.playAnimation||r.playAnimation,o=f(e,r,i,a);let s,m=o.timeToFrame;function u(){s=n?setTimeout((()=>{o.nextFrame(),m=o.timeToFrame,u()}),m):void 0}return u(),t((()=>n&&clearTimeout(s)))}const d=document.createElement("canvas"),g=d.getContext("2d");function F(t,e,i){d.width=e,d.height=i;const a=[],n=t.frameDurations.length;for(let o=0;o<n;o++){const n=t.getFrame(o);g.clearRect(0,0,e,i),n instanceof ImageData?g.drawImage(r(n),0,0,e,i):g.drawImage(n,0,0,e,i),a.push(g.getImageData(0,0,e,i))}return{width:e,height:i,frameDurations:t.frameDurations,getFrame:t=>a[t],frameCount:t.frameCount,duration:t.duration}}export{c as Player,m as adjustDuration,h as appendDelay,f as createPlayer,o as getDuration,l as play,u as prependDelay,F as resize,s as reverse};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as o}from"../../../../core/analysisThemeUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{project as c,initializeProjection as h}from"../../../../geometry/projection.js";import{isValid as l}from"../../../../geometry/support/spatialReferenceUtils.js";import p from"../../../../layers/GraphicsLayer.js";import{applyCIMSymbolColor as d}from"../../../../symbols/support/cimSymbolUtils.js";import{ViewingMode as m}from"../../../ViewingMode.js";import{DragManipulation as y}from"./manipulations/DragManipulation.js";import{primaryKey as _}from"../../../input/keys.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as f}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as u}from"../../../interactive/editGeometry/interfaces.js";import P from"../../../../symbols/CIMSymbol.js";const v={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:_},S=1,k=10,b=new e("#009AF2");let G=class extends g{constructor(t){super(t),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new p({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0}initialize(){this._initialize()}destroy(){const{map:t}=this.view;this._controlPointManipulations.forEach((t=>t.destroy())),this._controlPointEditGeometryOperations.forEach((t=>t.destroy())),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=r(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return l(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const t=this._undoStack[this._undoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canUndo}canRedo(){const t=this._redoStack[this._redoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canRedo}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();this._controlPointEditGeometryOperations[t].undo(),this.updateGraphics(),this._redoStack.push(t)}}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();this._controlPointEditGeometryOperations[t].redo(),this.updateGraphics(),this._undoStack.push(t)}}refresh(){const{mediaElement:t}=this;if(null==t.georeference)return;const e=t.georeference;"control-points"===e.type&&null!=e.coords&&(this._georeference=e,this._georeference.controlPoints.forEach((({mapPoint:t},e)=>{const i=this._controlPointEditGeometryOperations[e],o=i.data.components[0].vertices[0];i.setVertexPosition(o,i.data.coordinateHelper.pointToVector(t))})),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._georeference,e=t.controlPoints,i=e[0].mapPoint.spatialReference,o=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map(((r,s)=>{const n=r.data.geometry;return this._controlPointGraphics[s].geometry=n,{mapPoint:c(n,i),sourcePoint:o?e[s].sourcePoint:t.toSource(n)}}))}updateActiveHandle(t){if(this.activeHandle===t)return;const e=this._controlPointGraphics[this.activeHandle].symbol.clone();d(e,o()),this._controlPointGraphics[this.activeHandle].symbol=e;const i=this._controlPointGraphics[t].symbol.clone();d(i,b),this._controlPointGraphics[t].symbol=i,this.activeHandle=t,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const t=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=t.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}async _initialize(){const{view:t,mediaElement:e}=this;if(null==e.georeference)return;const r=e.georeference;"control-points"===r.type&&null!=r.coords&&(this._georeference=r,this._initialControlPoints=this._georeference.controlPoints,t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map((({mapPoint:e})=>f.fromGeometry(c(e,t.spatialReference),m.Local))),this._controlPointGraphics=this._controlPointEditGeometryOperations.map(((t,e)=>new i({symbol:new P({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e===this.activeHandle?b.toArray():o().toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:t.data.geometry}))),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map((e=>new y({tool:this,view:t,graphic:e}))),this.addHandles([...this._controlPointManipulations.map(((t,e)=>t.createDragPipeline(this._getInfo.bind(this,e),((t,i)=>{"start"===t.action&&(this._undoStack.push(e),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0),this.updateGraphics()})))),s((()=>this.view.scale),(()=>this.active?this.updateGraphics():null))]),this._controlPointManipulations.forEach(((t,e)=>{const i=t=>{this.addHandles([t.events.on(["click","grab-changed"],(t=>this.updateActiveHandle(e)))])};t.forEachManipulator(i)})),this.addHandles([t.on("key-down",(i=>{t.activeTool===this&&(i.key!==v.shift||i.repeat||(this._isModifierActive=!0,i.stopPropagation()),i.key!==v.toggleOpacity||i.repeat||(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,i.stopPropagation()),i.key!==v.primaryKey||i.repeat||(this._factor=k,i.stopPropagation()),this._isModifierActive&&(i.key===v.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===v.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===v.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===v.right&&(this._move(this._factor,0),i.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===v.shift&&(this._isModifierActive=!1,e.stopPropagation()),e.key===v.primaryKey&&(this._factor=S,e.stopPropagation()))}))]))}async _loadProjectionEngine(){const t=this._georeference.controlPoints[0].mapPoint;return h(t.spatialReference,this.view.spatialReference)}_getInfo(t){return{editGeometryOperations:this._controlPointEditGeometryOperations[t],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(t,e){const i=this._controlPointEditGeometryOperations[this.activeHandle],o=[];for(const s of i.data.components)o.push(...s.vertices);const r=i.moveVertices(o,t*this.view.resolution,e*this.view.resolution,0,u.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([n()],G.prototype,"_hasValidSpatialReference",null),t([n()],G.prototype,"activeHandle",void 0),t([n({constructOnly:!0,nonNullable:!0})],G.prototype,"mediaElement",void 0),t([n({constructOnly:!0})],G.prototype,"view",void 0),G=t([a("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],G);export{G as ControlPointsTransformTool,v as KEYS};
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../Graphic.js";import"../../../../symbols.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{project as a,initializeProjection as c}from"../../../../geometry/projection.js";import{isValid as h}from"../../../../geometry/support/spatialReferenceUtils.js";import l from"../../../../layers/GraphicsLayer.js";import{applyCIMSymbolColor as p}from"../../../../symbols/support/cimSymbolUtils.js";import{ViewingMode as d}from"../../../ViewingMode.js";import{DragManipulation as m}from"./manipulations/DragManipulation.js";import{primaryKey as y}from"../../../input/keys.js";import{InteractiveToolBase as _}from"../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as g}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as f}from"../../../interactive/editGeometry/interfaces.js";import u from"../../../../symbols/CIMSymbol.js";const P={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:y},v=1,S=10,k=new e("#009AF2");let b=class extends _{constructor(t){super(t),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new l({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0}initialize(){this._initialize()}destroy(){const{map:t}=this.view;this._controlPointManipulations.forEach((t=>t.destroy())),this._controlPointEditGeometryOperations.forEach((t=>t.destroy())),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=o(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return h(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const t=this._undoStack[this._undoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canUndo}canRedo(){const t=this._redoStack[this._redoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canRedo}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();this._controlPointEditGeometryOperations[t].undo(),this.updateGraphics(),this._redoStack.push(t)}}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();this._controlPointEditGeometryOperations[t].redo(),this.updateGraphics(),this._undoStack.push(t)}}refresh(){const{mediaElement:t}=this;if(null==t.georeference)return;const e=t.georeference;"control-points"===e.type&&null!=e.coords&&(this._georeference=e,this._georeference.controlPoints.forEach((({mapPoint:t},e)=>{const i=this._controlPointEditGeometryOperations[e],o=i.data.components[0].vertices[0];i.setVertexPosition(o,i.data.coordinateHelper.pointToVector(t))})),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._georeference,e=t.controlPoints,i=e[0].mapPoint.spatialReference,o=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map(((r,s)=>{const n=r.data.geometry;return this._controlPointGraphics[s].geometry=n,{mapPoint:a(n,i),sourcePoint:o?e[s].sourcePoint:t.toSource(n)}}))}updateActiveHandle(t){if(this.activeHandle===t)return;const e=this._controlPointGraphics[this.activeHandle].symbol.clone();p(e,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=e;const i=this._controlPointGraphics[t].symbol.clone();p(i,k),this._controlPointGraphics[t].symbol=i,this.activeHandle=t,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const t=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=t.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}async _initialize(){const{view:t,mediaElement:e}=this;if(null==e.georeference)return;const o=e.georeference;"control-points"===o.type&&null!=o.coords&&(this._georeference=o,this._initialControlPoints=this._georeference.controlPoints,t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map((({mapPoint:e})=>g.fromGeometry(a(e,t.spatialReference),d.Local))),this._controlPointGraphics=this._controlPointEditGeometryOperations.map(((t,e)=>new i({symbol:new u({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e===this.activeHandle?k.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:t.data.geometry}))),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map((e=>new m({tool:this,view:t,graphic:e}))),this.addHandles([...this._controlPointManipulations.map(((t,e)=>t.createDragPipeline(this._getInfo.bind(this,e),((t,i)=>{"start"===t.action&&(this._undoStack.push(e),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0),this.updateGraphics()})))),r((()=>this.view.scale),(()=>this.active?this.updateGraphics():null))]),this._controlPointManipulations.forEach(((t,e)=>{const i=t=>{this.addHandles([t.events.on(["click","grab-changed"],(t=>this.updateActiveHandle(e)))])};t.forEachManipulator(i)})),this.addHandles([t.on("key-down",(i=>{t.activeTool===this&&(i.key!==P.shift||i.repeat||(this._isModifierActive=!0,i.stopPropagation()),i.key!==P.toggleOpacity||i.repeat||(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,i.stopPropagation()),i.key!==P.primaryKey||i.repeat||(this._factor=S,i.stopPropagation()),this._isModifierActive&&(i.key===P.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===P.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===P.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===P.right&&(this._move(this._factor,0),i.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===P.shift&&(this._isModifierActive=!1,e.stopPropagation()),e.key===P.primaryKey&&(this._factor=v,e.stopPropagation()))}))]))}async _loadProjectionEngine(){const t=this._georeference.controlPoints[0].mapPoint;return c(t.spatialReference,this.view.spatialReference)}_getInfo(t){return{editGeometryOperations:this._controlPointEditGeometryOperations[t],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(t,e){const i=this._controlPointEditGeometryOperations[this.activeHandle],o=[];for(const s of i.data.components)o.push(...s.vertices);const r=i.moveVertices(o,t*this.view.resolution,e*this.view.resolution,0,f.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([s()],b.prototype,"_hasValidSpatialReference",null),t([s()],b.prototype,"activeHandle",void 0),t([s({constructOnly:!0,nonNullable:!0})],b.prototype,"mediaElement",void 0),t([s({constructOnly:!0})],b.prototype,"view",void 0),b=t([n("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],b);export{b as ControlPointsTransformTool,P as KEYS};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i,getContrastColor as s}from"../../../../core/analysisThemeUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as a}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c,e as p}from"../../../../chunks/vec2.js";import{a as l,U as _}from"../../../../chunks/vec2f64.js";import{g as m,l as d,n as y,a as u,h as g,b as f}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{project as G,initializeProjection as w}from"../../../../geometry/projection.js";import{a as R,c as b}from"../../../../chunks/boundedPlane.js";import{equals as k}from"../../../../geometry/support/spatialReferenceUtils.js";import j from"../../../../layers/GraphicsLayer.js";import{ViewingMode as P}from"../../../ViewingMode.js";import{DragManipulation as A}from"./manipulations/DragManipulation.js";import{RotateManipulation as C}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as S}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as M,SnapRotation as T}from"./manipulations/utils.js";import{primaryKey as O}from"../../../input/keys.js";import{InteractiveToolBase as U}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as D}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as x}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as E}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as L}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as B}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as H}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as V}from"../../../support/screenUtils.js";import I from"../../../../geometry/Polygon.js";import z from"../../../../geometry/Point.js";import K from"../../../../symbols/SimpleFillSymbol.js";import N from"../../../../symbols/SimpleMarkerSymbol.js";const W={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:O},q=80,F=10,J=30,Q=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],X=1,Y=10;let Z=class extends U{constructor(t){super(t),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=R(),this._displayPlaneCache=R(),this._mainAxisCache=l(),this._rotationHandleCache=v(),this._cornerA=v(),this._cornerB=v(),this._cornerC=v(),this._cornerD=v(),this._avgAB=v(),this._avgBC=v(),this._avgCD=v(),this._avgDA=v(),this._preserveAspectRatio=new M,this._snapRotation=new T,this._graphicsLayer=new j({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:t}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((t=>t.destroy())),this._editGeometryOperations.destroy(),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=o(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const t=this._graphic.geometry;if(null==t)return null;const e=this._editGeometryOperations.data,i=e.components[0].edges[0],s=c(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);p(s,s);let o=q*this.view.resolution;const r=this.view.spatialReference;return k(r,t.spatialReference)&&(o*=a(r)/a(t.spatialReference)),B(s,e,o,this._planeCache)}get _displayPlane(){const t=this._plane;if(!t)return null;const e=this._displayPlaneCache;b(t,e);const i=F*this.view.resolution;return m(e.basis1,e.basis1,1+i/d(e.basis1)),m(e.basis2,e.basis2,1+i/d(e.basis2)),e}get _backgroundGraphicGeometry(){const t=this._displayPlane;if(!t)return null;const e=this.view.spatialReference;return this._updateDisplayPlaneConrers(t),new I({spatialReference:e,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const t=this._plane;if(!t)return null;const e=this._rotationHandleCache;return y(e,t.basis1),m(e,e,J*this.view.resolution),u(e,e,t.origin),u(e,e,t.basis1),new z({x:e[0],y:e[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const t=this._displayPlane;if(!t)return[];const e=this.view.spatialReference;this._updateDisplayPlaneConrers(t);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=g(this._avgAB,i,s,.5),n=g(this._avgBC,s,o,.5),h=g(this._avgCD,o,r,.5),c=g(this._avgDA,r,i,.5);return[new z({x:i[0],y:i[1],spatialReference:e}),new z({x:s[0],y:s[1],spatialReference:e}),new z({x:o[0],y:o[1],spatialReference:e}),new z({x:r[0],y:r[1],spatialReference:e}),new z({x:a[0],y:a[1],spatialReference:e}),new z({x:n[0],y:n[1],spatialReference:e}),new z({x:h[0],y:h[1],spatialReference:e}),new z({x:c[0],y:c[1],spatialReference:e})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:t,target:e}=this,i="georeference"in e?e.georeference.coords:e.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=D.fromGeometry(G(i,t.spatialReference),P.Local).components[0].vertices;o.forEach(((t,e)=>{s.setVertexPosition(t,r[e].pos)})),this.updateGraphics()}reset(){const{target:t}=this;if("georeference"in t){const e=t.georeference;"control-points"===e.type&&(e.controlPoints=this._initialControlPoints)}else t.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=t}this._graphic.geometry=t,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((t,e)=>{this._scaleGraphics[e].geometry=t}))}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}async _initialize(){const{view:t,target:o}=this;if("georeference"in o){const t=o.georeference;this._graphic=new e({geometry:t.coords}),this._initialControlPoints="control-points"===t.type?t.controlPoints:null}else this._graphic=o,this._initialGeometry=o.geometry;t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=x.fromGeometry(G(this._graphic.geometry,t.spatialReference),P.Local),this._backgroundGraphic=new e({symbol:new K({color:"transparent",outline:{type:"simple-line",color:i(),width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new e({symbol:new N({color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((t=>new e({symbol:new N({size:6,style:"square",color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:t}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new A({tool:this,view:t,graphic:this._graphic}),this._rotateManipulation=new C({tool:this,view:t,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((e,i)=>new S({tool:this,view:t,graphic:e,direction:Q[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((t=>t.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),r((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),t.on("click",(async e=>{if(null!=t.activeTool&&t.activeTool!==this)return;const i=V(e),s=[];t.map.allLayers.forEach((t=>{"vector-tile"!==t.type&&"imagery"!==t.type||s.push(t)}));const r=await this.view.hitTest(i,{exclude:s}),a=r.results;if(0===a.length)t.activeTool=null;else{const e=H(r.results),i="georeference"in o,s=a.map((t=>"media"===t.type?t.element:null)).filter(Boolean),n=[...this._graphicsLayer.graphics,i?null:o].filter(Boolean);i&&s.includes(o)||null!=e&&n.includes(e.graphic)?null==t.activeTool&&(t.activeTool=this):t.activeTool=null}}))]);const a=t=>{this.addHandles(t.events.on("grab-changed",(t=>{"georeference"in o&&("start"===t.action?o.opacity*=.5:"end"===t.action&&(o.opacity*=2))})))};this._dragManipulation.forEachManipulator(a),this._rotateManipulation.forEachManipulator(a),this._scaleManipulations.forEach((t=>t.forEachManipulator(a))),this.addHandles([t.on("key-down",(e=>{t.activeTool===this&&(e.key!==W.shift||e.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,e.stopPropagation()),e.key!==W.toggleOpacity||e.repeat||("georeference"in o&&(o.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),e.stopPropagation()),e.key!==W.primaryKey||e.repeat||(this._factor=Y,e.stopPropagation()),this._isModifierActive&&(e.key===W.plus&&(this._scale(this._factor),e.stopPropagation()),e.key===W.minus&&(this._scale(-this._factor),e.stopPropagation()),e.key===W.up&&(this._move(0,this._factor),e.stopPropagation()),e.key===W.down&&(this._move(0,-this._factor),e.stopPropagation()),e.key===W.left&&(this._move(-this._factor,0),e.stopPropagation()),e.key===W.right&&(this._move(this._factor,0),e.stopPropagation())))})),t.on("key-up",(e=>{t.activeTool===this&&(e.key===W.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,e.stopPropagation()),e.key===W.primaryKey&&(this._factor=X,e.stopPropagation()))}))])}async _loadProjectionEngine(){const t=this._graphic.geometry;return w(t.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(t){const{basis1:e,basis2:i,origin:s}=t,o=this._cornerA;u(o,s,e),u(o,o,i);const r=this._cornerB;u(r,s,e),f(r,r,i);const a=this._cornerC;f(a,s,e),f(a,a,i);const n=this._cornerD;f(n,s,e),u(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(t,e){"start"===t.action&&(this._sharedUndoStack.push({tool:this,operation:e}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(t){const e=this._editGeometryOperations,i=[];for(const a of e.data.components)i.push(...a.vertices);const s=e.data.geometry.extent?.width,o=(s+t*this.view.resolution)/s,r=e.scaleVertices(i,this._plane.origin,_,o,o,E.NEW_STEP,L.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(t,e){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,t*this.view.resolution,e*this.view.resolution,0,E.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([n()],Z.prototype,"_plane",null),t([n()],Z.prototype,"_backgroundGraphicGeometry",null),t([n()],Z.prototype,"_rotateGraphicGeometry",null),t([n()],Z.prototype,"_scaleGraphicGeometries",null),t([n()],Z.prototype,"preserveAspectRatio",void 0),t([n()],Z.prototype,"snapRotation",void 0),t([n({constructOnly:!0,nonNullable:!0})],Z.prototype,"target",void 0),t([n({constructOnly:!0})],Z.prototype,"view",void 0),Z=t([h("esri.views.2d.interactive.editingTools.TransformTool")],Z);export{W as KEYS,Z as TransformTool};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as h,e as c}from"../../../../chunks/vec2.js";import{a as p,U as l}from"../../../../chunks/vec2f64.js";import{g as _,l as m,n as d,a as y,h as u,b as g}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import k from"../../../../layers/GraphicsLayer.js";import{ViewingMode as j}from"../../../ViewingMode.js";import{DragManipulation as P}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as C}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as M}from"./manipulations/utils.js";import{primaryKey as T}from"../../../input/keys.js";import{InteractiveToolBase as O}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as U}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as D}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as x}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as E}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as L}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as B}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import V from"../../../../geometry/Polygon.js";import I from"../../../../geometry/Point.js";import z from"../../../../symbols/SimpleFillSymbol.js";import K from"../../../../symbols/SimpleMarkerSymbol.js";const N={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:T},W=80,q=10,F=30,J=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Q=1,X=10;let Y=class extends O{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=p(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new S,this._snapRotation=new M,this._graphicsLayer=new k({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=W*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),L(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=q*this.view.resolution;return _(t.basis1,t.basis1,1+i/m(t.basis1)),_(t.basis2,t.basis2,1+i/m(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new V({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return d(t,e.basis1),_(t,t,F*this.view.resolution),y(t,t,e.origin),y(t,t,e.basis1),new I({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),h=u(this._avgCD,o,r,.5),c=u(this._avgDA,r,i,.5);return[new I({x:i[0],y:i[1],spatialReference:t}),new I({x:s[0],y:s[1],spatialReference:t}),new I({x:o[0],y:o[1],spatialReference:t}),new I({x:r[0],y:r[1],spatialReference:t}),new I({x:a[0],y:a[1],spatialReference:t}),new I({x:n[0],y:n[1],spatialReference:t}),new I({x:h[0],y:h[1],spatialReference:t}),new I({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=U.fromGeometry(v(i,e.spatialReference),j.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=D.fromGeometry(v(this._graphic.geometry,e.spatialReference),j.Local),this._backgroundGraphic=new t({symbol:new z({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new K({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new K({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new P({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new C({tool:this,view:e,graphic:t,direction:J[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=H(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=B(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=[...this._graphicsLayer.graphics,i?null:s].filter(Boolean);i&&o.includes(s)||null!=t&&n.includes(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&(t.key!==N.shift||t.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,t.stopPropagation()),t.key!==N.toggleOpacity||t.repeat||("georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),t.stopPropagation()),t.key!==N.primaryKey||t.repeat||(this._factor=X,t.stopPropagation()),this._isModifierActive&&(t.key===N.plus&&(this._scale(this._factor),t.stopPropagation()),t.key===N.minus&&(this._scale(-this._factor),t.stopPropagation()),t.key===N.up&&(this._move(0,this._factor),t.stopPropagation()),t.key===N.down&&(this._move(0,-this._factor),t.stopPropagation()),t.key===N.left&&(this._move(-this._factor,0),t.stopPropagation()),t.key===N.right&&(this._move(this._factor,0),t.stopPropagation())))})),e.on("key-up",(t=>{e.activeTool===this&&(t.key===N.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,t.stopPropagation()),t.key===N.primaryKey&&(this._factor=Q,t.stopPropagation()))}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;y(o,s,t),y(o,o,i);const r=this._cornerB;y(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),y(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=[];for(const a of t.data.components)i.push(...a.vertices);const s=t.data.geometry.extent?.width,o=(s+e*this.view.resolution)/s,r=t.scaleVertices(i,this._plane.origin,l,o,o,x.NEW_STEP,E.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,e*this.view.resolution,t*this.view.resolution,0,x.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Y.prototype,"_plane",null),e([a()],Y.prototype,"_backgroundGraphicGeometry",null),e([a()],Y.prototype,"_rotateGraphicGeometry",null),e([a()],Y.prototype,"_scaleGraphicGeometries",null),e([a()],Y.prototype,"preserveAspectRatio",void 0),e([a()],Y.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Y.prototype,"target",void 0),e([a({constructOnly:!0})],Y.prototype,"view",void 0),Y=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Y);export{N as KEYS,Y as TransformTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import"../tiling/PagedTileQueue.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{THIN_LINE_HALF_WIDTH_THRESHOLD as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import x from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],T=[];class w{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new p(e):null}get context(){return this.view.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import"../tiling/PagedTileQueue.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{THIN_LINE_HALF_WIDTH_THRESHOLD as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import x from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],T=[];class w{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new p(e):null}get context(){return this.view.stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||a(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),o=r?.spans,i=r?.lodInfo;if(o?.length&&i){const e=i.level;for(const{row:t,colFrom:r,colTo:n}of o)for(let o=r;o<=n;o++){const r=i.normalizeCol(o),n=i.getWorldForColumn(o),a=`${e}/${t}/${r}/${n}`;if(!this._tileMap.has(a)){const o=new w(a,e,t,r,n,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(a,o),s.push(o),v.push(o)}g.add(a)}}}for(let r=s.length-1;r>=0;r--){const e=s[r];g.has(e.id)||(s.splice(r,1),T.push(e),this._tileMap.delete(e.id))}(v.length||T.length)&&(this.tilesChanged(v,T),v.length=T.length=0),g.clear(),this.requestRender()}moveStart(){}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map((e=>({x:e[0],y:e[1],spatialReference:s.spatialReference})));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r||!r.length)return s;let o;const i=new h(((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u}),((e,t,r)=>{s.indices.push(e,t,r)}),!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map((e=>({x:e[0],y:-e[1]})));i.tessellate(e,_)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r||!r.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return m(s.rings,(()=>{}),((e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])})),m(s.rings,(()=>{}),((e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])})),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await c(e.spatialReference,this.view.spatialReference);const t=n(e);return l(t,e.spatialReference,this.view.spatialReference)}};e([t()],j.prototype,"_tileInfoView",null),e([t()],j.prototype,"layer",void 0),e([t()],j.prototype,"context",null),j=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],j);const _={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:f+1,initialDistance:0,textured:!0,offset:0},O=j;export{O as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import t from"../../../core/Logger.js";import"../../../symbols.js";import r from"../../../core/Collection.js";import"../../../core/has.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../config.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../chunks/index.js";import"../../../chunks/index2.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import t from"../../../core/Logger.js";import"../../../symbols.js";import r from"../../../core/Collection.js";import"../../../core/has.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../core/accessorSupport/tracking/Flags.js";import"../../../config.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../chunks/index.js";import"../../../chunks/index2.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import h from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import g from"../engine/webgl/Overlay.js";import d from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import j from"../../layers/LayerView.js";import y from"../../../geometry/Extent.js";let w=class extends(f(j)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new r}attach(){this.addAttachHandles([n((()=>this.layer.effectiveSource),"refresh",(()=>{this._tileStrategy.refresh((e=>this._updateTile(e))),this.requestUpdate()})),n((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new d,this.container.addChild(this._overlayContainer),this._fetchQueue=new h({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new u({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],i=e.normalize(),s=[i.x,i.y];for(const{projectedElement:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&m(n.rings,s)&&r.push({type:"media",element:o,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh((e=>this._updateTile(e)))}_acquireTile(e){const t=new T(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,i]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,i),this.requestUpdate()}),(e=>{s(e)||t.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(null==r)return[];this.view.featuresTilingScheme.getTileBounds(b,e,!0);const i=new y({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:this.view.spatialReference});return r.queryElements(i,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){i(this._elementReferences,t.uid,(()=>{const e=new c({element:t,spatialReference:this.view.spatialReference}),r=new g(e);this._overlayContainer.addChild(r),this.elements.add(t);let i=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:i}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(null==r)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const i=[],s=[];for(const e of this._tileStrategy.tiles){const n=v(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||s.push(e):n&&i.push(e)}for(const t of i)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new c({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=r)for(const i of this._tileStrategy.tiles){v(this.view.featuresTilingScheme,i,r)&&this._referenceElement(i,e)}}};e([o()],w.prototype,"_fetchQueue",void 0),e([o()],w.prototype,"layer",void 0),e([o({readOnly:!0})],w.prototype,"elements",void 0),w=e([l("esri.views.2d.layers.MediaLayerView2D")],w);const b=a(),_={xmin:0,ymin:0,xmax:0,ymax:0};function v(e,t,r){return e.getTileBounds(b,t.key,!0),_.xmin=b[0],_.ymin=b[1],_.xmax=b[2],_.ymax=b[3],p(_,r)}class T{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const i of e)r.has(i)?r.delete(i):t.push(i);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const R=w;export{R as default};
|