WFSSourceWorker-2XJ7RNZY.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import {
  2. K
  3. } from "./chunk-Z32FUDOP.js";
  4. import "./chunk-FEH5F4VW.js";
  5. import {
  6. L,
  7. O as O2
  8. } from "./chunk-YVTH4OGO.js";
  9. import {
  10. m
  11. } from "./chunk-XHRYELNQ.js";
  12. import {
  13. u
  14. } from "./chunk-5FHVUYVE.js";
  15. import {
  16. Y
  17. } from "./chunk-NP2BYFXT.js";
  18. import "./chunk-6H5PP7QI.js";
  19. import "./chunk-HSPVIAVJ.js";
  20. import "./chunk-XIEPNAEI.js";
  21. import {
  22. f as f2,
  23. g as g2
  24. } from "./chunk-M5BTTMP6.js";
  25. import "./chunk-WQJRLXWG.js";
  26. import "./chunk-ETWBEEKL.js";
  27. import "./chunk-XZA4MVET.js";
  28. import "./chunk-4GGRJYTB.js";
  29. import "./chunk-D5GG5NVO.js";
  30. import "./chunk-USORKAIZ.js";
  31. import "./chunk-Q34L5KZA.js";
  32. import "./chunk-ROWZMUVJ.js";
  33. import "./chunk-7IKYLNB5.js";
  34. import "./chunk-P4UZNLD5.js";
  35. import {
  36. ne,
  37. te
  38. } from "./chunk-FYNVVMWY.js";
  39. import "./chunk-Q52DVFYK.js";
  40. import "./chunk-HBMVUVZX.js";
  41. import "./chunk-QOV6ITMI.js";
  42. import "./chunk-DH2OBAUC.js";
  43. import "./chunk-TNLRDNTC.js";
  44. import {
  45. d
  46. } from "./chunk-KMAHKQ2G.js";
  47. import "./chunk-522WBHUO.js";
  48. import "./chunk-WNCU6BFU.js";
  49. import "./chunk-BJHM4JNS.js";
  50. import "./chunk-F6A2QQ26.js";
  51. import "./chunk-EOSZHC5H.js";
  52. import "./chunk-C43UE3Z5.js";
  53. import "./chunk-NE3ESGA6.js";
  54. import "./chunk-YIS6BAC3.js";
  55. import "./chunk-7XXXCK2A.js";
  56. import "./chunk-7ZIDBK7B.js";
  57. import "./chunk-WZQZRKNH.js";
  58. import "./chunk-LRDX4TO7.js";
  59. import "./chunk-WDLTDV2L.js";
  60. import "./chunk-TERAW6FT.js";
  61. import "./chunk-N2663GRX.js";
  62. import "./chunk-O4FY3ITT.js";
  63. import "./chunk-JXW4QTJA.js";
  64. import "./chunk-UXF37FQ4.js";
  65. import "./chunk-ZOEK6QHJ.js";
  66. import "./chunk-XNLG7T2T.js";
  67. import "./chunk-IR4PV7VK.js";
  68. import "./chunk-2Z6LERTI.js";
  69. import "./chunk-OWVBLVP3.js";
  70. import "./chunk-MXB2XLKV.js";
  71. import "./chunk-ALDCDSPV.js";
  72. import "./chunk-DT6EAZQ5.js";
  73. import "./chunk-HNOZUNJ4.js";
  74. import "./chunk-VNFRAYHO.js";
  75. import "./chunk-R5IG2D6H.js";
  76. import "./chunk-VBRY5KJM.js";
  77. import "./chunk-PDKDCAAD.js";
  78. import "./chunk-ECW2QABR.js";
  79. import "./chunk-GCDJLKH4.js";
  80. import {
  81. E,
  82. c
  83. } from "./chunk-MRJEICT6.js";
  84. import "./chunk-Y3WMVFTW.js";
  85. import "./chunk-SAS7RONY.js";
  86. import "./chunk-WSRBH7BF.js";
  87. import "./chunk-IHXECKQQ.js";
  88. import {
  89. O,
  90. f,
  91. g
  92. } from "./chunk-ULGDPLM2.js";
  93. import {
  94. s,
  95. s3 as s2
  96. } from "./chunk-EMJ4ZSM2.js";
  97. import "./chunk-IKP3YN53.js";
  98. import {
  99. e,
  100. r
  101. } from "./chunk-GZT4BVFP.js";
  102. import "./chunk-A5ICIBVI.js";
  103. // node_modules/@arcgis/core/layers/graphics/sources/WFSSourceWorker.js
  104. var E2 = class {
  105. constructor() {
  106. this._queryEngine = null, this._customParameters = null, this._snapshotFeatures = async (e2) => {
  107. const { objectIdField: t } = this._queryEngine, s3 = await K(this._getFeatureUrl, this._featureType.typeName, this._getFeatureOutputFormat, { customParameters: this._customParameters, dateFields: this._queryEngine.fieldsIndex.dateFields.map((e3) => e3.name), signal: e2 });
  108. await O2(s3), f(e2);
  109. const i = L(s3, { geometryType: this._queryEngine.geometryType, hasZ: false, objectIdField: t });
  110. if (!E(this._queryEngine.spatialReference, c))
  111. for (const a of i)
  112. r(a.geometry) && (a.geometry = te(g2(ne(a.geometry, this._queryEngine.geometryType, false, false), c, this._queryEngine.spatialReference)));
  113. let o = 1;
  114. for (const r2 of i) {
  115. const e3 = {};
  116. m(this._fieldsIndex, e3, r2.attributes, true), r2.attributes = e3, r2.attributes[t] == null && (r2.objectId = r2.attributes[t] = o++);
  117. }
  118. return i;
  119. };
  120. }
  121. destroy() {
  122. this._queryEngine?.destroy(), this._queryEngine = null;
  123. }
  124. async load(e2, t) {
  125. const { getFeatureUrl: r2, getFeatureOutputFormat: i, spatialReference: o, fields: n, geometryType: u2, featureType: p, objectIdField: h, customParameters: c2 } = e2;
  126. this._featureType = p, this._customParameters = c2, this._getFeatureUrl = r2, this._getFeatureOutputFormat = i, this._fieldsIndex = new d(n), await this._checkProjection(o), f(t), this._queryEngine = new Y({ fields: n, geometryType: u2, hasM: false, hasZ: false, objectIdField: h, spatialReference: o, timeInfo: null, featureStore: new u({ geometryType: u2, hasM: false, hasZ: false }) });
  127. const m2 = await this._snapshotFeatures(e(t.signal));
  128. return this._queryEngine.featureStore.addMany(m2), { extent: this._queryEngine.fullExtent };
  129. }
  130. async applyEdits() {
  131. throw new s2("wfs-source:editing-not-supported", "applyEdits() is not supported on WFSLayer");
  132. }
  133. async queryFeatures(e2 = {}, t = {}) {
  134. return await this._waitSnapshotComplete(), this._queryEngine.executeQuery(e2, t.signal);
  135. }
  136. async queryFeatureCount(e2 = {}, t = {}) {
  137. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForCount(e2, t.signal);
  138. }
  139. async queryObjectIds(e2 = {}, t = {}) {
  140. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForIds(e2, t.signal);
  141. }
  142. async queryExtent(e2 = {}, t = {}) {
  143. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForExtent(e2, t.signal);
  144. }
  145. async querySnapping(e2, t = {}) {
  146. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForSnapping(e2, t.signal);
  147. }
  148. async refresh(r2) {
  149. return this._customParameters = r2, this._snapshotTask?.abort(), this._snapshotTask = O(this._snapshotFeatures), this._snapshotTask.promise.then((e2) => {
  150. this._queryEngine.featureStore.clear(), e2 && this._queryEngine.featureStore.addMany(e2);
  151. }, (r3) => {
  152. this._queryEngine.featureStore.clear(), g(r3) || s.getLogger("esri.layers.WFSLayer").error(new s2("wfs-layer:getfeature-error", "An error occurred during the GetFeature request", { error: r3 }));
  153. }), await this._waitSnapshotComplete(), { extent: this._queryEngine.fullExtent };
  154. }
  155. async _waitSnapshotComplete() {
  156. if (this._snapshotTask && !this._snapshotTask.finished) {
  157. try {
  158. await this._snapshotTask.promise;
  159. } catch {
  160. }
  161. return this._waitSnapshotComplete();
  162. }
  163. }
  164. async _checkProjection(t) {
  165. try {
  166. await f2(c, t);
  167. } catch {
  168. throw new s2("unsupported-projection", "Projection not supported", { spatialReference: t });
  169. }
  170. }
  171. };
  172. export {
  173. E2 as default
  174. };
  175. //# sourceMappingURL=WFSSourceWorker-2XJ7RNZY.js.map