chunk-TD4DLRQ7.js 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import {
  2. n as n2
  3. } from "./chunk-AMQJEM7V.js";
  4. import {
  5. i
  6. } from "./chunk-MD4XYAEQ.js";
  7. import {
  8. t
  9. } from "./chunk-S7R5EXHN.js";
  10. import {
  11. a
  12. } from "./chunk-RMX2AZ4P.js";
  13. import {
  14. g
  15. } from "./chunk-PSV473TI.js";
  16. import {
  17. d,
  18. e,
  19. n2 as n,
  20. y3 as y
  21. } from "./chunk-Y3WMVFTW.js";
  22. import {
  23. r
  24. } from "./chunk-GZT4BVFP.js";
  25. // node_modules/@arcgis/core/layers/support/ExportImageParameters.js
  26. var m = { visible: "visibleSublayers", definitionExpression: "layerDefs", labelingInfo: "hasDynamicLayers", labelsVisible: "hasDynamicLayers", opacity: "hasDynamicLayers", minScale: "visibleSublayers", maxScale: "visibleSublayers", renderer: "hasDynamicLayers", source: "hasDynamicLayers" };
  27. var c = class extends a(y) {
  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(m[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. const e2 = !!this.floors?.length, r2 = this.visibleSublayers.filter((r3) => r3.definitionExpression != null || e2 && r3.floorInfo != null);
  55. return r2.length ? JSON.stringify(r2.reduce((e3, r3) => {
  56. const s = n2(this.floors, r3), o = t(s, r3.definitionExpression);
  57. return r(o) && (e3[r3.id] = o), e3;
  58. }, {})) : null;
  59. }
  60. get version() {
  61. this.commitProperty("layers"), this.commitProperty("layerDefs"), this.commitProperty("dynamicLayers"), this.commitProperty("timeExtent");
  62. const e2 = this.layer;
  63. return e2 && (e2.commitProperty("dpi"), e2.commitProperty("imageFormat"), e2.commitProperty("imageTransparency"), e2.commitProperty("gdbVersion")), (this._get("version") || 0) + 1;
  64. }
  65. get visibleSublayers() {
  66. const e2 = [];
  67. if (!this.layer)
  68. return e2;
  69. const r2 = this.layer.sublayers, s = (r3) => {
  70. const t3 = this.scale, i2 = t3 === 0, o = r3.minScale === 0 || t3 <= r3.minScale, a2 = r3.maxScale === 0 || t3 >= r3.maxScale;
  71. r3.visible && (i2 || o && a2) && (r3.sublayers ? r3.sublayers.forEach(s) : e2.unshift(r3));
  72. };
  73. r2 && r2.forEach(s);
  74. const t2 = this._get("visibleSublayers");
  75. return !t2 || t2.length !== e2.length || t2.some((r3, s2) => e2[s2] !== r3) ? e2 : t2;
  76. }
  77. toJSON() {
  78. const e2 = this.layer;
  79. let r2 = { dpi: e2.dpi, format: e2.imageFormat, transparent: e2.imageTransparency, gdbVersion: e2.gdbVersion || null };
  80. return this.hasDynamicLayers && this.dynamicLayers ? r2.dynamicLayers = this.dynamicLayers : r2 = { ...r2, layers: this.layers, layerDefs: this.layerDefs }, r2;
  81. }
  82. };
  83. e([d({ readOnly: true })], c.prototype, "dynamicLayers", null), e([d()], c.prototype, "floors", void 0), e([d({ readOnly: true })], c.prototype, "hasDynamicLayers", null), e([d()], c.prototype, "layer", null), e([d({ readOnly: true })], c.prototype, "layers", null), e([d({ readOnly: true })], c.prototype, "layerDefs", null), e([d({ type: Number })], c.prototype, "scale", void 0), e([d(g)], c.prototype, "timeExtent", void 0), e([d({ readOnly: true })], c.prototype, "version", null), e([d({ readOnly: true })], c.prototype, "visibleSublayers", null), c = e([n("esri.layers.mixins.ExportImageParameters")], c);
  84. export {
  85. c
  86. };
  87. //# sourceMappingURL=chunk-TD4DLRQ7.js.map