12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/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{unwrap as o,isNone as s,isSome as i}from"../../core/maybe.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as l}from"../../layers/support/commonProperties.js";import{getDefaultDatumTransformationForDataset as p,projectExtent as u}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const f=f=>{let m=class extends f{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return p(o(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(e){return!!this.projectFullExtent(e)}projectFullExtent(e){const t=o(this.layer.fullExtent),r=p(t,e,!1);return u(t,e,r)}async fetchPopupFeatures(e,o){const{layer:a}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=c(a,o);if(!n||s(l))throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:l});const p=[],{value:u,magdirValue:f}=await a.identify(e,{timeExtent:this.timeExtent});let m="";if(u&&u.length){m="imagery-tile"===a.type&&a.hasStandardTime()&&null!=u[0]?u.map((e=>a.getStandardTimeValue(e))).join(", "):u.join(", ");const e={ObjectId:0};e["Raster.ServicePixelValue"]=m;const r=a.rasterInfo.attributeTable;if(i(r)){const{fields:t,features:o}=r,s=t.find((({name:e})=>"value"===e.toLowerCase())),i=s?o.find((e=>String(e.attributes[s.name])===m)):null;if(i)for(const r in i.attributes)if(i.attributes.hasOwnProperty(r)){e[this._rasterFieldPrefix+r]=i.attributes[r]}}const o=a.rasterInfo.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(e["Raster.Magnitude"]=f?.[0],e["Raster.Direction"]=f?.[1]);const s=new t(this.fullExtent.clone(),null,e);s.layer=a,s.sourceLayer=s.layer,p.push(s)}return p}};return e([a()],m.prototype,"layer",void 0),e([a(l)],m.prototype,"timeExtent",void 0),e([a()],m.prototype,"view",void 0),e([a()],m.prototype,"fullExtent",null),e([a()],m.prototype,"tileInfo",void 0),e([a({readOnly:!0})],m.prototype,"hasTilingEffects",null),m=e([n("esri.views.layers.ImageryTileLayerView")],m),m};export{f as default};
|