CSVLayer-6YW6DGCE.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. import {
  2. l
  3. } from "./chunk-A6WD5XTM.js";
  4. import "./chunk-OP2HNSVZ.js";
  5. import {
  6. Ze
  7. } from "./chunk-WM52QDLS.js";
  8. import "./chunk-MEZ7BUMM.js";
  9. import "./chunk-7B57NUGF.js";
  10. import "./chunk-AOQ55JXI.js";
  11. import "./chunk-X42TFXOU.js";
  12. import "./chunk-JFSMKLAQ.js";
  13. import "./chunk-LXOC7SMQ.js";
  14. import "./chunk-DN6W4TJU.js";
  15. import {
  16. u
  17. } from "./chunk-OUUXJOLT.js";
  18. import "./chunk-PLQUCCQV.js";
  19. import "./chunk-JZAS4TIG.js";
  20. import "./chunk-VBR5BOXI.js";
  21. import "./chunk-NBKUI76A.js";
  22. import "./chunk-6334AFGG.js";
  23. import {
  24. x as x3
  25. } from "./chunk-NLLFSKB2.js";
  26. import "./chunk-LC3GBQ56.js";
  27. import "./chunk-5GYJGY4C.js";
  28. import "./chunk-OXF7W4BJ.js";
  29. import "./chunk-SAJAEMIJ.js";
  30. import "./chunk-S6EFEKAU.js";
  31. import "./chunk-2RHPWGZL.js";
  32. import "./chunk-XEQ4FTFC.js";
  33. import "./chunk-JM5OVQAD.js";
  34. import "./chunk-S3GK7VUF.js";
  35. import "./chunk-TU7WVKU4.js";
  36. import "./chunk-WWXZOC2Y.js";
  37. import "./chunk-ZOKNWEG3.js";
  38. import "./chunk-NQA5XJGK.js";
  39. import "./chunk-EKYSPJO6.js";
  40. import "./chunk-JAUFBT5U.js";
  41. import "./chunk-W6U6FKJ3.js";
  42. import "./chunk-7C2KDOAI.js";
  43. import "./chunk-RHFU6KWO.js";
  44. import "./chunk-3FNKD2EB.js";
  45. import "./chunk-ZOO4I2U4.js";
  46. import "./chunk-JPUFJK2B.js";
  47. import "./chunk-HZ2WKB3G.js";
  48. import "./chunk-3HCJD762.js";
  49. import "./chunk-RVCE264D.js";
  50. import "./chunk-HKJ7X3BD.js";
  51. import "./chunk-Y74D3LKQ.js";
  52. import "./chunk-PK4W65H4.js";
  53. import "./chunk-7C23ILQ4.js";
  54. import "./chunk-P6VVVEX6.js";
  55. import "./chunk-3Z755LKF.js";
  56. import "./chunk-LTZ5XXDV.js";
  57. import "./chunk-IEU3AM37.js";
  58. import "./chunk-SKKBVHTF.js";
  59. import "./chunk-DLMAGHHC.js";
  60. import {
  61. x as x2
  62. } from "./chunk-WD4J43GZ.js";
  63. import "./chunk-JOYXMSKE.js";
  64. import "./chunk-SZFMKPVM.js";
  65. import "./chunk-YZVAB3DF.js";
  66. import "./chunk-JLYTER4T.js";
  67. import "./chunk-CRHRHOXH.js";
  68. import "./chunk-ZSW35JPD.js";
  69. import "./chunk-JLSNMUQJ.js";
  70. import "./chunk-ECY35CJI.js";
  71. import "./chunk-PT62335L.js";
  72. import "./chunk-JGBXYDGB.js";
  73. import "./chunk-QEWF7QPH.js";
  74. import "./chunk-PJNBFKPF.js";
  75. import "./chunk-C7742RNZ.js";
  76. import "./chunk-FNA5GLRW.js";
  77. import "./chunk-MCWCB5IY.js";
  78. import "./chunk-TV3CFJQR.js";
  79. import "./chunk-TJV6ODRM.js";
  80. import "./chunk-JUWKPBLS.js";
  81. import "./chunk-WLSB4F4I.js";
  82. import "./chunk-GLSWDDR3.js";
  83. import "./chunk-MIQGEDET.js";
  84. import "./chunk-DUEMJ5XS.js";
  85. import "./chunk-VRLXUHP2.js";
  86. import "./chunk-3LVSQLWJ.js";
  87. import {
  88. f,
  89. p
  90. } from "./chunk-4ONPMX2F.js";
  91. import "./chunk-CRGY2SDS.js";
  92. import "./chunk-4T5ZGMEN.js";
  93. import "./chunk-GN35O2ZO.js";
  94. import "./chunk-XTVKPAWY.js";
  95. import "./chunk-3OSQ6GXO.js";
  96. import "./chunk-3WQOA5CB.js";
  97. import "./chunk-PLWDAYK7.js";
  98. import "./chunk-FZQZIM7U.js";
  99. import "./chunk-CZBRZ6SU.js";
  100. import "./chunk-VGWC3IKZ.js";
  101. import "./chunk-2H5MD622.js";
  102. import "./chunk-3RSFVUKZ.js";
  103. import "./chunk-UVVU4UUO.js";
  104. import "./chunk-HWSWTWZD.js";
  105. import "./chunk-O6VYMEIX.js";
  106. import "./chunk-X4SA4ELJ.js";
  107. import "./chunk-5N7JLUJJ.js";
  108. import "./chunk-ZAY3CMAZ.js";
  109. import "./chunk-P3XKUGLS.js";
  110. import "./chunk-2ZSOO377.js";
  111. import "./chunk-YUA3AHKR.js";
  112. import "./chunk-LU5IJZB4.js";
  113. import "./chunk-7IBV2TRE.js";
  114. import "./chunk-ZLNEXZAN.js";
  115. import "./chunk-5UVJ64RB.js";
  116. import "./chunk-SFEFRQCL.js";
  117. import "./chunk-DXVOOCG4.js";
  118. import "./chunk-3GZSQU56.js";
  119. import "./chunk-ZYRIJWLX.js";
  120. import "./chunk-RYY6632W.js";
  121. import "./chunk-DW42UVIT.js";
  122. import "./chunk-YAEIHDJH.js";
  123. import "./chunk-TJNOJH33.js";
  124. import "./chunk-OSHI574D.js";
  125. import "./chunk-ETGAZ7LF.js";
  126. import "./chunk-75U5LM2V.js";
  127. import "./chunk-RMDDCMKS.js";
  128. import "./chunk-VCH45Q2I.js";
  129. import "./chunk-LBW34VZ2.js";
  130. import "./chunk-GSSTTHIT.js";
  131. import {
  132. m
  133. } from "./chunk-YFSLJIO4.js";
  134. import "./chunk-IM3LVQXV.js";
  135. import "./chunk-55RWC67C.js";
  136. import "./chunk-HZRKBTHJ.js";
  137. import "./chunk-DVUG3KID.js";
  138. import "./chunk-FWSQEIAR.js";
  139. import {
  140. j
  141. } from "./chunk-VEGAOVMY.js";
  142. import {
  143. o,
  144. w2
  145. } from "./chunk-6T6G6LCQ.js";
  146. import "./chunk-YEJL5NEF.js";
  147. import {
  148. k2 as k
  149. } from "./chunk-PQFTYGF5.js";
  150. import {
  151. e,
  152. n5 as n,
  153. y3 as y
  154. } from "./chunk-2Z2TG5CU.js";
  155. import "./chunk-6KZ2LTDA.js";
  156. import "./chunk-U2XHEJM7.js";
  157. import "./chunk-SQOPWYIT.js";
  158. import {
  159. w,
  160. x
  161. } from "./chunk-V6P2MAQQ.js";
  162. import {
  163. s3 as s
  164. } from "./chunk-E5O6P5I2.js";
  165. import {
  166. has
  167. } from "./chunk-SPWQ3AWG.js";
  168. import "./chunk-2TIUKVZN.js";
  169. import {
  170. r
  171. } from "./chunk-YXWMMD76.js";
  172. import "./chunk-S5KM4IGW.js";
  173. // node_modules/@arcgis/core/layers/graphics/sources/CSVSource.js
  174. var u2 = class extends m {
  175. constructor(t) {
  176. super(t), this.type = "csv", this.refresh = x(async (t2) => {
  177. await this.load();
  178. const { extent: e2, timeExtent: o2 } = await this._connection.invoke("refresh", t2);
  179. return this.sourceJSON.extent = e2, o2 && (this.sourceJSON.timeInfo.timeExtent = [o2.start, o2.end]), { dataChanged: true, updates: { extent: this.sourceJSON.extent, timeInfo: this.sourceJSON.timeInfo } };
  180. });
  181. }
  182. load(t) {
  183. const e2 = r(t) ? t.signal : null;
  184. return this.addResolvingPromise(this._startWorker(e2)), Promise.resolve(this);
  185. }
  186. destroy() {
  187. var _a;
  188. (_a = this._connection) == null ? void 0 : _a.close(), this._connection = null;
  189. }
  190. async openPorts() {
  191. return await this.load(), this._connection.openPorts();
  192. }
  193. async queryFeatures(t, e2 = {}) {
  194. await this.load(e2);
  195. const o2 = await this._connection.invoke("queryFeatures", t ? t.toJSON() : null, e2);
  196. return x3.fromJSON(o2);
  197. }
  198. async queryFeaturesJSON(t, e2 = {}) {
  199. return await this.load(e2), this._connection.invoke("queryFeatures", t ? t.toJSON() : null, e2);
  200. }
  201. async queryFeatureCount(t, e2 = {}) {
  202. return await this.load(e2), this._connection.invoke("queryFeatureCount", t ? t.toJSON() : null, e2);
  203. }
  204. async queryObjectIds(t, e2 = {}) {
  205. return await this.load(e2), this._connection.invoke("queryObjectIds", t ? t.toJSON() : null, e2);
  206. }
  207. async queryExtent(t, e2 = {}) {
  208. await this.load(e2);
  209. const o2 = await this._connection.invoke("queryExtent", t ? t.toJSON() : null, e2);
  210. return { count: o2.count, extent: w2.fromJSON(o2.extent) };
  211. }
  212. async querySnapping(t, e2 = {}) {
  213. return await this.load(e2), this._connection.invoke("querySnapping", t, e2);
  214. }
  215. async _startWorker(t) {
  216. this._connection = await u("CSVSourceWorker", { strategy: has("feature-layers-workers") ? "dedicated" : "local", signal: t });
  217. const { url: e2, delimiter: o2, fields: r2, latitudeField: i, longitudeField: n2, spatialReference: a, timeInfo: c } = this.loadOptions, u3 = await this._connection.invoke("load", { url: e2, customParameters: this.customParameters, parsingOptions: { delimiter: o2, fields: r2 == null ? void 0 : r2.map((t2) => t2.toJSON()), latitudeField: i, longitudeField: n2, spatialReference: a == null ? void 0 : a.toJSON(), timeInfo: c == null ? void 0 : c.toJSON() } }, { signal: t });
  218. this.locationInfo = u3.locationInfo, this.sourceJSON = u3.layerDefinition, this.delimiter = u3.delimiter;
  219. }
  220. };
  221. e([y()], u2.prototype, "type", void 0), e([y()], u2.prototype, "loadOptions", void 0), e([y()], u2.prototype, "customParameters", void 0), e([y()], u2.prototype, "locationInfo", void 0), e([y()], u2.prototype, "sourceJSON", void 0), e([y()], u2.prototype, "delimiter", void 0), u2 = e([n("esri.layers.graphics.sources.CSVSource")], u2);
  222. // node_modules/@arcgis/core/layers/CSVLayer.js
  223. function m2(e2, r2) {
  224. throw new s(r2, `CSVLayer (title: ${e2.title}, id: ${e2.id}) cannot be saved to a portal item`);
  225. }
  226. var f2 = class extends Ze {
  227. constructor(...e2) {
  228. super(...e2), this.geometryType = "point", this.capabilities = l(false, false), this.delimiter = null, this.editingEnabled = false, this.fields = null, this.latitudeField = null, this.locationType = "coordinates", this.longitudeField = null, this.operationalLayerType = "CSV", this.outFields = ["*"], this.path = null, this.spatialReference = k.WGS84, this.source = null, this.type = "csv";
  229. }
  230. normalizeCtorArgs(e2, t) {
  231. return "string" == typeof e2 ? { url: e2, ...t } : e2;
  232. }
  233. load(e2) {
  234. const t = r(e2) ? e2.signal : null, o2 = this.loadFromPortal({ supportedTypes: ["CSV"], supportsData: false }, e2).catch(w).then(async () => this.initLayerProperties(await this.createGraphicsSource(t)));
  235. return this.addResolvingPromise(o2), Promise.resolve(this);
  236. }
  237. get isTable() {
  238. return this.loaded && null == this.geometryType;
  239. }
  240. readWebMapLabelsVisible(e2, t) {
  241. return null != t.showLabels ? t.showLabels : !!(t.layerDefinition && t.layerDefinition.drawingInfo && t.layerDefinition.drawingInfo.labelingInfo);
  242. }
  243. set url(e2) {
  244. if (!e2)
  245. return void this._set("url", e2);
  246. const t = j(e2);
  247. this._set("url", t.path), t.query && (this.customParameters = { ...this.customParameters, ...t.query });
  248. }
  249. async createGraphicsSource(e2) {
  250. const t = new u2({ loadOptions: { delimiter: this.delimiter, fields: this.fields, latitudeField: this.latitudeField, longitudeField: this.longitudeField, spatialReference: this.spatialReference, timeInfo: this.timeInfo, url: this.url }, customParameters: this.customParameters });
  251. return this._set("source", t), await t.load({ signal: e2 }), this.read({ locationInfo: t.locationInfo, columnDelimiter: t.delimiter }, { origin: "service", url: this.parsedUrl }), t;
  252. }
  253. queryFeatures(e2, t) {
  254. return this.load().then(() => this.source.queryFeatures(x2.from(e2) || this.createQuery())).then((e3) => {
  255. if (e3 == null ? void 0 : e3.features)
  256. for (const t2 of e3.features)
  257. t2.layer = t2.sourceLayer = this;
  258. return e3;
  259. });
  260. }
  261. queryObjectIds(e2, t) {
  262. return this.load().then(() => this.source.queryObjectIds(x2.from(e2) || this.createQuery()));
  263. }
  264. queryFeatureCount(e2, t) {
  265. return this.load().then(() => this.source.queryFeatureCount(x2.from(e2) || this.createQuery()));
  266. }
  267. queryExtent(e2, t) {
  268. return this.load().then(() => this.source.queryExtent(x2.from(e2) || this.createQuery()));
  269. }
  270. read(e2, t) {
  271. super.read(e2, t), t && "service" === t.origin && this.revert(["latitudeField", "longitudeField"], "service");
  272. }
  273. write(e2, t) {
  274. return super.write(e2, { ...t, writeLayerSchema: true });
  275. }
  276. clone() {
  277. throw new s("csv-layer:clone", `CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`);
  278. }
  279. async save(e2) {
  280. return m2(this, "csv-layer:save");
  281. }
  282. async saveAs(e2, t) {
  283. return m2(this, "csv-layer:save-as");
  284. }
  285. async hasDataChanged() {
  286. try {
  287. const { dataChanged: e2, updates: t } = await this.source.refresh(this.customParameters);
  288. return r(t) && this.read(t, { origin: "service", url: this.parsedUrl, ignoreDefaults: true }), e2;
  289. } catch {
  290. }
  291. return false;
  292. }
  293. _verifyFields() {
  294. }
  295. _verifySource() {
  296. }
  297. _hasMemorySource() {
  298. return false;
  299. }
  300. };
  301. e([y({ readOnly: true, json: { read: false, write: false } })], f2.prototype, "capabilities", void 0), e([y({ type: [",", " ", ";", "|", " "], json: { read: { source: "columnDelimiter" }, write: { target: "columnDelimiter", ignoreOrigin: true } } })], f2.prototype, "delimiter", void 0), e([y({ readOnly: true, type: Boolean, json: { origins: { "web-scene": { read: false, write: false } } } })], f2.prototype, "editingEnabled", void 0), e([y({ json: { read: { source: "layerDefinition.fields" }, write: { target: "layerDefinition.fields" } } })], f2.prototype, "fields", void 0), e([y({ type: Boolean, readOnly: true })], f2.prototype, "isTable", null), e([o("web-map", "labelsVisible", ["layerDefinition.drawingInfo.labelingInfo", "showLabels"])], f2.prototype, "readWebMapLabelsVisible", null), e([y({ type: String, json: { read: { source: "locationInfo.latitudeFieldName" }, write: { target: "locationInfo.latitudeFieldName", ignoreOrigin: true } } })], f2.prototype, "latitudeField", void 0), e([y({ type: ["show", "hide"] })], f2.prototype, "listMode", void 0), e([y({ type: ["coordinates"], json: { read: { source: "locationInfo.locationType" }, write: { target: "locationInfo.locationType", ignoreOrigin: true, isRequired: true } } })], f2.prototype, "locationType", void 0), e([y({ type: String, json: { read: { source: "locationInfo.longitudeFieldName" }, write: { target: "locationInfo.longitudeFieldName", ignoreOrigin: true } } })], f2.prototype, "longitudeField", void 0), e([y({ type: ["CSV"] })], f2.prototype, "operationalLayerType", void 0), e([y()], f2.prototype, "outFields", void 0), e([y({ type: String, json: { origins: { "web-scene": { read: false, write: false } }, read: false, write: false } })], f2.prototype, "path", void 0), e([y({ json: { read: false }, cast: null, type: u2, readOnly: true })], f2.prototype, "source", void 0), e([y({ json: { read: false }, value: "csv", readOnly: true })], f2.prototype, "type", void 0), e([y({ json: { read: p, write: { isRequired: true, ignoreOrigin: true, writer: f } } })], f2.prototype, "url", null), f2 = e([n("esri.layers.CSVLayer")], f2);
  302. var g = f2;
  303. export {
  304. g as default
  305. };
  306. //# sourceMappingURL=CSVLayer-6YW6DGCE.js.map