@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 3.5 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{commonRasterFieldNames as a,addMultidimensionalFieldValues as n,rasterFieldPrefix as o}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{getDefaultDatumTransformationForDataset as u,projectDatasetExtent as c,getSourceScale as p}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as m}from"./support/popupUtils.js";const y=y=>{let f=class extends y{constructor(){super(...arguments),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?u(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:l}=s,u=m(s,i);if(!l||null==u)return[];const c=[],{value:p,magdirValue:y,processedValue:f}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let d="";if(p?.length){d="imagery-tile"===s.type&&s.hasStandardTime()&&null!=p[0]?p.map((e=>s.getStandardTimeValue(e))).join(", "):p.join(", ");const e={ObjectId:0};e[a.servicePixelValue]="imagery-tile"===s.type&&"Function"===s.raster.datasetFormat?f?.join(", "):d,e[a.rawServicePixelValue]=d;const r=s.raster?.rasterInfo??s.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:t,features:r}=i,s=t.find((({name:e})=>"value"===e.toLowerCase())),n=e[a.servicePixelValue],l=s?r.find((e=>String(e.attributes[s.name])===n)):null;if(l)for(const i in l.attributes)if(l.attributes.hasOwnProperty(i)){e[o+i]=l.attributes[i]}}const l=r?.dataType;if("vector-magdir"!==l&&"vector-uv"!==l||(e[a.magnitude]=y?.[0],e[a.direction]=y?.[1]),"imagery-tile"===s.type){const{multidimensionalDefinition:t}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});n(s.rasterFields,e,t)}const u=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:s,sourceLayer:s});c.push(u)}return c}async getSourceScale(){return await this.layer.load(),p(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],f.prototype,"fullExtent",null),e([i()],f.prototype,"layer",void 0),e([i({readOnly:!0})],f.prototype,"timeExtent",null),e([i()],f.prototype,"tileInfo",void 0),e([i({readOnly:!0})],f.prototype,"hasTilingEffects",null),e([i()],f.prototype,"datumTransformation",null),f=e([s("esri.views.layers.ImageryTileLayerView")],f),f};export{y as default};