chunk-ST53DRNI.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import {
  2. A,
  3. _,
  4. f
  5. } from "./chunk-3WXSWAUV.js";
  6. import {
  7. E,
  8. S
  9. } from "./chunk-EQNT4A7P.js";
  10. // node_modules/@arcgis/core/views/2d/layers/features/createSymbolSchema.js
  11. function l(e) {
  12. var _a;
  13. if ("line-marker" === e.type) {
  14. return { type: "line-marker", color: (_a = e.color) == null ? void 0 : _a.toJSON(), placement: e.placement, style: e.style };
  15. }
  16. return e.constructor.fromJSON(e.toJSON()).toJSON();
  17. }
  18. function s(e) {
  19. return A(e);
  20. }
  21. function o(e, a, t = false) {
  22. if (!e)
  23. return null;
  24. switch (e.type) {
  25. case "simple-fill":
  26. case "picture-fill":
  27. return c(e, a, t);
  28. case "simple-marker":
  29. case "picture-marker":
  30. return h(e, a, t);
  31. case "simple-line":
  32. return m(e, a, t);
  33. case "text":
  34. return y(e, a, t);
  35. case "label":
  36. return i(e, a, t);
  37. case "cim":
  38. return { type: "cim", rendererKey: a.vvFlags, data: e.data, maxVVSize: a.maxVVSize };
  39. case "CIMSymbolReference":
  40. return { type: "cim", rendererKey: a.vvFlags, data: e, maxVVSize: a.maxVVSize };
  41. case "web-style":
  42. return { ...l(e), type: "web-style", hash: e.hash(), rendererKey: a.vvFlags, maxVVSize: a.maxVVSize };
  43. default:
  44. throw new Error(`symbol not supported ${e.type}`);
  45. }
  46. }
  47. function i(a, r, n) {
  48. const l2 = a.toJSON(), o2 = f(E.LABEL, { ...r, placement: l2.labelPlacement });
  49. return { materialKey: n ? s(o2) : o2, hash: a.hash(), ...l2, labelPlacement: l2.labelPlacement };
  50. }
  51. function c(a, n, o2) {
  52. const i2 = f(E.FILL, n), c2 = o2 ? s(i2) : i2, m2 = a.clone(), h2 = m2.outline, y2 = _(n.symbologyType);
  53. y2 || (m2.outline = null);
  54. const u = { materialKey: c2, hash: m2.hash(), ...l(m2) };
  55. if (y2)
  56. return u;
  57. const p = [];
  58. if (p.push(u), h2) {
  59. const a2 = f(E.LINE, { ...n, isOutline: true }), r = { materialKey: o2 ? s(a2) : a2, hash: h2.hash(), ...l(h2) };
  60. p.push(r);
  61. }
  62. return { type: "composite-symbol", layers: p, hash: p.reduce((e, a2) => a2.hash + e, "") };
  63. }
  64. function m(n, o2, i2) {
  65. var _a;
  66. const c2 = _(o2.symbologyType) ? S.DEFAULT : o2.symbologyType, m2 = f(E.LINE, { ...o2, symbologyType: c2 }), h2 = i2 ? s(m2) : m2, y2 = n.clone(), u = y2.marker;
  67. y2.marker = null;
  68. const p = [];
  69. if (p.push({ materialKey: h2, hash: y2.hash(), ...l(y2) }), u) {
  70. const a = f(E.MARKER, o2), r = i2 ? s(a) : a;
  71. u.color = (_a = u.color) != null ? _a : y2.color, p.push({ materialKey: r, hash: u.hash(), lineWidth: y2.width, ...l(u) });
  72. }
  73. return { type: "composite-symbol", layers: p, hash: p.reduce((e, a) => a.hash + e, "") };
  74. }
  75. function h(a, r, n) {
  76. const o2 = f(E.MARKER, r), i2 = n ? s(o2) : o2, c2 = l(a);
  77. return { materialKey: i2, hash: a.hash(), ...c2, angle: a.angle, maxVVSize: r.maxVVSize };
  78. }
  79. function y(a, r, n) {
  80. const o2 = f(E.TEXT, r), i2 = n ? s(o2) : o2, c2 = l(a);
  81. return { materialKey: i2, hash: a.hash(), ...c2, angle: a.angle, maxVVSize: r.maxVVSize };
  82. }
  83. export {
  84. o
  85. };
  86. //# sourceMappingURL=chunk-ST53DRNI.js.map