UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.45 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 t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.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 o}from"../../core/accessorSupport/decorators/subclass.js";import r from"../../geometry/Extent.js";import s from"../../geometry/SpatialReference.js";import{srToRESTValue as p}from"../../geometry/support/spatialReferenceUtils.js";import l from"../../layers/support/LayerTimeOptions.js";import{serializeLayerDefinitions as n,serializeTimeOptions as a}from"../../layers/support/layerUtils.js";import m from"../../time/TimeExtent.js";let h=class extends e{constructor(t){super(t),this.extent=null,this.width=null,this.height=null,this.dpi=null,this.format=null,this.imageSpatialReference=null,this.layerDefinitions=[],this.layerOption=null,this.layerIds=null,this.transparent=!0,this.timeExtent=null,this.layerTimeOptions=null}toJSON(){let t,e=this.extent;if(e=e&&e.clone()._normalize(!0),this.timeExtent){const e=this.timeExtent.toJSON(),{start:i,end:o}=e;null==i&&null==o||(t=i===o?""+i:`${i??"null"},${o??"null"}`)}const i=this.layerOption,o=p(e?.spatialReference),r=this.imageSpatialReference,s={dpi:this.dpi,format:this.format,transparent:this.transparent,size:null!==this.width&&null!==this.height?this.width+","+this.height:null,bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:null,bboxSR:o,layers:i?i+":"+(this.layerIds??[]).join(","):null,layerDefs:n(this.layerDefinitions),layerTimeOptions:a(this.layerTimeOptions??[]),imageSR:r?p(r):o,time:t},l={};return Object.keys(s).filter((t=>null!=s[t])).forEach((t=>l[t]=s[t])),l}};t([i({type:r})],h.prototype,"extent",void 0),t([i()],h.prototype,"width",void 0),t([i()],h.prototype,"height",void 0),t([i()],h.prototype,"dpi",void 0),t([i()],h.prototype,"format",void 0),t([i({type:s})],h.prototype,"imageSpatialReference",void 0),t([i()],h.prototype,"layerDefinitions",void 0),t([i()],h.prototype,"layerOption",void 0),t([i()],h.prototype,"layerIds",void 0),t([i()],h.prototype,"transparent",void 0),t([i({type:m})],h.prototype,"timeExtent",void 0),t([i({type:[l]})],h.prototype,"layerTimeOptions",void 0),h=t([o("esri.rest.support.ImageParameters")],h);const y=h;export{y as default};