chunk-GZJP6H3U.js 2.8 KB

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