// 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 ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/support/ElevationTileData ../../../layers/support/LercDecoder ./LayerView3D ./TiledLayerView3D ../terrain/TerrainConst ../terrain/terrainUtils ../../layers/LayerView".split(" "),function(e,h,k,l,m,f,d,w,n,p,q,r,t,g,u,v){d= class extends t.TiledLayerView3D(r.LayerView3D(v)){constructor(){super(...arguments);this.type="elevation-3d"}get tileInfo(){return this.layer.tileInfo}initialize(){const a=this.view;var b=a.map?.allLayers;b=b&&b.includes(this.layer);var c=a.map?.ground?.layers;c=c&&c.includes(this.layer);b&&!c&&(b=new h("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`),this.addResolvingPromise(Promise.reject(b)));this._lercDecoder=q.acquireDecoder(a.resourceController); this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=l.releaseMaybe(this._lercDecoder)}async fetchTile(a,b){const c=this.layer;if(u.useFetchTileForLayer(c)){a=await c.fetchTile(a[0],a[1],a[2],{noDataValue:g.elevationNoDataValue,signal:b.signal});if(m.isAborted(b)){k.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.");return}return a}a=this.getTileUrl(a);a=await b.requester.request(a, "binary",b);if(b=await this._lercDecoder.decode(a,{noDataValue:g.elevationNoDataValue},b.signal))return new p.ElevationTileData(b);throw Error("LERC decoding failed");}};e.__decorate([f.property()],d.prototype,"layer",void 0);e.__decorate([f.property()],d.prototype,"tileInfo",null);return d=e.__decorate([n.subclass("esri.views.3d.layers.ElevationLayerView3D")],d)});