maplibre-gl-layers 0.15.0 → 0.17.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.
Files changed (39) hide show
  1. package/README.md +2 -2
  2. package/dist/SpriteLayer.d.ts +5 -4
  3. package/dist/config.d.ts +2 -2
  4. package/dist/const.d.ts +30 -2
  5. package/dist/default.d.ts +2 -2
  6. package/dist/gl/atlas.d.ts +2 -2
  7. package/dist/gl/hitTest.d.ts +5 -5
  8. package/dist/gl/shader.d.ts +39 -26
  9. package/dist/gl/text.d.ts +2 -2
  10. package/dist/host/calculationHost.d.ts +3 -3
  11. package/dist/host/mapLibreProjectionHost.d.ts +2 -2
  12. package/dist/host/projectionHost.d.ts +8 -7
  13. package/dist/host/runtime.d.ts +2 -2
  14. package/dist/host/wasmCalculationHost.d.ts +6 -2
  15. package/dist/host/wasmHost.d.ts +3 -3
  16. package/dist/host/wasmProjectionHost.d.ts +2 -2
  17. package/dist/index.cjs +2019 -1052
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.mjs +2019 -1052
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/internalTypes.d.ts +84 -96
  23. package/dist/interpolation/degreeInterpolation.d.ts +18 -19
  24. package/dist/interpolation/distanceInterpolation.d.ts +6 -7
  25. package/dist/interpolation/easing.d.ts +10 -8
  26. package/dist/interpolation/interpolation.d.ts +10 -12
  27. package/dist/interpolation/interpolationChannels.d.ts +4 -3
  28. package/dist/interpolation/rotationInterpolation.d.ts +10 -10
  29. package/dist/types.d.ts +227 -138
  30. package/dist/utils/color.d.ts +20 -0
  31. package/dist/utils/image.d.ts +2 -2
  32. package/dist/utils/looseQuadTree.d.ts +2 -2
  33. package/dist/utils/math.d.ts +80 -86
  34. package/dist/utils/utils.d.ts +2 -2
  35. package/dist/wasm/config.json.d.ts +2 -2
  36. package/dist/wasm/offloads-nosimd.wasm +0 -0
  37. package/dist/wasm/offloads-simd-mt.wasm +0 -0
  38. package/dist/wasm/offloads-simd.wasm +0 -0
  39. package/package.json +6 -6
package/dist/types.d.ts CHANGED
@@ -1,20 +1,14 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.17.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: d850b7e9c713f54f0630248dc4ea370721b6965b
8
+ * git.commit.hash: 9fe9aa30db6602d13643e32c94af39ae2b26b082
9
9
  */
10
10
 
11
11
  import { CustomLayerInterface } from 'maplibre-gl';
12
- /**
13
- * Sprite rendering modes.
14
- * Billboard: Image always faces the viewport, suited for HUD-style elements.
15
- * Surface: Image lies parallel to the map surface, suited for dynamic markers on the map.
16
- */
17
- export type SpriteMode = 'billboard' | 'surface';
18
12
  /**
19
13
  * Base coordinate for the sprite. All images within the sprite are positioned relative to this location.
20
14
  */
@@ -42,6 +36,15 @@ export interface SpriteImageOffset {
42
36
  */
43
37
  offsetDeg: number;
44
38
  }
39
+ /**
40
+ * Line attribute.
41
+ */
42
+ export interface SpriteImageLineAttribute {
43
+ /** CSS color string. Defaults to red. */
44
+ color?: string;
45
+ /** Line width in meters. Defaults to 1. */
46
+ widthMeters?: number;
47
+ }
45
48
  /**
46
49
  * Anchor within the image.
47
50
  * The sprite's base coordinate maps to this location; range is -1.0 to 1.0 relative to image size.
@@ -71,32 +74,118 @@ export interface SpriteImageOriginLocation {
71
74
  */
72
75
  useResolvedAnchor?: boolean;
73
76
  }
74
- /** Defines movement interpolation modes. */
77
+ /**
78
+ * Linear easing definition.
79
+ */
80
+ export interface SpriteEasingLinear {
81
+ readonly type: 'linear';
82
+ }
83
+ /**
84
+ * Ease easing definition.
85
+ */
86
+ export interface SpriteEasingEase {
87
+ readonly type: 'ease';
88
+ /** Power applied to the easing curve. Defaults to 3. */
89
+ power?: number;
90
+ /** Direction of the easing curve. Defaults to in-out. */
91
+ mode?: 'in' | 'out' | 'in-out';
92
+ }
93
+ /**
94
+ * Exponential easing definition.
95
+ */
96
+ export interface SpriteEasingExponential {
97
+ readonly type: 'exponential';
98
+ /** Growth rate used by the exponential curve. Defaults to 5. */
99
+ exponent?: number;
100
+ /** Direction of the exponential curve. Defaults to in-out. */
101
+ mode?: 'in' | 'out' | 'in-out';
102
+ }
103
+ /**
104
+ * Quadratic easing definition.
105
+ */
106
+ export interface SpriteEasingQuadratic {
107
+ readonly type: 'quadratic';
108
+ /** Direction of the quadratic curve. Defaults to in-out. */
109
+ mode?: 'in' | 'out' | 'in-out';
110
+ }
111
+ /**
112
+ * Cubic easing definition.
113
+ */
114
+ export interface SpriteEasingCubic {
115
+ readonly type: 'cubic';
116
+ /** Direction of the cubic curve. Defaults to in-out. */
117
+ mode?: 'in' | 'out' | 'in-out';
118
+ }
119
+ /**
120
+ * Sine easing definition.
121
+ */
122
+ export interface SpriteEasingSine {
123
+ readonly type: 'sine';
124
+ /** Direction of the sine ease. Defaults to in-out. */
125
+ mode?: 'in' | 'out' | 'in-out';
126
+ /** Multiplier applied to the sine amplitude. Defaults to 1. */
127
+ amplitude?: number;
128
+ }
129
+ /**
130
+ * Bounce easing definition.
131
+ */
132
+ export interface SpriteEasingBounce {
133
+ readonly type: 'bounce';
134
+ /** Number of visible bounces before settling. Defaults to 3. */
135
+ bounces?: number;
136
+ /** Decay factor applied per bounce; range (0, 1]. Defaults to 0.5. */
137
+ decay?: number;
138
+ }
139
+ /**
140
+ * Back easing definition.
141
+ */
142
+ export interface SpriteEasingBack {
143
+ readonly type: 'back';
144
+ /** Overshoot factor controlling how far past the target the curve goes. Defaults to 1.70158. */
145
+ overshoot?: number;
146
+ }
147
+ /**
148
+ * Union of supported easing parameters.
149
+ */
150
+ export type SpriteEasingParam = SpriteEasingLinear | SpriteEasingEase | SpriteEasingExponential | SpriteEasingQuadratic | SpriteEasingCubic | SpriteEasingSine | SpriteEasingBounce | SpriteEasingBack;
151
+ /**
152
+ * Easing types.
153
+ */
154
+ export type SpriteEasingType = SpriteEasingParam['type'];
155
+ /**
156
+ * Defines interpolation modes.
157
+ */
75
158
  export type SpriteInterpolationMode = 'feedback' | 'feedforward';
76
- /** Easing function signature used to map interpolation progress. */
77
- export type EasingFunction = (progress: number) => number;
78
- export type SpriteEasingPresetName = 'linear';
79
- export type SpriteInterpolationEasing = EasingFunction | SpriteEasingPresetName;
80
- /** Options for interpolating values. */
159
+ /**
160
+ * Options for interpolating values.
161
+ */
81
162
  export interface SpriteInterpolationOptions {
82
- /** Interpolation mode; defaults to feedback. */
163
+ /** Interpolation mode; defaults to `feedback`. */
83
164
  mode?: SpriteInterpolationMode;
84
165
  /** Duration in milliseconds. */
85
166
  durationMs: number;
86
- /** Easing mapping applied to progress values. Accepts preset names or custom functions. Defaults to linear. */
87
- easing?: SpriteInterpolationEasing;
167
+ /** Easing definition. Defaults to `linear`. */
168
+ easing?: SpriteEasingParam;
88
169
  }
89
- /** Interpolation configuration for rotateDeg and offsetDeg. */
170
+ /**
171
+ * Interpolation configuration.
172
+ */
90
173
  export interface SpriteImageInterpolationOptions {
91
- /** Interpolation settings for rotateDeg; null disables interpolation. */
174
+ /** Interpolation settings for rotateDeg; `null` will disable interpolation. */
92
175
  rotateDeg?: SpriteInterpolationOptions | null;
93
- /** Interpolation settings for offset.offsetDeg; null disables interpolation. */
176
+ /** Interpolation settings for offset.offsetDeg; `null` will disable interpolation. */
94
177
  offsetDeg?: SpriteInterpolationOptions | null;
95
- /** Interpolation settings for offset.offsetMeters; null disables interpolation. */
178
+ /** Interpolation settings for offset.offsetMeters; `null` will disable interpolation. */
96
179
  offsetMeters?: SpriteInterpolationOptions | null;
97
- /** Interpolation settings for opacity; null disables interpolation. */
180
+ /** Interpolation settings for opacity; `null` will disable interpolation. */
98
181
  opacity?: SpriteInterpolationOptions | null;
99
182
  }
183
+ /**
184
+ * Sprite rendering modes.
185
+ * Billboard: Image always faces the viewport, suited for HUD-style elements.
186
+ * Surface: Image lies parallel to the map surface, suited for dynamic markers on the map.
187
+ */
188
+ export type SpriteMode = 'billboard' | 'surface';
100
189
  /**
101
190
  * Initial attributes that define a sprite image.
102
191
  */
@@ -113,9 +202,13 @@ export interface SpriteImageDefinitionInit {
113
202
  anchor?: SpriteAnchor;
114
203
  /** Offset from the sprite coordinate. Defaults to no offset. */
115
204
  offset?: SpriteImageOffset;
205
+ /** Optional border rendered around the image. */
206
+ border?: SpriteImageLineAttribute;
207
+ /** Optional leader line rendered toward the origin image. */
208
+ leaderLine?: SpriteImageLineAttribute;
116
209
  /**
117
210
  * Determines which coordinate to anchor against.
118
- * - Omitted: use the sprite base coordinate.
211
+ * - Omitted: use "the sprite" base coordinate.
119
212
  * - Provided: use the referenced image's anchor and offset (resolving references recursively).
120
213
  */
121
214
  originLocation?: SpriteImageOriginLocation;
@@ -154,6 +247,10 @@ export interface SpriteImageDefinitionUpdate {
154
247
  anchor?: SpriteAnchor;
155
248
  /** Offset from the sprite coordinate. */
156
249
  offset?: SpriteImageOffset;
250
+ /** Border rendered around the image. Specify null to remove. */
251
+ border?: SpriteImageLineAttribute | null;
252
+ /** Leader line rendered toward the origin image. Specify null to remove. */
253
+ leaderLine?: SpriteImageLineAttribute | null;
157
254
  /** Additional rotation in degrees. */
158
255
  rotateDeg?: number;
159
256
  /** Enables auto-rotation toward the travel direction. */
@@ -184,11 +281,24 @@ export interface SpriteInit<TTag> {
184
281
  isEnabled?: boolean;
185
282
  /** Initial location. */
186
283
  location: SpriteLocation;
284
+ /**
285
+ * Marks the sprite as invalidated initially, causing interpolation parameters to be
286
+ * ignored until the first update drives the value again.
287
+ */
288
+ invalidate?: boolean;
187
289
  /**
188
290
  * Pseudo LOD threshold for the sprite. When the camera distance exceeds this value,
189
291
  * all images attached to the sprite become invisible.
190
292
  */
191
293
  visibilityDistanceMeters?: number;
294
+ /**
295
+ * Default interpolation settings applied to initial location updates until overridden.
296
+ */
297
+ interpolation?: SpriteInterpolationOptions;
298
+ /**
299
+ * Multiplier applied to every image opacity belonging to the sprite. Defaults to 1.0.
300
+ */
301
+ opacityMultiplier?: number;
192
302
  /** Array of zero or more images. */
193
303
  images: SpriteImageDefinitionInitEntry[];
194
304
  /** Optional tag value; null or omission means no tag. */
@@ -211,42 +321,38 @@ export interface SpriteInitEntry<TTag> extends SpriteInit<TTag> {
211
321
  export type SpriteInitCollection<TTag> = Record<string, SpriteInit<TTag>> | readonly SpriteInitEntry<TTag>[];
212
322
  /**
213
323
  * Interpolated values.
214
- * @param T - Value type.
324
+ * @param TValue - Value type.
215
325
  */
216
- export interface InterpolatedValues<T> {
326
+ export interface SpriteInterpolatedValues<TValue> {
217
327
  /** Current time value. */
218
- readonly current: T;
328
+ readonly current: TValue;
219
329
  /** Requested value. */
220
- readonly from: T | undefined;
330
+ readonly from: TValue | undefined;
221
331
  /** Will be reached value. */
222
- readonly to: T | undefined;
332
+ readonly to: TValue | undefined;
333
+ /** Marks whether the value was invalidated due to visibility changes. */
334
+ readonly invalidated: boolean | undefined;
223
335
  }
224
336
  /**
225
337
  * Offset with interpolation metadata for both distance and heading.
226
338
  */
227
339
  export interface SpriteImageInterpolatedOffset {
228
340
  /** Distance from the anchor in meters. */
229
- readonly offsetMeters: InterpolatedValues<number>;
341
+ readonly offsetMeters: SpriteInterpolatedValues<number>;
230
342
  /** Heading describing the offset direction in degrees. */
231
- readonly offsetDeg: InterpolatedValues<number>;
343
+ readonly offsetDeg: SpriteInterpolatedValues<number>;
344
+ }
345
+ /**
346
+ * Resolved line attribute state.
347
+ */
348
+ export interface SpriteImageLineAttributeState {
349
+ /** CSS color string applied to the line. */
350
+ readonly color: string;
351
+ /** Line width in meters. */
352
+ readonly widthMeters: number;
232
353
  }
233
354
  /**
234
355
  * Sprite image state evaluated at runtime.
235
- *
236
- * @property {number} subLayer - Sub-layer index the image belongs to.
237
- * @property {number} order - Ordering slot within the sub-layer.
238
- * @property {string} imageId - Identifier of the registered image or glyph.
239
- * @property {SpriteMode} mode - Rendering mode applied to the image.
240
- * @property {InterpolatedValues<number>} opacity - Opacity multiplier applied when rendering, with interpolation metadata.
241
- * @property {number} scale - Scale factor converting pixels to meters.
242
- * @property {Readonly<SpriteAnchor>} anchor - Anchor coordinates resolved for the image.
243
- * @property {Readonly<SpriteImageInterpolatedOffset>} offset - Offset applied relative to the anchor point, with interpolation metadata.
244
- * @property {InterpolatedValues<number>} rotateDeg - Additional rotation in degrees plus interpolation metadata.
245
- * @property {boolean} autoRotation - Indicates whether auto-rotation is active.
246
- * @property {number} autoRotationMinDistanceMeters - Minimum travel distance before auto-rotation updates.
247
- * @property {number} resolvedBaseRotateDeg - Internal base rotation resolved for the current frame.
248
- * @property {number} displayedRotateDeg - Rotation value actually used for rendering.
249
- * @property {Readonly<SpriteImageOriginLocation> | undefined} originLocation - Optional reference to another image used for anchoring.
250
356
  */
251
357
  export interface SpriteImageState {
252
358
  /** Sub-layer index the image belongs to. */
@@ -262,14 +368,18 @@ export interface SpriteImageState {
262
368
  /** Anchor coordinates resolved for the image. */
263
369
  readonly anchor: Readonly<SpriteAnchor>;
264
370
  /** Opacity multiplier applied when rendering. */
265
- readonly opacity: InterpolatedValues<number>;
371
+ readonly opacity: SpriteInterpolatedValues<number>;
266
372
  /** Offset applied relative to the anchor point. */
267
- readonly offset: Readonly<SpriteImageInterpolatedOffset>;
373
+ readonly offset: SpriteImageInterpolatedOffset;
374
+ /** Optional border rendered around the image. */
375
+ readonly border: SpriteImageLineAttributeState | undefined;
376
+ /** Optional leader line rendered toward the origin image. */
377
+ readonly leaderLine: SpriteImageLineAttributeState | undefined;
268
378
  /**
269
379
  * Additional rotation in degrees with interpolation metadata.
270
380
  * `from`/`to` are `undefined` when no rotation animation is running.
271
381
  */
272
- readonly rotateDeg: InterpolatedValues<number>;
382
+ readonly rotateDeg: SpriteInterpolatedValues<number>;
273
383
  /** Indicates whether auto-rotation is active. */
274
384
  readonly autoRotation: boolean;
275
385
  /** Minimum travel distance before auto-rotation updates. */
@@ -291,6 +401,8 @@ export interface SpriteCurrentState<TTag> {
291
401
  readonly spriteId: string;
292
402
  /** Indicates whether the sprite is enabled. */
293
403
  readonly isEnabled: boolean;
404
+ /** Multiplier applied to every image opacity. */
405
+ readonly opacityMultiplier: number;
294
406
  /**
295
407
  * Pseudo LOD threshold for the sprite. When the camera distance exceeds this value,
296
408
  * the sprite's images become invisible.
@@ -300,7 +412,7 @@ export interface SpriteCurrentState<TTag> {
300
412
  * Location information including current, source, and destination coordinates.
301
413
  * `from`/`to` are `undefined` when interpolation is inactive.
302
414
  */
303
- readonly location: InterpolatedValues<Readonly<SpriteLocation>>;
415
+ readonly location: SpriteInterpolatedValues<Readonly<SpriteLocation>>;
304
416
  /** Current image states, grouped by sub-layer and order. */
305
417
  readonly images: ReadonlyMap<number, ReadonlyMap<number, SpriteImageState>>;
306
418
  /** Optional tag value; null indicates no tag. */
@@ -310,10 +422,6 @@ export interface SpriteCurrentState<TTag> {
310
422
  * Base structure for sprite updates.
311
423
  *
312
424
  * @template TTag Tag type stored on the sprite.
313
- * @property {boolean | undefined} isEnabled - Optional toggle to enable or disable the sprite.
314
- * @property {SpriteLocation | undefined} location - Optional target location for the sprite.
315
- * @property {SpriteLocationInterpolationOptions | null | undefined} interpolation - Optional location interpolation settings; `null` disables interpolation.
316
- * @property {TTag | null | undefined} tag - Optional tag value to replace the current one; `null` clears the tag.
317
425
  */
318
426
  export interface SpriteUpdateEntryBase<TTag> {
319
427
  /** Optional toggle to enable or disable the sprite. */
@@ -329,13 +437,13 @@ export interface SpriteUpdateEntryBase<TTag> {
329
437
  * `null` to clear the current threshold, or leave `undefined` to keep the existing value.
330
438
  */
331
439
  visibilityDistanceMeters?: number | null;
440
+ /**
441
+ * Optional multiplier applied to every image opacity. When omitted the previous multiplier is preserved.
442
+ */
443
+ opacityMultiplier?: number;
332
444
  }
333
445
  /**
334
446
  * Update entry describing a sprite image modification.
335
- *
336
- * @property {number} subLayer - Target sub-layer that contains the image.
337
- * @property {number} order - Order slot within the sub-layer.
338
- * @property {SpriteImageDefinitionUpdate | null} image - Update payload, or `null` to remove the image.
339
447
  */
340
448
  export interface SpriteImageDefinitionUpdateEntry {
341
449
  /** Target sub-layer that contains the image. */
@@ -349,7 +457,6 @@ export interface SpriteImageDefinitionUpdateEntry {
349
457
  * Sprite update entry with optional image list.
350
458
  *
351
459
  * @template TTag Tag type stored on the sprite.
352
- * @property {SpriteImageDefinitionUpdateEntry[] | undefined} images - Optional set of image updates.
353
460
  */
354
461
  export interface SpriteUpdateEntry<TTag> extends SpriteUpdateEntryBase<TTag> {
355
462
  /** Optional set of image updates. */
@@ -359,19 +466,35 @@ export interface SpriteUpdateEntry<TTag> extends SpriteUpdateEntryBase<TTag> {
359
466
  * Callback-based helper for mutating sprite state.
360
467
  *
361
468
  * @template TTag Tag type stored on the sprite.
362
- * @property {() => ReadonlyMap<number, ReadonlySet<number>>} getImageIndexMap - Retrieves the current image layout.
363
- * @property {(subLayer: number, order: number, imageInit: SpriteImageDefinitionInit) => boolean} addImage - Adds an image definition.
364
- * @property {(subLayer: number, order: number, imageUpdate: SpriteImageDefinitionUpdate) => boolean} updateImage - Applies image updates.
365
- * @property {(subLayer: number, order: number) => boolean} removeImage - Removes an image slot.
366
469
  */
367
470
  export interface SpriteUpdaterEntry<TTag> extends SpriteUpdateEntryBase<TTag> {
368
- /** Retrieves the current image layout. */
471
+ /**
472
+ * Retrieves the current image layout.
473
+ * @returns Structured image index (order sets each sub layers).
474
+ */
369
475
  readonly getImageIndexMap: () => ReadonlyMap<number, ReadonlySet<number>>;
370
- /** Adds an image definition. */
476
+ /**
477
+ * Adds an image definition.
478
+ * @param subLayer - Sub layer index.
479
+ * @param order - Order index.
480
+ * @param imageInit - Image initializer.
481
+ * @returns True if added.
482
+ */
371
483
  readonly addImage: (subLayer: number, order: number, imageInit: SpriteImageDefinitionInit) => boolean;
372
- /** Applies image updates. */
484
+ /**
485
+ * Applies image updates.
486
+ * @param subLayer - Sub layer index.
487
+ * @param order - Order index.
488
+ * @param imageUpdate - Image updater.
489
+ * @returns True if updated.
490
+ */
373
491
  readonly updateImage: (subLayer: number, order: number, imageUpdate: SpriteImageDefinitionUpdate) => boolean;
374
- /** Removes an image slot. */
492
+ /**
493
+ * Removes an image slot.
494
+ * @param subLayer - Sub layer index.
495
+ * @param order - Order index.
496
+ * @returns True if removed.
497
+ */
375
498
  readonly removeImage: (subLayer: number, order: number) => boolean;
376
499
  }
377
500
  /**
@@ -414,9 +537,6 @@ export interface SpriteMutateCallbacks<TTag, TSourceItem extends SpriteMutateSou
414
537
  }
415
538
  /**
416
539
  * Represents a point on anonymous-unit space.
417
- *
418
- * @property {number} x - Horizontal (X axis) coordinate.
419
- * @property {number} y - Vertical (Y axis) coordinate.
420
540
  */
421
541
  export interface SpritePoint {
422
542
  /** Horizontal (X axis) coordinate. */
@@ -431,18 +551,13 @@ export type SpriteScreenPoint = SpritePoint;
431
551
  /**
432
552
  * Event dispatched when a sprite is clicked or tapped.
433
553
  *
434
- * @template T Tag type stored on sprites.
435
- * @property {'spriteclick'} type - Discriminated event type.
436
- * @property {SpriteCurrentState<T>} sprite - Snapshot of the sprite that was hit.
437
- * @property {SpriteImageState} image - Sprite image that received the interaction.
438
- * @property {SpriteScreenPoint} screenPoint - Screen position of the interaction.
439
- * @property {MouseEvent | PointerEvent | TouchEvent} originalEvent - Original DOM event.
440
- */
441
- export interface SpriteLayerClickEvent<T> {
554
+ * @template TTag Tag type stored on sprites.
555
+ */
556
+ export interface SpriteLayerClickEvent<TTag> {
442
557
  /** Discriminated event type. */
443
558
  readonly type: 'spriteclick';
444
559
  /** Snapshot of the sprite that was hit, or `undefined` when it no longer exists. */
445
- readonly sprite: SpriteCurrentState<T> | undefined;
560
+ readonly sprite: SpriteCurrentState<TTag> | undefined;
446
561
  /** Sprite image that received the interaction, or `undefined` when missing. */
447
562
  readonly image: SpriteImageState | undefined;
448
563
  /** Screen position of the interaction. */
@@ -453,18 +568,13 @@ export interface SpriteLayerClickEvent<T> {
453
568
  /**
454
569
  * Event dispatched when a sprite is hovered by a pointing device.
455
570
  *
456
- * @template T Tag type stored on sprites.
457
- * @property {'spritehover'} type - Discriminated event type.
458
- * @property {SpriteCurrentState<T>} sprite - Snapshot of the sprite that was hit.
459
- * @property {SpriteImageState} image - Sprite image that received the interaction.
460
- * @property {SpriteScreenPoint} screenPoint - Screen position of the interaction.
461
- * @property {MouseEvent | PointerEvent} originalEvent - Original hover-capable DOM event.
462
- */
463
- export interface SpriteLayerHoverEvent<T> {
571
+ * @template TTag Tag type stored on sprites.
572
+ */
573
+ export interface SpriteLayerHoverEvent<TTag> {
464
574
  /** Discriminated event type. */
465
575
  readonly type: 'spritehover';
466
576
  /** Snapshot of the sprite that was hit, or `undefined` when it no longer exists. */
467
- readonly sprite: SpriteCurrentState<T> | undefined;
577
+ readonly sprite: SpriteCurrentState<TTag> | undefined;
468
578
  /** Sprite image that received the interaction, or `undefined` when missing. */
469
579
  readonly image: SpriteImageState | undefined;
470
580
  /** Screen position of the interaction. */
@@ -475,35 +585,25 @@ export interface SpriteLayerHoverEvent<T> {
475
585
  /**
476
586
  * Map of events emitted by SpriteLayer.
477
587
  *
478
- * @template T Tag type stored on sprites.
479
- * @property {SpriteLayerClickEvent<T>} spriteclick - Event fired when a sprite image is clicked.
480
- * @property {SpriteLayerHoverEvent<T>} spritehover - Event fired when a sprite image is hovered.
588
+ * @template TTag Tag type stored on sprites.
481
589
  */
482
- export interface SpriteLayerEventMap<T> {
590
+ export interface SpriteLayerEventMap<TTag> {
483
591
  /** Event fired when a sprite image is clicked. */
484
- readonly spriteclick: SpriteLayerClickEvent<T>;
592
+ readonly spriteclick: SpriteLayerClickEvent<TTag>;
485
593
  /** Event fired when a sprite image is hovered. */
486
- readonly spritehover: SpriteLayerHoverEvent<T>;
594
+ readonly spritehover: SpriteLayerHoverEvent<TTag>;
487
595
  }
488
596
  /**
489
597
  * Event listener callback.
490
598
  *
491
- * @template T Tag type stored on sprites.
599
+ * @template TTag Tag type stored on sprites.
492
600
  * @template K Event key from {@link SpriteLayerEventMap}.
493
- * @param {SpriteLayerEventMap<T>[K]} event - Event payload dispatched by SpriteLayer.
601
+ * @param {SpriteLayerEventMap<TTag>[K]} event - Event payload dispatched by SpriteLayer.
494
602
  * @returns {void}
495
603
  */
496
- export type SpriteLayerEventListener<T, K extends keyof SpriteLayerEventMap<T>> = (event: SpriteLayerEventMap<T>[K]) => void;
604
+ export type SpriteLayerEventListener<TTag, K extends keyof SpriteLayerEventMap<TTag>> = (event: SpriteLayerEventMap<TTag>[K]) => void;
497
605
  /**
498
606
  * Options controlling zoom-to-pixel scaling.
499
- *
500
- * @property {number | undefined} metersPerPixel - Overrides the baseline meters-per-pixel ratio.
501
- * @property {number | undefined} zoomMin - Minimum zoom level before scaling adjustments apply.
502
- * @property {number | undefined} zoomMax - Maximum zoom level before scaling adjustments apply.
503
- * @property {number | undefined} scaleMin - Lower limit for scale clamping.
504
- * @property {number | undefined} scaleMax - Upper limit for scale clamping.
505
- * @property {number | undefined} spriteMinPixel - Minimum on-screen pixel size for sprites (0 disables the lower clamp).
506
- * @property {number | undefined} spriteMaxPixel - Maximum on-screen pixel size for sprites (0 disables the upper clamp).
507
607
  */
508
608
  export interface SpriteScalingOptions {
509
609
  /**
@@ -534,37 +634,27 @@ export type SpriteTextureMinFilter = 'nearest' | 'linear' | 'nearest-mipmap-near
534
634
  export type SpriteTextureMagFilter = 'nearest' | 'linear';
535
635
  /**
536
636
  * Texture filtering configuration.
537
- *
538
- * @property {SpriteTextureMinFilter | undefined} minFilter - Minification filter to apply (defaults to `linear`).
539
- * @property {SpriteTextureMagFilter | undefined} magFilter - Magnification filter to apply (defaults to `linear`).
540
- * @property {boolean | undefined} generateMipmaps - Generates mipmaps during upload when true (defaults to `false`).
541
- * @property {number | undefined} maxAnisotropy - Desired anisotropy factor (>= 1) when EXT_texture_filter_anisotropic is available.
542
637
  */
543
638
  export interface SpriteTextureFilteringOptions {
639
+ /** Minification filter to apply (defaults to `linear`). */
544
640
  minFilter?: SpriteTextureMinFilter;
641
+ /** Magnification filter to apply (defaults to `linear`). */
545
642
  magFilter?: SpriteTextureMagFilter;
643
+ /** Generates mipmaps during upload when true (defaults to `false`). */
546
644
  generateMipmaps?: boolean;
645
+ /** Desired anisotropy factor (>= 1) when EXT_texture_filter_anisotropic is available. */
547
646
  maxAnisotropy?: number;
548
647
  }
549
648
  /**
550
649
  * Options accepted when creating a SpriteLayer.
551
- *
552
- * @property {string | undefined} id - Optional layer identifier supplied to MapLibre.
553
- * @property {SpriteScalingOptions | undefined} spriteScaling - Optional scaling controls. Default is UNLIMITED_SPRITE_SCALING_OPTIONS.
554
- * @property {SpriteTextureFilteringOptions | undefined} textureFiltering - Optional texture filtering overrides.
555
650
  */
556
651
  export interface SpriteLayerOptions {
557
652
  /** Optional layer identifier supplied to MapLibre. */
558
653
  id?: string;
559
- /** Optional scaling controls. */
654
+ /** Optional scaling controls. Default is UNLIMITED_SPRITE_SCALING_OPTIONS. */
560
655
  spriteScaling?: SpriteScalingOptions;
561
656
  /** Optional texture filtering configuration. */
562
657
  textureFiltering?: SpriteTextureFilteringOptions;
563
- /**
564
- * When true, renders red outlines around sprite hit-test regions to aid debugging.
565
- * Defaults to false.
566
- */
567
- showDebugBounds?: boolean;
568
658
  }
569
659
  /**
570
660
  * Options used when registering SVG images.
@@ -593,18 +683,26 @@ export interface SpriteImageRegisterOptions {
593
683
  /** SVG-specific configuration. */
594
684
  readonly svg?: SpriteImageSvgOptions;
595
685
  }
596
- /** Horizontal alignment options for text glyphs. */
686
+ /**
687
+ * Horizontal alignment options for text glyphs.
688
+ */
597
689
  export type SpriteTextGlyphHorizontalAlign = 'left' | 'center' | 'right';
598
- /** Padding in pixels applied when rendering text glyphs. */
690
+ /**
691
+ * Padding in pixels applied when rendering text glyphs.
692
+ */
599
693
  export type SpriteTextGlyphPaddingPixel = number | {
600
694
  top?: number;
601
695
  right?: number;
602
696
  bottom?: number;
603
697
  left?: number;
604
698
  };
605
- /** Border sides that can be rendered for a text glyph outline. */
699
+ /**
700
+ * Border sides that can be rendered for a text glyph outline.
701
+ */
606
702
  export type SpriteTextGlyphBorderSide = 'top' | 'right' | 'bottom' | 'left';
607
- /** Additional size options accepted by registerTextGlyph. */
703
+ /**
704
+ * Additional size options accepted by registerTextGlyph.
705
+ */
608
706
  export type SpriteTextGlyphDimensions = {
609
707
  readonly lineHeightPixel: number;
610
708
  readonly maxWidthPixel?: never;
@@ -614,21 +712,6 @@ export type SpriteTextGlyphDimensions = {
614
712
  };
615
713
  /**
616
714
  * Text glyph appearance options.
617
- *
618
- * @property {string | undefined} fontFamily - Font family name.
619
- * @property {string | undefined} fontWeight - CSS font-weight value.
620
- * @property {'normal' | 'italic' | undefined} fontStyle - CSS font-style value.
621
- * @property {string | undefined} color - Text fill color.
622
- * @property {number | undefined} letterSpacingPixel - Letter spacing in pixels.
623
- * @property {string | undefined} backgroundColor - Background color applied behind the text.
624
- * @property {SpriteTextGlyphPaddingPixel | undefined} paddingPixel - Padding around the glyph.
625
- * @property {string | undefined} borderColor - Outline color.
626
- * @property {number | undefined} borderWidthPixel - Outline width in pixels.
627
- * @property {SpriteTextGlyphBorderSide[] | undefined} borderSides - Border sides to draw (defaults to all four).
628
- * @property {number | undefined} borderRadiusPixel - Border radius in pixels.
629
- * @property {SpriteTextGlyphHorizontalAlign | undefined} textAlign - Horizontal alignment of multiline text.
630
- * @property {number | undefined} fontSizePixelHint - It is not specified normally. Preferred font size in pixels before dimension constraints are enforced.
631
- * @property {number | undefined} renderPixelRatio - Canvas pixel ratio multiplier (defaults to 1) applied before the glyph is resampled to its logical size.
632
715
  */
633
716
  export interface SpriteTextGlyphOptions {
634
717
  /** Font family name. */
@@ -813,6 +896,12 @@ export interface SpriteLayerInterface<TTag = any> extends CustomLayerInterface {
813
896
  * @returns {number} Number of sprites that were updated.
814
897
  */
815
898
  readonly updateForEach: (updater: (sprite: SpriteCurrentState<TTag>, update: SpriteUpdaterEntry<TTag>) => boolean) => number;
899
+ /**
900
+ * Controls entire interpolation Calculation.
901
+ * When `false`, interpolation halts immediately and resumes smoothly from the paused state when re-enabled.
902
+ * @param moveable - Continuous calculation for movement interpolation when value is true.
903
+ */
904
+ readonly setInterpolationCalculation: (moveable: boolean) => void;
816
905
  /**
817
906
  * Adds an event listener.
818
907
  *
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.17.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: 9fe9aa30db6602d13643e32c94af39ae2b26b082
9
+ */
10
+
11
+ import { RgbaColor } from '../internalTypes';
12
+ /**
13
+ * Parses a CSS color string into normalized RGBA values.
14
+ * Falls back to the supplied default when parsing fails.
15
+ *
16
+ * @param color CSS color string to parse.
17
+ * @param fallback Fallback value used when parsing fails.
18
+ * @returns Parsed RGBA tuple.
19
+ */
20
+ export declare const parseCssColorToRgba: (color: string | undefined, fallback: RgbaColor) => RgbaColor;
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.17.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: d850b7e9c713f54f0630248dc4ea370721b6965b
8
+ * git.commit.hash: 9fe9aa30db6602d13643e32c94af39ae2b26b082
9
9
  */
10
10
 
11
11
  import { SpriteImageRegisterOptions } from '../types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.17.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: d850b7e9c713f54f0630248dc4ea370721b6965b
8
+ * git.commit.hash: 9fe9aa30db6602d13643e32c94af39ae2b26b082
9
9
  */
10
10
 
11
11
  export interface Rect {