{"version":3,"sources":["webpack:///./node_modules/arcgis-js-api/layers/support/ElevationTile.js","webpack:///./node_modules/arcgis-js-api/layers/support/ElevationQuery.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO,CAAC,kCAAS,CAAC,OAAS,CAAC,mCAAE,cAAc,aAAa,sCAAsC,SAAS,yBAAyB,iBAAiB,gBAAgB,kBAAkB,uBAAuB,kBAAkB,kLAAkL,2BAA2B,wCAAwC,2CAA2C,sLAAsL,+BAA+B,sBAAsB,6BAA6B,OAAO,uBAAuB,GAAG,GAAG,kBAAkB,qBAAqB,8BAA8B;AAAA,oGAAE,C;;;;;;;ACxBh3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO,CAAC,kCAAS,CAAC,OAAS,CAAC,2BAAO,CAAC,2BAAuB,CAAC,2BAAuB,CAAC,2BAAkB,CAAC,2BAAyB,CAAC,2BAAsB,CAAC,2BAA2B,CAAC,2BAAsB,CAAC,2BAAyB,CAAC,2BAAuC,CAAC,2BAAyC,CAAC,4BAAoB,CAAC,2BAAiB,CAAC,mCAAE,wCAAwC,aAAa,sCAAsC,SAAS,mEAAmE,iBAAiB,cAAc,4CAA4C,kDAAkD,cAAc,uCAAuC,gBAAgB,iEAAiE,iBAAiB,sGAAsG,yCAAyC,KAAK,yCAAyC,uKAAuK,2DAA2D,qFAAqF,GAAG,GAAG,mCAAmC,kDAAkD,MAAM,uCAAuC,gBAAgB,iHAAiH,qGAAqG,mTAAmT,oFAAoF,2DAA2D,4FAA4F,GAAG,GAAG,2CAA2C,kDAAkD,uCAAuC,6CAA6C,kFAAkF,gPAAgP,GAAG,GAAG,8CAA8C,kDAAkD,QAA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AuB,GAAG,4CAA4C,wCAAwC,WAAW,KAAK,WAAW,kEAAkE,gDAAgD,wCAAwC,WAAW,KAAK,WAAW,0DAA0D,oCAAoC,wCAAwC,WAAW,KAAK,WAAW,qBAAqB,wCAAwC,YAAY,sCAAsC,WAAW,KAAK,oBAAoB,yDAAyD,SAAS,4CAA4C,sBAAsB,+CAA+C,mBAAmB,GAAG,iCAAiC,WAAW,KAAK,SAAS,GAAG,kBAAkB,oBAAoB,6BAA6B,mJAAmJ,mEAAmE,qDAAqD,+EAA+E,gDAAgD,0BAA0B,6BAA6B,wCAAwC,KAAK,KAAK,kEAAkE,0DAA0D,SAAS,iDAAiD,+DAA+D,4CAA4C,4DAA4D,gDAAgD,kCAAkC,WAAW,KAAK,qBAAqB,gEAAgE,oCAAoC,yFAAyF,eAAe,IAAI,wCAAwC,2BAA2B,8CAA8C,iCAAiC,8CAA8C,sCAAsC,KAAK,SAAS,gBAAgB,YAAY,uCAAuC,8EAA8E,sDAAsD,YAAY,cAAc,WAAW,KAAK,WAAW,sCAAsC,4BAA4B,uBAAuB,GAAG,+BAA+B,YAAY,IAAI,0DAA0D,SAAS,GAAG,+DAA+D,6BAA6B,wNAAwN,IAAI,gBAAgB,IAAI,KAAK,OAAO,+CAA+C,wEAAwE,uCAAuC,6DAA6D,8BAA8B,GAAG,GAAG,IAAI,gBAAgB,sBAAsB,QAAQ,sCAAsC,sBAAsB,GAAG,uBAAuB,SAAS,kCAAkC;AAAA,oGAAE,C","file":"js/chunk-75e690aa.d5e26fc3.js","sourcesContent":["// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\"],(function(t,e){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ElevationTile=void 0;var a=function(){function t(t,e){if(this.tile=t,e){var a=this.tile.extent;this.samplerData={pixelData:e.values,width:e.width,height:e.height,safeWidth:.99999999*(e.width-1),noDataValue:e.noDataValue,dx:(e.width-1)/(a[2]-a[0]),dy:(e.width-1)/(a[3]-a[1]),x0:a[0],y1:a[3]}}else this.samplerData=null}return t.prototype.sample=function(t,e){if(this.samplerData)return function(t,e,a){var r=t.safeWidth,n=t.width,l=t.pixelData,o=t.noDataValue,u=i(t.dy*(t.y1-a),0,r),h=i(t.dx*(e-t.x0),0,r),s=Math.floor(u),d=Math.floor(h),f=s*n+d,p=f+n,v=l[f],D=l[p],c=l[f+1],x=l[p+1];if(v!==o&&D!==o&&c!==o&&x!==o){var w=h-d,y=v+(c-v)*w;return y+(D+(x-D)*w-y)*(u-s)}return}(this.samplerData,t,e)},t}();function i(t,e,a){return ta?a:t}e.ElevationTile=a,e.default=a}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../core/arrayUtils\",\"../../core/asyncUtils\",\"../../core/Error\",\"../../core/promiseUtils\",\"../../core/unitUtils\",\"../../geometry/Multipoint\",\"../../geometry/Point\",\"../../geometry/Polyline\",\"../../geometry/support/aaBoundingRect\",\"../../geometry/support/webMercatorUtils\",\"./ElevationSampler\",\"./ElevationTile\"],(function(e,t,n,i,r,o,a,l,s,u,c,p,f,h,d){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getFinestLodIndex=t.GeometryDescriptor=t.ElevationQuery=void 0;var v=function(){function e(){}return e.prototype.queryAll=function(e,t,i){return n.__awaiter(this,void 0,void 0,(function(){var r,l,s,u,c;return n.__generator(this,(function(p){switch(p.label){case 0:return(e=i&&i.ignoreInvisibleLayers?e.filter((function(e){return e.visible})):e.slice()).length?(r=m.fromGeometry(t),l=!1,i&&i.returnSampleInfo||(l=!0),s=n.__assign(n.__assign({noDataValue:0,maximumAutoTileRequests:20},i),{returnSampleInfo:!0,demResolution:\"auto\"}),[4,this.query(e[e.length-1],r,s)]):[2,a.reject(new o(\"elevation-query:invalid-layer\",\"Elevation queries require at least one elevation layer to fetch tiles from\"))];case 1:return u=p.sent(),[4,this._queryAllContinue(e,u,s)];case 2:return(c=p.sent()).geometry=c.geometry.export(),l&&delete c.sampleInfo,[2,c]}}))}))},e.prototype.query=function(e,t,i){return n.__awaiter(this,void 0,void 0,(function(){var r;return n.__generator(this,(function(l){switch(l.label){case 0:return e?t&&(t instanceof m||\"point\"===t.type||\"multipoint\"===t.type||\"polyline\"===t.type)?(i=n.__assign({noDataValue:0,demResolution:\"auto\",minDemResolution:0,maximumAutoTileRequests:20,returnSampleInfo:!1},i),r=new _(e,t.spatialReference,i),[4,e.load(i)]):[2,a.reject(new o(\"elevation-query:invalid-geometry\",\"Only point, polyline and multipoint geometries can be used to query elevation\"))]:[2,a.reject(new o(\"elevation-query:invalid-layer\",\"Elevation queries require an elevation layer to fetch tiles from\"))];case 1:return l.sent(),this._createGeometryDescriptor(r,t),[4,this._selectTiles(r)];case 2:return l.sent(),[4,this._populateElevationTiles(r)];case 3:return l.sent(),this._sampleGeometryWithElevation(r),[2,this._createQueryResult(r)]}}))}))},e.prototype.createSampler=function(e,t,i){return n.__awaiter(this,void 0,void 0,(function(){return n.__generator(this,(function(r){return e?t&&\"extent\"===t.type?(i=n.__assign({noDataValue:0,demResolution:\"auto\",maximumAutoTileRequests:20,returnSampleInfo:!1},i),[2,this._createSampler(e,t,i)]):[2,a.reject(new o(\"elevation-query:invalid-extent\",\"Invalid or undefined extent\"))]:[2,a.reject(new o(\"elevation-query:invalid-layer\",\"Elevation queries require an elevation layer to fetch tiles from\"))]}))}))},e.prototype.createSamplerAll=function(e,t,i){return n.__awaiter(this,void 0,void 0,(function(){var r,l;return n.__generator(this,(function(s){switch(s.label){case 0:return(e=i&&i.ignoreInvisibleLayers?e.filter((function(e){return e.visible})):e.slice()).length?t&&\"extent\"===t.type?(r=n.__assign(n.__assign({noDataValue:0,maximumAutoTileRequests:20},i),{returnSampleInfo:!0,demResolution:\"auto\"}),[4,this._createSampler(e[e.length-1],t,r)]):[2,a.reject(new o(\"elevation-query:invalid-extent\",\"Invalid or undefined extent\"))]:[2,a.reject(new o(\"elevation-query:invalid-layer\",\"Elevation queries require at least one elevation layer to fetch tiles from\"))];case 1:return l=s.sent(),[2,this._createSamplerAllContinue(e,t,l,r)]}}))}))},e.prototype._createSampler=function(e,t,i,r){return n.__awaiter(this,void 0,void 0,(function(){var l,s,u;return n.__generator(this,(function(n){switch(n.label){case 0:return[4,e.load()];case 1:if(n.sent(),l=t.spatialReference,s=e.tileInfo.spatialReference,!l.equals(s)){if(!f.canProject(l,s))return[2,a.reject(new o(\"elevation-query:invalid-extent\",\"Extent spatial reference (\"+l.wkid+\") must be compatible with tile spatial reference (\"+s.wkid+\")\"))];t=f.project(t,s)}return u=new T(e,t,i,r),[4,this._selectTiles(u)];case 2:return n.sent(),[4,this._populateElevationTiles(u)];case 3:return n.sent(),[2,new h.MultiTileElevationSampler(u.elevationTiles,u.layer.tileInfo,u.options.noDataValue)]}}))}))},e.prototype._createSamplerAllContinue=function(e,t,i,r){return n.__awaiter(this,void 0,void 0,(function(){var o,a,l,s;return n.__generator(this,(function(n){switch(n.label){case 0:return e.pop(),e.length?(o=i.samplers.map((function(e){return p.fromExtent(e.extent)})),[4,this._createSampler(e[e.length-1],t,r,o)]):[2,i];case 1:return 0===(a=n.sent()).samplers.length?[2,i]:(l=i.samplers.concat(a.samplers),s=new h.MultiTileElevationSampler(l,r.noDataValue),[2,this._createSamplerAllContinue(e,t,s,r)])}}))}))},e.prototype._queryAllContinue=function(e,t,i){return n.__awaiter(this,void 0,void 0,(function(){var r,o,a,l,s,u,c;return n.__generator(this,(function(n){switch(n.label){case 0:if(r=e.pop(),t.geometry.coordinates.forEach((function(e,n){t.sampleInfo[n].demResolution>=0&&!t.sampleInfo[n].source&&(t.sampleInfo[n].source=r)})),!e.length)return[2,t];for(o=t.geometry.coordinates,a=[],l=[],s=0;sn.xmax||rn.ymax)&&(e.elevationTile=t)}))},e.prototype._selectTilesClosestResolution=function(e){var t=e.layer.tileInfo,n=this._findNearestDemResolutionLODIndex(t,e.options.demResolution);e.selectTilesAtLOD(n)},e.prototype._findNearestDemResolutionLODIndex=function(e,t){for(var n=t/l.getMetersPerUnitForSR(e.spatialReference),i=e.lods[0],r=0,o=1;o=0;i--){var r=t.lods[i],o=r.resolution*t.size[0],a=r.resolution*t.size[1];if(Math.ceil(n.width/o)*Math.ceil(n.height/a)<=e)return i}return-1},t.prototype.allElevationTilesFetched=function(){return this.candidateTiles.length===this.elevationTiles.length},t.prototype.clearElevationTiles=function(){this.elevationTiles.length=0,this.fetchedCandidates.clear()},t.prototype.populateElevationTiles=function(e){for(var t=0,n=this.candidateTiles;t0){var r=i.findIndex(e.lods,(function(e){return e.resolution0&&(n=r-1)}return n}t.getFinestLodIndex=g,t.default=v}));"],"sourceRoot":""}