GeoJSONLayer-YDKKKMXQ.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. import {
  2. l
  3. } from "./chunk-A6WD5XTM.js";
  4. import "./chunk-OP2HNSVZ.js";
  5. import {
  6. c
  7. } from "./chunk-AOQ55JXI.js";
  8. import {
  9. n as n4,
  10. p as p3
  11. } from "./chunk-X42TFXOU.js";
  12. import "./chunk-JFSMKLAQ.js";
  13. import "./chunk-LXOC7SMQ.js";
  14. import {
  15. s as s3
  16. } from "./chunk-DN6W4TJU.js";
  17. import {
  18. u
  19. } from "./chunk-OUUXJOLT.js";
  20. import "./chunk-NBKUI76A.js";
  21. import "./chunk-6334AFGG.js";
  22. import {
  23. x as x3
  24. } from "./chunk-NLLFSKB2.js";
  25. import "./chunk-S6EFEKAU.js";
  26. import {
  27. a
  28. } from "./chunk-XEQ4FTFC.js";
  29. import "./chunk-JM5OVQAD.js";
  30. import {
  31. n as n5
  32. } from "./chunk-NQA5XJGK.js";
  33. import {
  34. p as p4
  35. } from "./chunk-EKYSPJO6.js";
  36. import {
  37. i as i2,
  38. j2
  39. } from "./chunk-JAUFBT5U.js";
  40. import {
  41. o
  42. } from "./chunk-W6U6FKJ3.js";
  43. import {
  44. p as p5
  45. } from "./chunk-7C2KDOAI.js";
  46. import {
  47. n as n3,
  48. p2
  49. } from "./chunk-RHFU6KWO.js";
  50. import "./chunk-3FNKD2EB.js";
  51. import "./chunk-ZOO4I2U4.js";
  52. import "./chunk-JPUFJK2B.js";
  53. import "./chunk-HZ2WKB3G.js";
  54. import "./chunk-3HCJD762.js";
  55. import "./chunk-RVCE264D.js";
  56. import "./chunk-HKJ7X3BD.js";
  57. import "./chunk-Y74D3LKQ.js";
  58. import "./chunk-PK4W65H4.js";
  59. import "./chunk-7C23ILQ4.js";
  60. import {
  61. k as k2
  62. } from "./chunk-P6VVVEX6.js";
  63. import "./chunk-3Z755LKF.js";
  64. import "./chunk-LTZ5XXDV.js";
  65. import "./chunk-IEU3AM37.js";
  66. import "./chunk-SKKBVHTF.js";
  67. import "./chunk-DLMAGHHC.js";
  68. import {
  69. x as x2
  70. } from "./chunk-WD4J43GZ.js";
  71. import "./chunk-JOYXMSKE.js";
  72. import "./chunk-JLYTER4T.js";
  73. import "./chunk-CRHRHOXH.js";
  74. import "./chunk-ZSW35JPD.js";
  75. import "./chunk-JLSNMUQJ.js";
  76. import "./chunk-ECY35CJI.js";
  77. import "./chunk-PT62335L.js";
  78. import {
  79. y as y2
  80. } from "./chunk-JGBXYDGB.js";
  81. import "./chunk-QEWF7QPH.js";
  82. import "./chunk-PJNBFKPF.js";
  83. import "./chunk-C7742RNZ.js";
  84. import "./chunk-FNA5GLRW.js";
  85. import "./chunk-MCWCB5IY.js";
  86. import "./chunk-TV3CFJQR.js";
  87. import "./chunk-TJV6ODRM.js";
  88. import {
  89. v as v2
  90. } from "./chunk-JUWKPBLS.js";
  91. import {
  92. c as c3
  93. } from "./chunk-WLSB4F4I.js";
  94. import {
  95. c as c2,
  96. d,
  97. f,
  98. j as j3,
  99. l as l2,
  100. m as m2,
  101. p as p6,
  102. w as w3
  103. } from "./chunk-GLSWDDR3.js";
  104. import {
  105. O
  106. } from "./chunk-MIQGEDET.js";
  107. import "./chunk-DUEMJ5XS.js";
  108. import "./chunk-VRLXUHP2.js";
  109. import "./chunk-3LVSQLWJ.js";
  110. import "./chunk-4ONPMX2F.js";
  111. import {
  112. F,
  113. x as x4
  114. } from "./chunk-CRGY2SDS.js";
  115. import "./chunk-4T5ZGMEN.js";
  116. import {
  117. p
  118. } from "./chunk-GN35O2ZO.js";
  119. import {
  120. n as n2
  121. } from "./chunk-XTVKPAWY.js";
  122. import "./chunk-3OSQ6GXO.js";
  123. import "./chunk-3WQOA5CB.js";
  124. import {
  125. t as t2
  126. } from "./chunk-PLWDAYK7.js";
  127. import "./chunk-FZQZIM7U.js";
  128. import "./chunk-CZBRZ6SU.js";
  129. import "./chunk-VGWC3IKZ.js";
  130. import "./chunk-2H5MD622.js";
  131. import "./chunk-3RSFVUKZ.js";
  132. import "./chunk-UVVU4UUO.js";
  133. import "./chunk-HWSWTWZD.js";
  134. import "./chunk-O6VYMEIX.js";
  135. import "./chunk-X4SA4ELJ.js";
  136. import "./chunk-5N7JLUJJ.js";
  137. import "./chunk-ZAY3CMAZ.js";
  138. import "./chunk-P3XKUGLS.js";
  139. import "./chunk-2ZSOO377.js";
  140. import "./chunk-YUA3AHKR.js";
  141. import "./chunk-LU5IJZB4.js";
  142. import "./chunk-7IBV2TRE.js";
  143. import "./chunk-ZLNEXZAN.js";
  144. import "./chunk-5UVJ64RB.js";
  145. import "./chunk-SFEFRQCL.js";
  146. import {
  147. b
  148. } from "./chunk-DXVOOCG4.js";
  149. import "./chunk-3GZSQU56.js";
  150. import "./chunk-ZYRIJWLX.js";
  151. import "./chunk-RYY6632W.js";
  152. import "./chunk-DW42UVIT.js";
  153. import "./chunk-YAEIHDJH.js";
  154. import "./chunk-TJNOJH33.js";
  155. import "./chunk-OSHI574D.js";
  156. import "./chunk-ETGAZ7LF.js";
  157. import {
  158. i
  159. } from "./chunk-75U5LM2V.js";
  160. import "./chunk-RMDDCMKS.js";
  161. import {
  162. v2 as v
  163. } from "./chunk-VCH45Q2I.js";
  164. import "./chunk-LBW34VZ2.js";
  165. import "./chunk-GSSTTHIT.js";
  166. import {
  167. m
  168. } from "./chunk-YFSLJIO4.js";
  169. import "./chunk-IM3LVQXV.js";
  170. import "./chunk-55RWC67C.js";
  171. import "./chunk-HZRKBTHJ.js";
  172. import "./chunk-DVUG3KID.js";
  173. import "./chunk-FWSQEIAR.js";
  174. import {
  175. j
  176. } from "./chunk-VEGAOVMY.js";
  177. import {
  178. w2
  179. } from "./chunk-6T6G6LCQ.js";
  180. import "./chunk-YEJL5NEF.js";
  181. import {
  182. k2 as k
  183. } from "./chunk-PQFTYGF5.js";
  184. import {
  185. e,
  186. n5 as n,
  187. y3 as y
  188. } from "./chunk-2Z2TG5CU.js";
  189. import "./chunk-6KZ2LTDA.js";
  190. import "./chunk-U2XHEJM7.js";
  191. import "./chunk-SQOPWYIT.js";
  192. import {
  193. w,
  194. x
  195. } from "./chunk-V6P2MAQQ.js";
  196. import {
  197. s2 as s,
  198. s3 as s2
  199. } from "./chunk-E5O6P5I2.js";
  200. import {
  201. has
  202. } from "./chunk-SPWQ3AWG.js";
  203. import "./chunk-2TIUKVZN.js";
  204. import {
  205. r,
  206. t
  207. } from "./chunk-YXWMMD76.js";
  208. import "./chunk-S5KM4IGW.js";
  209. // node_modules/@arcgis/core/layers/graphics/sources/GeoJSONSource.js
  210. var y3 = "esri.layers.graphics.sources.GeoJSONSource";
  211. var f2 = s.getLogger(y3);
  212. var g = class extends m {
  213. constructor() {
  214. super(...arguments), this.type = "geojson", this.refresh = x(async (e2) => {
  215. await this.load();
  216. const { extent: t3, timeExtent: r2 } = await this._connection.invoke("refresh", e2);
  217. return this.sourceJSON.extent = t3, r2 && (this.sourceJSON.timeInfo.timeExtent = [r2.start, r2.end]), { dataChanged: true, updates: { extent: this.sourceJSON.extent, timeInfo: this.sourceJSON.timeInfo } };
  218. });
  219. }
  220. load(e2) {
  221. const t3 = r(e2) ? e2.signal : null;
  222. return this.addResolvingPromise(this._startWorker(t3)), Promise.resolve(this);
  223. }
  224. destroy() {
  225. var _a;
  226. (_a = this._connection) == null ? void 0 : _a.close(), this._connection = null;
  227. }
  228. applyEdits(e2) {
  229. return this.load().then(() => this._applyEdits(e2));
  230. }
  231. openPorts() {
  232. return this.load().then(() => this._connection.openPorts());
  233. }
  234. queryFeatures(e2, t3 = {}) {
  235. return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)).then((e3) => x3.fromJSON(e3));
  236. }
  237. queryFeaturesJSON(e2, t3 = {}) {
  238. return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3));
  239. }
  240. queryFeatureCount(e2, t3 = {}) {
  241. return this.load(t3).then(() => this._connection.invoke("queryFeatureCount", e2 ? e2.toJSON() : null, t3));
  242. }
  243. queryObjectIds(e2, t3 = {}) {
  244. return this.load(t3).then(() => this._connection.invoke("queryObjectIds", e2 ? e2.toJSON() : null, t3));
  245. }
  246. queryExtent(e2, t3 = {}) {
  247. return this.load(t3).then(() => this._connection.invoke("queryExtent", e2 ? e2.toJSON() : null, t3)).then((e3) => ({ count: e3.count, extent: w2.fromJSON(e3.extent) }));
  248. }
  249. querySnapping(e2, t3 = {}) {
  250. return this.load(t3).then(() => this._connection.invoke("querySnapping", e2, t3));
  251. }
  252. _applyEdits(e2) {
  253. if (!this._connection)
  254. throw new s2("geojson-layer-source:edit-failure", "Memory source not loaded");
  255. const r2 = this.layer.objectIdField, o2 = [], s4 = [], i3 = [];
  256. if (e2.addFeatures)
  257. for (const t3 of e2.addFeatures)
  258. o2.push(this._serializeFeature(t3));
  259. if (e2.deleteFeatures)
  260. for (const t3 of e2.deleteFeatures)
  261. "objectId" in t3 && null != t3.objectId ? s4.push(t3.objectId) : "attributes" in t3 && null != t3.attributes[r2] && s4.push(t3.attributes[r2]);
  262. if (e2.updateFeatures)
  263. for (const t3 of e2.updateFeatures)
  264. i3.push(this._serializeFeature(t3));
  265. return this._connection.invoke("applyEdits", { adds: o2, updates: i3, deletes: s4 }).then(({ extent: e3, timeExtent: t3, featureEditResults: r3 }) => (this.sourceJSON.extent = e3, t3 && (this.sourceJSON.timeInfo.timeExtent = [t3.start, t3.end]), this._createEditsResult(r3)));
  266. }
  267. _createEditsResult(e2) {
  268. return { addFeatureResults: e2.addResults ? e2.addResults.map(this._createFeatureEditResult, this) : [], updateFeatureResults: e2.updateResults ? e2.updateResults.map(this._createFeatureEditResult, this) : [], deleteFeatureResults: e2.deleteResults ? e2.deleteResults.map(this._createFeatureEditResult, this) : [], addAttachmentResults: [], updateAttachmentResults: [], deleteAttachmentResults: [] };
  269. }
  270. _createFeatureEditResult(e2) {
  271. const r2 = true === e2.success ? null : e2.error || { code: void 0, description: void 0 };
  272. return { objectId: e2.objectId, globalId: e2.globalId, error: r2 ? new s2("geojson-layer-source:edit-failure", r2.description, { code: r2.code }) : null };
  273. }
  274. _serializeFeature(e2) {
  275. const { attributes: t3 } = e2, r2 = this._geometryForSerialization(e2);
  276. return r2 ? { geometry: r2.toJSON(), attributes: t3 } : { attributes: t3 };
  277. }
  278. _geometryForSerialization(e2) {
  279. const { geometry: t3 } = e2;
  280. return t(t3) ? null : "mesh" === t3.type || "extent" === t3.type ? v.fromExtent(t3.extent) : t3;
  281. }
  282. async _startWorker(e2) {
  283. this._connection = await u("GeoJSONSourceWorker", { strategy: has("feature-layers-workers") ? "dedicated" : "local", signal: e2 });
  284. const { fields: t3, spatialReference: r2, hasZ: o2, geometryType: s4, objectIdField: i3, url: n6, timeInfo: u2, customParameters: l3 } = this.layer, d2 = "defaults" === this.layer.originOf("spatialReference"), p7 = { url: n6, customParameters: l3, fields: t3 && t3.map((e3) => e3.toJSON()), geometryType: i.toJSON(s4), hasZ: o2, objectIdField: i3, timeInfo: u2 ? u2.toJSON() : null, spatialReference: d2 ? null : r2 && r2.toJSON() }, h = await this._connection.invoke("load", p7, { signal: e2 });
  285. for (const a2 of h.warnings)
  286. f2.warn(a2.message, { layer: this.layer, warning: a2 });
  287. h.featureErrors.length && f2.warn(`Encountered ${h.featureErrors.length} validation errors while loading features`, h.featureErrors), this.sourceJSON = h.layerDefinition, this.capabilities = l(this.sourceJSON.hasZ, true);
  288. }
  289. };
  290. e([y()], g.prototype, "capabilities", void 0), e([y()], g.prototype, "type", void 0), e([y({ constructOnly: true })], g.prototype, "layer", void 0), e([y()], g.prototype, "sourceJSON", void 0), g = e([n(y3)], g);
  291. // node_modules/@arcgis/core/layers/GeoJSONLayer.js
  292. var Z = s3();
  293. var M = class extends c(o(n4(p3(n2(a(t2(p(c3(v2(O(b))))))))))) {
  294. constructor(e2) {
  295. super(e2), this.copyright = null, this.definitionExpression = null, this.displayField = null, this.editingEnabled = false, this.elevationInfo = null, this.fields = null, this.fieldsIndex = null, this.fullExtent = null, this.geometryType = null, this.hasZ = void 0, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.objectIdField = null, this.operationalLayerType = "GeoJSON", this.popupEnabled = true, this.popupTemplate = null, this.screenSizePerspectiveEnabled = true, this.source = new g({ layer: this }), this.spatialReference = k.WGS84, this.templates = null, this.title = "GeoJSON", this.type = "geojson", this.typeIdField = null, this.types = null;
  296. }
  297. destroy() {
  298. var _a;
  299. (_a = this.source) == null ? void 0 : _a.destroy();
  300. }
  301. load(e2) {
  302. const t3 = this.loadFromPortal({ supportedTypes: ["GeoJson"], supportsData: false }, e2).catch(w).then(() => this.source.load(e2)).then(() => {
  303. this.read(this.source.sourceJSON, { origin: "service", url: this.parsedUrl }), this.revert(["objectIdField", "fields", "timeInfo"], "service"), F(this.renderer, this.fieldsIndex), x4(this.timeInfo, this.fieldsIndex);
  304. });
  305. return this.addResolvingPromise(t3), Promise.resolve(this);
  306. }
  307. get capabilities() {
  308. return this.source ? this.source.capabilities : null;
  309. }
  310. get createQueryVersion() {
  311. return this.commitProperty("definitionExpression"), this.commitProperty("timeExtent"), this.commitProperty("timeOffset"), this.commitProperty("geometryType"), this.commitProperty("capabilities"), (this._get("createQueryVersion") || 0) + 1;
  312. }
  313. get defaultPopupTemplate() {
  314. return this.createPopupTemplate();
  315. }
  316. get isTable() {
  317. return this.loaded && null == this.geometryType;
  318. }
  319. get parsedUrl() {
  320. return this.url ? j(this.url) : null;
  321. }
  322. set renderer(e2) {
  323. F(e2, this.fieldsIndex), this._set("renderer", e2);
  324. }
  325. set url(e2) {
  326. if (!e2)
  327. return void this._set("url", e2);
  328. const t3 = j(e2);
  329. this._set("url", t3.path), t3.query && (this.customParameters = { ...this.customParameters, ...t3.query });
  330. }
  331. async applyEdits(e2, t3) {
  332. const r2 = await import("./editingSupport-YMIKJKVG.js");
  333. await this.load();
  334. const i3 = await r2.applyEdits(this, this.source, e2, t3);
  335. return this.read({ extent: this.source.sourceJSON.extent, timeInfo: this.source.sourceJSON.timeInfo }, { origin: "service", ignoreDefaults: true }), i3;
  336. }
  337. on(e2, t3) {
  338. return super.on(e2, t3);
  339. }
  340. createPopupTemplate(e2) {
  341. return p5(this, e2);
  342. }
  343. createQuery() {
  344. const e2 = new x2(), t3 = this.get("capabilities.data");
  345. e2.returnGeometry = true, t3 && t3.supportsZ && (e2.returnZ = true), e2.outFields = ["*"], e2.where = this.definitionExpression || "1=1";
  346. const { timeOffset: r2, timeExtent: i3 } = this;
  347. return e2.timeExtent = null != r2 && null != i3 ? i3.offset(-r2.value, r2.unit) : i3 || null, e2;
  348. }
  349. getFieldDomain(e2, t3) {
  350. let r2, i3 = false;
  351. const o2 = t3 && t3.feature, s4 = o2 && o2.attributes, p7 = this.typeIdField && s4 && s4[this.typeIdField];
  352. return null != p7 && this.types && (i3 = this.types.some((t4) => t4.id == p7 && (r2 = t4.domains && t4.domains[e2], r2 && "inherited" === r2.type && (r2 = this._getLayerDomain(e2)), true))), i3 || r2 || (r2 = this._getLayerDomain(e2)), r2;
  353. }
  354. getField(e2) {
  355. return this.fieldsIndex.get(e2);
  356. }
  357. queryFeatures(e2, t3) {
  358. return this.load().then(() => this.source.queryFeatures(x2.from(e2) || this.createQuery(), t3)).then((e3) => {
  359. if (e3 == null ? void 0 : e3.features)
  360. for (const t4 of e3.features)
  361. t4.layer = t4.sourceLayer = this;
  362. return e3;
  363. });
  364. }
  365. queryObjectIds(e2, t3) {
  366. return this.load().then(() => this.source.queryObjectIds(x2.from(e2) || this.createQuery(), t3));
  367. }
  368. queryFeatureCount(e2, t3) {
  369. return this.load().then(() => this.source.queryFeatureCount(x2.from(e2) || this.createQuery(), t3));
  370. }
  371. queryExtent(e2, t3) {
  372. return this.load().then(() => this.source.queryExtent(x2.from(e2) || this.createQuery(), t3));
  373. }
  374. async hasDataChanged() {
  375. try {
  376. const { dataChanged: e2, updates: t3 } = await this.source.refresh(this.customParameters);
  377. return r(t3) && this.read(t3, { origin: "service", url: this.parsedUrl, ignoreDefaults: true }), e2;
  378. } catch {
  379. }
  380. return false;
  381. }
  382. _getLayerDomain(e2) {
  383. if (!this.fields)
  384. return null;
  385. let t3 = null;
  386. return this.fields.some((r2) => (r2.name === e2 && (t3 = r2.domain), !!t3)), t3;
  387. }
  388. };
  389. e([y({ readOnly: true, json: { read: false, write: false } })], M.prototype, "capabilities", null), e([y({ type: String })], M.prototype, "copyright", void 0), e([y({ readOnly: true })], M.prototype, "createQueryVersion", null), e([y({ readOnly: true })], M.prototype, "defaultPopupTemplate", null), e([y({ type: String, json: { name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], M.prototype, "definitionExpression", void 0), e([y({ type: String })], M.prototype, "displayField", void 0), e([y({ type: Boolean })], M.prototype, "editingEnabled", void 0), e([y(d)], M.prototype, "elevationInfo", void 0), e([y({ type: [y2], json: { name: "layerDefinition.fields", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "fields" } } } })], M.prototype, "fields", void 0), e([y(Z.fieldsIndex)], M.prototype, "fieldsIndex", void 0), e([y({ type: w2, json: { name: "extent" } })], M.prototype, "fullExtent", void 0), e([y({ type: ["point", "polygon", "polyline", "multipoint"], json: { read: { reader: i.read } } })], M.prototype, "geometryType", void 0), e([y({ type: Boolean })], M.prototype, "hasZ", void 0), e([y(j3)], M.prototype, "id", void 0), e([y({ type: Boolean, readOnly: true })], M.prototype, "isTable", null), e([y(m2)], M.prototype, "labelsVisible", void 0), e([y({ type: [j2], json: { name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: i2 }, write: true } })], M.prototype, "labelingInfo", void 0), e([y(c2)], M.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide"] })], M.prototype, "listMode", void 0), e([y({ type: String, json: { name: "layerDefinition.objectIdField", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "objectIdField" } } } })], M.prototype, "objectIdField", void 0), e([y(w3)], M.prototype, "opacity", void 0), e([y({ type: ["GeoJSON"] })], M.prototype, "operationalLayerType", void 0), e([y({ readOnly: true })], M.prototype, "parsedUrl", null), e([y(p6)], M.prototype, "popupEnabled", void 0), e([y({ type: k2, json: { name: "popupInfo", write: true } })], M.prototype, "popupTemplate", void 0), e([y({ types: p2, json: { name: "layerDefinition.drawingInfo.renderer", write: true, origins: { service: { name: "drawingInfo.renderer" }, "web-scene": { types: n3 } } } })], M.prototype, "renderer", null), e([y(l2)], M.prototype, "screenSizePerspectiveEnabled", void 0), e([y({ readOnly: true })], M.prototype, "source", void 0), e([y({ type: k })], M.prototype, "spatialReference", void 0), e([y({ type: [p4] })], M.prototype, "templates", void 0), e([y()], M.prototype, "title", void 0), e([y({ json: { read: false }, readOnly: true })], M.prototype, "type", void 0), e([y({ type: String, readOnly: true })], M.prototype, "typeIdField", void 0), e([y({ type: [n5] })], M.prototype, "types", void 0), e([y(f)], M.prototype, "url", null), M = e([n("esri.layers.GeoJSONLayer")], M);
  390. var k3 = M;
  391. export {
  392. k3 as default
  393. };
  394. //# sourceMappingURL=GeoJSONLayer-YDKKKMXQ.js.map