GeoJSONLayer-G3YCJ5UG.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. import {
  2. c
  3. } from "./chunk-4D6PVVFX.js";
  4. import "./chunk-WQJRLXWG.js";
  5. import {
  6. p as p4
  7. } from "./chunk-XKHC7KKF.js";
  8. import {
  9. p as p3,
  10. p3 as p5,
  11. r as r2
  12. } from "./chunk-HGDNY7J3.js";
  13. import "./chunk-GD5TMIPM.js";
  14. import {
  15. l as l2
  16. } from "./chunk-ZRX5UNQH.js";
  17. import {
  18. u
  19. } from "./chunk-VEAEIBHK.js";
  20. import "./chunk-6SASJ6IM.js";
  21. import "./chunk-3OHML7FO.js";
  22. import {
  23. x as x2
  24. } from "./chunk-2VFJVI2I.js";
  25. import {
  26. a as a3
  27. } from "./chunk-435DJNTD.js";
  28. import "./chunk-T3EUPDKL.js";
  29. import "./chunk-2SJEIKRW.js";
  30. import "./chunk-PHRSJJ3U.js";
  31. import {
  32. n as n4,
  33. p as p6
  34. } from "./chunk-KN7TOKVN.js";
  35. import {
  36. j as j2
  37. } from "./chunk-RQJNTZAL.js";
  38. import "./chunk-QTOOFNRV.js";
  39. import "./chunk-7O56JPWQ.js";
  40. import {
  41. o
  42. } from "./chunk-6B2LQBKM.js";
  43. import {
  44. d as d3
  45. } from "./chunk-MFI6BALW.js";
  46. import {
  47. n as n3,
  48. p2
  49. } from "./chunk-CIG5OHC7.js";
  50. import "./chunk-FUD7XO3N.js";
  51. import "./chunk-6EU7GFUT.js";
  52. import "./chunk-MFUAILAT.js";
  53. import "./chunk-HZJYXMI6.js";
  54. import "./chunk-27P5ZSC7.js";
  55. import "./chunk-UPD4MTCL.js";
  56. import "./chunk-GRBROWI6.js";
  57. import "./chunk-5NKYXKIA.js";
  58. import "./chunk-MPWGHCZG.js";
  59. import "./chunk-FTI5VP6T.js";
  60. import "./chunk-RZFGRBD7.js";
  61. import {
  62. B
  63. } from "./chunk-PUSPZYFZ.js";
  64. import "./chunk-EN7YGJWG.js";
  65. import "./chunk-VBNMTM7L.js";
  66. import "./chunk-3D3QEPRE.js";
  67. import "./chunk-JFNNSBWL.js";
  68. import {
  69. b
  70. } from "./chunk-UD63WBG3.js";
  71. import "./chunk-LY74KTXV.js";
  72. import "./chunk-EWE6EXPY.js";
  73. import "./chunk-KUXNUNAI.js";
  74. import "./chunk-KMAHKQ2G.js";
  75. import "./chunk-522WBHUO.js";
  76. import "./chunk-WNCU6BFU.js";
  77. import "./chunk-PIGRDDRG.js";
  78. import {
  79. y
  80. } from "./chunk-BJHM4JNS.js";
  81. import "./chunk-F6A2QQ26.js";
  82. import "./chunk-XLV7RUSE.js";
  83. import "./chunk-NTUXR253.js";
  84. import "./chunk-EOSZHC5H.js";
  85. import "./chunk-C43UE3Z5.js";
  86. import "./chunk-H2KDMZTR.js";
  87. import "./chunk-7XXXCK2A.js";
  88. import "./chunk-7ZIDBK7B.js";
  89. import {
  90. c as c3
  91. } from "./chunk-FGKNEJKJ.js";
  92. import {
  93. c as c2,
  94. d as d2,
  95. f,
  96. l,
  97. m as m2,
  98. p,
  99. v as v2,
  100. w
  101. } from "./chunk-PSV473TI.js";
  102. import {
  103. O
  104. } from "./chunk-I3OBGWNS.js";
  105. import "./chunk-FONIFA5N.js";
  106. import "./chunk-EG5OI4V4.js";
  107. import "./chunk-65BYCSII.js";
  108. import {
  109. c as c4,
  110. m as m3
  111. } from "./chunk-WZQZRKNH.js";
  112. import "./chunk-LRDX4TO7.js";
  113. import "./chunk-6A4U74YA.js";
  114. import {
  115. n as n2
  116. } from "./chunk-CYI7KFYB.js";
  117. import {
  118. a as a2
  119. } from "./chunk-5LXROFTA.js";
  120. import "./chunk-GJXW4HL5.js";
  121. import "./chunk-WJW5DUN6.js";
  122. import {
  123. t as t2
  124. } from "./chunk-W72F6AS3.js";
  125. import "./chunk-PJ7ZQ4VD.js";
  126. import "./chunk-WDLTDV2L.js";
  127. import "./chunk-TERAW6FT.js";
  128. import "./chunk-N2663GRX.js";
  129. import "./chunk-O4FY3ITT.js";
  130. import "./chunk-WEMIK25H.js";
  131. import {
  132. b as b2
  133. } from "./chunk-4DDBH2K5.js";
  134. import "./chunk-7N4X6GF3.js";
  135. import "./chunk-JXW4QTJA.js";
  136. import "./chunk-UXF37FQ4.js";
  137. import {
  138. i
  139. } from "./chunk-ZOEK6QHJ.js";
  140. import "./chunk-XNLG7T2T.js";
  141. import "./chunk-IR4PV7VK.js";
  142. import "./chunk-2Z6LERTI.js";
  143. import {
  144. v2 as v
  145. } from "./chunk-OWVBLVP3.js";
  146. import "./chunk-AFZ7XSEW.js";
  147. import "./chunk-4NKD334K.js";
  148. import "./chunk-65K7LC56.js";
  149. import "./chunk-ATPLLI5W.js";
  150. import "./chunk-MXB2XLKV.js";
  151. import "./chunk-XH7RUGVZ.js";
  152. import {
  153. m
  154. } from "./chunk-TBBTRX4O.js";
  155. import "./chunk-YBSUITLL.js";
  156. import "./chunk-ALDCDSPV.js";
  157. import "./chunk-DT6EAZQ5.js";
  158. import "./chunk-HNOZUNJ4.js";
  159. import "./chunk-VNFRAYHO.js";
  160. import "./chunk-R5IG2D6H.js";
  161. import {
  162. j
  163. } from "./chunk-VBRY5KJM.js";
  164. import "./chunk-PDKDCAAD.js";
  165. import {
  166. M2 as M
  167. } from "./chunk-ECW2QABR.js";
  168. import "./chunk-GCDJLKH4.js";
  169. import {
  170. k2 as k
  171. } from "./chunk-MRJEICT6.js";
  172. import {
  173. d,
  174. e,
  175. n2 as n
  176. } from "./chunk-Y3WMVFTW.js";
  177. import "./chunk-SAS7RONY.js";
  178. import "./chunk-WSRBH7BF.js";
  179. import "./chunk-IHXECKQQ.js";
  180. import {
  181. x
  182. } from "./chunk-ULGDPLM2.js";
  183. import {
  184. s,
  185. s3 as s2
  186. } from "./chunk-EMJ4ZSM2.js";
  187. import "./chunk-IKP3YN53.js";
  188. import {
  189. a,
  190. r,
  191. t
  192. } from "./chunk-GZT4BVFP.js";
  193. import "./chunk-A5ICIBVI.js";
  194. // node_modules/@arcgis/core/layers/graphics/sources/GeoJSONSource.js
  195. var f2 = s.getLogger("esri.layers.graphics.sources.GeoJSONSource");
  196. var g = class extends m {
  197. constructor() {
  198. super(...arguments), this.type = "geojson", this.refresh = x(async (e2) => {
  199. await this.load();
  200. const { extent: t3, timeExtent: r3 } = await this._connection.invoke("refresh", e2);
  201. return this.sourceJSON.extent = t3, r3 && (this.sourceJSON.timeInfo.timeExtent = [r3.start, r3.end]), { dataChanged: true, updates: { extent: this.sourceJSON.extent, timeInfo: this.sourceJSON.timeInfo } };
  202. });
  203. }
  204. load(e2) {
  205. const t3 = r(e2) ? e2.signal : null;
  206. return this.addResolvingPromise(this._startWorker(t3)), Promise.resolve(this);
  207. }
  208. destroy() {
  209. this._connection?.close(), this._connection = null;
  210. }
  211. applyEdits(e2) {
  212. return this.load().then(() => this._applyEdits(e2));
  213. }
  214. openPorts() {
  215. return this.load().then(() => this._connection.openPorts());
  216. }
  217. queryFeatures(e2, t3 = {}) {
  218. return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)).then((e3) => x2.fromJSON(e3));
  219. }
  220. queryFeaturesJSON(e2, t3 = {}) {
  221. return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3));
  222. }
  223. queryFeatureCount(e2, t3 = {}) {
  224. return this.load(t3).then(() => this._connection.invoke("queryFeatureCount", e2 ? e2.toJSON() : null, t3));
  225. }
  226. queryObjectIds(e2, t3 = {}) {
  227. return this.load(t3).then(() => this._connection.invoke("queryObjectIds", e2 ? e2.toJSON() : null, t3));
  228. }
  229. queryExtent(e2, t3 = {}) {
  230. return this.load(t3).then(() => this._connection.invoke("queryExtent", e2 ? e2.toJSON() : null, t3)).then((e3) => ({ count: e3.count, extent: M.fromJSON(e3.extent) }));
  231. }
  232. querySnapping(e2, t3 = {}) {
  233. return this.load(t3).then(() => this._connection.invoke("querySnapping", e2, t3));
  234. }
  235. _applyEdits(e2) {
  236. if (!this._connection)
  237. throw new s2("geojson-layer-source:edit-failure", "Memory source not loaded");
  238. const r3 = this.layer.objectIdField, o2 = [], s3 = [], i2 = [];
  239. if (e2.addFeatures)
  240. for (const t3 of e2.addFeatures)
  241. o2.push(this._serializeFeature(t3));
  242. if (e2.deleteFeatures)
  243. for (const t3 of e2.deleteFeatures)
  244. "objectId" in t3 && t3.objectId != null ? s3.push(t3.objectId) : "attributes" in t3 && t3.attributes[r3] != null && s3.push(t3.attributes[r3]);
  245. if (e2.updateFeatures)
  246. for (const t3 of e2.updateFeatures)
  247. i2.push(this._serializeFeature(t3));
  248. return this._connection.invoke("applyEdits", { adds: o2, updates: i2, deletes: s3 }).then(({ extent: e3, timeExtent: t3, featureEditResults: r4 }) => (this.sourceJSON.extent = e3, t3 && (this.sourceJSON.timeInfo.timeExtent = [t3.start, t3.end]), this._createEditsResult(r4)));
  249. }
  250. _createEditsResult(e2) {
  251. 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: [] };
  252. }
  253. _createFeatureEditResult(e2) {
  254. const r3 = e2.success === true ? null : e2.error || { code: void 0, description: void 0 };
  255. return { objectId: e2.objectId, globalId: e2.globalId, error: r3 ? new s2("geojson-layer-source:edit-failure", r3.description, { code: r3.code }) : null };
  256. }
  257. _serializeFeature(e2) {
  258. const { attributes: t3 } = e2, r3 = this._geometryForSerialization(e2);
  259. return r3 ? { geometry: r3.toJSON(), attributes: t3 } : { attributes: t3 };
  260. }
  261. _geometryForSerialization(e2) {
  262. const { geometry: t3 } = e2;
  263. return t(t3) ? null : t3.type === "mesh" || t3.type === "extent" ? v.fromExtent(t3.extent) : t3;
  264. }
  265. async _startWorker(e2) {
  266. this._connection = await u("GeoJSONSourceWorker", { strategy: a("feature-layers-workers") ? "dedicated" : "local", signal: e2 });
  267. const { fields: t3, spatialReference: o2, hasZ: s3, geometryType: i2, objectIdField: n5, url: a4, timeInfo: l3, customParameters: c5 } = this.layer, p7 = this.layer.originOf("spatialReference") === "defaults", h = { url: a4, customParameters: c5, fields: t3 && t3.map((e3) => e3.toJSON()), geometryType: i.toJSON(i2), hasZ: s3, objectIdField: n5, timeInfo: l3 ? l3.toJSON() : null, spatialReference: p7 ? null : o2 && o2.toJSON() }, m4 = await this._connection.invoke("load", h, { signal: e2 });
  268. for (const r3 of m4.warnings)
  269. f2.warn(r3.message, { layer: this.layer, warning: r3 });
  270. m4.featureErrors.length && f2.warn(`Encountered ${m4.featureErrors.length} validation errors while loading features`, m4.featureErrors), this.sourceJSON = m4.layerDefinition, this.capabilities = c(this.sourceJSON.hasZ, true);
  271. }
  272. };
  273. e([d()], g.prototype, "capabilities", void 0), e([d()], g.prototype, "type", void 0), e([d({ constructOnly: true })], g.prototype, "layer", void 0), e([d()], g.prototype, "sourceJSON", void 0), g = e([n("esri.layers.graphics.sources.GeoJSONSource")], g);
  274. // node_modules/@arcgis/core/layers/GeoJSONLayer.js
  275. var V = l2();
  276. var B2 = class extends p4(o(p3(a2(a3(t2(n2(c3(O(b2))))))))) {
  277. constructor(e2) {
  278. super(e2), this.copyright = null, this.definitionExpression = null, this.displayField = null, this.editingEnabled = false, this.elevationInfo = null, this.featureReduction = 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;
  279. }
  280. destroy() {
  281. this.source?.destroy();
  282. }
  283. load(e2) {
  284. return this.addResolvingPromise(this.source.load(e2).then(() => {
  285. this.read(this.source.sourceJSON, { origin: "service", url: this.parsedUrl }), this.revert(["objectIdField", "fields", "timeInfo"], "service"), c4(this.renderer, this.fieldsIndex), m3(this.timeInfo, this.fieldsIndex);
  286. })), Promise.resolve(this);
  287. }
  288. get capabilities() {
  289. return this.source ? this.source.capabilities : null;
  290. }
  291. get createQueryVersion() {
  292. return this.commitProperty("definitionExpression"), this.commitProperty("timeExtent"), this.commitProperty("timeOffset"), this.commitProperty("geometryType"), this.commitProperty("capabilities"), (this._get("createQueryVersion") || 0) + 1;
  293. }
  294. get defaultPopupTemplate() {
  295. return this.createPopupTemplate();
  296. }
  297. get isTable() {
  298. return this.loaded && this.geometryType == null;
  299. }
  300. get parsedUrl() {
  301. return this.url ? j(this.url) : null;
  302. }
  303. set renderer(e2) {
  304. c4(e2, this.fieldsIndex), this._set("renderer", e2);
  305. }
  306. set url(e2) {
  307. if (!e2)
  308. return void this._set("url", e2);
  309. const t3 = j(e2);
  310. this._set("url", t3.path), t3.query && (this.customParameters = { ...this.customParameters, ...t3.query });
  311. }
  312. async applyEdits(e2, t3) {
  313. const r3 = await import("./editingSupport-KL4E3VVF.js");
  314. await this.load();
  315. const i2 = await r3.applyEdits(this, this.source, e2, t3);
  316. return this.read({ extent: this.source.sourceJSON.extent, timeInfo: this.source.sourceJSON.timeInfo }, { origin: "service", ignoreDefaults: true }), i2;
  317. }
  318. on(e2, t3) {
  319. return super.on(e2, t3);
  320. }
  321. createPopupTemplate(e2) {
  322. return d3(this, e2);
  323. }
  324. createQuery() {
  325. const e2 = new b(), t3 = this.get("capabilities.data");
  326. e2.returnGeometry = true, t3 && t3.supportsZ && (e2.returnZ = true), e2.outFields = ["*"], e2.where = this.definitionExpression || "1=1";
  327. const { timeOffset: r3, timeExtent: i2 } = this;
  328. return e2.timeExtent = r3 != null && i2 != null ? i2.offset(-r3.value, r3.unit) : i2 || null, e2;
  329. }
  330. getFieldDomain(e2, t3) {
  331. let r3, i2 = false;
  332. const o2 = t3 && t3.feature, s3 = o2 && o2.attributes, p7 = this.typeIdField && s3 && s3[this.typeIdField];
  333. return p7 != null && this.types && (i2 = this.types.some((t4) => t4.id == p7 && (r3 = t4.domains && t4.domains[e2], r3 && r3.type === "inherited" && (r3 = this._getLayerDomain(e2)), true))), i2 || r3 || (r3 = this._getLayerDomain(e2)), r3;
  334. }
  335. getField(e2) {
  336. return this.fieldsIndex.get(e2);
  337. }
  338. queryFeatures(e2, t3) {
  339. return this.load().then(() => this.source.queryFeatures(b.from(e2) || this.createQuery(), t3)).then((e3) => {
  340. if (e3?.features)
  341. for (const t4 of e3.features)
  342. t4.layer = t4.sourceLayer = this;
  343. return e3;
  344. });
  345. }
  346. queryObjectIds(e2, t3) {
  347. return this.load().then(() => this.source.queryObjectIds(b.from(e2) || this.createQuery(), t3));
  348. }
  349. queryFeatureCount(e2, t3) {
  350. return this.load().then(() => this.source.queryFeatureCount(b.from(e2) || this.createQuery(), t3));
  351. }
  352. queryExtent(e2, t3) {
  353. return this.load().then(() => this.source.queryExtent(b.from(e2) || this.createQuery(), t3));
  354. }
  355. async hasDataChanged() {
  356. try {
  357. const { dataChanged: e2, updates: t3 } = await this.source.refresh(this.customParameters);
  358. return r(t3) && this.read(t3, { origin: "service", url: this.parsedUrl, ignoreDefaults: true }), e2;
  359. } catch {
  360. }
  361. return false;
  362. }
  363. _getLayerDomain(e2) {
  364. if (!this.fields)
  365. return null;
  366. let t3 = null;
  367. return this.fields.some((r3) => (r3.name === e2 && (t3 = r3.domain), !!t3)), t3;
  368. }
  369. };
  370. e([d({ readOnly: true, json: { read: false, write: false } })], B2.prototype, "capabilities", null), e([d({ type: String })], B2.prototype, "copyright", void 0), e([d({ readOnly: true })], B2.prototype, "createQueryVersion", null), e([d({ readOnly: true })], B2.prototype, "defaultPopupTemplate", null), e([d({ type: String, json: { name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], B2.prototype, "definitionExpression", void 0), e([d({ type: String })], B2.prototype, "displayField", void 0), e([d({ type: Boolean })], B2.prototype, "editingEnabled", void 0), e([d(d2)], B2.prototype, "elevationInfo", void 0), e([d(p5)], B2.prototype, "featureReduction", void 0), e([d({ type: [y], json: { name: "layerDefinition.fields", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "fields" } } } })], B2.prototype, "fields", void 0), e([d(V.fieldsIndex)], B2.prototype, "fieldsIndex", void 0), e([d({ type: M, json: { name: "extent" } })], B2.prototype, "fullExtent", void 0), e([d({ type: ["point", "polygon", "polyline", "multipoint"], json: { read: { reader: i.read } } })], B2.prototype, "geometryType", void 0), e([d({ type: Boolean })], B2.prototype, "hasZ", void 0), e([d(v2)], B2.prototype, "id", void 0), e([d({ type: Boolean, readOnly: true })], B2.prototype, "isTable", null), e([d(m2)], B2.prototype, "labelsVisible", void 0), e([d({ type: [j2], json: { name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: r2 }, write: true } })], B2.prototype, "labelingInfo", void 0), e([d(c2)], B2.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], B2.prototype, "listMode", void 0), e([d({ type: String, json: { name: "layerDefinition.objectIdField", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "objectIdField" } } } })], B2.prototype, "objectIdField", void 0), e([d(w)], B2.prototype, "opacity", void 0), e([d({ type: ["GeoJSON"] })], B2.prototype, "operationalLayerType", void 0), e([d({ readOnly: true })], B2.prototype, "parsedUrl", null), e([d(p)], B2.prototype, "popupEnabled", void 0), e([d({ type: B, json: { name: "popupInfo", write: true } })], B2.prototype, "popupTemplate", void 0), e([d({ types: p2, json: { name: "layerDefinition.drawingInfo.renderer", write: true, origins: { service: { name: "drawingInfo.renderer" }, "web-scene": { types: n3 } } } })], B2.prototype, "renderer", null), e([d(l)], B2.prototype, "screenSizePerspectiveEnabled", void 0), e([d({ readOnly: true })], B2.prototype, "source", void 0), e([d({ type: k })], B2.prototype, "spatialReference", void 0), e([d({ type: [p6] })], B2.prototype, "templates", void 0), e([d()], B2.prototype, "title", void 0), e([d({ json: { read: false }, readOnly: true })], B2.prototype, "type", void 0), e([d({ type: String, readOnly: true })], B2.prototype, "typeIdField", void 0), e([d({ type: [n4] })], B2.prototype, "types", void 0), e([d(f)], B2.prototype, "url", null), B2 = e([n("esri.layers.GeoJSONLayer")], B2);
  371. var Z = B2;
  372. export {
  373. Z as default
  374. };
  375. //# sourceMappingURL=GeoJSONLayer-G3YCJ5UG.js.map