SymbolProcessor-QR2MTX2K.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. import {
  2. E,
  3. l,
  4. l2,
  5. t as t2,
  6. x
  7. } from "./chunk-IDINBHDV.js";
  8. import "./chunk-6LE4RPMZ.js";
  9. import {
  10. n as n2
  11. } from "./chunk-67RFR4NT.js";
  12. import "./chunk-WPDBODJM.js";
  13. import "./chunk-5IVP3KUS.js";
  14. import "./chunk-JXYBFGFY.js";
  15. import "./chunk-EPMXCACW.js";
  16. import "./chunk-UCPKJYXN.js";
  17. import "./chunk-KFLNKWNF.js";
  18. import "./chunk-R24MO4IV.js";
  19. import "./chunk-YQBYWPBD.js";
  20. import "./chunk-UWKVAZQ6.js";
  21. import {
  22. p as p2
  23. } from "./chunk-XBFCIW4K.js";
  24. import "./chunk-T2SKWJGU.js";
  25. import "./chunk-UO3LS2M5.js";
  26. import "./chunk-H2VOWDMO.js";
  27. import "./chunk-QISOH77W.js";
  28. import "./chunk-4HL6BBWO.js";
  29. import {
  30. p
  31. } from "./chunk-MDY6FJJE.js";
  32. import "./chunk-KUO7OCMN.js";
  33. import "./chunk-XO5VJRK4.js";
  34. import "./chunk-3WXSWAUV.js";
  35. import "./chunk-27YO3FKC.js";
  36. import {
  37. S
  38. } from "./chunk-EQNT4A7P.js";
  39. import "./chunk-4OM3EX6P.js";
  40. import "./chunk-3OFVLRSL.js";
  41. import "./chunk-UMUHMVL4.js";
  42. import "./chunk-L5DZVCCW.js";
  43. import "./chunk-WNPL3C7R.js";
  44. import "./chunk-E7ZLMIQ7.js";
  45. import "./chunk-JEA4MMTV.js";
  46. import "./chunk-RG3AHHRL.js";
  47. import "./chunk-XHRNCFJT.js";
  48. import "./chunk-UDYHZLTE.js";
  49. import "./chunk-QC7NCR5N.js";
  50. import "./chunk-VQXMCZYH.js";
  51. import "./chunk-JQUWFKNU.js";
  52. import "./chunk-RWQH5X3O.js";
  53. import "./chunk-6334AFGG.js";
  54. import "./chunk-CC74Y7ET.js";
  55. import "./chunk-TFHLTN6F.js";
  56. import "./chunk-E3G7BRZB.js";
  57. import "./chunk-JKFWEHNK.js";
  58. import "./chunk-EDHROVWI.js";
  59. import "./chunk-3IRT3YKJ.js";
  60. import "./chunk-HKJ7X3BD.js";
  61. import {
  62. a,
  63. m
  64. } from "./chunk-IEU3AM37.js";
  65. import "./chunk-YZVAB3DF.js";
  66. import "./chunk-JLYTER4T.js";
  67. import "./chunk-CRHRHOXH.js";
  68. import "./chunk-ZSW35JPD.js";
  69. import "./chunk-PT62335L.js";
  70. import "./chunk-TJV6ODRM.js";
  71. import "./chunk-4ONPMX2F.js";
  72. import "./chunk-4T5ZGMEN.js";
  73. import "./chunk-2H5MD622.js";
  74. import "./chunk-UVVU4UUO.js";
  75. import "./chunk-X4SA4ELJ.js";
  76. import "./chunk-LU5IJZB4.js";
  77. import "./chunk-7IBV2TRE.js";
  78. import "./chunk-ZLNEXZAN.js";
  79. import "./chunk-5UVJ64RB.js";
  80. import "./chunk-SFEFRQCL.js";
  81. import "./chunk-ZYRIJWLX.js";
  82. import "./chunk-RYY6632W.js";
  83. import "./chunk-DW42UVIT.js";
  84. import "./chunk-YAEIHDJH.js";
  85. import "./chunk-TJNOJH33.js";
  86. import "./chunk-OSHI574D.js";
  87. import "./chunk-ETGAZ7LF.js";
  88. import "./chunk-75U5LM2V.js";
  89. import "./chunk-RMDDCMKS.js";
  90. import "./chunk-VCH45Q2I.js";
  91. import "./chunk-LBW34VZ2.js";
  92. import "./chunk-GSSTTHIT.js";
  93. import "./chunk-YFSLJIO4.js";
  94. import "./chunk-IM3LVQXV.js";
  95. import "./chunk-55RWC67C.js";
  96. import "./chunk-HZRKBTHJ.js";
  97. import "./chunk-DVUG3KID.js";
  98. import "./chunk-FWSQEIAR.js";
  99. import "./chunk-VEGAOVMY.js";
  100. import "./chunk-6T6G6LCQ.js";
  101. import "./chunk-YEJL5NEF.js";
  102. import {
  103. k2 as k
  104. } from "./chunk-PQFTYGF5.js";
  105. import {
  106. e,
  107. n5 as n
  108. } from "./chunk-2Z2TG5CU.js";
  109. import "./chunk-6KZ2LTDA.js";
  110. import "./chunk-U2XHEJM7.js";
  111. import "./chunk-SQOPWYIT.js";
  112. import {
  113. f as f2,
  114. j
  115. } from "./chunk-V6P2MAQQ.js";
  116. import "./chunk-E5O6P5I2.js";
  117. import "./chunk-SPWQ3AWG.js";
  118. import "./chunk-2TIUKVZN.js";
  119. import {
  120. e as e2,
  121. f,
  122. o,
  123. r,
  124. t
  125. } from "./chunk-YXWMMD76.js";
  126. import "./chunk-S5KM4IGW.js";
  127. // node_modules/@arcgis/core/views/2d/layers/features/support/ResourceManagerProxy.js
  128. var t3 = class {
  129. constructor(e3) {
  130. this._remoteClient = e3, this._resourceMap = /* @__PURE__ */ new Map(), this._inFlightResourceMap = /* @__PURE__ */ new Map(), this.geometryEngine = null;
  131. }
  132. destroy() {
  133. }
  134. async fetchResource(t4, r2) {
  135. const s = this._resourceMap, i = s.get(t4);
  136. if (i)
  137. return i;
  138. let n3 = this._inFlightResourceMap.get(t4);
  139. if (n3)
  140. return n3;
  141. try {
  142. n3 = this._remoteClient.invoke("tileRenderer.fetchResource", { url: t4 }, { ...r2 }), this._inFlightResourceMap.set(t4, n3), n3.then((e3) => (this._inFlightResourceMap.delete(t4), s.set(t4, e3), e3));
  143. } catch (o2) {
  144. return j(o2) ? null : { width: 0, height: 0 };
  145. }
  146. return n3;
  147. }
  148. getResource(e3) {
  149. var _a;
  150. return (_a = this._resourceMap.get(e3)) != null ? _a : null;
  151. }
  152. };
  153. // node_modules/@arcgis/core/views/2d/layers/features/processors/SymbolProcessor.js
  154. function I(e3, t4) {
  155. return (!e3.minScale || e3.minScale >= t4) && (!e3.maxScale || e3.maxScale <= t4);
  156. }
  157. function M(e3) {
  158. const t4 = e3.message, r2 = { message: { data: {}, tileKey: t4.tileKey, tileKeyOrigin: t4.tileKeyOrigin, version: t4.version }, transferList: new Array() };
  159. for (const a2 in t4.data) {
  160. const e4 = t4.data[a2];
  161. if (r2.message.data[a2] = null, r(e4)) {
  162. const t5 = e4.stride, i = e4.indices.slice(0), o2 = e4.vertices.slice(0), n3 = e4.records.slice(0), l3 = { stride: t5, indices: i, vertices: o2, records: n3, metrics: o(e4.metrics, (e5) => e5.slice(0)) };
  163. r2.transferList.push(i, o2, n3), r2.message.data[a2] = l3;
  164. }
  165. }
  166. return r2;
  167. }
  168. var v = class extends p {
  169. constructor() {
  170. super(...arguments), this.type = "symbol", this._matchers = { feature: null, aggregate: null }, this._bufferData = /* @__PURE__ */ new Map(), this._bufferIds = /* @__PURE__ */ new Map();
  171. }
  172. initialize() {
  173. this.handles.add([this.tileStore.on("update", this.onTileUpdate.bind(this))]), this._resourceManagerProxy = new t3(this.remoteClient);
  174. }
  175. destroy() {
  176. this._resourceManagerProxy.destroy();
  177. }
  178. get supportsTileUpdates() {
  179. return true;
  180. }
  181. forEachBufferId(e3) {
  182. this._bufferIds.forEach((t4) => {
  183. t4.forEach(e3);
  184. });
  185. }
  186. async update(e3, t4) {
  187. const s = t4.schema.processors[0];
  188. if ("symbol" !== s.type)
  189. return;
  190. const r2 = m(this._schema, s);
  191. (a(r2, "mesh") || a(r2, "target")) && (e3.mesh = true, e3.why.mesh.push("Symbology changed"), this._schema = s, this._factory = this._createFactory(s), this._factory.update(s, this.tileStore.tileScheme.tileInfo));
  192. }
  193. onTileMessage(e3, t4, s, r2) {
  194. return f2(r2), this._onTileData(e3, t4, s, r2);
  195. }
  196. onTileClear(e3) {
  197. const t4 = { clear: true };
  198. return this._bufferData.delete(e3.key.id), this._bufferIds.delete(e3.key.id), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t4 });
  199. }
  200. onTileError(e3, t4, s) {
  201. const r2 = s.signal, i = { tileKey: e3.id, error: t4 };
  202. return this.remoteClient.invoke("tileRenderer.onTileError", i, { signal: r2 });
  203. }
  204. onTileUpdate(e3) {
  205. for (const t4 of e3.removed)
  206. this._bufferData.has(t4.key.id) && this._bufferData.delete(t4.key.id), this._bufferIds.has(t4.key.id) && this._bufferIds.delete(t4.key.id);
  207. for (const t4 of e3.added)
  208. this._bufferData.forEach((e4) => {
  209. for (const s of e4)
  210. s.message.tileKey === t4.id && this._updateTileMesh("append", t4, M(s), [], false, false, null);
  211. });
  212. }
  213. _addBufferData(e3, t4) {
  214. this._bufferData.has(e3) || this._bufferData.set(e3, []), this._bufferData.get(e3).push(M(t4));
  215. }
  216. _createFactory(e3) {
  217. const { geometryType: t4, objectIdField: r2, fields: i } = this.service, a2 = (e4, t5) => this.remoteClient.invoke("tileRenderer.getMaterialItems", e4, t5), o2 = { geometryType: t4, fields: i, spatialReference: k.fromJSON(this.spatialReference) }, n3 = new x(a2, this.tileStore.tileScheme.tileInfo), { matcher: l3, aggregateMatcher: c } = e3.mesh;
  218. return this._store = n3, this._matchers.feature = l2(l3, n3, o2, this._resourceManagerProxy), this._matchers.aggregate = o(c, (e4) => l2(e4, n3, o2, this._resourceManagerProxy)), new l(t4, r2, n3);
  219. }
  220. async _onTileData(e3, t4, s, a2) {
  221. f2(a2);
  222. const { type: o2, addOrUpdate: l3, remove: c, clear: d, end: h } = t4, f3 = !!this._schema.mesh.sortKey;
  223. if (!l3) {
  224. const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 };
  225. return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, a2);
  226. }
  227. const m2 = this._processFeatures(e3, l3, s, a2, t4.status.version);
  228. try {
  229. const s2 = await m2;
  230. if (t(s2)) {
  231. const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 };
  232. return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, a2);
  233. }
  234. const n3 = [];
  235. for (const t5 of s2) {
  236. let s3 = false;
  237. const r2 = t5.message.bufferIds, a3 = e3.key.id, o3 = t5.message.tileKey;
  238. if (a3 !== o3 && r(r2)) {
  239. if (!this.tileStore.get(o3)) {
  240. this._addBufferData(a3, t5), n3.push(t5);
  241. continue;
  242. }
  243. let e4 = this._bufferIds.get(o3);
  244. e4 || (e4 = /* @__PURE__ */ new Set(), this._bufferIds.set(o3, e4));
  245. const i = Array.from(r2);
  246. for (const t6 of i) {
  247. if (e4.has(t6)) {
  248. s3 = true;
  249. break;
  250. }
  251. e4.add(t6);
  252. }
  253. }
  254. s3 || (this._addBufferData(a3, t5), n3.push(t5));
  255. }
  256. await Promise.all(n3.map((s3) => {
  257. const r2 = e3.key.id === s3.message.tileKey, i = r2 ? t4.remove : [], n4 = r2 && t4.end;
  258. return this._updateTileMesh(o2, e3, s3, i, n4, t4.clear, a2.signal);
  259. }));
  260. } catch (u) {
  261. this._handleError(e3, u, a2);
  262. }
  263. }
  264. async _updateTileMesh(e3, t4, r2, i, a2, l3, c) {
  265. const d = e3, h = r2.message.tileKey, f3 = !!this._schema.mesh.sortKey;
  266. h !== t4.key.id && (a2 = false);
  267. const m2 = o(r2, (e4) => e4.message), u = o(r2, (e4) => e4.transferList) || [], g = { type: d, addOrUpdate: m2, remove: i, clear: l3, end: a2, sort: f3 }, p3 = { transferList: e2(u) || [], signal: c };
  268. return f2(p3), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: h, data: g }, p3);
  269. }
  270. async _processFeatures(e3, t4, s, i, a2) {
  271. if (t(t4) || !t4.hasFeatures)
  272. return null;
  273. const o2 = { transform: e3.transform, hasZ: false, hasM: false }, l3 = this._factory, c = { viewingMode: "", scale: e3.scale }, d = await this._matchers.feature, h = await this._matchers.aggregate;
  274. f2(i);
  275. const f3 = this._getLabelInfos(e3, t4);
  276. return await l3.analyze(t4.getCursor(), this._resourceManagerProxy, d, h, o2, c), f2(i), this._writeFeatureSet(e3, t4, o2, f3, l3, s, a2);
  277. }
  278. _writeFeatureSet(e3, t4, s, r2, a2, o2, n3) {
  279. const l3 = t4.getSize(), c = this._schema.mesh.matcher.symbologyType, d = new E(e3.key.id, { features: l3, records: l3, metrics: 0 }, c, o2, c !== S.HEATMAP, n3), h = { viewingMode: "", scale: e3.scale }, f3 = t4.getCursor();
  280. for (; f3.next(); )
  281. try {
  282. const t5 = f3.getDisplayId(), o3 = r(r2) ? r2.get(t5) : null;
  283. a2.writeCursor(d, f3, s, h, e3.level, o3, this._resourceManagerProxy);
  284. } catch (p3) {
  285. }
  286. const m2 = e3.tileInfoView.tileInfo.isWrappable;
  287. return d.serialize(m2);
  288. }
  289. _handleError(e3, t4, s) {
  290. if (!j(t4)) {
  291. const r2 = { tileKey: e3.id, error: t4.message };
  292. return this.remoteClient.invoke("tileRenderer.onTileError", r2, { signal: s.signal });
  293. }
  294. }
  295. _getLabelingSchemaForScale(e3) {
  296. const t4 = this._schema.mesh.labels;
  297. if (t(t4))
  298. return null;
  299. if ("subtype" === t4.type) {
  300. const s2 = { type: "subtype", classes: {} };
  301. let r2 = false;
  302. for (const i in t4.classes) {
  303. const a2 = t4.classes[i].filter((t5) => I(t5, e3.scale));
  304. r2 = r2 || !!a2.length, s2.classes[i] = a2;
  305. }
  306. return r2 ? s2 : null;
  307. }
  308. const s = t4.classes.filter((t5) => I(t5, e3.scale));
  309. return s.length ? { type: "simple", classes: s } : null;
  310. }
  311. _getLabels(e3, t4) {
  312. var _a;
  313. if ("subtype" === t4.type) {
  314. const s = this.service.subtypeField, r2 = f(s, "Expected to find subtype Field"), i = e3.readAttribute(r2);
  315. return null == i ? [] : (_a = t4.classes[i]) != null ? _a : [];
  316. }
  317. return t4.classes;
  318. }
  319. _getLabelInfos(e3, s) {
  320. const i = this._getLabelingSchemaForScale(e3);
  321. if (t(i))
  322. return null;
  323. const a2 = /* @__PURE__ */ new Map(), o2 = s.getCursor();
  324. for (; o2.next(); ) {
  325. const e4 = o2.getDisplayId(), s2 = [], r2 = p2(e4), n3 = r2 && 1 !== o2.readAttribute("cluster_count") ? "aggregate" : "feature", l3 = this._getLabels(o2, i);
  326. for (const i2 of l3) {
  327. if (i2.target !== n3)
  328. continue;
  329. const a3 = o2.getStorage(), l4 = r2 && "feature" === n3 ? a3.getComputedStringAtIndex(o2.readAttribute("referenceId"), i2.fieldIndex) : a3.getComputedStringAtIndex(e4, i2.fieldIndex);
  330. if (!l4)
  331. continue;
  332. const c = n2(l4.toString()), d = c[0], h = c[1];
  333. this._store.getMosaicItem(i2.symbol, t2(d)).then((e5) => {
  334. s2[i2.index] = { glyphs: e5.glyphMosaicItems, rtl: h, index: i2.index };
  335. });
  336. }
  337. a2.set(e4, s2);
  338. }
  339. return a2;
  340. }
  341. };
  342. v = e([n("esri.views.2d.layers.features.processors.SymbolProcessor")], v);
  343. var T = v;
  344. export {
  345. T as default
  346. };
  347. //# sourceMappingURL=SymbolProcessor-QR2MTX2K.js.map