You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
3.5 KiB
10 lines
3.5 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/aaBoundingRect ../../../layers/support/layerUtils ../../ViewingMode ../support/supportedSpatialReference ./terrainUtils ./TilingScheme".split(" "),function(b,e,n,t,k,f,u,v,p,q,r,l,m,h,g){b.TilingSchemeLogic=class extends n{constructor(a){super(a)}initialize(){this.addHandles([this.layers.on("change", |
|
()=>this._update()),k.watch(()=>this.extentHelper.layerViewsExtent,()=>this._setAdHocTilingScheme())]);this._update();this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._waitTask=null;this.layers.destroy()}_update(){this._waitTask=null;if(!this.tilingSchemeLocked){var a;this.layers.some(c=>!r.isTiledLayer(c)||c.isRejected()?!1:c.isFulfilled()&&null==h.getTiledLayerInfo(c,this.viewSpatialReference,this.viewingMode)?!1:(a=c,"vector-tile"!==c?.type&&!h.isProjectableRasterLayer(c))); |
|
if(a)if(a.isResolved()){var d=h.getTiledLayerInfo(a,this.viewSpatialReference,this.viewingMode);null!=d&&(d=new g.TilingScheme(d.tileInfo),this._lockTilingScheme(d))}else this._updateWhen(a)}}_updateWhen(a){const d=a.when().catch(()=>{}).then(()=>{d!==this._waitTask||this.destroyed||this._update()});this._waitTask=d}_lockTilingScheme(a){if(this.viewingMode===l.ViewingMode.Global){const d=a.levels.length-1,c=a.spatialReference;c.isWebMercator?a=g.TilingScheme.makeWebMercatorAuxiliarySphere(d):m.isSupportedEarthGCS(c)&& |
|
(a=g.TilingScheme.makeGCSWithTileSize(a.spatialReference,a.pixelSize,d))}this.tilingSchemeLocked=!0;this.tilingScheme=a;this.extentHelper.tilingScheme=this.tilingScheme;this._updateTiledLayerExtent();this.removeAllHandles();this.addHandles(k.watch(()=>this.extentHelper.tiledLayersExtent,()=>this._updateTiledLayerExtent()))}_updateTiledLayerExtent(){this._set("extent",this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===l.ViewingMode.Global){var a=this.extentHelper.viewSpatialReference; |
|
a.isWebMercator?this.tilingScheme=g.TilingScheme.WebMercatorAuxiliarySphere:m.isSupportedGCSOnGlobe(a)&&(this.tilingScheme=g.TilingScheme.makeGCSWithTileSize(a,256));this._set("extent",this.extentHelper.layerViewsExtent)}else a=this.extentHelper.layerViewsExtent,null==a||q.equals(a,this.extent)||(this.tilingScheme=g.TilingScheme.fromExtent(a,this.extentHelper.viewSpatialReference),this._set("extent",a))}get test(){}};e.__decorate([f.property()],b.TilingSchemeLogic.prototype,"tilingScheme",void 0); |
|
e.__decorate([f.property({readOnly:!0})],b.TilingSchemeLogic.prototype,"extent",void 0);e.__decorate([f.property({value:!1})],b.TilingSchemeLogic.prototype,"tilingSchemeLocked",void 0);e.__decorate([f.property({constructOnly:!0})],b.TilingSchemeLogic.prototype,"viewSpatialReference",void 0);e.__decorate([f.property({constructOnly:!0})],b.TilingSchemeLogic.prototype,"layers",void 0);e.__decorate([f.property({constructOnly:!0})],b.TilingSchemeLogic.prototype,"extentHelper",void 0);e.__decorate([f.property({constructOnly:!0})], |
|
b.TilingSchemeLogic.prototype,"viewingMode",void 0);b.TilingSchemeLogic=e.__decorate([p.subclass("esri.views.3d.terrain.TilingSchemeLogic")],b.TilingSchemeLogic);Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); |