chunk-RZPC4VQ3.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import {
  2. z
  3. } from "./chunk-O4FY3ITT.js";
  4. import {
  5. M2 as M
  6. } from "./chunk-ECW2QABR.js";
  7. import {
  8. r
  9. } from "./chunk-GZT4BVFP.js";
  10. // node_modules/@arcgis/core/renderers/support/clickToleranceUtils.js
  11. function t(t3, e2) {
  12. return e2 ? "xoffset" in e2 && e2.xoffset ? Math.max(t3, Math.abs(e2.xoffset)) : "yoffset" in e2 && e2.yoffset ? Math.max(t3, Math.abs(e2.yoffset || 0)) : t3 : t3;
  13. }
  14. function e(t3) {
  15. let e2 = 0, n2 = 0;
  16. for (let r3 = 0; r3 < t3.length; r3++) {
  17. const s3 = t3[r3].size;
  18. typeof s3 == "number" && (e2 += s3, n2++);
  19. }
  20. return e2 / n2;
  21. }
  22. function n(t3, n2) {
  23. return typeof t3 == "number" ? t3 : t3 && t3.stops && t3.stops.length ? e(t3.stops) : n2;
  24. }
  25. function r2(t3, e2) {
  26. if (!e2)
  27. return t3;
  28. const r3 = e2.filter((t4) => t4.type === "size").map((e3) => {
  29. const { maxSize: r4, minSize: s4 } = e3;
  30. return (n(r4, t3) + n(s4, t3)) / 2;
  31. });
  32. let s3 = 0;
  33. const o = r3.length;
  34. if (o === 0)
  35. return t3;
  36. for (let n2 = 0; n2 < o; n2++)
  37. s3 += r3[n2];
  38. const f = Math.floor(s3 / o);
  39. return Math.max(f, t3);
  40. }
  41. function s(e2) {
  42. const n2 = e2 && e2.renderer, s3 = (e2 && e2.event && e2.event.pointerType) === "touch" ? 9 : 6;
  43. if (!n2)
  44. return s3;
  45. const o = "visualVariables" in n2 ? r2(s3, n2.visualVariables) : s3;
  46. if (n2.type === "simple")
  47. return t(o, n2.symbol);
  48. if (n2.type === "unique-value") {
  49. let e3 = o;
  50. return n2.uniqueValueInfos.forEach((n3) => {
  51. e3 = t(e3, n3.symbol);
  52. }), e3;
  53. }
  54. if (n2.type === "class-breaks") {
  55. let e3 = o;
  56. return n2.classBreakInfos.forEach((n3) => {
  57. e3 = t(e3, n3.symbol);
  58. }), e3;
  59. }
  60. return n2.type === "dot-density" || n2.type, o;
  61. }
  62. // node_modules/@arcgis/core/views/support/drapedUtils.js
  63. function a(t3, n2, a2, o = new M()) {
  64. let s3;
  65. if (a2.type === "2d")
  66. s3 = n2 * a2.resolution;
  67. else if (a2.type === "3d") {
  68. const i = a2.overlayPixelSizeInMapUnits(t3), o2 = a2.basemapSpatialReference;
  69. s3 = r(o2) && !o2.equals(a2.spatialReference) ? z(o2) / z(a2.spatialReference) : n2 * i;
  70. }
  71. const m = t3.x - s3, p = t3.y - s3, c = t3.x + s3, l = t3.y + s3, { spatialReference: f } = a2;
  72. return o.xmin = Math.min(m, c), o.ymin = Math.min(p, l), o.xmax = Math.max(m, c), o.ymax = Math.max(p, l), o.spatialReference = f, o;
  73. }
  74. var s2 = new M();
  75. export {
  76. s,
  77. a
  78. };
  79. //# sourceMappingURL=chunk-RZPC4VQ3.js.map