@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 2.29 kB
JavaScript
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import i from"../../core/Accessor.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../geometry/Extent.js";import p from"../../geometry/SpatialReference.js";import l from"../../layers/support/LayerTimeOptions.js";import{serializeLayerDefinitions as n,serializeTimeOptions as a}from"../../layers/support/layerUtils.js";let m=class extends i{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:r}=e;null==i&&null==r||(t=i===r?""+i:`${i??"null"},${r??"null"}`)}const i=this.layerOption,r=e?e.spatialReference.wkid||JSON.stringify(e.spatialReference.toJSON()):null,o=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:r,layers:i?i+":"+(this.layerIds??[]).join(","):null,layerDefs:n(this.layerDefinitions),layerTimeOptions:a(this.layerTimeOptions??[]),imageSR:o?o.wkid||JSON.stringify(o.toJSON()):r,time:t},p={};return Object.keys(s).filter((t=>null!==s[t])).forEach((t=>p[t]=s[t])),p}};t([r({type:s})],m.prototype,"extent",void 0),t([r()],m.prototype,"width",void 0),t([r()],m.prototype,"height",void 0),t([r()],m.prototype,"dpi",void 0),t([r()],m.prototype,"format",void 0),t([r({type:p})],m.prototype,"imageSpatialReference",void 0),t([r()],m.prototype,"layerDefinitions",void 0),t([r()],m.prototype,"layerOption",void 0),t([r()],m.prototype,"layerIds",void 0),t([r()],m.prototype,"transparent",void 0),t([r({type:e})],m.prototype,"timeExtent",void 0),t([r({type:[l]})],m.prototype,"layerTimeOptions",void 0),m=t([o("esri.rest.support.ImageParameters")],m);const y=m;export{y as default};