UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.19 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import r from"../../geometry/Extent.js";import s from"../../geometry/SpatialReference.js";import{srToRESTValue as l}from"../../geometry/support/spatialReferenceUtils.js";import p from"../../layers/support/LayerTimeOptions.js";import{serializeTimeOptions as n,serializeLayerDefinitions as a}from"../../layers/support/layerUtils.js";import m from"../../time/TimeExtent.js";let y=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=l(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:a(this.layerDefinitions),layerTimeOptions:n(this.layerTimeOptions??[]),imageSR:r?l(r):o,time:t},p={};return Object.keys(s).filter(t=>null!=s[t]).forEach(t=>p[t]=s[t]),p}};t([i({type:r})],y.prototype,"extent",void 0),t([i()],y.prototype,"width",void 0),t([i()],y.prototype,"height",void 0),t([i()],y.prototype,"dpi",void 0),t([i()],y.prototype,"format",void 0),t([i({type:s})],y.prototype,"imageSpatialReference",void 0),t([i()],y.prototype,"layerDefinitions",void 0),t([i()],y.prototype,"layerOption",void 0),t([i()],y.prototype,"layerIds",void 0),t([i()],y.prototype,"transparent",void 0),t([i({type:m})],y.prototype,"timeExtent",void 0),t([i({type:[p]})],y.prototype,"layerTimeOptions",void 0),y=t([o("esri.rest.support.ImageParameters")],y);const h=y;export{h as default};