chunk-PT5TF6KZ.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import {
  2. n as n2
  3. } from "./chunk-OFTOCPN5.js";
  4. import {
  5. i
  6. } from "./chunk-XO7O5UZJ.js";
  7. import {
  8. t
  9. } from "./chunk-TU7WVKU4.js";
  10. import {
  11. a
  12. } from "./chunk-YZVAB3DF.js";
  13. import {
  14. g
  15. } from "./chunk-GLSWDDR3.js";
  16. import {
  17. e,
  18. m,
  19. n5 as n,
  20. y3 as y
  21. } from "./chunk-2Z2TG5CU.js";
  22. import {
  23. r
  24. } from "./chunk-YXWMMD76.js";
  25. // node_modules/@arcgis/core/layers/support/ExportImageParameters.js
  26. var m2 = { visible: "visibleSublayers", definitionExpression: "layerDefs", labelingInfo: "hasDynamicLayers", labelsVisible: "hasDynamicLayers", opacity: "hasDynamicLayers", minScale: "visibleSublayers", maxScale: "visibleSublayers", renderer: "hasDynamicLayers", source: "hasDynamicLayers" };
  27. var c = class extends a(m) {
  28. constructor(e2) {
  29. super(e2), this.floors = null, this.scale = 0;
  30. }
  31. destroy() {
  32. this.layer = null;
  33. }
  34. get dynamicLayers() {
  35. if (!this.hasDynamicLayers)
  36. return null;
  37. const e2 = this.visibleSublayers.map((e3) => {
  38. const r2 = n2(this.floors, e3);
  39. return e3.toExportImageJSON(r2);
  40. });
  41. return e2.length ? JSON.stringify(e2) : null;
  42. }
  43. get hasDynamicLayers() {
  44. return this.layer && i(this.visibleSublayers, this.layer.serviceSublayers, this.layer.gdbVersion);
  45. }
  46. set layer(e2) {
  47. this._get("layer") !== e2 && (this._set("layer", e2), this.handles.remove("layer"), e2 && this.handles.add([e2.allSublayers.on("change", () => this.notifyChange("visibleSublayers")), e2.on("sublayer-update", (e3) => this.notifyChange(m2[e3.propertyName]))], "layer"));
  48. }
  49. get layers() {
  50. const e2 = this.visibleSublayers;
  51. return e2 ? e2.length ? "show:" + e2.map((e3) => e3.id).join(",") : "show:-1" : null;
  52. }
  53. get layerDefs() {
  54. var _a;
  55. const e2 = !!((_a = this.floors) == null ? void 0 : _a.length), r2 = this.visibleSublayers.filter((r3) => null != r3.definitionExpression || e2 && null != r3.floorInfo);
  56. return r2.length ? JSON.stringify(r2.reduce((e3, r3) => {
  57. const s = n2(this.floors, r3), o = t(s, r3.definitionExpression);
  58. return r(o) && (e3[r3.id] = o), e3;
  59. }, {})) : null;
  60. }
  61. get version() {
  62. this.commitProperty("layers"), this.commitProperty("layerDefs"), this.commitProperty("dynamicLayers"), this.commitProperty("timeExtent");
  63. const e2 = this.layer;
  64. return e2 && (e2.commitProperty("dpi"), e2.commitProperty("imageFormat"), e2.commitProperty("imageTransparency"), e2.commitProperty("gdbVersion")), (this._get("version") || 0) + 1;
  65. }
  66. get visibleSublayers() {
  67. const e2 = [];
  68. if (!this.layer)
  69. return e2;
  70. const r2 = this.layer.sublayers, s = (r3) => {
  71. const t3 = this.scale, i2 = 0 === t3, o = 0 === r3.minScale || t3 <= r3.minScale, a2 = 0 === r3.maxScale || t3 >= r3.maxScale;
  72. r3.visible && (i2 || o && a2) && (r3.sublayers ? r3.sublayers.forEach(s) : e2.unshift(r3));
  73. };
  74. r2 && r2.forEach(s);
  75. const t2 = this._get("visibleSublayers");
  76. return !t2 || t2.length !== e2.length || t2.some((r3, s2) => e2[s2] !== r3) ? e2 : t2;
  77. }
  78. toJSON() {
  79. const e2 = this.layer;
  80. let r2 = { dpi: e2.dpi, format: e2.imageFormat, transparent: e2.imageTransparency, gdbVersion: e2.gdbVersion || null };
  81. return this.hasDynamicLayers && this.dynamicLayers ? r2.dynamicLayers = this.dynamicLayers : r2 = { ...r2, layers: this.layers, layerDefs: this.layerDefs }, r2;
  82. }
  83. };
  84. e([y({ readOnly: true })], c.prototype, "dynamicLayers", null), e([y()], c.prototype, "floors", void 0), e([y({ readOnly: true })], c.prototype, "hasDynamicLayers", null), e([y()], c.prototype, "layer", null), e([y({ readOnly: true })], c.prototype, "layers", null), e([y({ readOnly: true })], c.prototype, "layerDefs", null), e([y({ type: Number })], c.prototype, "scale", void 0), e([y(g)], c.prototype, "timeExtent", void 0), e([y({ readOnly: true })], c.prototype, "version", null), e([y({ readOnly: true })], c.prototype, "visibleSublayers", null), c = e([n("esri.layers.mixins.ExportImageParameters")], c);
  85. export {
  86. c
  87. };
  88. //# sourceMappingURL=chunk-PT5TF6KZ.js.map