UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4.51 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{strict as t}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as s}from"../../core/accessorSupport/decorators/cast.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/Point.js";import d from"./DimensionalDefinition.js";import u from"./RasterFunction.js";var m;const h=t()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),w=t()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function M(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return w.fromJSON(t)}let y=m=class extends o{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method="none",this.multidimensionalDefinition=null,this.objectIds=null,this.operation="first",this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return M(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,o){null!=e&&(e=e.filter((({variableName:e,dimensionName:t})=>e&&"*"!==e||t))).length&&(t[o]=e.map((e=>e.toJSON())))}readOperation(e,t){const o=t.mosaicOperation,i=t.mosaicOperator?.toLowerCase(),r=o||(i?h.toJSON(i):null);return h.fromJSON(r)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new m({ascending:this.ascending,itemRasterFunction:i(this.itemRasterFunction),lockRasterIds:i(this.lockRasterIds),method:this.method,multidimensionalDefinition:i(this.multidimensionalDefinition),objectIds:i(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:i(this.viewpoint),where:this.where})}};e([r({type:Boolean,json:{write:!0}})],y.prototype,"ascending",void 0),e([n("ascending",["ascending","sortAscending"])],y.prototype,"readAscending",null),e([r({type:u,json:{name:"itemRenderingRule",write:!0}})],y.prototype,"itemRasterFunction",void 0),e([r({type:[l],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],y.prototype,"lockRasterIds",void 0),e([r({type:w.apiValues,json:{type:w.jsonValues,write:{target:"mosaicMethod",writer:w.write,isRequired:!0}}})],y.prototype,"method",void 0),e([n("method",["mosaicMethod","defaultMosaicMethod"])],y.prototype,"readMethod",null),e([r({type:[d],json:{write:!0}})],y.prototype,"multidimensionalDefinition",void 0),e([c("multidimensionalDefinition")],y.prototype,"writeMultidimensionalDefinition",null),e([r({type:[l],json:{name:"fids",write:!0}})],y.prototype,"objectIds",void 0),e([r({type:h.apiValues,json:{type:h.jsonValues,read:{reader:h.read},write:{target:"mosaicOperation",writer:h.write}}})],y.prototype,"operation",void 0),e([n("operation",["mosaicOperation","mosaicOperator"])],y.prototype,"readOperation",null),e([r({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],y.prototype,"sortField",void 0),e([r({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],y.prototype,"sortValue",void 0),e([s("sortValue")],y.prototype,"castSortValue",null),e([r({type:p,json:{write:!0}})],y.prototype,"viewpoint",void 0),e([r({type:String,json:{write:!0}})],y.prototype,"where",void 0),y=m=e([a("esri.layers.support.MosaicRule")],y);export{y as default};