maplibre-gl-layers 0.13.0 → 0.14.0

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/README.md CHANGED
@@ -27,7 +27,7 @@ Here is a minimal example that places a single sprite:
27
27
  import { Map } from 'maplibre-gl';
28
28
  import {
29
29
  createSpriteLayer,
30
- initializeSpriteLayerHost,
30
+ initializeRuntimeHost,
31
31
  } from 'maplibre-gl-layers';
32
32
 
33
33
  // Create the MapLibre instance
@@ -43,8 +43,8 @@ const spriteLayer = createSpriteLayer({ id: 'vehicles' });
43
43
 
44
44
  // When MapLibre is ready
45
45
  map.on('load', async () => {
46
- // Optional: enable WASM acceleration (falls back to JS when unavailable)
47
- await initializeSpriteLayerHost();
46
+ // Initialize and add SpriteLayer to MapLibre
47
+ await initializeRuntimeHost();
48
48
  map.addLayer(spriteLayer);
49
49
 
50
50
  // Register an image that can be referenced by sprites
@@ -1,21 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
- import { SpriteLayerInterface, SpriteLayerOptions, SpriteAnchor, SpriteLocation, SpriteImageDefinitionInit, SpriteImageOffset, SpriteInterpolationOptions, SpriteLayerCalculationVariant } from './types';
11
+ import { SpriteLayerInterface, SpriteLayerOptions, SpriteAnchor, SpriteLocation, SpriteImageDefinitionInit, SpriteImageOffset, SpriteInterpolationOptions } from './types';
12
12
  import { InternalSpriteImageState, InternalSpriteCurrentState, SpriteOriginReference } from './internalTypes';
13
- export interface SpriteLayerHostOptions {
14
- readonly variant?: SpriteLayerCalculationVariant;
15
- readonly wasmBaseUrl?: string;
16
- }
17
- export declare const initializeSpriteLayerHost: (variantOrOptions?: SpriteLayerCalculationVariant | SpriteLayerHostOptions) => Promise<SpriteLayerCalculationVariant>;
18
- export declare const releaseSpriteLayerHost: () => void;
19
13
  /**
20
14
  * Applies auto-rotation to all images within a sprite when movement exceeds the configured threshold.
21
15
  * @template T Arbitrary sprite tag type.
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.14.0
4
+ * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
+ * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
+ * license: MIT
7
+ * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
+ */
10
+
11
+ import { Canvas2DSource } from './internalTypes';
12
+ import { Deferred } from 'async-primitives';
13
+ export interface AtlasManagerOptions {
14
+ readonly pageWidth?: number;
15
+ readonly pageHeight?: number;
16
+ readonly padding?: number;
17
+ }
18
+ export interface AtlasPlacement {
19
+ readonly pageIndex: number;
20
+ readonly width: number;
21
+ readonly height: number;
22
+ readonly x: number;
23
+ readonly y: number;
24
+ readonly u0: number;
25
+ readonly v0: number;
26
+ readonly u1: number;
27
+ readonly v1: number;
28
+ }
29
+ export interface AtlasPageState {
30
+ readonly index: number;
31
+ readonly width: number;
32
+ readonly height: number;
33
+ readonly canvas: Canvas2DSource;
34
+ needsUpload: boolean;
35
+ }
36
+ export interface AtlasManager {
37
+ readonly upsertImage: (id: string, bitmap: ImageBitmap) => AtlasPlacement;
38
+ readonly removeImage: (id: string) => boolean;
39
+ readonly getImagePlacement: (id: string) => AtlasPlacement | null;
40
+ readonly getPages: () => readonly AtlasPageState[];
41
+ readonly markPageClean: (pageIndex: number) => void;
42
+ readonly clear: () => void;
43
+ }
44
+ export interface AtlasQueueUpsertEntry {
45
+ readonly imageId: string;
46
+ readonly bitmap: ImageBitmap;
47
+ readonly deferred: Deferred<boolean>;
48
+ }
49
+ export interface AtlasQueueOptions {
50
+ readonly maxOperationsPerPass: number;
51
+ readonly timeBudgetMs: number;
52
+ }
53
+ export interface AtlasQueueCallbacks {
54
+ readonly onChunkProcessed: () => void;
55
+ }
56
+ export interface AtlasOperationQueue {
57
+ readonly enqueueUpsert: (entry: AtlasQueueUpsertEntry) => void;
58
+ readonly flushPending: () => void;
59
+ readonly cancelForImage: (imageId: string, reason?: Error) => void;
60
+ readonly rejectAll: (reason: Error) => void;
61
+ readonly pendingCount: number;
62
+ }
63
+ export declare const createAtlasManager: (options?: AtlasManagerOptions) => AtlasManager;
64
+ export declare const createAtlasOperationQueue: (atlasManager: AtlasManager, options: AtlasQueueOptions, callbacks: AtlasQueueCallbacks) => AtlasOperationQueue;
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { Map as MapLibreMap } from 'maplibre-gl';
package/dist/config.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  /** Debug flag */
@@ -16,3 +16,11 @@ export declare const USE_SHADER_BILLBOARD_GEOMETRY = true;
16
16
  export declare const USE_SHADER_SURFACE_GEOMETRY = true;
17
17
  /** Whether to enable the NDC bias for surface rendering (disabled by default). */
18
18
  export declare const ENABLE_NDC_BIAS_SURFACE = true;
19
+ /** Maximum number of atlas operations handled per processing pass. */
20
+ export declare const ATLAS_QUEUE_CHUNK_SIZE = 64;
21
+ /** Time budget (milliseconds) spent per atlas queue processing pass. */
22
+ export declare const ATLAS_QUEUE_TIME_BUDGET_MS = 20;
23
+ /** Maximum number of text glyph jobs handled per processing pass. */
24
+ export declare const TEXT_GLYPH_QUEUE_CHUNK_SIZE = 16;
25
+ /** Time budget (milliseconds) spent on text glyph generation per pass. */
26
+ export declare const TEXT_GLYPH_QUEUE_TIME_BUDGET_MS = 20;
package/dist/const.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { Rect } from './looseQuadTree';
package/dist/default.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteScalingOptions, SpriteTextureFilteringOptions } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteInterpolationOptions } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteInterpolationOptions } from './types';
package/dist/easing.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { EasingFunction } from './types';
package/dist/image.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.0
4
4
  * description: MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/maplibre-gl-layers.git
8
- * git.commit.hash: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteImageRegisterOptions } from './types';