// All material copyright ESRI, All Rights Reserved, unless otherwise specified.// See https://js.arcgis.com/4.6/esri/copyright.txt for details.//>>builtdefine("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators dojo/_base/lang dojo/_base/kernel ../request ../core/Error ../core/promiseUtils ../core/requireUtils ../core/urlUtils ../geometry/HeightModelInfo ./TiledLayer ./mixins/ArcGISMapService ./mixins/ArcGISCachedService ./mixins/OperationalLayer ./mixins/PortalLayer ./support/rasterFormats/LercCodec".split(" "),function(m,A,n,c,d,e,f,g,p,h,q,r,t,u,v,w,x,y,z){returnfunction(k){functionb(a){a=k.call(this)||this;a.heightModelInfo=null;a.type="elevation";a.url=null;a.opacity=1;a.operationalLayerType="ArcGISTiledElevationServiceLayer";returna}n(b,k);b.prototype.normalizeCtorArgs=function(a,b){return"string"===typeofa?e.mixin({},{url:a},b):a};Object.defineProperty(b.prototype,"minScale",{get:function(){},set:function(a){f.deprecated(this.declaredClass+".minScale support has been removed.","","4.5")},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"maxScale",{get:function(){},set:function(a){f.deprecated(this.declaredClass+".maxScale support has been removed.","","4.5")},enumerable:!0,configurable:!0});b.prototype.load=function(){vara=this;this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:function(a){for(varb=0;b<a.typeKeywords.length;b++)if("elevation 3d layer"===a.typeKeywords[b].toLowerCase())return!0;thrownewp("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}' ",{type:"Image Service",expectedType:"Image Service Elevation 3D Layer"});}}).always(function(){returna._fetchImageService()}));returnthis.when()};b.prototype.fetchTile=function(a,b,d,c){varl=this;void0===c&&(c=0);returnthis.load().then(function(){returnl._fetchTileAvailability(a,b,d)}).then(function(){varc=l.getTileUrl(a,b,d);returng(c,{responseType:"array-buffer",failOk:!0})}).then(function(a){a=z.decode(a.data,{noDataValue:c,returnFileInfo:!0});return{values:a.pixelData,width:a.width,height:a.height,maxZError:a.fileInfo.maxZError,noDataValue:a.noDataValue}})};b.prototype.queryElevation=function(a,b){varc=this;returnq.when(m,"./support/ElevationQuery").then(function(d){return(newd.ElevationQuery).query(c,a,b)})};b.prototype._fetchTileAvailability=function(a,b,c){returnthis.tilemapCache?this.tilemapCache.fetchAvailability(a,b,c):h.resolve("unknown")};b.prototype._fetchImageService=function(){vara=this;returnh.resolve().then(function(){if(a.resourceInfo)returna.resourceInfo;varb={query:e.mixin({f:"json"},a.parsedUrl.query),responseType:"json",callbackParamName:"callback"};returng(a.parsedUrl.path,b)}).then(function(b){b.ssl&&(a.url=a.url.replace(/^http:/i,"https:"));a.read(b.data,{origin:"service",url:a.parsedUrl})})};c([d.shared({"3d":"../views/3d/layers/ElevationLayerView3D"})],b.prototype,"viewModulePaths",void0);c([d.property({readOnly:!0,type:t})],b.prototype,"heightModelInfo",void0);c([d.property({json:{read:!1,write:!1}})],b.prototype,"minScale",null);c([d.property({json:{read:!1,write:!1}})],b.prototype,"maxScale",null);c([d.property()],b.prototype,"resourceInfo",void0);c([d.property({json:{read:!1},value:"elevation",readOnly:!0})],b.prototype,"type",void0);c([d.property({json:{origins:{"web-scene":{write:{isRequired:!0,writer:r.writeOperationalLayerUrl}}}}})],b.prototype,"url",void0);c([d.property({json:{read:!1,write:!1}})],b.prototype,"opacity",void0);c([d.property()],b.prototype,"operationalLayerType",void0);returnb=c([d.subclass("esri.layers.ElevationLayer")],b)}(d.declared(u,v,w,x,y))});