GroupLayer-VVRSBWUE.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. import {
  2. p as p2,
  3. t as t2,
  4. y as y2
  5. } from "./chunk-77N52HSV.js";
  6. import {
  7. y
  8. } from "./chunk-4YMGIMYW.js";
  9. import "./chunk-4FQG6M7Q.js";
  10. import {
  11. n as n2
  12. } from "./chunk-5MVUZO4F.js";
  13. import {
  14. p
  15. } from "./chunk-V7H6CJ37.js";
  16. import "./chunk-RMX2AZ4P.js";
  17. import "./chunk-NE3ESGA6.js";
  18. import {
  19. U,
  20. l
  21. } from "./chunk-YIS6BAC3.js";
  22. import {
  23. v
  24. } from "./chunk-KHA63LLS.js";
  25. import {
  26. c
  27. } from "./chunk-FGKNEJKJ.js";
  28. import "./chunk-PSV473TI.js";
  29. import {
  30. O
  31. } from "./chunk-I3OBGWNS.js";
  32. import "./chunk-FONIFA5N.js";
  33. import "./chunk-EG5OI4V4.js";
  34. import "./chunk-65BYCSII.js";
  35. import "./chunk-WZQZRKNH.js";
  36. import "./chunk-LRDX4TO7.js";
  37. import "./chunk-6A4U74YA.js";
  38. import {
  39. a
  40. } from "./chunk-5LXROFTA.js";
  41. import "./chunk-GJXW4HL5.js";
  42. import "./chunk-WJW5DUN6.js";
  43. import {
  44. t
  45. } from "./chunk-W72F6AS3.js";
  46. import "./chunk-PJ7ZQ4VD.js";
  47. import "./chunk-WDLTDV2L.js";
  48. import "./chunk-TERAW6FT.js";
  49. import "./chunk-O4FY3ITT.js";
  50. import "./chunk-WEMIK25H.js";
  51. import {
  52. b
  53. } from "./chunk-4DDBH2K5.js";
  54. import "./chunk-7N4X6GF3.js";
  55. import "./chunk-JXW4QTJA.js";
  56. import "./chunk-UXF37FQ4.js";
  57. import "./chunk-ZOEK6QHJ.js";
  58. import "./chunk-IR4PV7VK.js";
  59. import "./chunk-2Z6LERTI.js";
  60. import "./chunk-OWVBLVP3.js";
  61. import "./chunk-AFZ7XSEW.js";
  62. import "./chunk-EGZW6HC3.js";
  63. import "./chunk-4NKD334K.js";
  64. import "./chunk-65K7LC56.js";
  65. import "./chunk-ATPLLI5W.js";
  66. import "./chunk-WJ3OEUD3.js";
  67. import "./chunk-MXB2XLKV.js";
  68. import "./chunk-XH7RUGVZ.js";
  69. import "./chunk-TBBTRX4O.js";
  70. import "./chunk-YBSUITLL.js";
  71. import "./chunk-ALDCDSPV.js";
  72. import "./chunk-DT6EAZQ5.js";
  73. import "./chunk-HNOZUNJ4.js";
  74. import "./chunk-VNFRAYHO.js";
  75. import "./chunk-R5IG2D6H.js";
  76. import "./chunk-VBRY5KJM.js";
  77. import "./chunk-PDKDCAAD.js";
  78. import "./chunk-ECW2QABR.js";
  79. import "./chunk-GCDJLKH4.js";
  80. import {
  81. r as r2
  82. } from "./chunk-MRJEICT6.js";
  83. import {
  84. d,
  85. e,
  86. e2,
  87. n2 as n
  88. } from "./chunk-Y3WMVFTW.js";
  89. import "./chunk-SAS7RONY.js";
  90. import "./chunk-WSRBH7BF.js";
  91. import "./chunk-IHXECKQQ.js";
  92. import "./chunk-ULGDPLM2.js";
  93. import "./chunk-EMJ4ZSM2.js";
  94. import "./chunk-IKP3YN53.js";
  95. import {
  96. r
  97. } from "./chunk-GZT4BVFP.js";
  98. import "./chunk-A5ICIBVI.js";
  99. // node_modules/@arcgis/core/layers/GroupLayer.js
  100. var _ = class extends a(t(c(v(p2(y2(O(b))))))) {
  101. constructor(i) {
  102. super(i), this._visibilityHandles = {}, this.allLayers = new p({ getCollections: () => [this.layers], getChildrenFunction: (i2) => "layers" in i2 ? i2.layers : null }), this.allTables = t2(this), this.fullExtent = void 0, this.operationalLayerType = "GroupLayer", this.spatialReference = void 0, this.type = "group";
  103. }
  104. initialize() {
  105. this._enforceVisibility(this.visibilityMode, this.visible), this.own(l(() => this.visible, this._onVisibilityChange.bind(this), U));
  106. }
  107. _writeLayers(i, e3, t3, r3) {
  108. const o = [];
  109. if (!i)
  110. return o;
  111. i.forEach((i2) => {
  112. const e4 = y(i2, r3.webmap ? r3.webmap.getLayerJSONFromResourceInfo(i2) : null, r3);
  113. r(e4) && e4.layerType && o.push(e4);
  114. }), e3.layers = o;
  115. }
  116. set portalItem(i) {
  117. this._set("portalItem", i);
  118. }
  119. set visibilityMode(i) {
  120. const e3 = this._get("visibilityMode") !== i;
  121. this._set("visibilityMode", i), e3 && this._enforceVisibility(i, this.visible);
  122. }
  123. load(i) {
  124. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Service", "Feature Collection", "Scene Service"] }, i)), Promise.resolve(this);
  125. }
  126. loadAll() {
  127. return n2(this, (i) => {
  128. i(this.layers, this.tables);
  129. });
  130. }
  131. layerAdded(i) {
  132. i.visible && this.visibilityMode === "exclusive" ? this._turnOffOtherLayers(i) : this.visibilityMode === "inherited" && (i.visible = this.visible), this._visibilityHandles[i.uid] = l(() => i.visible, (e3) => this._onChildVisibilityChange(i, e3), U);
  133. }
  134. layerRemoved(i) {
  135. const e3 = this._visibilityHandles[i.uid];
  136. e3 && (e3.remove(), delete this._visibilityHandles[i.uid]), this._enforceVisibility(this.visibilityMode, this.visible);
  137. }
  138. _turnOffOtherLayers(i) {
  139. this.layers.forEach((e3) => {
  140. e3 !== i && (e3.visible = false);
  141. });
  142. }
  143. _enforceVisibility(i, e3) {
  144. if (!e2(this).initialized)
  145. return;
  146. const t3 = this.layers;
  147. let s = t3.find((i2) => i2.visible);
  148. switch (i) {
  149. case "exclusive":
  150. t3.length && !s && (s = t3.getItemAt(0), s.visible = true), this._turnOffOtherLayers(s);
  151. break;
  152. case "inherited":
  153. t3.forEach((i2) => {
  154. i2.visible = e3;
  155. });
  156. }
  157. }
  158. _onVisibilityChange(i) {
  159. this.visibilityMode === "inherited" && this.layers.forEach((e3) => {
  160. e3.visible = i;
  161. });
  162. }
  163. _onChildVisibilityChange(i, e3) {
  164. switch (this.visibilityMode) {
  165. case "exclusive":
  166. e3 ? this._turnOffOtherLayers(i) : this._isAnyLayerVisible() || (i.visible = true);
  167. break;
  168. case "inherited":
  169. i.visible = this.visible;
  170. }
  171. }
  172. _isAnyLayerVisible() {
  173. return this.layers.some((i) => i.visible);
  174. }
  175. };
  176. e([d({ readOnly: true, dependsOn: [] })], _.prototype, "allLayers", void 0), e([d({ readOnly: true })], _.prototype, "allTables", void 0), e([d()], _.prototype, "fullExtent", void 0), e([d({ json: { read: false, write: { ignoreOrigin: true } } })], _.prototype, "layers", void 0), e([r2("layers")], _.prototype, "_writeLayers", null), e([d({ type: ["GroupLayer"] })], _.prototype, "operationalLayerType", void 0), e([d({ json: { origins: { "web-document": { read: false, write: false } } } })], _.prototype, "portalItem", null), e([d()], _.prototype, "spatialReference", void 0), e([d({ json: { read: false }, readOnly: true, value: "group" })], _.prototype, "type", void 0), e([d({ type: ["independent", "inherited", "exclusive"], value: "independent", json: { write: true, origins: { "web-map": { read: false, write: false } } } })], _.prototype, "visibilityMode", null), _ = e([n("esri.layers.GroupLayer")], _);
  177. var L = _;
  178. export {
  179. L as default
  180. };
  181. //# sourceMappingURL=GroupLayer-VVRSBWUE.js.map