UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.68 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"./chunks/tslib.es6.js";import s from"./Basemap.js";import r from"./Ground.js";import o from"./core/Accessor.js";import t from"./core/CollectionFlattener.js";import a from"./core/Evented.js";import{destroyMaybe as i}from"./core/maybe.js";import{property as p}from"./core/accessorSupport/decorators/property.js";import{cast as l}from"./core/accessorSupport/decorators/cast.js";import"./core/has.js";import"./core/RandomLCG.js";import{subclass as n}from"./core/accessorSupport/decorators/subclass.js";import d from"./effects/FocusAreas.js";import{isEditableLayer as m}from"./layers/support/editableLayers.js";import{createCache as c,destroyCache as u,basemapEnsureType as y}from"./support/basemapEnsureType.js";import{createFlattenedTablesCollection as h}from"./support/collectionUtils.js";import{ensureType as b}from"./support/groundUtils.js";import{LayersMixin as f}from"./support/LayersMixin.js";import{TablesMixin as j}from"./support/TablesMixin.js";let g=class extends(j(f(a.EventedMixin(o)))){constructor(e){super(e),this.allLayers=new t({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.focusAreas=new d,this.allTables=h(this),this.basemap=null,this.editableLayers=new t({getCollections:()=>[this.allLayers],itemFilterFunction:m}),this.ground=new r,this._basemapCache=c()}destroy(){u(this._basemapCache),this._basemapCache=null,this.focusAreas.destroy(),this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=i(this.basemap),i(this.ground),this._set("ground",null)}castBasemap(e){return y(e,this._basemapCache)}castGround(e){const s=b(e);return s??this._get("ground")}findLayerById(e){return this.allLayers.find((s=>s.id===e))}findTableById(e){return this.allTables.find((s=>s.id===e))}};e([p({readOnly:!0,dependsOn:[]})],g.prototype,"allLayers",void 0),e([p({type:d,nonNullable:!0,json:{write:{overridePolicy:e=>({enabled:e.areas.length>0,ignoreOrigin:!0})}}})],g.prototype,"focusAreas",void 0),e([p({readOnly:!0})],g.prototype,"allTables",void 0),e([p({type:s,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],g.prototype,"basemap",void 0),e([l("basemap")],g.prototype,"castBasemap",null),e([p({readOnly:!0})],g.prototype,"editableLayers",void 0),e([p({type:r,nonNullable:!0})],g.prototype,"ground",void 0),e([l("ground")],g.prototype,"castGround",null),e([p()],g.prototype,"undoRedo",void 0),g=e([n("esri.Map")],g);const L=g;export{L as default};