@gisatcz/deckgl-geolib 2.5.0-dev.3 → 2.5.0-dev.5
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 +264 -155
- 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 +264 -156
- 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 +8 -3
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/utils/suppressAbortErrors.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeoTIFF, GeoTIFFImage } from 'geotiff';
|
|
2
2
|
import GeoImage from './GeoImage';
|
|
3
|
-
import { GeoImageOptions, TileResult } from './types';
|
|
3
|
+
import { GeoImageOptions, TileResult, TypedArray } from './types';
|
|
4
4
|
export type Bounds = [minX: number, minY: number, maxX: number, maxY: number];
|
|
5
5
|
declare class CogTiles {
|
|
6
6
|
cog: GeoTIFF;
|
|
@@ -12,8 +12,13 @@ declare class CogTiles {
|
|
|
12
12
|
bounds: [number, number, number, number];
|
|
13
13
|
geo: GeoImage;
|
|
14
14
|
options: GeoImageOptions;
|
|
15
|
+
private rasterCache;
|
|
16
|
+
private readonly maxCacheSize;
|
|
17
|
+
private getCachedRaster;
|
|
18
|
+
private setCachedRaster;
|
|
15
19
|
private imageCache;
|
|
16
20
|
private initializePromise?;
|
|
21
|
+
private lastInitializedUrl?;
|
|
17
22
|
constructor(options: GeoImageOptions);
|
|
18
23
|
initializeCog(url: string): Promise<void>;
|
|
19
24
|
getZoomRange(): number[];
|
|
@@ -50,13 +55,13 @@ declare class CogTiles {
|
|
|
50
55
|
* @returns {number} The index of the image in the COG that best matches the specified zoom level.
|
|
51
56
|
*/
|
|
52
57
|
getImageIndexForZoomLevel(zoom: number): number;
|
|
53
|
-
getTileFromImage(tileX: number, tileY: number, zoom: number, fetchSize?: number): Promise<
|
|
58
|
+
getTileFromImage(tileX: number, tileY: number, zoom: number, fetchSize?: number, signal?: AbortSignal): Promise<TypedArray[]>;
|
|
54
59
|
/**
|
|
55
60
|
* Creates a blank tile buffer filled with the "No Data" value.
|
|
56
61
|
* @param size The width/height of the square tile (e.g., 256 or 257)
|
|
57
62
|
*/
|
|
58
63
|
createEmptyTile(size?: number): Float32Array<ArrayBuffer>;
|
|
59
|
-
getTile(x: number, y: number, z: number, bounds
|
|
64
|
+
getTile(x: number, y: number, z: number, bounds?: Bounds, meshMaxError?: number, signal?: AbortSignal): Promise<TileResult | null>;
|
|
60
65
|
/**
|
|
61
66
|
* Determines the data type (e.g., "Int32", "Float64") of a GeoTIFF image
|
|
62
67
|
* by reading its TIFF tags.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suppresses unhandled AbortErrors from deck.gl tile cancellation.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: The library's main entry point installs this handler automatically
|
|
5
|
+
* when the package is imported via its primary build (for example
|
|
6
|
+
* `import '@gisatcz/deckgl-geolib'`). This default prevents console spam during
|
|
7
|
+
* normal tile cancellation (pan/zoom) for the vast majority of consumers.
|
|
8
|
+
*
|
|
9
|
+
* If you need to control installation manually (for example when importing
|
|
10
|
+
* internals or for custom lifecycle control), import and call the exported
|
|
11
|
+
* function yourself:
|
|
12
|
+
*
|
|
13
|
+
* import { suppressGlobalAbortErrors } from '@gisatcz/deckgl-geolib';
|
|
14
|
+
* suppressGlobalAbortErrors();
|
|
15
|
+
*
|
|
16
|
+
* Warning: This suppresses ALL unhandled AbortErrors (including from your own
|
|
17
|
+
* code). If you need finer control, implement a custom `unhandledrejection`
|
|
18
|
+
* handler instead.
|
|
19
|
+
*
|
|
20
|
+
* The listener is attached only once and only in browser environments,
|
|
21
|
+
* making this function idempotent and safe to call multiple times.
|
|
22
|
+
*/
|
|
23
|
+
export declare function suppressGlobalAbortErrors(): void;
|