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.
12 lines
4.6 KiB
12 lines
4.6 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/CollectionFlattener ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/reactiveUtils ../core/urlUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer ../geometry/SpatialReference ./Layer ./mixins/BlendLayer ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./support/commonProperties ./support/KMLSublayer ./support/kmlUtils ../geometry/Extent".split(" "), |
|
function(d,c,p,q,r,t,k,u,g,G,H,I,l,v,w,m,x,y,z,A,B,C,D,n,h,E){const F=["kml","xml"];c=class extends y.BlendLayer(B.RefreshableLayer(C.ScaleRangeLayer(z.OperationalLayer(A.PortalLayer(r.MultiOriginJSONMixin(x)))))){constructor(...a){super(...a);this._visibleFolders=[];this.allSublayers=new q({getCollections:()=>[this.sublayers],getChildrenFunction(b){return b.sublayers}});this.outSpatialReference=m.WGS84;this.path=null;this.legendEnabled=!1;this.operationalLayerType="KML";this.sublayers=null;this.type= |
|
"kml";this.url=null}initialize(){this.addHandles([k.watch(()=>this.sublayers,(a,b)=>{b&&b.forEach(e=>{e.parent=null;e.layer=null});a&&a.forEach(e=>{e.parent=this;e.layer=this})},k.sync),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(a,b){return"string"===typeof a?{url:a,...b}:a}readSublayersFromItemOrWebMap(a,b){this._visibleFolders=b.visibleFolders}readSublayers(a,b,e){return h.sublayersFromJSON(n,b,e,this._visibleFolders)}writeSublayers(a,b){const e=[];for(a= |
|
a.toArray();a.length;){const f=a[0];f.networkLink||(f.visible&&e.push(f.id),f.sublayers&&a.push(...f.sublayers.toArray()));a.shift()}b.visibleFolders=e}get title(){const a=this._get("title");return a&&"defaults"!==this.originOf("title")?a:this.url?u.getFilename(this.url,F)||"KML":a}set title(a){this._set("title",a)}get visibleSublayers(){const a=this.sublayers,b=[],e=f=>{f.visible&&(b.push(f),f.sublayers&&f.sublayers.forEach(e))};a&&a.forEach(e);return b}get fullExtent(){return this._recomputeFullExtent()}load(a){const b= |
|
null!=a?a.signal:null;this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},a).catch(t.throwIfAbortError).then(()=>this._fetchService(b)));return Promise.resolve(this)}destroy(){super.destroy();this.allSublayers.destroy()}async _fetchService(a){var b=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:h.fetchService(this.url??"",this.outSpatialReference,this.refreshInterval,a));(b=h.parseKML(b.data))&&this.read(b,{origin:"service"})}_recomputeFullExtent(){let a= |
|
null;null!=this.extent&&(a=this.extent.clone());const b=e=>{if(e.sublayers)for(const f of e.sublayers.items)b(f),f.visible&&f.fullExtent&&(null!=a?a.union(f.fullExtent):a=f.fullExtent.clone())};b(this);return a}};d.__decorate([g.property({readOnly:!0})],c.prototype,"allSublayers",void 0);d.__decorate([g.property({type:m})],c.prototype,"outSpatialReference",void 0);d.__decorate([g.property({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],c.prototype,"path",void 0);d.__decorate([g.property({readOnly:!0, |
|
json:{read:!1,write:!1}})],c.prototype,"legendEnabled",void 0);d.__decorate([g.property({type:["show","hide","hide-children"]})],c.prototype,"listMode",void 0);d.__decorate([g.property({type:["KML"]})],c.prototype,"operationalLayerType",void 0);d.__decorate([g.property({})],c.prototype,"resourceInfo",void 0);d.__decorate([g.property({type:p.ofType(n),json:{write:{ignoreOrigin:!0}}})],c.prototype,"sublayers",void 0);d.__decorate([l.reader(["web-map","portal-item"],"sublayers",["visibleFolders"])], |
|
c.prototype,"readSublayersFromItemOrWebMap",null);d.__decorate([l.reader("service","sublayers",["sublayers"])],c.prototype,"readSublayers",null);d.__decorate([w.writer("sublayers")],c.prototype,"writeSublayers",null);d.__decorate([g.property({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0);d.__decorate([g.property({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],c.prototype,"title",null);d.__decorate([g.property(D.url)],c.prototype,"url",void 0);d.__decorate([g.property({readOnly:!0})], |
|
c.prototype,"visibleSublayers",null);d.__decorate([g.property({type:E})],c.prototype,"extent",void 0);d.__decorate([g.property()],c.prototype,"fullExtent",null);return c=d.__decorate([v.subclass("esri.layers.KMLLayer")],c)}); |