You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
2.3 KiB
8 lines
2.3 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("exports ../chunks/tslib.es6 ../core/Collection ../core/collectionUtils ../core/Logger ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../layers/Layer".split(" "),function(k,l,m,n,g,p,q,u,v,r,t){function h(e,b,c){if(e)for(let a=0,f=e.length;a<f;a++){var d=e.at(a);if(d?.[b]===c||"group"===d?.type&&(d=h(d.layers,b,c)))return d}}k.LayersMixin=e=>{e=class extends e{constructor(...b){super(...b);this.layers= |
|
new m;const c=a=>{a.parent=this;this.layerAdded(a);"elevation"!==a.type&&"base-elevation"!==a.type||g.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as an operational layer and will therefore be ignored.`)},d=a=>{a.parent=null;this.layerRemoved(a)};this.addHandles([this.layers.on("before-add",a=>{a.item===this?(a.preventDefault(),g.getLogger(this).error("#add()","Cannot add layer to itself.")):(a=a.item,a.parent&&"remove"in a.parent&&a.parent.remove(a))}), |
|
this.layers.on("after-add",a=>c(a.item)),this.layers.on("after-remove",a=>d(a.item))])}destroy(){const b=this.layers.toArray();for(const c of b)c.destroy();this.layers.destroy()}set layers(b){this._set("layers",n.referenceSetter(b,this._get("layers")))}add(b,c){const d=this.layers;c=d.getNextIndex(c);b instanceof t?b.parent===this?this.reorder(b,c):d.add(b,c):p.isPromiseLike(b)?b.then(a=>{this.destroyed||this.add(a,c)}):g.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(b, |
|
c){const d=this.layers;let a=d.getNextIndex(c);b.slice().forEach(f=>{f.parent===this?this.reorder(f,a):(d.add(f,a),a+=1)})}findLayerById(b){return h(this.layers,"id",b)}findLayerByUid(b){return h(this.layers,"uid",b)}remove(b){return this.layers.remove(b)}removeMany(b){return this.layers.removeMany(b)}removeAll(){return this.layers.removeAll()}reorder(b,c){return this.layers.reorder(b,c)}layerAdded(b){}layerRemoved(b){}};l.__decorate([q.property()],e.prototype,"layers",null);return e=l.__decorate([r.subclass("esri.support.LayersMixin")], |
|
e)};Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}); |