WFSSourceWorker-KUOZZVB5.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import {
  2. K
  3. } from "./chunk-DVYEME2A.js";
  4. import "./chunk-YINMVLPI.js";
  5. import {
  6. I,
  7. T
  8. } from "./chunk-JK76NUHI.js";
  9. import {
  10. m
  11. } from "./chunk-QR6V6X5R.js";
  12. import {
  13. u
  14. } from "./chunk-RDOYANC4.js";
  15. import {
  16. Y
  17. } from "./chunk-FSIQKOJP.js";
  18. import "./chunk-OQSZOHTF.js";
  19. import "./chunk-OP2HNSVZ.js";
  20. import "./chunk-UVQJ7AVD.js";
  21. import "./chunk-DMVKVC5I.js";
  22. import "./chunk-Y7BZ6TKQ.js";
  23. import {
  24. f as f2,
  25. g
  26. } from "./chunk-VEJPYAE4.js";
  27. import "./chunk-4GGDRIJK.js";
  28. import "./chunk-D5UVUJIX.js";
  29. import "./chunk-PZ7XDUL6.js";
  30. import "./chunk-ULSPZIPE.js";
  31. import "./chunk-UMUHMVL4.js";
  32. import "./chunk-FZSI6IGI.js";
  33. import "./chunk-B5O7N7PM.js";
  34. import "./chunk-KOKTANE6.js";
  35. import "./chunk-OKUFE7TO.js";
  36. import {
  37. nt,
  38. rt
  39. } from "./chunk-JKFWEHNK.js";
  40. import "./chunk-IIAN3QNN.js";
  41. import "./chunk-P24XEEHY.js";
  42. import "./chunk-WOXHUQGM.js";
  43. import "./chunk-FMPQIGFA.js";
  44. import "./chunk-EDHROVWI.js";
  45. import "./chunk-3IRT3YKJ.js";
  46. import "./chunk-SAJAEMIJ.js";
  47. import {
  48. r as r2
  49. } from "./chunk-JLSNMUQJ.js";
  50. import "./chunk-ECY35CJI.js";
  51. import "./chunk-PT62335L.js";
  52. import "./chunk-JGBXYDGB.js";
  53. import "./chunk-QEWF7QPH.js";
  54. import "./chunk-FNA5GLRW.js";
  55. import "./chunk-MCWCB5IY.js";
  56. import "./chunk-TJV6ODRM.js";
  57. import "./chunk-CRGY2SDS.js";
  58. import "./chunk-4T5ZGMEN.js";
  59. import "./chunk-CZBRZ6SU.js";
  60. import "./chunk-VGWC3IKZ.js";
  61. import "./chunk-2H5MD622.js";
  62. import "./chunk-3RSFVUKZ.js";
  63. import "./chunk-X4SA4ELJ.js";
  64. import "./chunk-5N7JLUJJ.js";
  65. import {
  66. j as j2
  67. } from "./chunk-2ZSOO377.js";
  68. import "./chunk-ZLNEXZAN.js";
  69. import "./chunk-ZYRIJWLX.js";
  70. import "./chunk-RYY6632W.js";
  71. import "./chunk-DW42UVIT.js";
  72. import "./chunk-YAEIHDJH.js";
  73. import "./chunk-TJNOJH33.js";
  74. import "./chunk-OSHI574D.js";
  75. import "./chunk-ETGAZ7LF.js";
  76. import "./chunk-75U5LM2V.js";
  77. import "./chunk-RMDDCMKS.js";
  78. import "./chunk-VCH45Q2I.js";
  79. import "./chunk-GSSTTHIT.js";
  80. import "./chunk-IM3LVQXV.js";
  81. import "./chunk-HZRKBTHJ.js";
  82. import "./chunk-DVUG3KID.js";
  83. import "./chunk-FWSQEIAR.js";
  84. import "./chunk-VEGAOVMY.js";
  85. import "./chunk-6T6G6LCQ.js";
  86. import "./chunk-YEJL5NEF.js";
  87. import {
  88. E,
  89. c
  90. } from "./chunk-PQFTYGF5.js";
  91. import "./chunk-2Z2TG5CU.js";
  92. import "./chunk-6KZ2LTDA.js";
  93. import "./chunk-U2XHEJM7.js";
  94. import "./chunk-SQOPWYIT.js";
  95. import {
  96. f,
  97. j
  98. } from "./chunk-V6P2MAQQ.js";
  99. import {
  100. s2 as s,
  101. s3 as s2
  102. } from "./chunk-E5O6P5I2.js";
  103. import "./chunk-SPWQ3AWG.js";
  104. import "./chunk-2TIUKVZN.js";
  105. import {
  106. e,
  107. r
  108. } from "./chunk-YXWMMD76.js";
  109. import "./chunk-S5KM4IGW.js";
  110. // node_modules/@arcgis/core/layers/graphics/sources/WFSSourceWorker.js
  111. var E2 = class {
  112. constructor() {
  113. this._queryEngine = null, this._customParameters = null, this._snapshotFeatures = async (e2) => {
  114. var _a;
  115. const { objectIdField: t } = this._queryEngine, r3 = await K((_a = this._getFeatureUrl) != null ? _a : "", this._featureType.typeName, this._getFeatureOutputFormat, { customParameters: this._customParameters, dateFields: this._queryEngine.fieldsIndex.dateFields.map((e3) => e3.name), signal: e2 });
  116. await T(r3), f(e2);
  117. const a = I(r3, { geometryType: this._queryEngine.geometryType, hasZ: false, objectIdField: t });
  118. if (!E(this._queryEngine.spatialReference, c))
  119. for (const i of a)
  120. r(i.geometry) && (i.geometry = nt(g(rt(i.geometry, this._queryEngine.geometryType, false, false), c, this._queryEngine.spatialReference)));
  121. let o = 1;
  122. for (const s3 of a) {
  123. const e3 = {};
  124. m(this._fieldsIndex, e3, s3.attributes, true), s3.attributes = e3, null == s3.attributes[t] && (s3.objectId = s3.attributes[t] = o++);
  125. }
  126. return a;
  127. };
  128. }
  129. destroy() {
  130. var _a;
  131. (_a = this._queryEngine) == null ? void 0 : _a.destroy(), this._queryEngine = null;
  132. }
  133. async load(e2, t) {
  134. const { getFeatureUrl: r3, getFeatureOutputFormat: s3, spatialReference: o, fields: n, geometryType: u2, featureType: p, objectIdField: h, customParameters: c2 } = e2;
  135. this._featureType = p, this._customParameters = c2, this._getFeatureUrl = r3, this._getFeatureOutputFormat = s3, this._fieldsIndex = new r2(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 }) });
  136. const m2 = await this._snapshotFeatures(e(t.signal));
  137. return this._queryEngine.featureStore.addMany(m2), { extent: this._queryEngine.fullExtent };
  138. }
  139. async applyEdits() {
  140. throw new s2("wfs-source:editing-not-supported", "applyEdits() is not supported on WFSLayer");
  141. }
  142. async queryFeatures(e2 = {}, t = {}) {
  143. return await this._waitSnapshotComplete(), this._queryEngine.executeQuery(e2, t.signal);
  144. }
  145. async queryFeatureCount(e2 = {}, t = {}) {
  146. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForCount(e2, t.signal);
  147. }
  148. async queryObjectIds(e2 = {}, t = {}) {
  149. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForIds(e2, t.signal);
  150. }
  151. async queryExtent(e2 = {}, t = {}) {
  152. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForExtent(e2, t.signal);
  153. }
  154. async querySnapping(e2, t = {}) {
  155. return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForSnapping(e2, t.signal);
  156. }
  157. async refresh(s3) {
  158. var _a;
  159. return this._customParameters = s3, (_a = this._snapshotTask) == null ? void 0 : _a.abort(), this._snapshotTask = j2(this._snapshotFeatures), this._snapshotTask.promise.then((e2) => {
  160. this._queryEngine.featureStore.clear(), e2 && this._queryEngine.featureStore.addMany(e2);
  161. }, (e2) => {
  162. this._queryEngine.featureStore.clear(), j(e2) || s.getLogger("esri.layers.WFSLayer").error(new s2("wfs-layer:getfeature-error", "An error occurred during the GetFeature request", { error: e2 }));
  163. }), await this._waitSnapshotComplete(), { extent: this._queryEngine.fullExtent };
  164. }
  165. async _waitSnapshotComplete() {
  166. if (this._snapshotTask && !this._snapshotTask.finished) {
  167. try {
  168. await this._snapshotTask.promise;
  169. } catch {
  170. }
  171. return this._waitSnapshotComplete();
  172. }
  173. }
  174. async _checkProjection(e2) {
  175. try {
  176. await f2(c, e2);
  177. } catch {
  178. throw new s2("unsupported-projection", "Projection not supported", { spatialReference: e2 });
  179. }
  180. }
  181. };
  182. export {
  183. E2 as default
  184. };
  185. //# sourceMappingURL=WFSSourceWorker-KUOZZVB5.js.map