@gisatcz/deckgl-geolib 2.5.0-dev.3 → 2.5.0-dev.4
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 +204 -148
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +2 -2
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +204 -149
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +2 -2
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/types/core/CogTiles.d.ts +2 -2
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/utils/suppressAbortErrors.d.ts +23 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -9,6 +9,45 @@ var schema = require('@loaders.gl/schema');
|
|
|
9
9
|
var loaderUtils = require('@loaders.gl/loader-utils');
|
|
10
10
|
var meshLayers = require('@deck.gl/mesh-layers');
|
|
11
11
|
|
|
12
|
+
let isListenerAttached = false;
|
|
13
|
+
/**
|
|
14
|
+
* Suppresses unhandled AbortErrors from deck.gl tile cancellation.
|
|
15
|
+
*
|
|
16
|
+
* NOTE: The library's main entry point installs this handler automatically
|
|
17
|
+
* when the package is imported via its primary build (for example
|
|
18
|
+
* `import '@gisatcz/deckgl-geolib'`). This default prevents console spam during
|
|
19
|
+
* normal tile cancellation (pan/zoom) for the vast majority of consumers.
|
|
20
|
+
*
|
|
21
|
+
* If you need to control installation manually (for example when importing
|
|
22
|
+
* internals or for custom lifecycle control), import and call the exported
|
|
23
|
+
* function yourself:
|
|
24
|
+
*
|
|
25
|
+
* import { suppressGlobalAbortErrors } from '@gisatcz/deckgl-geolib';
|
|
26
|
+
* suppressGlobalAbortErrors();
|
|
27
|
+
*
|
|
28
|
+
* Warning: This suppresses ALL unhandled AbortErrors (including from your own
|
|
29
|
+
* code). If you need finer control, implement a custom `unhandledrejection`
|
|
30
|
+
* handler instead.
|
|
31
|
+
*
|
|
32
|
+
* The listener is attached only once and only in browser environments,
|
|
33
|
+
* making this function idempotent and safe to call multiple times.
|
|
34
|
+
*/
|
|
35
|
+
function suppressGlobalAbortErrors() {
|
|
36
|
+
// Ensure we are in a browser environment and haven't already attached the listener
|
|
37
|
+
if (typeof window !== 'undefined' && !isListenerAttached) {
|
|
38
|
+
window.addEventListener('unhandledrejection', (event) => {
|
|
39
|
+
// Suppress standard AbortErrors from tile cancellation and fetch aborts.
|
|
40
|
+
// These are expected during viewport changes and represent normal control flow,
|
|
41
|
+
// not application errors.
|
|
42
|
+
if (event.reason && event.reason.name === 'AbortError') {
|
|
43
|
+
// Prevent the browser from logging it to the console
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
isListenerAttached = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
12
51
|
/* eslint-disable no-restricted-globals, no-restricted-syntax */
|
|
13
52
|
/* global SharedArrayBuffer */
|
|
14
53
|
|
|
@@ -2959,7 +2998,7 @@ class CustomAggregateError extends Error {
|
|
|
2959
2998
|
this.name = 'AggregateError';
|
|
2960
2999
|
}
|
|
2961
3000
|
}
|
|
2962
|
-
const AggregateError = CustomAggregateError;
|
|
3001
|
+
const AggregateError$1 = CustomAggregateError;
|
|
2963
3002
|
|
|
2964
3003
|
class Block {
|
|
2965
3004
|
/**
|
|
@@ -3090,7 +3129,7 @@ class BlockedSource extends BaseSource {
|
|
|
3090
3129
|
const blocks = allBlockIds.map((id) => this.blockCache.get(id) || this.evictedBlocks.get(id));
|
|
3091
3130
|
const failedBlocks = blocks.filter((i) => !i);
|
|
3092
3131
|
if (failedBlocks.length) {
|
|
3093
|
-
throw new AggregateError(failedBlocks, 'Request failed');
|
|
3132
|
+
throw new AggregateError$1(failedBlocks, 'Request failed');
|
|
3094
3133
|
}
|
|
3095
3134
|
// create a final Map, with all required blocks for this request to satisfy
|
|
3096
3135
|
const requiredBlocks = new Map(zip(allBlockIds, blocks));
|
|
@@ -5549,14 +5588,14 @@ function addSkirt(attributes, triangles, skirtHeight, outsideIndices) {
|
|
|
5549
5588
|
* @returns {number[][]} - outside edges data
|
|
5550
5589
|
*/
|
|
5551
5590
|
function getOutsideEdgesFromTriangles(triangles) {
|
|
5552
|
-
// Use
|
|
5553
|
-
//
|
|
5591
|
+
// Use BigInt keys to avoid collisions for large meshes.
|
|
5592
|
+
// Pack min and max into a single BigInt key: (min << 32) | max
|
|
5554
5593
|
const edgeMap = new Map();
|
|
5555
5594
|
const processEdge = (a, b) => {
|
|
5556
5595
|
const min = Math.min(a, b);
|
|
5557
5596
|
const max = Math.max(a, b);
|
|
5558
|
-
//
|
|
5559
|
-
const key = min
|
|
5597
|
+
// Pack indices into a single BigInt key to avoid string allocation and collisions
|
|
5598
|
+
const key = (BigInt(min) << 32n) | BigInt(max);
|
|
5560
5599
|
if (edgeMap.has(key)) {
|
|
5561
5600
|
edgeMap.delete(key); // Interior edge, remove
|
|
5562
5601
|
}
|
|
@@ -6834,113 +6873,137 @@ class CogTiles {
|
|
|
6834
6873
|
}
|
|
6835
6874
|
return exactMatchIndex;
|
|
6836
6875
|
}
|
|
6837
|
-
async getTileFromImage(tileX, tileY, zoom, fetchSize) {
|
|
6838
|
-
|
|
6839
|
-
//
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
const
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
//
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
//
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6876
|
+
async getTileFromImage(tileX, tileY, zoom, fetchSize, signal) {
|
|
6877
|
+
// Create a fresh local AbortController for this specific fetch.
|
|
6878
|
+
// We do NOT pass `signal` directly to readRasters because deck.gl may reuse tile
|
|
6879
|
+
// objects whose signal is already aborted (same tile re-requested after viewport change).
|
|
6880
|
+
// An already-aborted signal passed to geotiff.js immediately cancels the fetch,
|
|
6881
|
+
// leaving the tile permanently empty. Instead, we only forward cancellation when
|
|
6882
|
+
// the signal fires WHILE the request is actually in flight.
|
|
6883
|
+
const controller = new AbortController();
|
|
6884
|
+
if (signal && !signal.aborted) {
|
|
6885
|
+
signal.addEventListener('abort', () => controller.abort(), { once: true });
|
|
6886
|
+
}
|
|
6887
|
+
const localSignal = controller.signal;
|
|
6888
|
+
try {
|
|
6889
|
+
const imageIndex = this.getImageIndexForZoomLevel(zoom);
|
|
6890
|
+
// Cache Promises to share in-flight requests across concurrent tiles at the same overview
|
|
6891
|
+
let imagePromise = this.imageCache.get(imageIndex);
|
|
6892
|
+
if (!imagePromise) {
|
|
6893
|
+
imagePromise = this.cog.getImage(imageIndex);
|
|
6894
|
+
this.imageCache.set(imageIndex, imagePromise);
|
|
6895
|
+
}
|
|
6896
|
+
const targetImage = await imagePromise;
|
|
6897
|
+
// --- STEP 1: CALCULATE BOUNDS IN METERS ---
|
|
6898
|
+
// 2. Get COG Metadata (image = COG)
|
|
6899
|
+
const imageResolution = this.cogResolutionLookup[imageIndex];
|
|
6900
|
+
const imageHeight = targetImage.getHeight();
|
|
6901
|
+
const imageWidth = targetImage.getWidth();
|
|
6902
|
+
const [imgOriginX, imgOriginY] = this.cogOrigin;
|
|
6903
|
+
// 3. Define Web Mercator Constants
|
|
6904
|
+
// We use the class property tileSize (usually 256) as the ground truth for grid calculations
|
|
6905
|
+
const TILE_SIZE = this.tileSize;
|
|
6906
|
+
const ORIGIN_X = webMercatorOrigin[0];
|
|
6907
|
+
const ORIGIN_Y = webMercatorOrigin[1];
|
|
6908
|
+
// 4. Calculate Tile BBox in World Meters
|
|
6909
|
+
// This defines where the map expects the tile to be physically located
|
|
6910
|
+
const tileGridResolution = (EARTH_CIRCUMFERENCE / TILE_SIZE) / (2 ** zoom);
|
|
6911
|
+
const tileMinXMeters = ORIGIN_X + (tileX * TILE_SIZE * tileGridResolution);
|
|
6912
|
+
const tileMaxYMeters = ORIGIN_Y - (tileY * TILE_SIZE * tileGridResolution);
|
|
6913
|
+
// Note: We don't strictly need MaxX/MinY meters for the start calculation,
|
|
6914
|
+
// but they are useful if debugging the full meter footprint.
|
|
6915
|
+
// --- STEP 2: CONVERT TO PIXEL COORDINATES ---
|
|
6916
|
+
// 5. Calculate precise floating-point start position relative to the image
|
|
6917
|
+
const windowMinX = (tileMinXMeters - imgOriginX) / imageResolution;
|
|
6918
|
+
const windowMinY = (imgOriginY - tileMaxYMeters) / imageResolution;
|
|
6919
|
+
// 6. Snap to Integer Grid (The "Force 256" Fix)
|
|
6920
|
+
// We round the start position to align with the nearest pixel.
|
|
6921
|
+
const FETCH_SIZE = fetchSize || TILE_SIZE; // Default to 256 if not provided
|
|
6922
|
+
const startX = Math.round(windowMinX);
|
|
6923
|
+
const startY = Math.round(windowMinY);
|
|
6924
|
+
const endX = startX + FETCH_SIZE;
|
|
6925
|
+
const endY = startY + FETCH_SIZE;
|
|
6926
|
+
// --- STEP 3: CALCULATE INTERSECTION ---
|
|
6927
|
+
// 7. Clamp the read window to the actual image dimensions
|
|
6928
|
+
// This defines the "Safe" area we can actually read from the file.
|
|
6929
|
+
const validReadX = Math.max(0, startX);
|
|
6930
|
+
const validReadY = Math.max(0, startY);
|
|
6931
|
+
const validReadMaxX = Math.min(imageWidth, endX);
|
|
6932
|
+
const validReadMaxY = Math.min(imageHeight, endY);
|
|
6933
|
+
const readWidth = validReadMaxX - validReadX;
|
|
6934
|
+
const readHeight = validReadMaxY - validReadY;
|
|
6935
|
+
// CHECK: If no overlap, return empty
|
|
6936
|
+
if (readWidth <= 0 || readHeight <= 0) {
|
|
6937
|
+
return [this.createEmptyTile(FETCH_SIZE)];
|
|
6938
|
+
}
|
|
6939
|
+
// 8. Calculate Offsets (Padding)
|
|
6940
|
+
// "missingLeft" is how many blank pixels we need to insert before the image data starts.
|
|
6941
|
+
// Logic: If we wanted to read from -50 (startX), but clamped to 0 (validReadX),
|
|
6942
|
+
// we are missing the first 50 pixels.
|
|
6943
|
+
const missingLeft = validReadX - startX;
|
|
6944
|
+
const missingTop = validReadY - startY;
|
|
6945
|
+
const window = [validReadX, validReadY, validReadMaxX, validReadMaxY];
|
|
6946
|
+
// --- STEP 4: READ AND COMPOSITE ---
|
|
6947
|
+
// Case A: Partial Overlap (Padding or Cropping required)
|
|
6948
|
+
// If the tile is hanging off the edge, we need to manually reconstruct it.
|
|
6949
|
+
// We strictly compare against FETCH_SIZE because that is our target buffer dimension.
|
|
6950
|
+
if (missingLeft > 0 || missingTop > 0 || readWidth < FETCH_SIZE || readHeight < FETCH_SIZE) {
|
|
6951
|
+
const numChannels = this.options.numOfChannels || 1;
|
|
6952
|
+
// Initialize with a TypedArray of the full target size and correct data type
|
|
6953
|
+
const validImageData = this.createTileBuffer(this.options.format || 'Float32', FETCH_SIZE, numChannels);
|
|
6912
6954
|
if (this.options.noDataValue !== undefined) {
|
|
6913
|
-
|
|
6955
|
+
validImageData.fill(this.options.noDataValue);
|
|
6914
6956
|
}
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
for
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6957
|
+
// if the valid window is smaller than the tile size, it gets the image size width and height, thus validRasterData.width must be used as below
|
|
6958
|
+
const validRasterData = await targetImage.readRasters({ window, signal: localSignal });
|
|
6959
|
+
// Place the valid pixel data into the tile buffer.
|
|
6960
|
+
for (let band = 0; band < validRasterData.length; band += 1) {
|
|
6961
|
+
// We must reset the buffer for each band, otherwise data from previous band persists in padding areas
|
|
6962
|
+
const tileBuffer = this.createTileBuffer(this.options.format || 'Float32', FETCH_SIZE);
|
|
6963
|
+
if (this.options.noDataValue !== undefined) {
|
|
6964
|
+
tileBuffer.fill(this.options.noDataValue);
|
|
6965
|
+
}
|
|
6966
|
+
for (let row = 0; row < readHeight; row += 1) {
|
|
6967
|
+
const destRow = missingTop + row;
|
|
6968
|
+
const destRowOffset = destRow * FETCH_SIZE;
|
|
6969
|
+
const srcRowOffset = row * validRasterData.width;
|
|
6970
|
+
for (let col = 0; col < readWidth; col += 1) {
|
|
6971
|
+
// Compute the destination position in the tile buffer.
|
|
6972
|
+
const destCol = missingLeft + col;
|
|
6973
|
+
// Bounds Check: Ensure we don't write outside the allocated buffer
|
|
6974
|
+
if (destRow < FETCH_SIZE && destCol < FETCH_SIZE) {
|
|
6975
|
+
tileBuffer[destRowOffset + destCol] = validRasterData[band][srcRowOffset + col];
|
|
6976
|
+
}
|
|
6977
|
+
else {
|
|
6978
|
+
/* eslint-disable no-console */
|
|
6979
|
+
console.log(`error in assigning data to tile buffer: destRow ${destRow}, destCol ${destCol}, FETCH_SIZE ${FETCH_SIZE}`);
|
|
6980
|
+
}
|
|
6929
6981
|
}
|
|
6930
6982
|
}
|
|
6983
|
+
for (let i = 0; i < tileBuffer.length; i += 1) {
|
|
6984
|
+
validImageData[i * numChannels + band] = tileBuffer[i];
|
|
6985
|
+
}
|
|
6931
6986
|
}
|
|
6932
|
-
|
|
6933
|
-
validImageData[i * numChannels + band] = tileBuffer[i];
|
|
6934
|
-
}
|
|
6987
|
+
return [validImageData];
|
|
6935
6988
|
}
|
|
6936
|
-
|
|
6989
|
+
// Case B: Perfect Match (Optimization)
|
|
6990
|
+
// If the read window is exactly 256x256 and aligned, we can read directly interleaved.
|
|
6991
|
+
const tileData = await targetImage.readRasters({ window, interleave: true, signal: localSignal });
|
|
6992
|
+
return [tileData];
|
|
6993
|
+
}
|
|
6994
|
+
catch (error) {
|
|
6995
|
+
// If the signal was aborted (or geotiff.js threw AggregateError wrapping an abort),
|
|
6996
|
+
// re-throw as a standard AbortError so deck.gl handles tile cancellation gracefully
|
|
6997
|
+
// and suppressGlobalAbortErrors() can suppress the unhandled rejection noise.
|
|
6998
|
+
const isAbortRelated = localSignal.aborted
|
|
6999
|
+
|| (error instanceof AggregateError && error.errors?.some((e) => e?.name === 'AbortError' || e?.message?.includes('aborted') || e?.message?.includes('abort')))
|
|
7000
|
+
|| (error instanceof DOMException && error.name === 'AbortError')
|
|
7001
|
+
|| (error instanceof Error && error.message === 'Request was aborted');
|
|
7002
|
+
if (isAbortRelated) {
|
|
7003
|
+
throw new DOMException('Tile request aborted', 'AbortError');
|
|
7004
|
+
}
|
|
7005
|
+
throw error;
|
|
6937
7006
|
}
|
|
6938
|
-
// Case B: Perfect Match (Optimization)
|
|
6939
|
-
// If the read window is exactly 256x256 and aligned, we can read directly interleaved.
|
|
6940
|
-
// console.log("Perfect aligned read");
|
|
6941
|
-
const tileData = await targetImage.readRasters({ window, interleave: true });
|
|
6942
|
-
// console.log(`data that starts at the left top corner of the tile ${tileX}, ${tileY}`);
|
|
6943
|
-
return [tileData];
|
|
6944
7007
|
}
|
|
6945
7008
|
/**
|
|
6946
7009
|
* Creates a blank tile buffer filled with the "No Data" value.
|
|
@@ -6956,7 +7019,7 @@ class CogTiles {
|
|
|
6956
7019
|
}
|
|
6957
7020
|
return tileData;
|
|
6958
7021
|
}
|
|
6959
|
-
async getTile(x, y, z, bounds, meshMaxError) {
|
|
7022
|
+
async getTile(x, y, z, bounds, meshMaxError, signal) {
|
|
6960
7023
|
let requiredSize = this.tileSize; // Default 256 for image/bitmap
|
|
6961
7024
|
if (this.options.type === 'terrain') {
|
|
6962
7025
|
const isKernel = this.options.useSlope || this.options.useHillshade || this.options.useSwissRelief;
|
|
@@ -6966,7 +7029,7 @@ class CogTiles {
|
|
|
6966
7029
|
// Bitmap layer with relief glaze mode needs kernel padding for slope/hillshade computation
|
|
6967
7030
|
requiredSize = this.tileSize + 2; // 258 for kernel
|
|
6968
7031
|
}
|
|
6969
|
-
const tileData = await this.getTileFromImage(x, y, z, requiredSize);
|
|
7032
|
+
const tileData = await this.getTileFromImage(x, y, z, requiredSize, signal);
|
|
6970
7033
|
// Compute true ground cell size in meters from tile indices.
|
|
6971
7034
|
// Tile y in slippy-map convention → center latitude → Web Mercator distortion correction.
|
|
6972
7035
|
const latRad = Math.atan(Math.sinh(Math.PI * (1 - 2 * (y + 0.5) / Math.pow(2, z))));
|
|
@@ -6990,9 +7053,9 @@ class CogTiles {
|
|
|
6990
7053
|
rasters,
|
|
6991
7054
|
width: tileWidth,
|
|
6992
7055
|
height: tileHeight,
|
|
6993
|
-
bounds,
|
|
7056
|
+
bounds: bounds ?? [0, 0, 0, 0],
|
|
6994
7057
|
cellSizeMeters,
|
|
6995
|
-
}, this.options, meshMaxError);
|
|
7058
|
+
}, this.options, meshMaxError ?? 4.0);
|
|
6996
7059
|
}
|
|
6997
7060
|
/**
|
|
6998
7061
|
* Determines the data type (e.g., "Int32", "Float64") of a GeoTIFF image
|
|
@@ -7202,20 +7265,11 @@ class CogBitmapLayer extends core.CompositeLayer {
|
|
|
7202
7265
|
}
|
|
7203
7266
|
}
|
|
7204
7267
|
async getTiledBitmapData(tile) {
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
const tileData = await this.state.bitmapCogTiles.getTile(tile.index.x, tile.index.y, tile.index.z);
|
|
7209
|
-
if (tileData && !this.props.pickable) {
|
|
7210
|
-
tileData.raw = null;
|
|
7211
|
-
}
|
|
7212
|
-
return tileData;
|
|
7213
|
-
}
|
|
7214
|
-
catch (error) {
|
|
7215
|
-
// Log the error and rethrow so TileLayer can surface the failure via onTileError
|
|
7216
|
-
core.log.warn(`Failed to load bitmap tile at ${tile.index.z}/${tile.index.x}/${tile.index.y}:`, error)();
|
|
7217
|
-
throw error;
|
|
7268
|
+
const resolvedTileData = await this.state.bitmapCogTiles.getTile(tile.index.x, tile.index.y, tile.index.z, undefined, undefined, tile.signal);
|
|
7269
|
+
if (resolvedTileData && !this.props.pickable) {
|
|
7270
|
+
resolvedTileData.raw = null;
|
|
7218
7271
|
}
|
|
7272
|
+
return resolvedTileData;
|
|
7219
7273
|
}
|
|
7220
7274
|
renderSubLayers(props) {
|
|
7221
7275
|
const SubLayerClass = this.getSubLayerClass('image', layers.BitmapLayer);
|
|
@@ -7349,7 +7403,6 @@ function urlTemplateToUpdateTrigger(template) {
|
|
|
7349
7403
|
}
|
|
7350
7404
|
// TODO remove elevationDecoder
|
|
7351
7405
|
// TODO use meshMaxError
|
|
7352
|
-
// TODO - pass signal to getTile
|
|
7353
7406
|
/** Render mesh surfaces from height map images. */
|
|
7354
7407
|
class CogTerrainLayer extends core.CompositeLayer {
|
|
7355
7408
|
static defaultProps = defaultProps;
|
|
@@ -7448,13 +7501,11 @@ class CogTerrainLayer extends core.CompositeLayer {
|
|
|
7448
7501
|
topRight = [bbox.right, bbox.top];
|
|
7449
7502
|
}
|
|
7450
7503
|
const bounds = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]];
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
if (terrain && !this.props.pickable) {
|
|
7455
|
-
terrain.raw = null;
|
|
7504
|
+
const resolvedTerrain = await this.state.terrainCogTiles.getTile(tile.index.x, tile.index.y, tile.index.z, bounds, this.props.meshMaxError, tile.signal);
|
|
7505
|
+
if (resolvedTerrain && !this.props.pickable) {
|
|
7506
|
+
resolvedTerrain.raw = null;
|
|
7456
7507
|
}
|
|
7457
|
-
return Promise.all([
|
|
7508
|
+
return Promise.all([resolvedTerrain, null]);
|
|
7458
7509
|
}
|
|
7459
7510
|
renderSubLayers(props) {
|
|
7460
7511
|
const SubLayerClass = this.getSubLayerClass('mesh', meshLayers.SimpleMeshLayer);
|
|
@@ -7563,6 +7614,10 @@ class CogTerrainLayer extends core.CompositeLayer {
|
|
|
7563
7614
|
}
|
|
7564
7615
|
}
|
|
7565
7616
|
|
|
7617
|
+
// src/index.ts
|
|
7618
|
+
// Initialize global error suppression for deck.gl AbortErrors
|
|
7619
|
+
suppressGlobalAbortErrors();
|
|
7620
|
+
|
|
7566
7621
|
class RawDecoder extends BaseDecoder {
|
|
7567
7622
|
/** @param {ArrayBuffer} buffer */
|
|
7568
7623
|
decodeBlock(buffer) {
|
|
@@ -7571,8 +7626,8 @@ class RawDecoder extends BaseDecoder {
|
|
|
7571
7626
|
}
|
|
7572
7627
|
|
|
7573
7628
|
var raw = /*#__PURE__*/Object.freeze({
|
|
7574
|
-
|
|
7575
|
-
|
|
7629
|
+
__proto__: null,
|
|
7630
|
+
default: RawDecoder
|
|
7576
7631
|
});
|
|
7577
7632
|
|
|
7578
7633
|
const MIN_BITS = 9;
|
|
@@ -7730,8 +7785,8 @@ class LZWDecoder extends BaseDecoder {
|
|
|
7730
7785
|
}
|
|
7731
7786
|
|
|
7732
7787
|
var lzw = /*#__PURE__*/Object.freeze({
|
|
7733
|
-
|
|
7734
|
-
|
|
7788
|
+
__proto__: null,
|
|
7789
|
+
default: LZWDecoder
|
|
7735
7790
|
});
|
|
7736
7791
|
|
|
7737
7792
|
/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
|
|
@@ -8794,8 +8849,8 @@ class JpegDecoder extends BaseDecoder {
|
|
|
8794
8849
|
}
|
|
8795
8850
|
|
|
8796
8851
|
var jpeg = /*#__PURE__*/Object.freeze({
|
|
8797
|
-
|
|
8798
|
-
|
|
8852
|
+
__proto__: null,
|
|
8853
|
+
default: JpegDecoder
|
|
8799
8854
|
});
|
|
8800
8855
|
|
|
8801
8856
|
/*============================================================================*/
|
|
@@ -12041,8 +12096,8 @@ class DeflateDecoder extends BaseDecoder {
|
|
|
12041
12096
|
}
|
|
12042
12097
|
|
|
12043
12098
|
var deflate = /*#__PURE__*/Object.freeze({
|
|
12044
|
-
|
|
12045
|
-
|
|
12099
|
+
__proto__: null,
|
|
12100
|
+
default: DeflateDecoder
|
|
12046
12101
|
});
|
|
12047
12102
|
|
|
12048
12103
|
class PackbitsDecoder extends BaseDecoder {
|
|
@@ -12072,8 +12127,8 @@ class PackbitsDecoder extends BaseDecoder {
|
|
|
12072
12127
|
}
|
|
12073
12128
|
|
|
12074
12129
|
var packbits = /*#__PURE__*/Object.freeze({
|
|
12075
|
-
|
|
12076
|
-
|
|
12130
|
+
__proto__: null,
|
|
12131
|
+
default: PackbitsDecoder
|
|
12077
12132
|
});
|
|
12078
12133
|
|
|
12079
12134
|
function getDefaultExportFromCjs (x) {
|
|
@@ -14527,9 +14582,9 @@ class LercDecoder extends BaseDecoder {
|
|
|
14527
14582
|
}
|
|
14528
14583
|
|
|
14529
14584
|
var lerc = /*#__PURE__*/Object.freeze({
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14585
|
+
__proto__: null,
|
|
14586
|
+
default: LercDecoder,
|
|
14587
|
+
zstd: zstd$2
|
|
14533
14588
|
});
|
|
14534
14589
|
|
|
14535
14590
|
/**
|
|
@@ -14703,9 +14758,9 @@ class ZstdDecoder extends BaseDecoder {
|
|
|
14703
14758
|
}
|
|
14704
14759
|
|
|
14705
14760
|
var zstd$1 = /*#__PURE__*/Object.freeze({
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14761
|
+
__proto__: null,
|
|
14762
|
+
default: ZstdDecoder,
|
|
14763
|
+
zstd: zstd
|
|
14709
14764
|
});
|
|
14710
14765
|
|
|
14711
14766
|
/**
|
|
@@ -14768,12 +14823,13 @@ class WebImageDecoder extends BaseDecoder {
|
|
|
14768
14823
|
}
|
|
14769
14824
|
|
|
14770
14825
|
var webimage = /*#__PURE__*/Object.freeze({
|
|
14771
|
-
|
|
14772
|
-
|
|
14826
|
+
__proto__: null,
|
|
14827
|
+
default: WebImageDecoder
|
|
14773
14828
|
});
|
|
14774
14829
|
|
|
14775
14830
|
exports.CogBitmapLayer = CogBitmapLayer;
|
|
14776
14831
|
exports.CogTerrainLayer = CogTerrainLayer;
|
|
14777
14832
|
exports.CogTiles = CogTiles;
|
|
14778
14833
|
exports.GeoImage = GeoImage;
|
|
14834
|
+
exports.suppressGlobalAbortErrors = suppressGlobalAbortErrors;
|
|
14779
14835
|
//# sourceMappingURL=index.js.map
|