symbolLayerUtils-JYVFC7K4.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import {
  2. e
  3. } from "./chunk-7IKYLNB5.js";
  4. import {
  5. c,
  6. t
  7. } from "./chunk-VBNMTM7L.js";
  8. import "./chunk-522WBHUO.js";
  9. import {
  10. F,
  11. a
  12. } from "./chunk-WNCU6BFU.js";
  13. import "./chunk-N2663GRX.js";
  14. import "./chunk-XNLG7T2T.js";
  15. import "./chunk-IR4PV7VK.js";
  16. import {
  17. U
  18. } from "./chunk-VNFRAYHO.js";
  19. import "./chunk-R5IG2D6H.js";
  20. import "./chunk-VBRY5KJM.js";
  21. import "./chunk-ECW2QABR.js";
  22. import "./chunk-GCDJLKH4.js";
  23. import "./chunk-MRJEICT6.js";
  24. import "./chunk-Y3WMVFTW.js";
  25. import "./chunk-SAS7RONY.js";
  26. import "./chunk-WSRBH7BF.js";
  27. import "./chunk-IHXECKQQ.js";
  28. import "./chunk-ULGDPLM2.js";
  29. import {
  30. s3 as s
  31. } from "./chunk-EMJ4ZSM2.js";
  32. import "./chunk-IKP3YN53.js";
  33. import {
  34. r
  35. } from "./chunk-GZT4BVFP.js";
  36. import "./chunk-A5ICIBVI.js";
  37. // node_modules/@arcgis/core/symbols/support/symbolLayerUtils.js
  38. var c2 = a2();
  39. function a2() {
  40. return new e(50);
  41. }
  42. function m() {
  43. c2 = a2();
  44. }
  45. function y(e2, o) {
  46. if (e2.type === "icon")
  47. return l(e2, o);
  48. if (e2.type === "object")
  49. return b(e2, o);
  50. throw new s("symbol3d:unsupported-symbol-layer", "computeLayerSize only works with symbol layers of type Icon and Object");
  51. }
  52. async function f(e2, o) {
  53. if (e2.type === "icon")
  54. return p(e2, o);
  55. if (e2.type === "object")
  56. return d(e2, o);
  57. throw new s("symbol3d:unsupported-symbol-layer", "computeLayerSize only works with symbol layers of type Icon and Object");
  58. }
  59. async function l(e2, o) {
  60. if (e2.resource.href)
  61. return h(e2.resource.href).then((e3) => [e3.width, e3.height]);
  62. if (e2.resource.primitive)
  63. return r(o) ? [o, o] : [256, 256];
  64. throw new s("symbol3d:invalid-symbol-layer", "symbol layers of type Icon must have either an href or a primitive resource");
  65. }
  66. function p(e2, r2) {
  67. return l(e2, r2).then((r3) => {
  68. if (e2.size == null)
  69. return r3;
  70. const o = r3[0] / r3[1];
  71. return o > 1 ? [e2.size, e2.size / o] : [e2.size * o, e2.size];
  72. });
  73. }
  74. function h(r2) {
  75. return U(r2, { responseType: "image" }).then((e2) => e2.data);
  76. }
  77. function b(e2, r2) {
  78. return w(e2, r2).then((e3) => F(e3));
  79. }
  80. async function d(e2, r2) {
  81. const o = await b(e2, r2);
  82. return t(o, e2);
  83. }
  84. async function w(e2, o) {
  85. if (!e2.isPrimitive) {
  86. const r2 = e2.resource.href, o2 = c2.get(r2);
  87. if (o2 !== void 0)
  88. return o2;
  89. const t2 = await import("./objectResourceUtils-OTLKPTOD.js"), n2 = await t2.fetch(r2, { disableTextures: true });
  90. return c2.put(r2, n2.referenceBoundingBox), n2.referenceBoundingBox;
  91. }
  92. let n = null;
  93. if (e2.resource && e2.resource.primitive && (n = a(c(e2.resource.primitive)), r(o)))
  94. for (let r2 = 0; r2 < n.length; r2++)
  95. n[r2] *= o;
  96. return n ? Promise.resolve(n) : Promise.reject(new s("symbol:invalid-resource", "The symbol does not have a valid resource"));
  97. }
  98. export {
  99. m as clearBoundingBoxCache,
  100. l as computeIconLayerResourceSize,
  101. y as computeLayerResourceSize,
  102. f as computeLayerSize,
  103. b as computeObjectLayerResourceSize
  104. };
  105. //# sourceMappingURL=symbolLayerUtils-JYVFC7K4.js.map