12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Evented.js";import{HandleOwnerMixin as s}from"../../core/HandleOwner.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import o from"../../core/Logger.js";import{unwrapOr as n}from"../../core/maybe.js";import{EsriPromiseMixin as l}from"../../core/Promise.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";let d=class extends(s(i(l(r.EventedMixin(t))))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch((e=>{if("layerview:create-error"!==e.name){const t=this.layer&&this.layer.id||"no id",r=this.layer&&this.layer.title||"no title";o.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${t}')`,e)}}))}get fullOpacity(){return n(this.get("layer.opacity"),1)*n(this.get("parent.fullOpacity"),1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this.updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){return!0===this.layer?.visible}set visible(e){this._overrideIfSome("visible",e)}canResume(){return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready||!1}getSuspendInfo(){const e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{},t=this;return t.view&&t.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};e([a()],d.prototype,"fullOpacity",null),e([a()],d.prototype,"layer",void 0),e([a()],d.prototype,"parent",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),e([a({readOnly:!0})],d.prototype,"suspendInfo",null),e([a({readOnly:!0})],d.prototype,"legendEnabled",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([a({readOnly:!0})],d.prototype,"updatingProgress",null),e([a()],d.prototype,"visible",null),e([a()],d.prototype,"view",void 0),d=e([p("esri.views.layers.LayerView")],d);const u=d;export{u as default};
|