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.
9 lines
3.1 KiB
9 lines
3.1 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("../../chunks/tslib.es6 ../../geometry ../../core/Collection ../../core/Evented ../../core/JSONSupport ../../core/Loadable ../../core/reactiveUtils ../../core/string ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ./kmlUtils ../../geometry/Extent".split(" "),function(d,c,m,p,q,r,e,t,f,u,x,y,v,w,k,n){var l;c=l=class extends p.EventedMixin(q.JSONSupportMixin(r)){constructor(...b){super(...b); |
|
this.layer=this.sourceJSON=this.title=this.sublayers=this.parent=this.networkLink=this.id=this.fullExtent=this.description=null;this.addHandles([e.on(()=>this.sublayers,"after-add",({item:a})=>{a.parent=this;a.layer=this.layer},e.sync),e.on(()=>this.sublayers,"after-remove",({item:a})=>{a.layer=a.parent=null},e.sync),e.watch(()=>this.sublayers,(a,g)=>{if(g)for(const h of g)h.layer=h.parent=null;if(a)for(const h of a)h.parent=this,h.layer=this.layer},e.sync),e.watch(()=>this.layer,a=>{if(this.sublayers)for(const g of this.sublayers)g.layer= |
|
a},e.sync)])}initialize(){e.whenOnce(()=>this.networkLink).then(()=>e.whenOnce(()=>!0===this.visible)).then(()=>this.load())}load(b){if(this.networkLink&&!this.networkLink.viewFormat)return b=null!=b?b.signal:null,b=this._fetchService(this._get("networkLink")?.href??"",b).then(a=>{const g=k.computeExtent(a.sublayers);this.fullExtent=n.fromJSON(g);this.sourceJSON=a;a=u.ensureType(m.ofType(l),k.sublayersFromJSON(l,a));this.sublayers?this.sublayers.addMany(a):this.sublayers=a;this.layer?.emit("sublayer-update"); |
|
this.layer&&this.layer.notifyChange("visibleSublayers")}),this.addResolvingPromise(b),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(b){this._get("visible")!==b&&(this._set("visible",b),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(b,a){return!!a.visibility}_fetchService(b,a){return k.fetchService(b,this.layer.outSpatialReference,this.layer.refreshInterval,a).then(g=>k.parseKML(g.data))}};d.__decorate([f.property()],c.prototype,"description",void 0); |
|
d.__decorate([f.property({type:n})],c.prototype,"fullExtent",void 0);d.__decorate([f.property()],c.prototype,"id",void 0);d.__decorate([f.property({readOnly:!0,value:null})],c.prototype,"networkLink",void 0);d.__decorate([f.property({json:{write:{allowNull:!0}}})],c.prototype,"parent",void 0);d.__decorate([f.property({type:m.ofType(c),json:{write:{allowNull:!0}}})],c.prototype,"sublayers",void 0);d.__decorate([f.property({value:null,json:{read:{source:"name",reader(b){return t.stripHTML(b)}}}})], |
|
c.prototype,"title",void 0);d.__decorate([f.property({value:!0})],c.prototype,"visible",null);d.__decorate([v.reader("visible",["visibility"])],c.prototype,"readVisible",null);d.__decorate([f.property()],c.prototype,"sourceJSON",void 0);d.__decorate([f.property()],c.prototype,"layer",void 0);return c=l=d.__decorate([w.subclass("esri.layers.support.KMLSublayer")],c)}); |