123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- import {
- p as p2,
- t as t2,
- y as y2
- } from "./chunk-77N52HSV.js";
- import {
- y
- } from "./chunk-4YMGIMYW.js";
- import "./chunk-4FQG6M7Q.js";
- import {
- n as n2
- } from "./chunk-5MVUZO4F.js";
- import {
- p
- } from "./chunk-V7H6CJ37.js";
- import "./chunk-RMX2AZ4P.js";
- import "./chunk-NE3ESGA6.js";
- import {
- U,
- l
- } from "./chunk-YIS6BAC3.js";
- import {
- v
- } from "./chunk-KHA63LLS.js";
- import {
- c
- } from "./chunk-FGKNEJKJ.js";
- import "./chunk-PSV473TI.js";
- import {
- O
- } from "./chunk-I3OBGWNS.js";
- import "./chunk-FONIFA5N.js";
- import "./chunk-EG5OI4V4.js";
- import "./chunk-65BYCSII.js";
- import "./chunk-WZQZRKNH.js";
- import "./chunk-LRDX4TO7.js";
- import "./chunk-6A4U74YA.js";
- import {
- a
- } from "./chunk-5LXROFTA.js";
- import "./chunk-GJXW4HL5.js";
- import "./chunk-WJW5DUN6.js";
- import {
- t
- } from "./chunk-W72F6AS3.js";
- import "./chunk-PJ7ZQ4VD.js";
- import "./chunk-WDLTDV2L.js";
- import "./chunk-TERAW6FT.js";
- import "./chunk-O4FY3ITT.js";
- import "./chunk-WEMIK25H.js";
- import {
- b
- } from "./chunk-4DDBH2K5.js";
- import "./chunk-7N4X6GF3.js";
- import "./chunk-JXW4QTJA.js";
- import "./chunk-UXF37FQ4.js";
- import "./chunk-ZOEK6QHJ.js";
- import "./chunk-IR4PV7VK.js";
- import "./chunk-2Z6LERTI.js";
- import "./chunk-OWVBLVP3.js";
- import "./chunk-AFZ7XSEW.js";
- import "./chunk-EGZW6HC3.js";
- import "./chunk-4NKD334K.js";
- import "./chunk-65K7LC56.js";
- import "./chunk-ATPLLI5W.js";
- import "./chunk-WJ3OEUD3.js";
- import "./chunk-MXB2XLKV.js";
- import "./chunk-XH7RUGVZ.js";
- import "./chunk-TBBTRX4O.js";
- import "./chunk-YBSUITLL.js";
- import "./chunk-ALDCDSPV.js";
- import "./chunk-DT6EAZQ5.js";
- import "./chunk-HNOZUNJ4.js";
- import "./chunk-VNFRAYHO.js";
- import "./chunk-R5IG2D6H.js";
- import "./chunk-VBRY5KJM.js";
- import "./chunk-PDKDCAAD.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import {
- r as r2
- } from "./chunk-MRJEICT6.js";
- import {
- d,
- e,
- e2,
- n2 as n
- } from "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import "./chunk-ULGDPLM2.js";
- import "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import {
- r
- } from "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/layers/GroupLayer.js
- var _ = class extends a(t(c(v(p2(y2(O(b))))))) {
- constructor(i) {
- 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";
- }
- initialize() {
- this._enforceVisibility(this.visibilityMode, this.visible), this.own(l(() => this.visible, this._onVisibilityChange.bind(this), U));
- }
- _writeLayers(i, e3, t3, r3) {
- const o = [];
- if (!i)
- return o;
- i.forEach((i2) => {
- const e4 = y(i2, r3.webmap ? r3.webmap.getLayerJSONFromResourceInfo(i2) : null, r3);
- r(e4) && e4.layerType && o.push(e4);
- }), e3.layers = o;
- }
- set portalItem(i) {
- this._set("portalItem", i);
- }
- set visibilityMode(i) {
- const e3 = this._get("visibilityMode") !== i;
- this._set("visibilityMode", i), e3 && this._enforceVisibility(i, this.visible);
- }
- load(i) {
- return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Service", "Feature Collection", "Scene Service"] }, i)), Promise.resolve(this);
- }
- loadAll() {
- return n2(this, (i) => {
- i(this.layers, this.tables);
- });
- }
- layerAdded(i) {
- 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);
- }
- layerRemoved(i) {
- const e3 = this._visibilityHandles[i.uid];
- e3 && (e3.remove(), delete this._visibilityHandles[i.uid]), this._enforceVisibility(this.visibilityMode, this.visible);
- }
- _turnOffOtherLayers(i) {
- this.layers.forEach((e3) => {
- e3 !== i && (e3.visible = false);
- });
- }
- _enforceVisibility(i, e3) {
- if (!e2(this).initialized)
- return;
- const t3 = this.layers;
- let s = t3.find((i2) => i2.visible);
- switch (i) {
- case "exclusive":
- t3.length && !s && (s = t3.getItemAt(0), s.visible = true), this._turnOffOtherLayers(s);
- break;
- case "inherited":
- t3.forEach((i2) => {
- i2.visible = e3;
- });
- }
- }
- _onVisibilityChange(i) {
- this.visibilityMode === "inherited" && this.layers.forEach((e3) => {
- e3.visible = i;
- });
- }
- _onChildVisibilityChange(i, e3) {
- switch (this.visibilityMode) {
- case "exclusive":
- e3 ? this._turnOffOtherLayers(i) : this._isAnyLayerVisible() || (i.visible = true);
- break;
- case "inherited":
- i.visible = this.visible;
- }
- }
- _isAnyLayerVisible() {
- return this.layers.some((i) => i.visible);
- }
- };
- 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")], _);
- var L = _;
- export {
- L as default
- };
- //# sourceMappingURL=GroupLayer-VVRSBWUE.js.map
|