SymbolProcessor-QOW6BODF.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. import {
  2. E,
  3. l,
  4. l2,
  5. t as t2,
  6. x
  7. } from "./chunk-PS4B3D6M.js";
  8. import "./chunk-DO6JJUZG.js";
  9. import "./chunk-54X4RLMR.js";
  10. import {
  11. n as n2
  12. } from "./chunk-MWIFVNKP.js";
  13. import "./chunk-MIWGTTJJ.js";
  14. import "./chunk-LL6JU3GU.js";
  15. import "./chunk-LSDW2622.js";
  16. import "./chunk-ZIWBDWEW.js";
  17. import "./chunk-IQNZZCQJ.js";
  18. import {
  19. p as p2
  20. } from "./chunk-HWIURR7X.js";
  21. import "./chunk-Q4LKAPDF.js";
  22. import "./chunk-TODU7HVH.js";
  23. import "./chunk-23ONSYIH.js";
  24. import "./chunk-SRMDO2KR.js";
  25. import "./chunk-PZKZIMMP.js";
  26. import "./chunk-YLVXZ2PS.js";
  27. import "./chunk-546QCRS4.js";
  28. import "./chunk-QXZVBSBH.js";
  29. import "./chunk-773XI6MQ.js";
  30. import "./chunk-ILP23N26.js";
  31. import {
  32. p
  33. } from "./chunk-BXIBTNXI.js";
  34. import "./chunk-5NM43FFO.js";
  35. import "./chunk-WFSV2B2I.js";
  36. import "./chunk-J525NRN3.js";
  37. import "./chunk-MI7HWWFL.js";
  38. import "./chunk-Q34L5KZA.js";
  39. import "./chunk-ZVHTCCQC.js";
  40. import "./chunk-PCGDLSZ4.js";
  41. import "./chunk-CAYFEZCR.js";
  42. import "./chunk-MFFE4I2S.js";
  43. import "./chunk-XBH7TGC2.js";
  44. import "./chunk-K3NA3LQS.js";
  45. import "./chunk-LMCIAW5S.js";
  46. import "./chunk-OTS3UE5B.js";
  47. import "./chunk-6RAL4JPQ.js";
  48. import "./chunk-TRK7CKWP.js";
  49. import "./chunk-LGW7TID4.js";
  50. import "./chunk-3OHML7FO.js";
  51. import "./chunk-H6ETEALK.js";
  52. import "./chunk-FIYKFRB2.js";
  53. import "./chunk-FYNVVMWY.js";
  54. import "./chunk-Q52DVFYK.js";
  55. import "./chunk-HBMVUVZX.js";
  56. import "./chunk-6P6NA7JB.js";
  57. import "./chunk-UPD4MTCL.js";
  58. import "./chunk-FTI5VP6T.js";
  59. import {
  60. a,
  61. m
  62. } from "./chunk-LY74KTXV.js";
  63. import "./chunk-EWE6EXPY.js";
  64. import "./chunk-KUXNUNAI.js";
  65. import "./chunk-522WBHUO.js";
  66. import "./chunk-RMX2AZ4P.js";
  67. import "./chunk-NE3ESGA6.js";
  68. import "./chunk-YIS6BAC3.js";
  69. import "./chunk-7XXXCK2A.js";
  70. import "./chunk-65BYCSII.js";
  71. import "./chunk-LRDX4TO7.js";
  72. import "./chunk-N2663GRX.js";
  73. import "./chunk-WEMIK25H.js";
  74. import "./chunk-JXW4QTJA.js";
  75. import "./chunk-UXF37FQ4.js";
  76. import "./chunk-ZOEK6QHJ.js";
  77. import "./chunk-XNLG7T2T.js";
  78. import "./chunk-IR4PV7VK.js";
  79. import "./chunk-2Z6LERTI.js";
  80. import "./chunk-OWVBLVP3.js";
  81. import "./chunk-4NKD334K.js";
  82. import "./chunk-65K7LC56.js";
  83. import "./chunk-ATPLLI5W.js";
  84. import "./chunk-MXB2XLKV.js";
  85. import "./chunk-XH7RUGVZ.js";
  86. import "./chunk-TBBTRX4O.js";
  87. import "./chunk-YBSUITLL.js";
  88. import "./chunk-ALDCDSPV.js";
  89. import "./chunk-DT6EAZQ5.js";
  90. import "./chunk-HNOZUNJ4.js";
  91. import "./chunk-VNFRAYHO.js";
  92. import "./chunk-R5IG2D6H.js";
  93. import "./chunk-VBRY5KJM.js";
  94. import "./chunk-PDKDCAAD.js";
  95. import "./chunk-ECW2QABR.js";
  96. import "./chunk-GCDJLKH4.js";
  97. import {
  98. k2 as k
  99. } from "./chunk-MRJEICT6.js";
  100. import {
  101. e,
  102. n2 as n
  103. } from "./chunk-Y3WMVFTW.js";
  104. import "./chunk-SAS7RONY.js";
  105. import "./chunk-WSRBH7BF.js";
  106. import "./chunk-IHXECKQQ.js";
  107. import {
  108. f as f2,
  109. g
  110. } from "./chunk-ULGDPLM2.js";
  111. import {
  112. s
  113. } from "./chunk-EMJ4ZSM2.js";
  114. import "./chunk-IKP3YN53.js";
  115. import {
  116. e as e2,
  117. f,
  118. o,
  119. r,
  120. t
  121. } from "./chunk-GZT4BVFP.js";
  122. import "./chunk-A5ICIBVI.js";
  123. // node_modules/@arcgis/core/views/2d/layers/features/support/ResourceManagerProxy.js
  124. var t3 = class {
  125. constructor(e3) {
  126. this._remoteClient = e3, this._resourceMap = new Map(), this._inFlightResourceMap = new Map(), this.geometryEngine = null;
  127. }
  128. destroy() {
  129. }
  130. async fetchResource(t4, r2) {
  131. const s2 = this._resourceMap, i = s2.get(t4);
  132. if (i)
  133. return i;
  134. let n3 = this._inFlightResourceMap.get(t4);
  135. if (n3)
  136. return n3;
  137. try {
  138. n3 = this._remoteClient.invoke("tileRenderer.fetchResource", { url: t4 }, { ...r2 }), this._inFlightResourceMap.set(t4, n3), n3.then((e3) => (this._inFlightResourceMap.delete(t4), s2.set(t4, e3), e3));
  139. } catch (o2) {
  140. return g(o2) ? null : { width: 0, height: 0 };
  141. }
  142. return n3;
  143. }
  144. getResource(e3) {
  145. return this._resourceMap.get(e3) ?? null;
  146. }
  147. };
  148. // node_modules/@arcgis/core/views/2d/layers/features/processors/SymbolProcessor.js
  149. function I(e3, t4) {
  150. return (!e3.minScale || e3.minScale >= t4) && (!e3.maxScale || e3.maxScale <= t4);
  151. }
  152. function v(e3) {
  153. const t4 = e3.message, s2 = { message: { data: {}, tileKey: t4.tileKey, tileKeyOrigin: t4.tileKeyOrigin, version: t4.version }, transferList: new Array() };
  154. for (const i in t4.data) {
  155. const e4 = t4.data[i];
  156. if (s2.message.data[i] = null, r(e4)) {
  157. const t5 = e4.stride, a2 = e4.indices.slice(0), o2 = e4.vertices.slice(0), n3 = e4.records.slice(0), l3 = { stride: t5, indices: a2, vertices: o2, records: n3, metrics: o(e4.metrics, (e5) => e5.slice(0)) };
  158. s2.transferList.push(a2, o2, n3), s2.message.data[i] = l3;
  159. }
  160. }
  161. return s2;
  162. }
  163. s.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");
  164. var M = class extends p {
  165. constructor() {
  166. super(...arguments), this.type = "symbol", this._matchers = { feature: null, aggregate: null }, this._bufferData = new Map(), this._bufferIds = new Map();
  167. }
  168. initialize() {
  169. this.handles.add([this.tileStore.on("update", this.onTileUpdate.bind(this))]), this._resourceManagerProxy = new t3(this.remoteClient);
  170. }
  171. destroy() {
  172. this._resourceManagerProxy.destroy();
  173. }
  174. get supportsTileUpdates() {
  175. return true;
  176. }
  177. forEachBufferId(e3) {
  178. this._bufferIds.forEach((t4) => {
  179. t4.forEach(e3);
  180. });
  181. }
  182. async update(e3, t4) {
  183. const s2 = t4.schema.processors[0];
  184. if (s2.type !== "symbol")
  185. return;
  186. const r2 = m(this._schema, s2);
  187. a(r2, "mesh") && (e3.mesh = true, e3.why.mesh.push("Symbology changed"), this._schema = s2, this._factory = this._createFactory(s2), this._factory.update(s2, this.tileStore.tileScheme.tileInfo));
  188. }
  189. onTileMessage(e3, t4, s2, r2) {
  190. return f2(r2), this._onTileData(e3, t4, s2, r2);
  191. }
  192. onTileClear(e3) {
  193. const t4 = { clear: true };
  194. return this._bufferData.delete(e3.key.id), this._bufferIds.delete(e3.key.id), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t4 });
  195. }
  196. onTileError(e3, t4, s2) {
  197. const r2 = s2.signal, i = { tileKey: e3.id, error: t4 };
  198. return this.remoteClient.invoke("tileRenderer.onTileError", i, { signal: r2 });
  199. }
  200. onTileUpdate(e3) {
  201. for (const t4 of e3.removed)
  202. this._bufferData.has(t4.key.id) && this._bufferData.delete(t4.key.id), this._bufferIds.has(t4.key.id) && this._bufferIds.delete(t4.key.id);
  203. for (const t4 of e3.added)
  204. this._bufferData.forEach((e4) => {
  205. for (const s2 of e4)
  206. s2.message.tileKey === t4.id && this._updateTileMesh("append", t4, v(s2), [], false, false, null);
  207. });
  208. }
  209. _addBufferData(e3, t4) {
  210. this._bufferData.has(e3) || this._bufferData.set(e3, []), this._bufferData.get(e3).push(v(t4));
  211. }
  212. _createFactory(e3) {
  213. const { geometryType: t4, objectIdField: s2, 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;
  214. 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, s2, n3);
  215. }
  216. async _onTileData(e3, t4, s2, r2) {
  217. f2(r2);
  218. const { type: o2, addOrUpdate: n3, remove: c, clear: d, end: h } = t4, f3 = !!this._schema.mesh.sortKey;
  219. if (!n3) {
  220. const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 };
  221. return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, r2);
  222. }
  223. const m2 = this._processFeatures(e3, n3, s2, r2, t4.status.version);
  224. try {
  225. const s3 = await m2;
  226. if (t(s3)) {
  227. const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 };
  228. return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, r2);
  229. }
  230. const n4 = [];
  231. for (const t5 of s3) {
  232. let s4 = false;
  233. const r3 = t5.message.bufferIds, i = e3.key.id, o3 = t5.message.tileKey;
  234. if (i !== o3 && r(r3)) {
  235. if (!this.tileStore.get(o3)) {
  236. this._addBufferData(i, t5), n4.push(t5);
  237. continue;
  238. }
  239. let e4 = this._bufferIds.get(o3);
  240. e4 || (e4 = new Set(), this._bufferIds.set(o3, e4));
  241. const a2 = Array.from(r3);
  242. for (const t6 of a2) {
  243. if (e4.has(t6)) {
  244. s4 = true;
  245. break;
  246. }
  247. e4.add(t6);
  248. }
  249. }
  250. s4 || (this._addBufferData(i, t5), n4.push(t5));
  251. }
  252. await Promise.all(n4.map((s4) => {
  253. const i = e3.key.id === s4.message.tileKey, a2 = i ? t4.remove : [], n5 = i && t4.end;
  254. return this._updateTileMesh(o2, e3, s4, a2, n5, t4.clear, r2.signal);
  255. }));
  256. } catch (u) {
  257. this._handleError(e3, u, r2);
  258. }
  259. }
  260. async _updateTileMesh(e3, t4, s2, i, a2, o2, c) {
  261. const d = e3, h = s2.message.tileKey, f3 = !!this._schema.mesh.sortKey;
  262. h !== t4.key.id && (a2 = false);
  263. const m2 = o(s2, (e4) => e4.message), u = o(s2, (e4) => e4.transferList) || [], p3 = { type: d, addOrUpdate: m2, remove: i, clear: o2, end: a2, sort: f3 }, g2 = { transferList: e2(u) || [], signal: c };
  264. return f2(g2), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: h, data: p3 }, g2);
  265. }
  266. async _processFeatures(e3, t4, s2, r2, a2) {
  267. if (t(t4) || !t4.hasFeatures)
  268. return null;
  269. const o2 = { transform: e3.transform, hasZ: false, hasM: false }, n3 = this._factory, c = { viewingMode: "", scale: e3.scale }, d = await this._matchers.feature, h = await this._matchers.aggregate;
  270. f2(r2);
  271. const f3 = this._getLabelInfos(e3, t4);
  272. return await n3.analyze(t4.getCursor(), this._resourceManagerProxy, d, h, o2, c), f2(r2), this._writeFeatureSet(e3, t4, o2, f3, n3, s2, a2);
  273. }
  274. _writeFeatureSet(e3, t4, s2, r2, i, o2, n3) {
  275. const l3 = t4.getSize(), c = new E(e3.key.id, { features: l3, records: l3, metrics: 0 }, this._schema.mesh.matcher.symbologyType, o2, true, n3), d = { viewingMode: "", scale: e3.scale }, h = t4.getCursor();
  276. for (; h.next(); )
  277. try {
  278. const t5 = h.getDisplayId(), o3 = r(r2) ? r2.get(t5) : null;
  279. i.writeCursor(c, h, s2, d, e3.level, o3, this._resourceManagerProxy);
  280. } catch (m2) {
  281. }
  282. const f3 = e3.tileInfoView.tileInfo.isWrappable;
  283. return c.serialize(f3);
  284. }
  285. _handleError(e3, t4, s2) {
  286. if (!g(t4)) {
  287. const r2 = { tileKey: e3.id, error: t4.message };
  288. return this.remoteClient.invoke("tileRenderer.onTileError", r2, { signal: s2.signal });
  289. }
  290. }
  291. _getLabelingSchemaForScale(e3) {
  292. const t4 = this._schema.mesh.labels;
  293. if (t(t4))
  294. return null;
  295. if (t4.type === "subtype") {
  296. const s3 = { type: "subtype", classes: {} };
  297. let r2 = false;
  298. for (const i in t4.classes) {
  299. const a2 = t4.classes[i].filter((t5) => I(t5, e3.scale));
  300. r2 = r2 || !!a2.length, s3.classes[i] = a2;
  301. }
  302. return r2 ? s3 : null;
  303. }
  304. const s2 = t4.classes.filter((t5) => I(t5, e3.scale));
  305. return s2.length ? { type: "simple", classes: s2 } : null;
  306. }
  307. _getLabels(e3, t4) {
  308. if (t4.type === "subtype") {
  309. const s2 = this.service.subtypeField, r2 = f(s2, "Expected to find subtype Field"), i = e3.readAttribute(r2);
  310. return i == null ? [] : t4.classes[i] ?? [];
  311. }
  312. return t4.classes;
  313. }
  314. _getLabelInfos(e3, s2) {
  315. const r2 = this._getLabelingSchemaForScale(e3);
  316. if (t(r2))
  317. return null;
  318. const a2 = new Map(), o2 = s2.getCursor();
  319. for (; o2.next(); ) {
  320. const e4 = o2.getDisplayId(), s3 = [], i = p2(e4), n3 = i && o2.readAttribute("cluster_count") !== 1 ? "aggregate" : "feature", l3 = this._getLabels(o2, r2);
  321. for (const r3 of l3) {
  322. if (r3.target !== n3)
  323. continue;
  324. const a3 = o2.getStorage(), l4 = i && n3 === "feature" ? a3.getComputedStringAtIndex(o2.readAttribute("referenceId"), r3.fieldIndex) : a3.getComputedStringAtIndex(e4, r3.fieldIndex);
  325. if (!l4)
  326. continue;
  327. const c = n2(l4.toString()), d = c[0], h = c[1];
  328. this._store.getMosaicItem(r3.symbol, t2(d)).then((e5) => {
  329. s3[r3.index] = { glyphs: e5.glyphMosaicItems, rtl: h, index: r3.index };
  330. });
  331. }
  332. a2.set(e4, s3);
  333. }
  334. return a2;
  335. }
  336. };
  337. M = e([n("esri.views.2d.layers.features.processors.SymbolProcessor")], M);
  338. var x2 = M;
  339. export {
  340. x2 as default
  341. };
  342. //# sourceMappingURL=SymbolProcessor-QOW6BODF.js.map