UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.01 kB
/* 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"../../core/Error.js";import{destroyMaybe as r}from"../../core/maybe.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{ExportWMSImageParameters as p}from"../../layers/support/ExportWMSImageParameters.js";import{combineTimeExtent as i}from"../../layers/support/timeSupport.js";const m=m=>{let n=class extends m{initialize(){this.exportImageParameters=new p({layer:this.layer})}destroy(){this.exportImageParameters=r(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return i(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,r){const{layer:s}=this;if(!e)throw new t("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s;if(!a)throw new t("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:a});const p=this.createFetchPopupFeaturesQuery(e);if(!p)return[];const{extent:i,width:m,height:n,x:c,y:u}=p;if(!(i&&m&&n))throw new t("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:i,width:m,height:n});const h=await s.fetchFeatureInfo(i,m,n,c,u);return o(r),h}};return e([s()],n.prototype,"exportImageParameters",void 0),e([s({readOnly:!0})],n.prototype,"exportImageVersion",null),e([s()],n.prototype,"layer",void 0),e([s({readOnly:!0})],n.prototype,"timeExtent",null),n=e([a("esri.views.layers.WMSLayerView")],n),n};export{m as default};