geometryServiceUtils-Y3BMMDSB.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import {
  2. f,
  3. i,
  4. o
  5. } from "./chunk-FMPQIGFA.js";
  6. import {
  7. j
  8. } from "./chunk-LU5IJZB4.js";
  9. import "./chunk-7IBV2TRE.js";
  10. import "./chunk-5UVJ64RB.js";
  11. import "./chunk-SFEFRQCL.js";
  12. import {
  13. c
  14. } from "./chunk-RMDDCMKS.js";
  15. import "./chunk-VCH45Q2I.js";
  16. import "./chunk-YFSLJIO4.js";
  17. import "./chunk-55RWC67C.js";
  18. import "./chunk-HZRKBTHJ.js";
  19. import {
  20. U
  21. } from "./chunk-DVUG3KID.js";
  22. import "./chunk-FWSQEIAR.js";
  23. import "./chunk-VEGAOVMY.js";
  24. import "./chunk-6T6G6LCQ.js";
  25. import "./chunk-YEJL5NEF.js";
  26. import "./chunk-PQFTYGF5.js";
  27. import {
  28. e,
  29. l3 as l,
  30. n5 as n,
  31. y3 as y
  32. } from "./chunk-2Z2TG5CU.js";
  33. import "./chunk-6KZ2LTDA.js";
  34. import "./chunk-U2XHEJM7.js";
  35. import {
  36. b
  37. } from "./chunk-SQOPWYIT.js";
  38. import "./chunk-V6P2MAQQ.js";
  39. import {
  40. s,
  41. s3 as s2
  42. } from "./chunk-E5O6P5I2.js";
  43. import "./chunk-SPWQ3AWG.js";
  44. import "./chunk-2TIUKVZN.js";
  45. import "./chunk-YXWMMD76.js";
  46. import "./chunk-S5KM4IGW.js";
  47. // node_modules/@arcgis/core/rest/support/ProjectParameters.js
  48. var i2 = class extends l {
  49. constructor(r) {
  50. super(r), this.geometries = null, this.outSpatialReference = null, this.transformation = null, this.transformForward = null;
  51. }
  52. toJSON() {
  53. const r = this.geometries.map((r2) => r2.toJSON()), t = this.geometries[0], o2 = {};
  54. return o2.outSR = this.outSpatialReference.wkid || JSON.stringify(this.outSpatialReference.toJSON()), o2.inSR = t.spatialReference.wkid || JSON.stringify(t.spatialReference.toJSON()), o2.geometries = JSON.stringify({ geometryType: c(t), geometries: r }), this.transformation && (o2.transformation = this.transformation.wkid || JSON.stringify(this.transformation)), null != this.transformForward && (o2.transformForward = this.transformForward), o2;
  55. }
  56. };
  57. e([y()], i2.prototype, "geometries", void 0), e([y({ json: { read: { source: "outSR" } } })], i2.prototype, "outSpatialReference", void 0), e([y()], i2.prototype, "transformation", void 0), e([y()], i2.prototype, "transformForward", void 0), i2 = e([n("esri.rest.support.ProjectParameters")], i2);
  58. var a = i2;
  59. // node_modules/@arcgis/core/rest/geometryService/project.js
  60. var i3 = b(a);
  61. async function n2(o2, m, n4) {
  62. m = i3(m);
  63. const u = f(o2), c2 = { ...u.query, f: "json", ...m.toJSON() }, j2 = m.outSpatialReference, a3 = c(m.geometries[0]), f2 = i(c2, n4);
  64. return U(u.path + "/project", f2).then(({ data: { geometries: r } }) => o(r, a3, j2));
  65. }
  66. // node_modules/@arcgis/core/portal/support/geometryServiceUtils.js
  67. async function n3(o2 = null, i4) {
  68. var _a, _b;
  69. if (s.geometryServiceUrl)
  70. return s.geometryServiceUrl;
  71. if (!o2)
  72. throw new s2("internal:geometry-service-url-not-configured");
  73. let n4;
  74. n4 = "portal" in o2 ? o2.portal || j.getDefault() : o2, await n4.load({ signal: i4 });
  75. const a3 = (_b = (_a = n4.helperServices) == null ? void 0 : _a.geometry) == null ? void 0 : _b.url;
  76. if (!a3)
  77. throw new s2("internal:geometry-service-url-not-configured");
  78. return a3;
  79. }
  80. async function a2(r, t, a3 = null, l2) {
  81. const c2 = await n3(a3, l2), s3 = new a();
  82. s3.geometries = [r], s3.outSpatialReference = t;
  83. const m = await n2(c2, s3, { signal: l2 });
  84. if (m && Array.isArray(m) && 1 === m.length)
  85. return m[0];
  86. throw new s2("internal:geometry-service-projection-failed");
  87. }
  88. export {
  89. n3 as getGeometryServiceURL,
  90. a2 as projectGeometry
  91. };
  92. //# sourceMappingURL=geometryServiceUtils-Y3BMMDSB.js.map