chunk-27P5ZSC7.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import {
  2. A,
  3. S,
  4. S2,
  5. b,
  6. b2,
  7. b3,
  8. c,
  9. h,
  10. k,
  11. m,
  12. m2,
  13. n,
  14. y
  15. } from "./chunk-EN7YGJWG.js";
  16. import {
  17. s3 as s
  18. } from "./chunk-EMJ4ZSM2.js";
  19. import {
  20. r,
  21. t
  22. } from "./chunk-GZT4BVFP.js";
  23. // node_modules/@arcgis/core/symbols/support/symbolConversion.js
  24. var p = { retainId: false, ignoreDrivers: false, hasLabelingContext: true };
  25. function a(a3, S3 = p) {
  26. if (!a3)
  27. return { symbol: null };
  28. const { retainId: c3 = p.retainId, ignoreDrivers: u = p.ignoreDrivers, hasLabelingContext: d = p.hasLabelingContext, retainCIM: j = p.retainCIM } = S3;
  29. let D;
  30. if (c(a3) || a3 instanceof b3)
  31. D = a3.clone();
  32. else if (a3.type === "cim") {
  33. const o = a3.data?.symbol?.type;
  34. if (o !== "CIMPointSymbol")
  35. return { error: new s("symbol-conversion:unsupported-cim-symbol", `CIM symbol of type '${o || "unknown"}' is unsupported in 3D`, { symbol: a3 }) };
  36. D = j ? a3.clone() : h.fromCIMSymbol(a3);
  37. } else if (a3 instanceof m)
  38. D = b2.fromSimpleLineSymbol(a3);
  39. else if (a3 instanceof y)
  40. D = h.fromSimpleMarkerSymbol(a3);
  41. else if (a3 instanceof n)
  42. D = h.fromPictureMarkerSymbol(a3);
  43. else if (a3 instanceof S2)
  44. D = S.fromSimpleFillSymbol(a3);
  45. else {
  46. if (!(a3 instanceof m2))
  47. return { error: new s("symbol-conversion:unsupported-2d-symbol", `2D symbol of type '${a3.type || a3.declaredClass}' is unsupported in 3D`, { symbol: a3 }) };
  48. D = d ? b.fromTextSymbol(a3) : h.fromTextSymbol(a3);
  49. }
  50. if (c3 && D.type !== "cim" && (D.id = a3.id), u && c(D))
  51. for (let o = 0; o < D.symbolLayers.length; ++o)
  52. D.symbolLayers.getItemAt(o)._ignoreDrivers = true;
  53. return { symbol: D };
  54. }
  55. // node_modules/@arcgis/core/symbols/support/jsonUtils.js
  56. var l = ["building-scene", "integrated-mesh", "point-cloud", "scene"];
  57. function m3(e, o, t2, s2) {
  58. const r2 = a2(e, {}, { context: s2, isLabelSymbol: false });
  59. r(r2) && (o[t2] = r2);
  60. }
  61. function b4(e, o, t2, s2) {
  62. const r2 = a2(e, {}, { context: s2, isLabelSymbol: true });
  63. r(r2) && (o[t2] = r2);
  64. }
  65. function c2(e) {
  66. return e instanceof A || e instanceof b3;
  67. }
  68. function a2(e, s2, i) {
  69. if (t(e))
  70. return null;
  71. const { context: m4, isLabelSymbol: b5 } = i, a3 = m4?.origin, p3 = m4?.messages;
  72. if (a3 === "web-scene" && !c2(e)) {
  73. const t2 = a(e, { retainCIM: true, hasLabelingContext: b5 });
  74. return r(t2.symbol) ? t2.symbol.write(s2, m4) : (p3?.push(new s("symbol:unsupported", `Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`, { symbol: e, context: m4, error: t2.error })), null);
  75. }
  76. return (a3 === "web-map" || a3 === "portal-item" && !l.includes(m4?.layer?.type)) && c2(e) ? (p3?.push(new s("symbol:unsupported", `Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`, { symbol: e, context: m4 })), null) : e.write(s2, m4);
  77. }
  78. function p2(o, n2) {
  79. return k(o, null, n2);
  80. }
  81. export {
  82. m3 as m,
  83. b4 as b,
  84. p2 as p
  85. };
  86. //# sourceMappingURL=chunk-27P5ZSC7.js.map