GroupLayer-O4E26MJH.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import {
  2. a
  3. } from "./chunk-PNB3LCW5.js";
  4. import {
  5. U,
  6. l
  7. } from "./chunk-BWATQC2Y.js";
  8. import {
  9. v
  10. } from "./chunk-2DSTZVND.js";
  11. import {
  12. c
  13. } from "./chunk-VXKIGGM4.js";
  14. import "./chunk-KG45D2XL.js";
  15. import {
  16. O
  17. } from "./chunk-JYRZQPQI.js";
  18. import "./chunk-3HZQM2NK.js";
  19. import "./chunk-AR2YN3E2.js";
  20. import "./chunk-U3LEOWJX.js";
  21. import "./chunk-4ONPMX2F.js";
  22. import "./chunk-47NSA4T4.js";
  23. import "./chunk-FUODOQDM.js";
  24. import {
  25. n as n3
  26. } from "./chunk-UA6W42KP.js";
  27. import "./chunk-3OSQ6GXO.js";
  28. import "./chunk-3WQOA5CB.js";
  29. import {
  30. t
  31. } from "./chunk-2L5METUC.js";
  32. import "./chunk-FZQZIM7U.js";
  33. import "./chunk-CZBRZ6SU.js";
  34. import "./chunk-VGWC3IKZ.js";
  35. import "./chunk-UKEN2UNL.js";
  36. import "./chunk-UVVU4UUO.js";
  37. import {
  38. d,
  39. l as l3,
  40. t as t2
  41. } from "./chunk-KTMBA3TM.js";
  42. import {
  43. y as y2
  44. } from "./chunk-UTSBIUUP.js";
  45. import "./chunk-ICWTATWH.js";
  46. import {
  47. n as n2
  48. } from "./chunk-R7V7MKKV.js";
  49. import {
  50. l as l2
  51. } from "./chunk-E36TKLKO.js";
  52. import "./chunk-PE24J2I5.js";
  53. import "./chunk-P3XKUGLS.js";
  54. import "./chunk-PIFOHNWC.js";
  55. import "./chunk-LLO7GCYU.js";
  56. import "./chunk-U7RKABRB.js";
  57. import "./chunk-X7CNGECX.js";
  58. import "./chunk-PSEI52P3.js";
  59. import "./chunk-ZLNEXZAN.js";
  60. import "./chunk-5UVJ64RB.js";
  61. import {
  62. b
  63. } from "./chunk-O43KLDSX.js";
  64. import "./chunk-AUOH2VSO.js";
  65. import "./chunk-ZYRIJWLX.js";
  66. import "./chunk-TJNOJH33.js";
  67. import "./chunk-OSHI574D.js";
  68. import "./chunk-44GMIOGP.js";
  69. import "./chunk-75U5LM2V.js";
  70. import "./chunk-ZHRAUKVQ.js";
  71. import "./chunk-RZK6A2GY.js";
  72. import "./chunk-4NQ74ZR6.js";
  73. import "./chunk-X4LLOW7U.js";
  74. import "./chunk-BDA6VH2A.js";
  75. import "./chunk-Z4JTBD7M.js";
  76. import "./chunk-MSBIHK67.js";
  77. import "./chunk-HZRKBTHJ.js";
  78. import "./chunk-5DMBXPN2.js";
  79. import "./chunk-QANZ6BFY.js";
  80. import "./chunk-VEGAOVMY.js";
  81. import "./chunk-CXCDYJ5R.js";
  82. import "./chunk-GAOW3WRZ.js";
  83. import {
  84. r as r2
  85. } from "./chunk-QCKFNSN2.js";
  86. import {
  87. e,
  88. e2,
  89. n5 as n,
  90. y3 as y
  91. } from "./chunk-6SOHRC7T.js";
  92. import "./chunk-U2XHEJM7.js";
  93. import "./chunk-SQOPWYIT.js";
  94. import "./chunk-6KZ2LTDA.js";
  95. import "./chunk-V6P2MAQQ.js";
  96. import "./chunk-E5O6P5I2.js";
  97. import "./chunk-SPWQ3AWG.js";
  98. import "./chunk-2TIUKVZN.js";
  99. import {
  100. r
  101. } from "./chunk-YXWMMD76.js";
  102. import "./chunk-S5KM4IGW.js";
  103. // node_modules/@arcgis/core/layers/GroupLayer.js
  104. var _ = class extends n3(t(c(v(l3(d(O(b))))))) {
  105. constructor(i) {
  106. super(i), this._visibilityHandles = {}, this.allLayers = new l2({ 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";
  107. }
  108. initialize() {
  109. this._enforceVisibility(this.visibilityMode, this.visible), this.addHandles(l(() => this.visible, this._onVisibilityChange.bind(this), U));
  110. }
  111. _writeLayers(i, e3, t3, r3) {
  112. const o = [];
  113. if (!i)
  114. return o;
  115. i.forEach((i2) => {
  116. const e4 = y2(i2, r3.webmap ? r3.webmap.getLayerJSONFromResourceInfo(i2) : null, r3);
  117. r(e4) && e4.layerType && o.push(e4);
  118. }), e3.layers = o;
  119. }
  120. set portalItem(i) {
  121. this._set("portalItem", i);
  122. }
  123. set visibilityMode(i) {
  124. const e3 = this._get("visibilityMode") !== i;
  125. this._set("visibilityMode", i), e3 && this._enforceVisibility(i, this.visible);
  126. }
  127. load(i) {
  128. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Service", "Feature Collection", "Scene Service"], layerModuleTypeMap: a }, i)), Promise.resolve(this);
  129. }
  130. loadAll() {
  131. return n2(this, (i) => {
  132. i(this.layers, this.tables);
  133. });
  134. }
  135. layerAdded(i) {
  136. i.visible && "exclusive" === this.visibilityMode ? this._turnOffOtherLayers(i) : "inherited" === this.visibilityMode && (i.visible = this.visible), this._visibilityHandles[i.uid] = l(() => i.visible, (e3) => this._onChildVisibilityChange(i, e3), U);
  137. }
  138. layerRemoved(i) {
  139. const e3 = this._visibilityHandles[i.uid];
  140. e3 && (e3.remove(), delete this._visibilityHandles[i.uid]), this._enforceVisibility(this.visibilityMode, this.visible);
  141. }
  142. _turnOffOtherLayers(i) {
  143. this.layers.forEach((e3) => {
  144. e3 !== i && (e3.visible = false);
  145. });
  146. }
  147. _enforceVisibility(i, e3) {
  148. if (!e2(this).initialized)
  149. return;
  150. const t3 = this.layers;
  151. let s = t3.find((i2) => i2.visible);
  152. switch (i) {
  153. case "exclusive":
  154. t3.length && !s && (s = t3.getItemAt(0), s.visible = true), this._turnOffOtherLayers(s);
  155. break;
  156. case "inherited":
  157. t3.forEach((i2) => {
  158. i2.visible = e3;
  159. });
  160. }
  161. }
  162. _onVisibilityChange(i) {
  163. "inherited" === this.visibilityMode && this.layers.forEach((e3) => {
  164. e3.visible = i;
  165. });
  166. }
  167. _onChildVisibilityChange(i, e3) {
  168. switch (this.visibilityMode) {
  169. case "exclusive":
  170. e3 ? this._turnOffOtherLayers(i) : this._isAnyLayerVisible() || (i.visible = true);
  171. break;
  172. case "inherited":
  173. i.visible = this.visible;
  174. }
  175. }
  176. _isAnyLayerVisible() {
  177. return this.layers.some((i) => i.visible);
  178. }
  179. };
  180. e([y({ readOnly: true, dependsOn: [] })], _.prototype, "allLayers", void 0), e([y({ readOnly: true })], _.prototype, "allTables", void 0), e([y()], _.prototype, "fullExtent", void 0), e([y({ json: { read: true, write: true } })], _.prototype, "blendMode", void 0), e([y({ json: { read: false, write: { ignoreOrigin: true } } })], _.prototype, "layers", void 0), e([r2("layers")], _.prototype, "_writeLayers", null), e([y({ type: ["GroupLayer"] })], _.prototype, "operationalLayerType", void 0), e([y({ json: { origins: { "web-document": { read: false, write: false } } } })], _.prototype, "portalItem", null), e([y()], _.prototype, "spatialReference", void 0), e([y({ json: { read: false }, readOnly: true, value: "group" })], _.prototype, "type", void 0), e([y({ type: ["independent", "inherited", "exclusive"], value: "independent", json: { write: true, origins: { "web-map": { read: false, write: false } } } })], _.prototype, "visibilityMode", null), _ = e([n("esri.layers.GroupLayer")], _);
  181. var g = _;
  182. export {
  183. g as default
  184. };
  185. //# sourceMappingURL=GroupLayer-O4E26MJH.js.map