UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 2.18 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{property as o}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 i from"../../geometry/Point.js";import{combineTimeExtent as a}from"../../layers/support/timeSupport.js";import{load as p,getSourceScale as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import u from"../../rest/support/Query.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const m=m=>{let l=class extends m{constructor(){super(...arguments),this.view=null}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,o){const{layer:s}=this;if(!e)throw new t("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,p=c(s,o);if(!a||null==p)return[];const n=await p.getRequiredFields();r(o);const m=new u;m.timeExtent=this.timeExtent,m.geometry=e,m.outFields=n,m.outSpatialReference=e.spatialReference;const{resolution:l,spatialReference:y}=this.view,h="2d"===this.view.type?new i(l,l,y):new i(.5*l,.5*l,y),{returnTopmostRaster:f,showNoDataRecords:w}=p.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},d={returnDomainValues:!0,returnTopmostRaster:f,pixelSize:h,showNoDataRecords:w,signal:o?.signal};return s.queryVisibleRasters(m,d).then((e=>e))}async getSourceScale(){return await p(),await this.layer.load(),n(this.layer.serviceRasterInfo,this.view.spatialReference)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return e([o()],l.prototype,"layer",void 0),e([o()],l.prototype,"suspended",void 0),e([o({readOnly:!0})],l.prototype,"timeExtent",null),e([o()],l.prototype,"view",void 0),l=e([s("esri.views.layers.ImageryLayerView")],l),l};export{m as default};