@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.31 kB
JavaScript
/*
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{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as r}from"../../core/accessorSupport/decorators/reader.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/SpatialReference.js";import i from"../support/TileInfo.js";import a from"../support/TileInfoTilemapCache.js";import{TilemapCache as s}from"../support/TilemapCache.js";const p=p=>{let n=class extends p{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(e,o){return null!=o.minLOD&&null!=o.maxLOD?e:0}readMaxScale(e,o){return null!=o.minLOD&&null!=o.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,o,r){const t=o.capabilities?.includes("Tilemap");let{minLOD:l,maxLOD:p,minScale:n,maxScale:c}=o;if(null==l&&null==p&&(0!==n||0!==c)){const e=e=>Math.round(1e4*e)/1e4;n=e(n||o.tileInfo.lods[0].scale),c=e(c||o.tileInfo.lods[o.tileInfo.lods.length-1].scale);for(const r of o.tileInfo.lods){const o=e(r.scale);l=o>=n?r.level:l,p=o>=c?r.level:p}}if(t)return new s({layer:this,minLOD:l,maxLOD:p});if(o.tileInfo){const e=new i;return e.read(o.tileInfo,r),new a(e,l,p)}return null}};return e([o({json:{read:{source:"copyrightText"}}})],n.prototype,"copyright",void 0),e([o()],n.prototype,"minScale",void 0),e([r("service","minScale")],n.prototype,"readMinScale",null),e([o()],n.prototype,"maxScale",void 0),e([r("service","maxScale")],n.prototype,"readMaxScale",null),e([o({type:l})],n.prototype,"spatialReference",void 0),e([o({readOnly:!0})],n.prototype,"supportsBlankTile",null),e([o({type:i})],n.prototype,"tileInfo",void 0),e([o()],n.prototype,"tilemapCache",void 0),e([r("service","tilemapCache",["capabilities","tileInfo"])],n.prototype,"readTilemapCache",null),e([o()],n.prototype,"version",void 0),n=e([t("esri.layers.mixins.ArcGISCachedService")],n),n};export{p as ArcGISCachedService};