@gisatcz/deckgl-geolib 1.11.0-dev.6 → 1.11.0-dev.7

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
@@ -15550,16 +15550,15 @@ class CogBitmapLayer extends core.CompositeLayer {
15550
15550
  bitmapCogTiles: new CogTiles(this.props.cogBitmapOptions),
15551
15551
  initialized: false,
15552
15552
  });
15553
- yield this.init(this.rasterUrl);
15553
+ yield this.init();
15554
15554
  });
15555
15555
  }
15556
- init(rasterUrl) {
15556
+ init() {
15557
15557
  return __awaiter(this, void 0, void 0, function* () {
15558
15558
  const cog = yield this.state.bitmapCogTiles.initializeCog(this.props.rasterData);
15559
- // this.tileSize = this.terrainCogTiles.getTileSize(cog);
15560
15559
  const zoomRange = this.state.bitmapCogTiles.getZoomRange(cog);
15561
- [this.minZoom, this.maxZoom] = zoomRange;
15562
- this.setState({ initialized: true });
15560
+ const [minZoom, maxZoom] = zoomRange;
15561
+ this.setState({ initialized: true, minZoom, maxZoom });
15563
15562
  });
15564
15563
  }
15565
15564
  updateState({ props, oldProps }) {
@@ -15567,8 +15566,8 @@ class CogBitmapLayer extends core.CompositeLayer {
15567
15566
  if (rasterDataChanged) {
15568
15567
  const { rasterData } = props;
15569
15568
  const isTiled = rasterData
15570
- && (Array.isArray(rasterData)
15571
- || (rasterData.includes('{x}') && rasterData.includes('{y}'))) || this.props.isTiled;
15569
+ && ((Array.isArray(rasterData)
15570
+ || (rasterData.includes('{x}') && rasterData.includes('{y}'))) || this.props.isTiled);
15572
15571
  this.setState({ isTiled });
15573
15572
  }
15574
15573
  // Reloading for single terrain mesh
@@ -15585,26 +15584,10 @@ class CogBitmapLayer extends core.CompositeLayer {
15585
15584
  }
15586
15585
  getTiledBitmapData(tile) {
15587
15586
  return __awaiter(this, void 0, void 0, function* () {
15588
- // const {
15589
- // rasterData, fetch,
15590
- // } = this.props;
15591
- const { viewport } = this.context;
15592
- let bottomLeft = [0, 0];
15593
- let topRight = [0, 0];
15594
- if (viewport.isGeospatial) {
15595
- const bbox = tile.bbox;
15596
- bottomLeft = viewport.projectFlat([bbox.west, bbox.south]);
15597
- topRight = viewport.projectFlat([bbox.east, bbox.north]);
15598
- }
15599
- else {
15600
- const bbox = tile.bbox;
15601
- bottomLeft = [bbox.left, bbox.bottom];
15602
- topRight = [bbox.right, bbox.top];
15603
- }
15604
- [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]];
15605
15587
  // TODO - pass signal to getTile
15606
15588
  // abort request if signal is aborted
15607
- return yield this.state.bitmapCogTiles.getTile(tile.index.x, tile.index.y, tile.index.z);
15589
+ const tileData = yield this.state.bitmapCogTiles.getTile(tile.index.x, tile.index.y, tile.index.z);
15590
+ return tileData;
15608
15591
  });
15609
15592
  }
15610
15593
  renderSubLayers(props) {
@@ -15616,7 +15599,7 @@ class CogBitmapLayer extends core.CompositeLayer {
15616
15599
  return null;
15617
15600
  }
15618
15601
  const { bbox: { west, south, east, north, }, } = props.tile;
15619
- return new SubLayerClass(Object.assign(Object.assign({}, props), { tileSize: 256 }), Object.assign({ data: null, image: data, _instanced: false, bounds: [west, south, east, north], opacity, textureParameters: {
15602
+ return new SubLayerClass(Object.assign(Object.assign({}, props), { tileSize: this.state.bitmapCogTiles.tileSize }), Object.assign({ data: null, image: data, _instanced: false, bounds: [west, south, east, north], opacity, textureParameters: {
15620
15603
  minFilter: blurredTexture ? 'linear' : 'nearest',
15621
15604
  magFilter: blurredTexture ? 'linear' : 'nearest',
15622
15605
  },
@@ -15626,8 +15609,11 @@ class CogBitmapLayer extends core.CompositeLayer {
15626
15609
  : {})));
15627
15610
  }
15628
15611
  renderLayers() {
15629
- const { rasterData, blurredTexture, opacity, clampToTerrain, tileSize, maxRequests, onTileLoad, onTileUnload, onTileError, maxCacheSize, maxCacheByteSize, refinementStrategy, } = this.props;
15612
+ const { rasterData, blurredTexture, opacity, clampToTerrain,
15613
+ // tileSize,
15614
+ maxRequests, onTileLoad, onTileUnload, onTileError, maxCacheSize, maxCacheByteSize, refinementStrategy, cogBitmapOptions, } = this.props;
15630
15615
  if (this.state.isTiled && this.state.initialized) {
15616
+ const { tileSize } = this.state.bitmapCogTiles;
15631
15617
  return new geoLayers.TileLayer(this.getSubLayerProps({
15632
15618
  id: 'tiles',
15633
15619
  }), {
@@ -15638,14 +15624,15 @@ class CogBitmapLayer extends core.CompositeLayer {
15638
15624
  rasterData: urlTemplateToUpdateTrigger$1(rasterData),
15639
15625
  // blurredTexture,
15640
15626
  // opacity,
15627
+ cogBitmapOptions,
15641
15628
  clampToTerrain,
15642
15629
  },
15643
15630
  },
15644
15631
  extent: this.state.bitmapCogTiles.cog
15645
15632
  ? this.state.bitmapCogTiles.getBoundsAsLatLon(this.state.bitmapCogTiles.cog) : null,
15646
15633
  tileSize,
15647
- minZoom: this.minZoom,
15648
- maxZoom: this.maxZoom,
15634
+ minZoom: this.state.minZoom,
15635
+ maxZoom: this.state.maxZoom,
15649
15636
  maxRequests,
15650
15637
  onTileLoad,
15651
15638
  onTileUnload,