UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.86 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Clonable.js";import o from"../../../core/Collection.js";import{on as t}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{isDisplayExternal as l,externalSourcesAreEqual as c,externalIsOnService as p}from"./External.js";let a=class extends r{constructor(e){super(e),this.externalSources=new o,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(t((()=>this.externalSources),"after-remove",(({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)}),{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!l(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every((r=>!c(r,e)))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter((r=>p(r,e)))}get _implicitDisplaySource(){return this.externalSources.find(l)}};e([s()],a.prototype,"externalSources",void 0),e([s()],a.prototype,"displaySource",null),e([s()],a.prototype,"_implicitDisplaySource",null),e([s()],a.prototype,"_explicitDisplaySource",void 0),e([s()],a.prototype,"georeferenced",void 0),a=e([i("esri.geometry.support.meshUtils.Metadata")],a);export{a as Metadata};