@arcgis/core 6.0.0-next.48 → 6.0.0-next.49

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.
Files changed (228) hide show
  1. package/Ground.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.d.ts +12 -10
  3. package/analysis/AreaMeasurementAnalysis.js +1 -1
  4. package/applications/Components/formatUtils.d.ts +3 -2
  5. package/applications/MapViewer/templateUtils.d.ts +4 -1
  6. package/applications/SceneViewer/sceneViewerUtils.d.ts +12 -1
  7. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  8. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  9. package/arcade/functions/featuresetgeom.js +1 -1
  10. package/arcade/functions/geomasync.js +1 -1
  11. package/arcade/geometry/operatorsWorker.js +1 -1
  12. package/arcade/geometry/operatorsWorkerConnection.js +1 -1
  13. package/arcgisGlobal.d.ts +4 -0
  14. package/assets/esri/core/workers/RemoteClient.js +1 -1
  15. package/assets/esri/core/workers/chunks/063cc462524646cd45e8.js +1 -0
  16. package/assets/esri/core/workers/chunks/119c62e9c9c7440a6129.js +1 -0
  17. package/assets/esri/core/workers/chunks/14c04fde8d33b739b415.js +1 -0
  18. package/assets/esri/core/workers/chunks/27a91b52d1bee92b6f20.js +1 -0
  19. package/assets/esri/core/workers/chunks/31eb09e96f31bced71ad.js +1 -0
  20. package/assets/esri/core/workers/chunks/{056a815273653271bf75.js → 3236e18921955450fc0d.js} +5 -5
  21. package/assets/esri/core/workers/chunks/3ce7120056040af3bab1.js +1 -0
  22. package/assets/esri/core/workers/chunks/435dacf493aec07ff6e3.js +1 -0
  23. package/assets/esri/core/workers/chunks/4c26d6408ee7a3b9d163.js +1 -0
  24. package/assets/esri/core/workers/chunks/{73bf76a3a0418edb26a5.js → 506954fb374ea528d020.js} +1 -1
  25. package/assets/esri/core/workers/chunks/55db28616f810ca063b7.js +1 -0
  26. package/assets/esri/core/workers/chunks/59ae5bd0ee1bae7a9fb3.js +1 -0
  27. package/assets/esri/core/workers/chunks/630a36c4817f33f4cad2.js +1 -0
  28. package/assets/esri/core/workers/chunks/6779afc2d6ee46c301b5.js +1 -0
  29. package/assets/esri/core/workers/chunks/6a509ffb4852d694a097.js +1 -0
  30. package/assets/esri/core/workers/chunks/6d25a7071fceb707858a.js +1 -0
  31. package/assets/esri/core/workers/chunks/7a97eec9823941fd210f.js +29 -0
  32. package/assets/esri/core/workers/chunks/82bbf0c5e18fc1c795f4.js +1 -0
  33. package/assets/esri/core/workers/chunks/91019e9dff63107f8cb4.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1345413ec0b4128849b1.js → 954f9854a9bf4a852b81.js} +1 -1
  35. package/assets/esri/core/workers/chunks/9846abf2d3991a15b2b5.js +1 -0
  36. package/assets/esri/core/workers/chunks/9f74b3f0f453bc957e3a.js +1 -0
  37. package/assets/esri/core/workers/chunks/a0e2a1c6f37454547193.js +1 -0
  38. package/assets/esri/core/workers/chunks/a1c45e8f5bba471b3905.js +1 -0
  39. package/assets/esri/core/workers/chunks/a2825285d46f8cd5d814.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d4f6be8290ad0243e1b8.js → b511b5c68defefccde0b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/bf81b3670b5323621e2d.js +1 -0
  42. package/assets/esri/core/workers/chunks/c4794d692934098988e7.js +1 -0
  43. package/assets/esri/core/workers/chunks/d0900a901197948bd7df.js +1 -0
  44. package/assets/esri/core/workers/chunks/d2ed93bbfa98395bbed7.js +1 -0
  45. package/assets/esri/core/workers/chunks/d486a8a61ff993f8202a.js +1 -0
  46. package/assets/esri/core/workers/chunks/e06036392a982dbf3ae3.js +1 -0
  47. package/assets/esri/core/workers/chunks/{773ba0909ccd3a034c31.js → ed1db6571b0c61fe4f91.js} +1 -1
  48. package/chunks/BlendWeights.glsl.js +4 -5
  49. package/chunks/Blur.glsl.js +10 -7
  50. package/chunks/BlurEmission.glsl.js +27 -7
  51. package/chunks/Clouds.glsl.js +2 -2
  52. package/chunks/Component.glsl.js +1 -1
  53. package/chunks/EdgeDetect.glsl.js +1 -1
  54. package/chunks/EdgeShader.glsl.js +1 -1
  55. package/chunks/EmissionComposite.glsl.js +2 -2
  56. package/chunks/Fog.glsl.js +4 -4
  57. package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
  58. package/chunks/HighlightSharpApply.glsl.js +4 -1
  59. package/chunks/LineMarker.glsl.js +4 -4
  60. package/chunks/Magnifier.glsl.js +1 -1
  61. package/chunks/NoiseTextureAtlas.glsl.js +3 -3
  62. package/chunks/Pattern.glsl.js +35 -32
  63. package/chunks/{ChapmanAtmosphere.glsl.js → RealisticAtmosphere.glsl.js} +18 -9
  64. package/chunks/RealisticAtmosphereCompositing.glsl.js +35 -0
  65. package/chunks/SSAO.glsl.js +2 -2
  66. package/chunks/SimpleAtmosphere.glsl.js +1 -1
  67. package/config.js +1 -1
  68. package/core/accessorSupport/ObservableBase.js +1 -1
  69. package/core/accessorSupport/tracking/ObservationHandle.js +1 -1
  70. package/core/accessorSupport/tracking/SimpleObservable.js +1 -1
  71. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  72. package/core/accessorSupport/tracking/TrackingTarget.js +1 -1
  73. package/core/quantity.js +1 -1
  74. package/core/timeUtils.js +1 -1
  75. package/geometry/coordinateConversion/CoordinateConversionModel.d.ts +258 -0
  76. package/geometry/coordinateConversion/CoordinateConversionModel.js +2 -0
  77. package/geometry/coordinateConversion/support/Conversion.d.ts +73 -0
  78. package/geometry/coordinateConversion/support/Conversion.js +2 -0
  79. package/geometry/coordinateConversion/support/Format.d.ts +131 -0
  80. package/geometry/coordinateConversion/support/Format.js +2 -0
  81. package/geometry/coordinateConversion/support/coordinateConversionUtils.js +2 -0
  82. package/geometry/coordinateConversion/support/formatUtils.js +2 -0
  83. package/geometry/coordinateConversion/types.d.ts +116 -0
  84. package/kernel.js +1 -1
  85. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  86. package/layers/IntegratedMeshLayer.js +1 -1
  87. package/layers/catalog/CatalogFootprintLayer.d.ts +2 -2
  88. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  89. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  90. package/layers/mixins/FeatureLayerBase.d.ts +2 -2
  91. package/layers/raster/formats/Lzw.js +1 -1
  92. package/layers/raster/formats/TiffDecoder.js +1 -1
  93. package/layers/raster/formats/tiffParser.js +1 -1
  94. package/layers/raster/formats/tiffTag.js +1 -1
  95. package/layers/support/IntegratedMeshSemantics.js +2 -0
  96. package/layers/support/VideoElement.js +1 -1
  97. package/legend/ActiveLayerInfo.js +1 -1
  98. package/package.json +2 -2
  99. package/symbols/FillSymbol3DLayer.d.ts +1 -4
  100. package/time/daylightUtils.d.ts +29 -0
  101. package/time/daylightUtils.js +2 -0
  102. package/time/timeZoneUtils.js +1 -1
  103. package/time/types.d.ts +57 -1
  104. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  105. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  106. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  107. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  108. package/views/2d/layers/MediaLayerView2D.js +1 -1
  109. package/views/2d/layers/TileLayerView2D.js +1 -1
  110. package/views/3d/GroundView3D.js +1 -1
  111. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  112. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  113. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  114. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  115. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  116. package/views/3d/interactive/Manipulator3D.js +1 -1
  117. package/views/3d/interactive/Manipulator3DBase.js +2 -0
  118. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  119. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  120. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  121. package/views/3d/layers/I3SMeshView3D.js +1 -1
  122. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  123. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  124. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  125. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  126. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  127. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  128. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  129. package/views/3d/layers/graphics/SymbolComplexity.js +1 -1
  130. package/views/3d/layers/graphics/webStyleUtils.js +1 -1
  131. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  132. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  133. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  134. package/views/3d/layers/support/patternUtils.js +1 -1
  135. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  136. package/views/3d/support/GroundAndIMSurface.js +1 -1
  137. package/views/3d/support/engineContent/line.js +1 -1
  138. package/views/3d/support/hitTest.js +1 -1
  139. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  140. package/views/3d/terrain/OverlayRenderer.js +1 -1
  141. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  142. package/views/3d/terrain/PatchRenderDataWaterproofness.js +1 -1
  143. package/views/3d/terrain/SphericalPatch.js +1 -1
  144. package/views/3d/terrain/TerrainSurface.js +1 -1
  145. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  146. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  147. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +1 -1
  148. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  149. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  150. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  151. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
  152. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -1
  153. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +6 -4
  154. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
  155. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +10 -9
  156. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
  157. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  158. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  159. package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +3 -3
  160. package/views/3d/webgl-engine/effects/atmosphere/{ChapmanAtmosphere.glsl.js → RealisticAtmosphere.glsl.js} +1 -1
  161. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.js +2 -0
  162. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositing.glsl.js +2 -0
  163. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositingTechnique.js +2 -0
  164. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereTechnique.js +2 -0
  165. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  166. package/views/3d/webgl-engine/effects/glow/BlurEmission.glsl.js +1 -1
  167. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +87 -41
  168. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  169. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  170. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  171. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  172. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  173. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  174. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  175. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  176. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  177. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  178. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  179. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  180. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  181. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  182. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/PatternLayouts.js +1 -1
  184. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  185. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  186. package/views/SceneView.js +1 -1
  187. package/views/VideoView.js +1 -1
  188. package/views/interactive/Tooltip.js +1 -1
  189. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  190. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  191. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  192. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +3 -0
  193. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  194. package/widgets/CoordinateConversion.js +1 -1
  195. package/widgets/Sketch/SketchViewModel.js +1 -1
  196. package/assets/esri/core/workers/chunks/022565ef98a702ab952f.js +0 -1
  197. package/assets/esri/core/workers/chunks/163e97987e1f75610009.js +0 -1
  198. package/assets/esri/core/workers/chunks/1d57b1445afec89a7941.js +0 -1
  199. package/assets/esri/core/workers/chunks/3654672d772d11484883.js +0 -1
  200. package/assets/esri/core/workers/chunks/3af0ff5a0b82872aac38.js +0 -1
  201. package/assets/esri/core/workers/chunks/3b9415dfd7546aeec261.js +0 -1
  202. package/assets/esri/core/workers/chunks/5109b48666138df14038.js +0 -1
  203. package/assets/esri/core/workers/chunks/6b73dfc9252b32f1eae2.js +0 -1
  204. package/assets/esri/core/workers/chunks/6e4698879e7d8fbc4d12.js +0 -1
  205. package/assets/esri/core/workers/chunks/71295afd21fc5bc5ddbc.js +0 -1
  206. package/assets/esri/core/workers/chunks/794a9f116c4700bb1210.js +0 -1
  207. package/assets/esri/core/workers/chunks/8e0ecc7f55dd8bf2cf16.js +0 -1
  208. package/assets/esri/core/workers/chunks/9dece842ada6278c33ef.js +0 -1
  209. package/assets/esri/core/workers/chunks/a12e29f2cb78fdaa0753.js +0 -1
  210. package/assets/esri/core/workers/chunks/b70af9fb974ef9836efd.js +0 -1
  211. package/assets/esri/core/workers/chunks/c0f2b6a10bcc766318f5.js +0 -1
  212. package/assets/esri/core/workers/chunks/c248db5e4d92cfb3c4d1.js +0 -1
  213. package/assets/esri/core/workers/chunks/ce02adb527389b90223d.js +0 -1
  214. package/assets/esri/core/workers/chunks/d8eea5ffe05c620fac9e.js +0 -1
  215. package/assets/esri/core/workers/chunks/d997d81d0965c05447d4.js +0 -1
  216. package/assets/esri/core/workers/chunks/e1645882f54818c4036a.js +0 -1
  217. package/assets/esri/core/workers/chunks/e44679a0d271c1efb60d.js +0 -1
  218. package/assets/esri/core/workers/chunks/f11f40017ec97a2a6b5f.js +0 -29
  219. package/assets/esri/core/workers/chunks/f7f5d8256e63d303cbcb.js +0 -1
  220. package/assets/esri/core/workers/chunks/f87d5450190896e61ff8.js +0 -1
  221. package/assets/esri/core/workers/chunks/fdee2255f49b43056e9d.js +0 -1
  222. package/assets/esri/core/workers/chunks/ff1e614fde01781360fa.js +0 -1
  223. package/chunks/AtmosphereCompositing.glsl.js +0 -25
  224. package/views/3d/analysis/ShadowCast/sunlightUtils.js +0 -2
  225. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +0 -2
  226. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +0 -2
  227. package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +0 -2
  228. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +0 -2
@@ -0,0 +1,258 @@
1
+ import type Collection from "../../core/Collection.js";
2
+ import type Point from "../Point.js";
3
+ import type Conversion from "./support/Conversion.js";
4
+ import type Format from "./support/Format.js";
5
+ import type CIMSymbol from "../../symbols/CIMSymbol.js";
6
+ import type PictureMarkerSymbol from "../../symbols/PictureMarkerSymbol.js";
7
+ import type PointSymbol3D from "../../symbols/PointSymbol3D.js";
8
+ import type SimpleMarkerSymbol from "../../symbols/SimpleMarkerSymbol.js";
9
+ import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
10
+ import type { EventedAccessor } from "../../core/Evented.js";
11
+ import type { LengthUnit } from "../../core/units.js";
12
+ import type { CoordinateConversionMessages, Mode, Position } from "./types.js";
13
+ import type { ConversionProperties } from "./support/Conversion.js";
14
+ import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
15
+ import type { GoTo, GoToProperties } from "../../widgets/support/GoTo.js";
16
+ import type { PointProperties } from "../Point.js";
17
+ import type { FormatProperties } from "./support/Format.js";
18
+ import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
19
+ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
20
+ import type { PictureMarkerSymbolProperties } from "../../symbols/PictureMarkerSymbol.js";
21
+ import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
22
+
23
+ /** @since 5.2 */
24
+ export interface CoordinateConversionModelProperties extends GoToProperties, Partial<Pick<CoordinateConversionModel, "calculateCoordinatePrecision" | "messages" | "mode" | "removeLeadingZeros" | "storageEnabled" | "storageType" | "verticalUnit" | "view">> {
25
+ /**
26
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) containing every [Conversion](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/)
27
+ * that is currently displaying.
28
+ *
29
+ * @since 5.2
30
+ * @example
31
+ * // conversions can be set with an array of strings where each string is a format's name
32
+ * coordinateConversion.conversions = ["mgrs"];
33
+ */
34
+ conversions?: ReadonlyArrayOrCollection<ConversionProperties>;
35
+ /**
36
+ * Describes the location of the coordinates currently displayed as a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/).
37
+ * Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#conversions).
38
+ *
39
+ * @since 5.2
40
+ */
41
+ currentLocation?: PointProperties | null;
42
+ /**
43
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) containing every [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/)
44
+ * that is capable of displaying.
45
+ *
46
+ * The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`.
47
+ *
48
+ * @since 5.2
49
+ */
50
+ formats?: ReadonlyArrayOrCollection<FormatProperties>;
51
+ /**
52
+ * This symbol is used to visualize the location currently, when `capture` mode
53
+ * is active.
54
+ *
55
+ * @since 5.2
56
+ */
57
+ locationSymbol?: (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (PointSymbol3DProperties & { type: "point-3d" }) | (CIMSymbolProperties & { type: "cim" });
58
+ }
59
+
60
+ /** @since 5.2 */
61
+ export type CoordinateConversionModelState = "ready" | "loading" | "disabled";
62
+
63
+ /**
64
+ * Provides the logic for the Coordinate Conversion (next) [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-coordinate-conversion-next/).
65
+ *
66
+ * The caller supplies localized [messages](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#messages)
67
+ * through the constructor or after construction. The model does not load a message bundle and remains
68
+ * disabled until messages are supplied.
69
+ *
70
+ * @since 5.2
71
+ * @see [Coordinate Conversion (next) component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-coordinate-conversion-next/)
72
+ * @see [Sample - CoordinateConversion component](https://developers.arcgis.com/javascript/latest/sample-code/coordinate-conversion/)
73
+ */
74
+ export default class CoordinateConversionModel extends CoordinateConversionModelSuperclass {
75
+ /** @since 5.2 */
76
+ constructor(properties?: CoordinateConversionModelProperties);
77
+ /**
78
+ * This property determines whether the coordinates output by the model will be truncated based
79
+ * on the current scale of the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
80
+ *
81
+ * @default true
82
+ * @since 5.2
83
+ */
84
+ accessor calculateCoordinatePrecision: boolean;
85
+ /**
86
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) containing every [Conversion](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/)
87
+ * that is currently displaying.
88
+ *
89
+ * @since 5.2
90
+ * @example
91
+ * // conversions can be set with an array of strings where each string is a format's name
92
+ * coordinateConversion.conversions = ["mgrs"];
93
+ */
94
+ get conversions(): Collection<Conversion>;
95
+ set conversions(value: ReadonlyArrayOrCollection<ConversionProperties>);
96
+ /**
97
+ * Describes the location of the coordinates currently displayed as a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/).
98
+ * Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#conversions).
99
+ *
100
+ * @since 5.2
101
+ */
102
+ get currentLocation(): Point | null | undefined;
103
+ set currentLocation(value: PointProperties | null | undefined);
104
+ /**
105
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) containing every [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/)
106
+ * that is capable of displaying.
107
+ *
108
+ * The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`.
109
+ *
110
+ * @since 5.2
111
+ */
112
+ get formats(): Collection<Format>;
113
+ set formats(value: ReadonlyArrayOrCollection<FormatProperties>);
114
+ /**
115
+ * This symbol is used to visualize the location currently, when `capture` mode
116
+ * is active.
117
+ *
118
+ * @since 5.2
119
+ */
120
+ get locationSymbol(): SimpleMarkerSymbol | PictureMarkerSymbol | PointSymbol3D | CIMSymbol;
121
+ set locationSymbol(value: (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (PointSymbol3DProperties & { type: "point-3d" }) | (CIMSymbolProperties & { type: "cim" }));
122
+ /**
123
+ * Localized direction abbreviations supplied by the caller. The model remains disabled until
124
+ * these strings are provided. Replace this object when the localized strings change.
125
+ *
126
+ * @since 5.2
127
+ */
128
+ accessor messages: CoordinateConversionMessages | null;
129
+ /**
130
+ * Describes the current mode.
131
+ *
132
+ * * While in `live` mode, updates occur as the cursor moves.
133
+ * * While in `capture` mode, updates occur on mouse click and then display a graphic
134
+ * marking the current location.
135
+ * * While in `idle` mode, no updates occur but the coordinate remains visible.
136
+ *
137
+ * @default "live"
138
+ * @since 5.2
139
+ */
140
+ accessor mode: Mode;
141
+ /**
142
+ * This property determines whether leading zeros in the coordinates will be removed.
143
+ * For example, the first coordinate includes leading zeros whereas the second does not:
144
+ *
145
+ * 1. 02 01 55.478822N 005 39 51.120259E
146
+ * 2. 1 55.478822N 5 39 51.120259E does not.
147
+ *
148
+ * @default false
149
+ * @since 5.2
150
+ */
151
+ accessor removeLeadingZeros: boolean;
152
+ /**
153
+ * The model's state.
154
+ *
155
+ * @default "disabled"
156
+ * @since 5.2
157
+ */
158
+ get state(): CoordinateConversionModelState;
159
+ /**
160
+ * If this property is set to `true`, sessionStorage or localStorage (depending on [storageType](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#storageType))
161
+ * will be used to hydrate and persist the CoordinateConversion's state.
162
+ *
163
+ * @default true
164
+ * @since 5.2
165
+ */
166
+ accessor storageEnabled: boolean;
167
+ /**
168
+ * This property determines whether sessionStorage or localStorage will be used to store state.
169
+ *
170
+ * @default "session"
171
+ * @since 5.2
172
+ * @see [Window.sessionStorage](https://developer.mozilla.org/docs/Web/API/Window/sessionStorage)
173
+ * @see [Window.localStorage](https://developer.mozilla.org/docs/Web/API/Window/localStorage)
174
+ */
175
+ accessor storageType: "session" | "local";
176
+ /**
177
+ * The user-selected vertical unit used to display the elevation of the current location when available
178
+ *
179
+ * @internal
180
+ * @since 5.2
181
+ */
182
+ accessor verticalUnit: LengthUnit | undefined;
183
+ /**
184
+ * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Set this to link to a specific view.
185
+ *
186
+ * @since 5.2
187
+ */
188
+ accessor view: MapViewOrSceneView | null | undefined;
189
+ /**
190
+ * Attempt to convert a point into a [Position](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/types/#Position).
191
+ *
192
+ * @param format - The format that describes how the point should be converted.
193
+ * @param point - The point to convert.
194
+ * @returns When resolved, returns a [Position](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/types/#Position).
195
+ * @since 5.2
196
+ */
197
+ convert(format: Format, point: Point): Promise<Position>;
198
+ /**
199
+ * Goes to a location in the view associated with the model
200
+ *
201
+ * @param point - The location to go to
202
+ * @since 5.2
203
+ * @see [MapView.goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#goTo)
204
+ */
205
+ goToLocation(point: Point): Promise<void>;
206
+ /**
207
+ * Pauses the model's operation. See the [resume()](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#resume) method
208
+ *
209
+ * @since 5.2
210
+ */
211
+ pause(): void;
212
+ /**
213
+ * Generates a localized coordinate string suitable for display given a [Conversion](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/)
214
+ * and a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/)
215
+ *
216
+ * @param conversion - Specifies the format to use to preview
217
+ * @param location - The position to preview
218
+ * @since 5.2
219
+ */
220
+ previewConversion(conversion: Conversion, location?: Point): Promise<string | null | undefined>;
221
+ /**
222
+ * Resumes the model's operation. See the [pause()](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#pause) method
223
+ *
224
+ * @since 5.2
225
+ */
226
+ resume(): void;
227
+ /**
228
+ * Attempt to convert a string into a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/). The format of the
229
+ * string must be specified. A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of available formats can be
230
+ * obtained from the [formats](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#formats) property.
231
+ *
232
+ * @param coordinate - The coordinate string.
233
+ * @param format - Specifies the format of the input coordinate.
234
+ * @returns When resolved, returns a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/).
235
+ * @since 5.2
236
+ */
237
+ reverseConvert(coordinate: string, format: Format): Promise<Point | null | undefined>;
238
+ /**
239
+ * Set the model's new location to the input [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/)
240
+ *
241
+ * @param point - The point to be set as the new location.
242
+ * @since 5.2
243
+ */
244
+ setLocation(point: Point | null | undefined): void;
245
+ /**
246
+ * Update the input conversions based on the input point.
247
+ *
248
+ * @param conversions - An array of [Conversions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/)
249
+ * to be updated.
250
+ * @param location - A point that will be used to update each input conversion.
251
+ * @returns When resolved, returns an array of
252
+ * [Conversions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/) with updated [Positions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/types/#Position).
253
+ * @since 5.2
254
+ */
255
+ updateConversions(conversions: Conversion[], location: Point | null | undefined): Promise<Conversion[]>;
256
+ }
257
+ declare const CoordinateConversionModelSuperclass: typeof EventedAccessor & typeof GoTo
258
+ export {};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import n from"../../Graphic.js";import{onLocaleChange as r,getLocale as i}from"../../intl.js";import a from"../../core/Collection.js";import o from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import c from"../../core/Logger.js";import{when as l,watch as u,initial as d,whenOnce as f}from"../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../core/accessorSupport/decorators.js";import{ensureType as h}from"../../core/accessorSupport/ensureType.js";import g from"../Point.js";import{load as _}from"../projectionUtils.js";import v from"./support/Conversion.js";import{isValidPoint as y,isSupportedNotation as b}from"./support/coordinateConversionUtils.js";import x from"./support/Format.js";import{generateDefaultFormats as S,setDefaultPatterns as C}from"./support/formatUtils.js";import w from"../../symbols/IconSymbol3DLayer.js";import T from"../../symbols/PictureMarkerSymbol.js";import E from"../../symbols/PointSymbol3D.js";import{pointSymbolTypes as D}from"../../symbols/support/typeUtils.js";import{GoTo as O}from"../../widgets/support/GoTo.js";const k=new g([0,0,500]),A=[`mgrs`,`utm`,`usng`,`dd`,`dms`,`ddm`],j=`esri__coordinateConversionWidgetState`,M={conversions:`conversions`,formats:`formats`,view:`view`,viewChange:`view-change`,cursor:`cursor`};let N=class extends O(s){constructor(e){super(e),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new a,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new a,this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType=`session`,this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new a}initialize(){this.formats.addMany(S()),this.addHandles(l(()=>this.messages,e=>{C(e,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(e=>{e.viewModel=this,this.addHandles(u(()=>e.currentPattern,this._saveWidgetState),e.name??`unnamed-format`)}),this.addHandles(this.conversions.on(`change`,this._handleConversionChange),M.conversions),this.addHandles(this.formats.on(`change`,this._handleFormatChange),M.formats),this.addHandles(u(()=>this.verticalUnit,this._saveWidgetState)),this.addHandles(u(()=>this.messages?.abbreviatedDirections,e=>{e&&C({abbreviatedDirections:e},this.formats)})),this.addHandles(r(()=>{this.messages&&C(this.messages,this.formats)})),_().then(()=>!0,e=>(c.getLogger(this).error(new o(`coordinate-conversion:projection-load-failed`,`Failed to load the projection module.`,{error:e})),!1)).then(e=>{this.destroyed||(this.formatterAvailable=e,e||this._filterFormatsAndConversions(),this.addHandles(u(()=>this.view,this._handleViewChange,d),M.viewChange),this.formatterLoading=!1)}),this.conversions.length===0&&this._addDefaultConversion()},{initial:!0,once:!0}))}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get(`conversions`)}set conversions(e){let t=new a;e.forEach(e=>{let n=null;if(typeof e==`string`){let t=this.formats.find(t=>t.name===e);t&&(n=new v({format:t}))}else n=h(v,e);n&&t.add(n)}),this._set(`conversions`,t)}set currentLocation(e){this._set(`currentLocation`,e),this._updateConversions()}get currentLocation(){return this._get(`currentLocation`)||null}set mode(e){switch(e){case`capture`:this.currentLocation=null,this._startCaptureMode(),this._set(`mode`,e);break;case`live`:this._startLiveMode(),this._set(`mode`,e);break;case`idle`:this.removeHandles(M.view),this.removeHandles(M.cursor),this._set(`mode`,e)}}get mode(){return this._get(`mode`)||`live`}get state(){let{messages:e,view:t}=this,n=t?.ready;return e?n?`ready`:t?`loading`:`disabled`:`disabled`}get locationSymbol(){let e=this._userLocationSymbol;if(e)return e;let n=t(`esri/images/search/search-symbol-32.png`);return this.view?.type===`3d`?new E({symbolLayers:new a([new w({occludedVisibility:{mode:`visible`},resource:{href:n},size:24})])}):new T({url:n,width:24,height:24})}set locationSymbol(e){this._userLocationSymbol=e}get storage(){return this.storageType===`session`?sessionStorage:localStorage}get waitingForConversions(){return this._conversionPromise!=null}setLocation(e){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),e&&(this._locationGraphic=new n({geometry:e.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(e,t){if(!y(t))throw new o(`coordinate-conversion:invalid-point`,`Invalid point cannot be converted.`,{point:t});return await this._waitForFormatter(),Promise.resolve().then(()=>e.convert(t))}async goToLocation(e){let{view:t}=this;if(!t)throw new o(`coordinate-conversion:go-to-failed`,`no view`);let n=t.type===`3d`?t.clippingArea:null,r=t.map?.basemap?.baseLayers;if(n||(r?.length??0)>0){let t=n??r?.at(0)?.fullExtent;if(t!=null&&!t.contains(e))throw new o(`coordinate-conversion:go-to-failed`,`Point outside basemap extent.`,{point:e})}return this.callGoTo({target:e})}pause(){this.currentLocation=null,this.removeHandles(M.view),this.view&&(this.removeHandles(M.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(e,t=this.currentLocation||k){return(await P(e,t)).displayCoordinate}resume(){let{mode:e}=this;e===`capture`?this._startCaptureMode():this._startLiveMode()}async reverseConvert(e,t){return await this._waitForFormatter(),t.reverseConvert(e)}async updateConversions(e,t){if(await this._waitForFormatter(),t?.type!==`point`)throw this._clearConversions(this.conversions),new o(`coordinate-conversion:invalid-input-point`,`Point is invalid, conversions cannot be updated.`,{point:t});return this._convertMany(e,t)}_addDefaultConversion(){let e=this.formats.find(e=>e.name===`xy`)||this.formats.at(0);e&&this.conversions.add(new v({format:e}))}_cleanUpView(e){e&&(this._locationGraphic&&e.graphics.remove(this._locationGraphic),this.removeHandles(M.view),this.removeHandles(M.cursor))}_clearConversions(e){e.forEach(e=>{e.position={location:null,coordinate:null}})}async _convertMany(e,t){return Promise.all(e.map(e=>P(e,t)))}_handleConversionChange(e){for(let t of e.added){let{format:e}=t;e&&(e.viewModel=this,this.currentLocation&&(this._set(`waitingForConversions`,!0),this.convert(e,this.currentLocation).then(e=>{t.position=e,this._set(`waitingForConversions`,!1)})))}this._saveWidgetState()}_handleFormatChange(e){e.added.forEach(e=>{this.addHandles(u(()=>e.currentPattern,this._saveWidgetState),e.name??`unnamed-format`),e.viewModel=this}),e.removed.forEach(e=>{e.viewModel=null;let t=this.conversions.filter(t=>t.format===e);this.conversions.removeMany(t),e.name&&this.removeHandles(e.name)}),this.conversions.length===0&&this._addDefaultConversion()}_loadWidgetState(){try{let e=JSON.parse(this.storage.getItem(j));e&&this._setWidgetState(e)}catch(e){c.getLogger(this).error(new o(`coordinate-conversion:invalid-session-storage-json`,`Could not read from storage.`,{error:e}))}}_startCaptureMode(){this.removeHandles(M.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(M.cursor),this.addHandles(this.view.acquireCursor(`crosshair`,`high`),M.cursor),this.addHandles(this.view.on(`click`,this._onClick),M.view))}_startIdleMode(){this.removeHandles(M.view),this.removeHandles(M.cursor),this.view&&this.currentLocation&&this.setLocation(this.currentLocation)}_startLiveMode(){this._pointerCount=0,this.removeHandles(M.view),this.view&&(this.removeHandles(M.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on(`pointer-down`,this._onPointerDown),this.view.on(`pointer-up`,this._onPointerUp),this.view.on(`pointer-move`,this._onPointerMove)],M.view))}_handleViewChange(e,t){if(t&&t!==e&&this._cleanUpView(t),e){let{mode:e}=this;e===`capture`?this._startCaptureMode():e===`live`?this._startLiveMode():e===`idle`&&this._startIdleMode(),t&&this._filterFormatsAndConversions()}}_onClick(e){if(e.button===0){let t=(this.view?.toMap(e,{exclude:[],excludeLabels:!0}))?.normalize();this.setLocation(t),this.currentLocation=t}}_onPointerDown(e){let{pointerType:t}=e;if(this._pointerCount++,(t===`touch`||t===`pen`)&&this._pointerCount===1){let t=this.view?.toMap(e,{exclude:[],excludeLabels:!0});this.currentLocation=t?.normalize()}}_onPointerMove(e){let{pointerType:t}=e;if(t===`mouse`||this._pointerCount===1){let t=this.view?.toMap(e,{exclude:[],excludeLabels:!0});this.currentLocation=t?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(e){try{this.verticalUnit=e.verticalUnit,e.formats.forEach(t=>{let n=this.formats.find(e=>e.name===t.name);n&&e.locale===i()&&t.currentPattern&&(n.currentPattern=t.currentPattern),n&&t.index>=0&&this.conversions.add(new v({format:n}))})}catch(e){c.getLogger(this).warn(new o(`coordinate-conversion:session-storage-read-error`,`Could not get state from stored JSON.`,{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;let e=this._getFormatsJson();try{this.storage.setItem(j,JSON.stringify({formats:e,locale:i(),verticalUnit:this.verticalUnit}))}catch(e){c.getLogger(this).error(new o(`coordinate-conversion:local-storage-write-error`,`Could not write to localStorage.`,{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_getFormatsJson(){return this.formats.filter(e=>{let t=e.name;return t===`xy`||t===`basemap`||b(t)}).map(e=>({name:e.name,currentPattern:e.currentPattern,defaultPattern:e.defaultPattern,index:this.conversions.findIndex(t=>t.format===e)})).sort((e,t)=>e.index-t.index).toArray()}_filterFormatsAndConversions(){let{formatterAvailable:e,conversions:t,formats:n}=this;e||this.addHandles(l(()=>this.view?.spatialReference,e=>{let r=e.isWebMercator||e.isWGS84,i=n.filter(e=>{let{name:t}=e;return F(t)?!0:t===`xy`&&!r}),a=this.filteredFormats.filter(e=>e.name===`xy`&&r&&!this.formats.includes(e)),o=t.filter(e=>i.includes(e.format));n.removeMany(i),t.removeMany(o),this.filteredFormats.addMany(i.filter(e=>!this.filteredFormats.includes(e))),n.addMany(a)},{once:!0,initial:!0}),M.view)}async _waitForFormatter(){this.formatterLoading&&await f(()=>this.formatterLoading===!1)}};e([p({types:D})],N.prototype,`_userLocationSymbol`,void 0),e([p()],N.prototype,`calculateCoordinatePrecision`,void 0),e([p()],N.prototype,`conversions`,null),e([p({type:g})],N.prototype,`currentLocation`,null),e([p({type:a.ofType(x)})],N.prototype,`formats`,void 0),e([p()],N.prototype,`formatterLoading`,void 0),e([p()],N.prototype,`messages`,void 0),e([p()],N.prototype,`mode`,null),e([p()],N.prototype,`filteredFormats`,void 0),e([p({readOnly:!0})],N.prototype,`state`,null),e([p({types:D})],N.prototype,`locationSymbol`,null),e([p()],N.prototype,`removeLeadingZeros`,void 0),e([p({readOnly:!0})],N.prototype,`storage`,null),e([p()],N.prototype,`storageEnabled`,void 0),e([p()],N.prototype,`storageType`,void 0),e([p()],N.prototype,`verticalUnit`,void 0),e([p({readOnly:!0})],N.prototype,`waitingForConversions`,null),e([p()],N.prototype,`view`,void 0),N=e([m(`esri.geometry.coordinateConversion.CoordinateConversionModel`)],N);async function P(e,t){try{e.position=await e.format?.convert(t)}catch{e.position=null}return e}function F(e){return A.includes(e)}const I=N;export{I as default};
@@ -0,0 +1,73 @@
1
+ import type Accessor from "../../../core/Accessor.js";
2
+ import type Format from "./Format.js";
3
+ import type { Position } from "../types.js";
4
+ import type { FormatProperties } from "./Format.js";
5
+
6
+ /** @since 5.2 */
7
+ export interface ConversionProperties extends Partial<Pick<Conversion, "position">> {
8
+ /**
9
+ * The [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/) for this conversion. The Format contains information
10
+ * detailing how the Conversion should be performed and how it will be displayed.
11
+ *
12
+ * @since 5.2
13
+ */
14
+ format?: FormatProperties | null;
15
+ }
16
+
17
+ /**
18
+ * The Conversion class represents one of the [CoordinateConversionModel.conversions](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#conversions)
19
+ * in a [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/). Each conversion describes a location
20
+ * in a particular [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/).
21
+ *
22
+ * @since 5.2
23
+ * @see [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/)
24
+ * @see [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/)
25
+ * @see [Sample - Add custom coordinate formats](https://developers.arcgis.com/javascript/latest/sample-code/coordinate-conversion-custom/)
26
+ */
27
+ export default class Conversion extends Accessor {
28
+ /**
29
+ * @since 5.2
30
+ * @example
31
+ * const model = new CoordinateConversionModel({
32
+ * view,
33
+ * messages: {
34
+ * abbreviatedDirections: { north: "N", south: "S", east: "E", west: "W" }
35
+ * }
36
+ * });
37
+ *
38
+ * const newFormat = new Format({
39
+ * // add new conversion format here
40
+ * });
41
+ *
42
+ * // add our new format to the model
43
+ * model.formats.add(newFormat);
44
+ *
45
+ * const newConversion = new Conversion({
46
+ * format: newFormat
47
+ * });
48
+ *
49
+ * // add the custom format to the model's conversions
50
+ * model.conversions.splice(0, newConversion);
51
+ */
52
+ constructor(properties?: ConversionProperties);
53
+ /**
54
+ * A formatted string based on the current [position](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/#position) and display information on the [format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Conversion/#format).
55
+ *
56
+ * @since 5.2
57
+ */
58
+ get displayCoordinate(): string | null | undefined;
59
+ /**
60
+ * The [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/) for this conversion. The Format contains information
61
+ * detailing how the Conversion should be performed and how it will be displayed.
62
+ *
63
+ * @since 5.2
64
+ */
65
+ get format(): Format | null | undefined;
66
+ set format(value: FormatProperties | null | undefined);
67
+ /**
68
+ * The position property contains the location information for this conversion.
69
+ *
70
+ * @since 5.2
71
+ */
72
+ accessor position: Position | null | undefined;
73
+ }
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./Format.js";let a=class extends t{constructor(e){super(e),this.format=null,this.position={coordinate:null,location:null}}get displayCoordinate(){return this.format?.getDisplayCoordinate(this.position?.coordinate)}};e([n({readOnly:!0})],a.prototype,`displayCoordinate`,null),e([n({type:i})],a.prototype,`format`,void 0),e([n()],a.prototype,`position`,void 0),a=e([r(`esri.geometry.coordinateConversion.support.Conversion`)],a);const o=a;export{o as default};
@@ -0,0 +1,131 @@
1
+ import type Accessor from "../../../core/Accessor.js";
2
+ import type Point from "../../Point.js";
3
+ import type SpatialReference from "../../SpatialReference.js";
4
+ import type CoordinateConversionModel from "../CoordinateConversionModel.js";
5
+ import type { ConversionInfo, CoordinateSegment } from "../types.js";
6
+ import type { SpatialReferenceProperties } from "../../SpatialReference.js";
7
+
8
+ /** @since 5.2 */
9
+ export interface FormatProperties extends Partial<Pick<Format, "conversionInfo" | "coordinateSegments" | "defaultPattern" | "name" | "viewModel">> {
10
+ /**
11
+ * A string that serves as a pattern describing how this Format should be displayed. The pattern should
12
+ * contain all of aliases specified by the Format's [coordinateSegments property](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/#coordinateSegments).
13
+ *
14
+ * @since 5.2
15
+ * @example
16
+ * // Remove the spaces from an mgrs coordinate
17
+ * let format = coordinateConversionModel.formats.find(function(format) {
18
+ * return format.name === "mgrs";
19
+ * });
20
+ *
21
+ * console.log.(format.currentPattern);
22
+ * // > Z S X Y
23
+ *
24
+ * format.currentPattern = "ZSXY"
25
+ */
26
+ currentPattern?: string | null;
27
+ /**
28
+ * A string that is used to label this Format in the UI. If not set, it will default to
29
+ * [name](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/#name)
30
+ *
31
+ * @since 5.2
32
+ */
33
+ label?: string | null;
34
+ /**
35
+ * The [SpatialReference](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/) for this format. Coordinates generated for a format
36
+ * will be derived from points in this spatial reference.
37
+ *
38
+ * @since 5.2
39
+ */
40
+ spatialReference?: SpatialReferenceProperties;
41
+ }
42
+
43
+ /**
44
+ * The Format class represents one of the [CoordinateConversionModel.formats](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#formats)
45
+ * in a [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/). Each format describes how
46
+ * a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) should be transformed into a coordinate for display purposes.
47
+ *
48
+ * @since 5.2
49
+ * @see [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/)
50
+ * @see [Sample - Add custom coordinate formats](https://developers.arcgis.com/javascript/latest/sample-code/coordinate-conversion-custom/)
51
+ */
52
+ export default class Format extends Accessor {
53
+ /** @since 5.2 */
54
+ constructor(properties?: FormatProperties);
55
+ /**
56
+ * Contains information that describes how this Format should be converted. This property should only be
57
+ * set when creating a custom Format.
58
+ *
59
+ * @since 5.2
60
+ */
61
+ accessor conversionInfo: ConversionInfo | null | undefined;
62
+ /**
63
+ * An array of [Coordinate Segments](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/types/#CoordinateSegment). Each segment represents a section of the Format's
64
+ * coordinate.
65
+ *
66
+ * @since 5.2
67
+ */
68
+ accessor coordinateSegments: CoordinateSegment[] | null | undefined;
69
+ /**
70
+ * A string that serves as a pattern describing how this Format should be displayed. The pattern should
71
+ * contain all of aliases specified by the Format's [coordinateSegments property](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/#coordinateSegments).
72
+ *
73
+ * @since 5.2
74
+ * @example
75
+ * // Remove the spaces from an mgrs coordinate
76
+ * let format = coordinateConversionModel.formats.find(function(format) {
77
+ * return format.name === "mgrs";
78
+ * });
79
+ *
80
+ * console.log.(format.currentPattern);
81
+ * // > Z S X Y
82
+ *
83
+ * format.currentPattern = "ZSXY"
84
+ */
85
+ get currentPattern(): string;
86
+ set currentPattern(value: string | null | undefined);
87
+ /**
88
+ * The default pattern describing how this Format should be displayed. See [currentPattern](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/#currentPattern).
89
+ *
90
+ * @since 5.2
91
+ */
92
+ accessor defaultPattern: string | null | undefined;
93
+ /**
94
+ * A string that is used to label this Format in the UI. If not set, it will default to
95
+ * [name](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/#name)
96
+ *
97
+ * @since 5.2
98
+ */
99
+ get label(): string;
100
+ set label(value: string | null | undefined);
101
+ /**
102
+ * The name of the coordinate. A [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/)
103
+ * should not contain multiple Formats with the same name.
104
+ *
105
+ * @since 5.2
106
+ */
107
+ accessor name: string | null | undefined;
108
+ /**
109
+ * The [SpatialReference](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/) for this format. Coordinates generated for a format
110
+ * will be derived from points in this spatial reference.
111
+ *
112
+ * @since 5.2
113
+ */
114
+ get spatialReference(): SpatialReference;
115
+ set spatialReference(value: SpatialReferenceProperties);
116
+ /**
117
+ * The [CoordinateConversionModel](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/) that is utilizing this format.
118
+ *
119
+ * @since 5.2
120
+ */
121
+ accessor viewModel: CoordinateConversionModel | null | undefined;
122
+ /**
123
+ * Attempt to convert a valid string for this [Format](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/support/Format/) into a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/)
124
+ *
125
+ * @param coordinate - The coordinate string.
126
+ * @returns When resolved, returns a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/)
127
+ * @since 5.2
128
+ * @see [CoordinateConversionModel.reverseConvert()](https://developers.arcgis.com/javascript/latest/references/core/geometry/coordinateConversion/CoordinateConversionModel/#reverseConvert)
129
+ */
130
+ reverseConvert(coordinate: string): Promise<Point | null | undefined>;
131
+ }
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Error.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{fromUsng as o,fromUtm as s,fromMgrs as c,fromLatitudeLongitude as l,toUtm as u,toUsng as d,toMgrs as f,toLatitudeLongitude as p}from"../../coordinateFormatter.js";import{isLoaded as m,project as h}from"../../projectionUtils.js";import g from"../../SpatialReference.js";import{isValidPoint as _,fromXY as v,pointToCoordinate as y,removeLeadingZeros as b,getGeometryPrecision as x,getDegreePrecision as S}from"./coordinateConversionUtils.js";import{equals as C}from"../../support/spatialReferenceUtils.js";import{project as w}from"../../support/webMercatorUtils.js";let T=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??``}set currentPattern(e){this._currentPattern=e}get label(){return this.name??``}set label(e){this._overrideIfSome(`label`,e)}get hasDisplayProperties(){return!!(this.defaultPattern&&this.coordinateSegments)}get spatialReference(){return this.name===`basemap`?this._viewSpatialReference:this.conversionInfo?.spatialReference??g.WGS84}set spatialReference(e){this._overrideIfSome(`spatialReference`,e)}get _viewSpatialReference(){return this.viewModel?.view?.spatialReference??g.WGS84}get _additionalCharactersPattern(){let e=this.coordinateSegments;if(!e)return null;let t=e.map(e=>e.alias),n=this.currentPattern.replaceAll(RegExp(`["nsew${t.join()}]`,`gi`),``).replaceAll(` `,``);return RegExp(`[${n}]`,`g`)}get test(){}async convert(e){if(!_(e))throw new n(`format:invalid-point`,`Could not convert invalid point.`,{point:e});let t=this.conversionInfo?.convert;if(t)return Promise.resolve().then(()=>t(e));let r=this._project(e,this.spatialReference);return{location:r,coordinate:this._getCoordinate(r)}}getConversionStrategy(){let e=this._viewSpatialReference;return this.conversionInfo?.convert||this.viewModel?.formatterAvailable||this.name===`xy`&&(e.isWebMercator||e.isWGS84)||this.name===`basemap`?`client`:`server`}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern,n=this._getSegmentMatches(e,!1);for(let e=this.coordinateSegments.length-1;e>=0;e--){let r=this.coordinateSegments[e];t=t.replace(r.alias,n[e])}return t}_parseUserInput(e){let{defaultPattern:t,_additionalCharactersPattern:n,coordinateSegments:r}=this;if(!t||!n)return``;let i=t.replace(n,``);e=e.replace(n,``);let a=this._getSegmentMatches(e,!0);if(r)for(let e=r.length-1;e>=0;e--){let t=r[e];i=i.replace(t.alias,a[e])}return i}_getSegmentMatches(e,t){let n=[],{coordinateSegments:r}=this;if(!r)return n;for(let i=0;i<r.length;i++){let a=r[i],o=e.match(a.searchPattern);if(!o){n.push(``);continue}let s=o[0];if(e=e.replace(s,``).trim(),a.substitution){let e=t?a.substitution.input(s):a.substitution.output(s);e&&(s=`${e}`)}n.push(s)}return n}async reverseConvert(e){let t=this._parseUserInput(e),i=this.conversionInfo?.reverseConvert,a;if(i)a=i(t);else if(this.name===`xy`||this.name===`basemap`)a=v(t,this.spatialReference);else if(this.viewModel?.formatterAvailable)switch(this.name){case`dd`:case`ddm`:case`dms`:a=l(t,this.spatialReference);break;case`mgrs`:a=c(t,this.spatialReference,`automatic`);break;case`utm`:a=s(t,this.spatialReference,`latitude-band-indicators`);break;case`usng`:a=o(t,this.spatialReference);break;default:a=null}if(!a)throw new n(`format:invalid-input`,`Could not parse input into point.`,{coordinate:e});if(this.viewModel?.view?.type===`3d`&&this.viewModel.view.map.ground)try{let e=await this.viewModel?.view?.map.ground.queryElevation(a);a.z=e?.geometry.z??a.z}catch(e){r.getLogger(this).warn(new n(`coordinate-conversion:elevation-query-error`,`Could not get elevation for point.`,{error:e}))}return this._project(a,this._viewSpatialReference)}_getCoordinate(e){let t=this.viewModel?.view?.resolution??0,r=this.viewModel?.view?.scale??0,i=this.viewModel?.view?.spatialReference??g.WebMercator;if(!_(e))throw new n(`format:invalid-point`,`Could not transform invalid point into coordinate.`,{point:e});if(this.viewModel?.formatterAvailable||this.name===`basemap`||this.name===`xy`)switch(this.name){case`dd`:case`ddm`:case`dms`:{let n=this._getPrecision(r,t,i,this.name),a=p(e,this.name,n);return this.viewModel?.removeLeadingZeros?b(a):a}case`mgrs`:return f(e,`automatic`,5,!1);case`usng`:return d(e,5,!1);case`utm`:return u(e,`latitude-band-indicators`,!0);default:return y(e,this._getPrecision(r,t,i,`dd`))}return y(e,this._getPrecision(r,t,i,`dd`))}_getPrecision(e,t,n,r){return this.viewModel?.calculateCoordinatePrecision?x(t,n,r):S(e)}_project(e,t){if(C(e.spatialReference,t)||!t)return e;if(this.viewModel?.formatterAvailable&&m())return h(e,t);if(!this.viewModel?.formatterAvailable){let n=w(e,t);if(n!=null)return n}return null}};e([i()],T.prototype,`conversionInfo`,void 0),e([i()],T.prototype,`coordinateSegments`,void 0),e([i()],T.prototype,`currentPattern`,null),e([i()],T.prototype,`_currentPattern`,void 0),e([i()],T.prototype,`label`,null),e([i()],T.prototype,`defaultPattern`,void 0),e([i({readOnly:!0})],T.prototype,`hasDisplayProperties`,null),e([i()],T.prototype,`name`,void 0),e([i({type:g})],T.prototype,`spatialReference`,null),e([i()],T.prototype,`viewModel`,void 0),e([i({readOnly:!0})],T.prototype,`_viewSpatialReference`,null),e([i({readOnly:!0})],T.prototype,`_additionalCharactersPattern`,null),T=e([a(`esri.geometry.coordinateConversion.support.Format`)],T);const E=T;export{E as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{clamp as e}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import n from"../../Point.js";import r from"../../SpatialReference.js";function i(e,t){return[e[0].toFixed(t),e[1].toFixed(t)]}const a=new Map;function o(n,r,i,o=4){if(n==null||!r)return o;if(a.has(n)){let e=a.get(n);if(e[i]!==void 0)return e[i]}let s=t(r);if(!Number.isFinite(s)||s<=0)return o;let c=n*s/111320,l=i===`dd`?c:i===`ddm`?c*60:c*3600,u=e(Math.ceil(-Math.log10(l)),0,7);return a.has(n)||(a.clear(),a.set(n,{})),a.get(n)[i]=u,u}function s(e){return e>=500?6:e<500&&e>=50?7:e<50&&e>=5?8:9}function c(e,t){let i=e.includes(`,`)?`,`:` `,[a,o,s]=e.split(i).map(e=>{let t=e.trim();return t?Number(t):null});if(!l(a)||!l(o))return null;let c=new n({x:a,y:o,spatialReference:t||r.WGS84});return s&&(c.z=s,c.hasZ=!0),c}function l(e){return typeof e==`number`&&isFinite(e)}function u(e){return!!e&&l(e.x)&&l(e.y)}function d(e,t){let[n,r]=i([e.x,e.y],t);return`${n}, ${r}`}const f=[`dd`,`dms`,`ddm`,`mgrs`,`usng`,`utm`];function p(e){return f.includes(e)}function m(e){return e&&e.replaceAll(/(?<![\d.])0+(?=\d)/g,``)}export{c as fromXY,s as getDegreePrecision,o as getGeometryPrecision,p as isSupportedNotation,u as isValidPoint,d as pointToCoordinate,m as removeLeadingZeros};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{getCustoms as e,format as t,parse as n}from"../../../core/number.js";import r from"./Format.js";import{getLocale as i}from"../../../intl/locale.js";const a=e().decimal,o={N:`north`,S:`south`,E:`east`,W:`west`},s=`°‎`,c=RegExp(`-?\\d+[\\.|\\${a}]?\\d*`),l=/^[\\0]+(?=\d)/;function u(t,n){let r=i()===`ar`,a=t.abbreviatedDirections.north,c=t.abbreviatedDirections.south,l=t.abbreviatedDirections.east,u=t.abbreviatedDirections.west,d=e().decimal,m={[a]:`N`,[c]:`S`,[l]:`E`,[u]:`W`},h=RegExp(`-?\\d+[\\.|\\${d}]?\\d*`),g=RegExp(`N|S|${a}|${c}`,`i`),_=RegExp(`E|W|${l}|${u}`,`i`),v={ddm:`Y${s} A'${t.abbreviatedDirections.north}, X${s} B'${t.abbreviatedDirections.east}`,dms:`Y${s} A' B"${t.abbreviatedDirections.north}, X${s} C' D"${t.abbreviatedDirections.east}`,dd:`Y${s}${t.abbreviatedDirections.north}, X${s}${t.abbreviatedDirections.east}`,xy:`X${s}, Y${s}`,basemap:`X, Y`},y={ddm:`${t.abbreviatedDirections.north}${s}Y 'A ,${t.abbreviatedDirections.east}${s}X 'B`,dms:`${t.abbreviatedDirections.north}${s}Y 'A "B ,${t.abbreviatedDirections.east}${s}X 'C "D`,dd:`${t.abbreviatedDirections.north}${s}Y ,${t.abbreviatedDirections.east}${s}X`,xy:`X${s} ,Y${s}`,basemap:`X ,Y`},b=e=>e!=null&&Object.keys(v).includes(e),x=RegExp(`\\d{1,2}[\\.|\\${d}]?\\d*`,`i`),S=RegExp(`\\d{1,3}[\\.|\\${d}]?\\d*`,`i`);n.forEach(e=>{let{name:n}=e;if(n===`dd`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`ddm`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`dms`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:(e.name===`xy`||e.name===`basemap`)&&(e.coordinateSegments=[{alias:`X`,description:`easting`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}}]),b(n)){let t=r?y[n]:v[n];e.defaultPattern=t,e.currentPattern=t}})}function d(){let e=RegExp(`N|S`,`i`),t=RegExp(`E|W`,`i`);return[new r({name:`basemap`,coordinateSegments:[{alias:`X`,description:`easting`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X, Y`,viewModel:null}),new r({name:`dd`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=\\D*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}[\\.|\\${a}]?\\d*(?=\\D*?[E|W|])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s}N, X${s}E`,viewModel:null}),new r({name:`ddm`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}[\\.\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=\\D*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\|${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A'N, X${s} B'E`,viewModel:null}),new r({name:`dms`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=.*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A' B"N, X${s} C' D"E`,viewModel:null}),new r({name:`xy`,coordinateSegments:[{alias:`X`,description:`longitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`latitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X${s}, Y${s}`,viewModel:null}),new r({name:`mgrs`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new r({name:`usng`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new r({name:`utm`,coordinateSegments:[{alias:`Z`,description:`zone number`,searchPattern:/\d{1,2}|[abyz]/i},{alias:`B`,description:`latitude band`,searchPattern:/^\D/},{alias:`X`,description:`easting`,searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:`Y`,description:`northing`,searchPattern:/\d{1,7}/}],defaultPattern:`ZB X Y`,viewModel:null})]}function f(e){let n=e.match(l),r=n?n[0]:``,i=e.includes(`.`)?e.split(`.`,2)[1].length:0;return r+t(Number(e),{pattern:`###0.###`,places:i,round:-1})}function p(e){return n(e)}export{s as degreeSymbol,d as generateDefaultFormats,u as setDefaultPatterns};