maplibre-gl-layers 0.2.0 → 0.3.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/dist/SpriteLayer.d.ts +2 -2
- package/dist/easing.d.ts +2 -2
- package/dist/index.cjs +121 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +121 -2
- package/dist/index.mjs.map +1 -1
- package/dist/interpolation.d.ts +2 -2
- package/dist/location.d.ts +2 -2
- package/dist/math.d.ts +2 -2
- package/dist/numericInterpolation.d.ts +2 -2
- package/dist/rotationInterpolation.d.ts +2 -2
- package/dist/types.d.ts +52 -13
- package/dist/utils.d.ts +2 -2
- package/package.json +6 -6
package/dist/interpolation.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { EasingFunction, SpriteInterpolationMode, SpriteInterpolationOptions, SpriteLocation } from './types';
|
package/dist/location.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { SpriteLocation } from './types';
|
package/dist/math.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { SpriteAnchor, SpriteImageOffset, SpriteLocation, SpriteScalingOptions } from './types';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { EasingFunction, SpriteNumericInterpolationOptions } from './types';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { SpriteNumericInterpolationOptions } from './types';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { CustomLayerInterface } from 'maplibre-gl';
|
|
@@ -326,14 +326,9 @@ export interface SpriteUpdateEntry<TTag> extends SpriteUpdateEntryBase<TTag> {
|
|
|
326
326
|
/** Optional set of image updates. */
|
|
327
327
|
images?: SpriteImageDefinitionUpdateEntry[];
|
|
328
328
|
}
|
|
329
|
-
/**
|
|
330
|
-
* Entry consumed by updateBulk to target a specific sprite.
|
|
331
|
-
*
|
|
332
|
-
* @template T Tag type stored on the sprite.
|
|
333
|
-
* @property {string} spriteId - Identifier of the sprite to update.
|
|
334
|
-
*/
|
|
329
|
+
/** @deprecated Scheduled for removal in a future release. Use {@link SpriteLayerInterface.mutateSprites} instead. */
|
|
335
330
|
export interface SpriteUpdateBulkEntry<T> extends SpriteUpdateEntry<T> {
|
|
336
|
-
/**
|
|
331
|
+
/** @deprecated Scheduled for removal in a future release. Use {@link SpriteLayerInterface.mutateSprites} instead. */
|
|
337
332
|
spriteId: string;
|
|
338
333
|
}
|
|
339
334
|
/**
|
|
@@ -355,6 +350,44 @@ export interface SpriteUpdaterEntry<TTag> extends SpriteUpdateEntryBase<TTag> {
|
|
|
355
350
|
/** Removes an image slot. */
|
|
356
351
|
readonly removeImage: (subLayer: number, order: number) => boolean;
|
|
357
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Result flags returned by `mutateSprites` callbacks.
|
|
355
|
+
* - `'notremove'`: Keep the sprite after applying any modifications.
|
|
356
|
+
* - `'remove'`: Remove the sprite from the layer.
|
|
357
|
+
*/
|
|
358
|
+
export type SpriteModifierResult = 'notremove' | 'remove';
|
|
359
|
+
/** Source items supplied to `mutateSprites` must expose the target sprite ID. */
|
|
360
|
+
export interface SpriteMutateSourceItem {
|
|
361
|
+
/** Identifier of the sprite targeted by the source item. */
|
|
362
|
+
readonly spriteId: string;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Callbacks invoked by `mutateSprites` for each source item.
|
|
366
|
+
*
|
|
367
|
+
* @template TTag Sprite tag type stored by the layer.
|
|
368
|
+
* @template TSourceItem Source item type that satisfies {@link SpriteMutateSourceItem}.
|
|
369
|
+
*/
|
|
370
|
+
export interface SpriteMutateCallbacks<TTag, TSourceItem extends SpriteMutateSourceItem> {
|
|
371
|
+
/**
|
|
372
|
+
* Invoked when the sprite ID from the source item does not yet exist.
|
|
373
|
+
* Return a populated {@link SpriteInit} when the sprite should be added; return `undefined`
|
|
374
|
+
* (or `null`) to skip creation.
|
|
375
|
+
*
|
|
376
|
+
* @param sourceItem Source item that produced the sprite ID.
|
|
377
|
+
* @returns Sprite initialiser to insert, or `undefined`/`null` to skip.
|
|
378
|
+
*/
|
|
379
|
+
add: (sourceItem: TSourceItem) => SpriteInit<TTag> | null | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Invoked when the sprite ID already exists on the layer.
|
|
382
|
+
* Use `update` to mutate sprite properties or images; return `'remove'` to delete the sprite instead.
|
|
383
|
+
*
|
|
384
|
+
* @param sourceItem Source item that produced the sprite ID.
|
|
385
|
+
* @param sprite Current sprite state snapshot.
|
|
386
|
+
* @param update Helper exposing the same operations as {@link SpriteUpdaterEntry}.
|
|
387
|
+
* @returns `'remove'` to delete the sprite; otherwise `'notremove'`.
|
|
388
|
+
*/
|
|
389
|
+
modify: (sourceItem: TSourceItem, sprite: SpriteCurrentState<TTag>, update: SpriteUpdaterEntry<TTag>) => SpriteModifierResult;
|
|
390
|
+
}
|
|
358
391
|
/**
|
|
359
392
|
* Represents a point in screen space.
|
|
360
393
|
*
|
|
@@ -640,12 +673,18 @@ export interface SpriteLayerInterface<TTag = any> extends CustomLayerInterface {
|
|
|
640
673
|
*/
|
|
641
674
|
readonly updateSprite: (spriteId: string, update: SpriteUpdateEntry<TTag>) => boolean;
|
|
642
675
|
/**
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
* @param {SpriteUpdateBulkEntry<TTag>[]} updateBulkList - List of sprite updates.
|
|
646
|
-
* @returns {number} Number of sprites that were updated.
|
|
676
|
+
* @deprecated Use {@link SpriteLayerInterface.mutateSprites} instead for clearer mutation flows.
|
|
647
677
|
*/
|
|
648
678
|
readonly updateBulk: (updateBulkList: SpriteUpdateBulkEntry<TTag>[]) => number;
|
|
679
|
+
/**
|
|
680
|
+
* Adds, updates, or removes sprites based on an arbitrary collection of source items.
|
|
681
|
+
*
|
|
682
|
+
* @param {readonly TSourceItem[]} sourceItems - Source items that describe desired sprite state.
|
|
683
|
+
* @param {SpriteMutateCallbacks<TTag, TSourceItem>} mutator - Callbacks responsible for creation and modification.
|
|
684
|
+
* @returns {number} Number of sprites that changed. Counts each `add` that returns a non-null
|
|
685
|
+
* initialiser and each `modify` that either invoked the updater helper or returned `'remove'`.
|
|
686
|
+
*/
|
|
687
|
+
readonly mutateSprites: <TSourceItem extends SpriteMutateSourceItem>(sourceItems: readonly TSourceItem[], mutator: SpriteMutateCallbacks<TTag, TSourceItem>) => number;
|
|
649
688
|
/**
|
|
650
689
|
* Iterates over each sprite and allows modifications through a callback.
|
|
651
690
|
*
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.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:
|
|
8
|
+
* git.commit.hash: fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"git": {
|
|
3
3
|
"tags": [
|
|
4
|
-
"0.
|
|
4
|
+
"0.3.0"
|
|
5
5
|
],
|
|
6
6
|
"branches": [
|
|
7
7
|
"main"
|
|
8
8
|
],
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.3.0",
|
|
10
10
|
"commit": {
|
|
11
|
-
"hash": "
|
|
12
|
-
"shortHash": "
|
|
13
|
-
"date": "2025-10-
|
|
11
|
+
"hash": "fd90d1fd66e4ca9c0defa49e68ecaeb9c14fbd06",
|
|
12
|
+
"shortHash": "fd90d1f",
|
|
13
|
+
"date": "2025-10-29T13:58:42+09:00Z",
|
|
14
14
|
"message": "Merge branch 'develop'"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.3.0",
|
|
18
18
|
"description": "MapLibre's layer extension library enabling the display, movement, and modification of large numbers of dynamic sprite images",
|
|
19
19
|
"author": "Kouji Matsui (@kekyo@mi.kekyo.net)",
|
|
20
20
|
"license": "MIT",
|