@gisatcz/deckgl-geolib 2.5.0-dev.2 → 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.
@@ -50,13 +50,13 @@ declare class CogTiles {
50
50
  * @returns {number} The index of the image in the COG that best matches the specified zoom level.
51
51
  */
52
52
  getImageIndexForZoomLevel(zoom: number): number;
53
- getTileFromImage(tileX: number, tileY: number, zoom: number, fetchSize?: number): Promise<(Uint8Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float64Array<ArrayBuffer>)[] | import("geotiff").TypedArrayWithDimensions[]>;
53
+ getTileFromImage(tileX: number, tileY: number, zoom: number, fetchSize?: number, signal?: AbortSignal): Promise<(Uint8Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float64Array<ArrayBuffer>)[] | import("geotiff").TypedArrayWithDimensions[]>;
54
54
  /**
55
55
  * Creates a blank tile buffer filled with the "No Data" value.
56
56
  * @param size The width/height of the square tile (e.g., 256 or 257)
57
57
  */
58
58
  createEmptyTile(size?: number): Float32Array<ArrayBuffer>;
59
- getTile(x: number, y: number, z: number, bounds: Bounds, meshMaxError: number): Promise<TileResult | null>;
59
+ getTile(x: number, y: number, z: number, bounds?: Bounds, meshMaxError?: number, signal?: AbortSignal): Promise<TileResult | null>;
60
60
  /**
61
61
  * Determines the data type (e.g., "Int32", "Float64") of a GeoTIFF image
62
62
  * by reading its TIFF tags.
@@ -29,7 +29,7 @@ export declare class TerrainGenerator {
29
29
  vertices: any;
30
30
  triangles: any;
31
31
  };
32
- static getMeshAttributes(vertices: Uint16Array | Uint32Array | Float32Array | Float64Array, terrain: Float32Array, width: number, height: number, bounds: Bounds | number[]): {
32
+ static getMeshAttributes(vertices: Uint16Array | Uint32Array | Float32Array | Float64Array, terrain: Float32Array, width: number, height: number, bounds: Bounds | number[], verticalExaggeration?: number): {
33
33
  POSITION: {
34
34
  value: Float32Array<ArrayBuffer>;
35
35
  size: number;
@@ -20,7 +20,26 @@ export type GeoImageOptions = {
20
20
  /** 0-based index of the channel to visualize (e.g. 0 for the first channel). Alternative to useChannel. */
21
21
  useChannelIndex?: number | null;
22
22
  noDataValue?: number;
23
+ /**
24
+ * Scalar applied to raw raster values before Martini/Delatin tessellation.
25
+ * Use this to convert or normalize source elevation values into the units that
26
+ * should be seen by the tessellator (e.g. convert raw values to metres).
27
+ * Because the scaled values are used during tessellation, changing `multiplier`
28
+ * also changes the effective mesh density unless `meshMaxError` is adjusted.
29
+ * `meshMaxError` must be specified in the same units as the post-`multiplier`
30
+ * elevation values.
31
+ * Default: 1.0
32
+ */
23
33
  multiplier?: number;
34
+ /**
35
+ * Vertical scale factor applied **only** to mesh vertex z positions, after
36
+ * tessellation. Use this for **visual exaggeration** (make terrain look taller).
37
+ * Unlike `multiplier`, this does not affect `meshMaxError` — the error threshold
38
+ * is always evaluated against real-world (post-`multiplier`) elevation values.
39
+ * The skirt height is scaled by this factor automatically.
40
+ * Default: 1.0
41
+ */
42
+ verticalExaggeration?: number;
24
43
  numOfChannels?: number;
25
44
  planarConfig?: number;
26
45
  tesselator?: 'martini' | 'delatin';
@@ -1,3 +1,4 @@
1
1
  export { CogBitmapLayer, CogTerrainLayer } from './layers/index';
2
2
  export { CogTiles, GeoImage } from './core/index';
3
+ export { suppressGlobalAbortErrors } from './utils/suppressAbortErrors';
3
4
  export type { GeoImageOptions } from './core/index';
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisatcz/deckgl-geolib",
3
- "version": "2.5.0-dev.2",
3
+ "version": "2.5.0-dev.4",
4
4
  "description": "Deck.gl extension for rendering Cloud-Optimized GeoTIFF (COG) data",
5
5
  "keywords": [
6
6
  "deck.gl",