@gisatcz/deckgl-geolib 1.3.1-dev.0 → 1.3.1-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -109670,10 +109670,6 @@ class CogTiles {
109670
109670
  }
109671
109671
  }
109672
109672
 
109673
- let cogTiles;
109674
- let tileSize$1;
109675
- let minZoom$1;
109676
- let maxZoom$1;
109677
109673
  // let needsRerender: boolean = false;
109678
109674
  // let extent = [0, 0, 0, 0]
109679
109675
  class CogBitmapLayer extends core.CompositeLayer {
@@ -109686,7 +109682,7 @@ class CogBitmapLayer extends core.CompositeLayer {
109686
109682
  // initialized: false,
109687
109683
  // };
109688
109684
  // this._isLoaded = false;
109689
- cogTiles = new CogTiles(options);
109685
+ this.cogTiles = new CogTiles(options);
109690
109686
  this.url = url;
109691
109687
  // setTimeout(() => {
109692
109688
  // this.init(url);
@@ -109700,11 +109696,11 @@ class CogBitmapLayer extends core.CompositeLayer {
109700
109696
  }
109701
109697
  init(url) {
109702
109698
  return __awaiter(this, void 0, void 0, function* () {
109703
- const cog = yield cogTiles.initializeCog(url);
109699
+ const cog = yield this.cogTiles.initializeCog(url);
109704
109700
  this.setState({ initialized: true });
109705
- tileSize$1 = cogTiles.getTileSize(cog);
109706
- const zoomRange = cogTiles.getZoomRange(cog);
109707
- [minZoom$1, maxZoom$1] = zoomRange;
109701
+ this.tileSize = this.cogTiles.getTileSize(cog);
109702
+ const zoomRange = this.cogTiles.getZoomRange(cog);
109703
+ [this.minZoom, this.maxZoom] = zoomRange;
109708
109704
  // console.log(zoomRange)
109709
109705
  // extent = cogTiles.getBoundsAsLatLon(cog)
109710
109706
  // console.log(extent)
@@ -109712,15 +109708,15 @@ class CogBitmapLayer extends core.CompositeLayer {
109712
109708
  });
109713
109709
  }
109714
109710
  renderLayers() {
109715
- if (cogTiles.cog) {
109711
+ if (this.cogTiles.cog) {
109716
109712
  const layer = new geoLayers.TileLayer({
109717
109713
  id: `${this.id}-${String(performance.now())}`,
109718
- getTileData: (tileData) => cogTiles.getTile(tileData.index.x, tileData.index.y, tileData.index.z),
109719
- minZoom: minZoom$1,
109720
- maxZoom: maxZoom$1,
109721
- tileSize: tileSize$1,
109714
+ getTileData: (tileData) => this.cogTiles.getTile(tileData.index.x, tileData.index.y, tileData.index.z),
109715
+ minZoom: this.minZoom,
109716
+ maxZoom: this.maxZoom,
109717
+ tileSize: this.tileSize,
109722
109718
  maxRequests: 6,
109723
- extent: cogTiles.cog ? cogTiles.getBoundsAsLatLon(cogTiles.cog) : null,
109719
+ extent: this.cogTiles.cog ? this.cogTiles.getBoundsAsLatLon(this.cogTiles.cog) : null,
109724
109720
  renderSubLayers: (props) => {
109725
109721
  const { bbox: { west, south, east, north, }, } = props.tile;
109726
109722
  return new layers.BitmapLayer(props, {
@@ -109756,12 +109752,6 @@ function getTileUrl(service, x, y, z) {
109756
109752
  return url;
109757
109753
  }
109758
109754
 
109759
- let terrainCogTiles;
109760
- let bitmapCogTiles;
109761
- let tileSize;
109762
- let minZoom;
109763
- let maxZoom;
109764
- // let needsRerender: boolean = false;
109765
109755
  class CogTerrainLayer extends core.CompositeLayer {
109766
109756
  constructor(id, terrainUrl, terrainOptions, bitmapUrl, bitmapOptions) {
109767
109757
  super({});
@@ -109774,15 +109764,15 @@ class CogTerrainLayer extends core.CompositeLayer {
109774
109764
  this.urlType = 'tile';
109775
109765
  }
109776
109766
  else if (isCogUrl(bitmapUrl)) {
109777
- bitmapCogTiles = new CogTiles(bitmapOptions);
109778
- bitmapCogTiles.initializeCog(bitmapUrl);
109767
+ this.bitmapCogTiles = new CogTiles(bitmapOptions);
109768
+ this.bitmapCogTiles.initializeCog(bitmapUrl);
109779
109769
  this.urlType = 'cog';
109780
109770
  }
109781
109771
  else {
109782
109772
  console.warn('URL needs to point to a valid cog file, or needs to be in the {x}{y}{z} format.');
109783
109773
  }
109784
109774
  }
109785
- terrainCogTiles = new CogTiles(terrainOptions);
109775
+ this.terrainCogTiles = new CogTiles(terrainOptions);
109786
109776
  // this.init(terrainUrl);
109787
109777
  this.terrainUrl = terrainUrl;
109788
109778
  }
@@ -109796,15 +109786,15 @@ class CogTerrainLayer extends core.CompositeLayer {
109796
109786
  init(terrainUrl) {
109797
109787
  return __awaiter(this, void 0, void 0, function* () {
109798
109788
  // console.log("LAYER INITIALIZE STATE");
109799
- const cog = yield terrainCogTiles.initializeCog(terrainUrl);
109800
- tileSize = terrainCogTiles.getTileSize(cog);
109801
- const zoomRange = terrainCogTiles.getZoomRange(cog);
109802
- [minZoom, maxZoom] = zoomRange;
109789
+ const cog = yield this.terrainCogTiles.initializeCog(terrainUrl);
109790
+ this.tileSize = this.terrainCogTiles.getTileSize(cog);
109791
+ const zoomRange = this.terrainCogTiles.getZoomRange(cog);
109792
+ [this.minZoom, this.maxZoom] = zoomRange;
109803
109793
  this.setState({ initialized: true });
109804
109794
  });
109805
109795
  }
109806
109796
  renderLayers() {
109807
- if (terrainCogTiles.cog) {
109797
+ if (this.terrainCogTiles.cog) {
109808
109798
  // console.log("LAYER RENDER");
109809
109799
  let bitmapTile;
109810
109800
  // let zoomOffset = 0
@@ -109814,13 +109804,13 @@ class CogTerrainLayer extends core.CompositeLayer {
109814
109804
  const layer = new geoLayers.TileLayer({
109815
109805
  id: `${this.id}-${String(performance.now())}`,
109816
109806
  zoomOffset: -1,
109817
- getTileData: (tileData) => terrainCogTiles.getTile(tileData.index.x, tileData.index.y, tileData.index.z),
109818
- minZoom,
109819
- maxZoom,
109820
- tileSize,
109807
+ getTileData: (tileData) => this.terrainCogTiles.getTile(tileData.index.x, tileData.index.y, tileData.index.z),
109808
+ minZoom: this.minZoom,
109809
+ maxZoom: this.maxZoom,
109810
+ tileSize: this.tileSize,
109821
109811
  maxRequests: 6,
109822
109812
  refinementStrategy: 'best-available',
109823
- extent: terrainCogTiles.getBoundsAsLatLon(terrainCogTiles.cog),
109813
+ extent: this.terrainCogTiles.getBoundsAsLatLon(this.terrainCogTiles.cog),
109824
109814
  renderSubLayers: (props) => {
109825
109815
  if (props.data && (props.tile.index.x !== undefined)) {
109826
109816
  switch (this.urlType) {
@@ -109828,7 +109818,7 @@ class CogTerrainLayer extends core.CompositeLayer {
109828
109818
  bitmapTile = getTileUrl(this.bitmapUrl, props.tile.index.x, props.tile.index.y, props.tile.index.z);
109829
109819
  break;
109830
109820
  case 'cog':
109831
- bitmapTile = bitmapCogTiles.getTile(props.tile.index.x, props.tile.index.y, props.tile.index.z);
109821
+ bitmapTile = this.bitmapCogTiles.getTile(props.tile.index.x, props.tile.index.y, props.tile.index.z);
109832
109822
  break;
109833
109823
  default:
109834
109824
  bitmapTile = null;
@@ -109849,8 +109839,8 @@ class CogTerrainLayer extends core.CompositeLayer {
109849
109839
  props.tile.bbox.east,
109850
109840
  props.tile.bbox.north,
109851
109841
  ],
109852
- minZoom,
109853
- maxZoom,
109842
+ minZoom: this.minZoom,
109843
+ maxZoom: this.maxZoom,
109854
109844
  loadOptions: {
109855
109845
  terrain: {
109856
109846
  skirtHeight: 2000,