maplibre-gl-layers 0.14.0 → 0.15.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/dist/SpriteLayer.d.ts +3 -21
  2. package/dist/config.d.ts +2 -2
  3. package/dist/const.d.ts +3 -3
  4. package/dist/default.d.ts +2 -2
  5. package/dist/{atlas.d.ts → gl/atlas.d.ts} +3 -3
  6. package/dist/gl/hitTest.d.ts +54 -0
  7. package/dist/{shader.d.ts → gl/shader.d.ts} +6 -6
  8. package/dist/gl/text.d.ts +17 -0
  9. package/dist/{calculationHost.d.ts → host/calculationHost.d.ts} +26 -4
  10. package/dist/{mapLibreProjectionHost.d.ts → host/mapLibreProjectionHost.d.ts} +3 -3
  11. package/dist/{projectionHost.d.ts → host/projectionHost.d.ts} +5 -4
  12. package/dist/{runtime.d.ts → host/runtime.d.ts} +4 -3
  13. package/dist/{wasmCalculationHost.d.ts → host/wasmCalculationHost.d.ts} +14 -14
  14. package/dist/{wasmHost.d.ts → host/wasmHost.d.ts} +7 -5
  15. package/dist/{wasmProjectionHost.d.ts → host/wasmProjectionHost.d.ts} +3 -3
  16. package/dist/index.cjs +4378 -2891
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.mjs +4378 -2891
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/internalTypes.d.ts +104 -15
  22. package/dist/{degreeInterpolation.d.ts → interpolation/degreeInterpolation.d.ts} +19 -4
  23. package/dist/interpolation/distanceInterpolation.d.ts +46 -0
  24. package/dist/{easing.d.ts → interpolation/easing.d.ts} +9 -4
  25. package/dist/{interpolation.d.ts → interpolation/interpolation.d.ts} +5 -27
  26. package/dist/{interpolationChannels.d.ts → interpolation/interpolationChannels.d.ts} +16 -7
  27. package/dist/{rotationInterpolation.d.ts → interpolation/rotationInterpolation.d.ts} +5 -10
  28. package/dist/types.d.ts +56 -22
  29. package/dist/{image.d.ts → utils/image.d.ts} +3 -3
  30. package/dist/{looseQuadTree.d.ts → utils/looseQuadTree.d.ts} +2 -2
  31. package/dist/{math.d.ts → utils/math.d.ts} +15 -4
  32. package/dist/{utils.d.ts → utils/utils.d.ts} +3 -3
  33. package/dist/wasm/config.json.d.ts +2 -2
  34. package/dist/wasm/offloads-nosimd.wasm +0 -0
  35. package/dist/wasm/offloads-simd-mt.js +1 -1
  36. package/dist/wasm/offloads-simd-mt.wasm +0 -0
  37. package/dist/wasm/offloads-simd.wasm +0 -0
  38. package/package.json +6 -8
  39. package/dist/distanceInterpolation.d.ts +0 -33
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { SpriteLayerInterface, SpriteLayerOptions, SpriteAnchor, SpriteLocation, SpriteImageDefinitionInit, SpriteImageOffset, SpriteInterpolationOptions } from './types';
11
+ import { SpriteLayerInterface, SpriteLayerOptions, SpriteLocation, SpriteImageDefinitionInit } from './types';
12
12
  import { InternalSpriteImageState, InternalSpriteCurrentState, SpriteOriginReference } from './internalTypes';
13
13
  /**
14
14
  * Applies auto-rotation to all images within a sprite when movement exceeds the configured threshold.
@@ -18,24 +18,6 @@ import { InternalSpriteImageState, InternalSpriteCurrentState, SpriteOriginRefer
18
18
  * @returns {boolean} `true` when auto-rotation was applied, `false` otherwise.
19
19
  */
20
20
  export declare const applyAutoRotation: <T>(sprite: InternalSpriteCurrentState<T>, nextLocation: SpriteLocation) => boolean;
21
- /**
22
- * Clones a sprite anchor, defaulting to the origin when none supplied.
23
- * @param {SpriteAnchor} [anchor] - Anchor to clone.
24
- * @returns {SpriteAnchor} Safe copy for mutation within the layer state.
25
- */
26
- export declare const cloneAnchor: (anchor?: SpriteAnchor) => SpriteAnchor;
27
- /**
28
- * Clones an image offset, applying defaults when missing.
29
- * @param {SpriteImageOffset} [offset] - Offset definition to copy.
30
- * @returns {SpriteImageOffset} Cloned offset structure.
31
- */
32
- export declare const cloneOffset: (offset?: SpriteImageOffset) => SpriteImageOffset;
33
- /**
34
- * Deep-clones interpolation options to prevent shared references between sprites.
35
- * @param {SpriteInterpolationOptions} options - Options provided by the user.
36
- * @returns {SpriteInterpolationOptions} Cloned options object.
37
- */
38
- export declare const cloneInterpolationOptions: (options: SpriteInterpolationOptions) => SpriteInterpolationOptions;
39
21
  /**
40
22
  * Creates internal sprite image state from initialization data and layer bookkeeping fields.
41
23
  * @param {SpriteImageDefinitionInit} imageInit - Caller-provided image definition.
package/dist/config.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  /** Debug flag */
package/dist/const.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { Rect } from './looseQuadTree';
11
+ import { Rect } from './utils/looseQuadTree';
12
12
  import { SpriteAnchor, SpriteImageOffset, SpriteTextGlyphHorizontalAlign } from './types';
13
13
  /** Default sprite anchor centered at the image origin. */
14
14
  export declare const DEFAULT_ANCHOR: Readonly<SpriteAnchor>;
package/dist/default.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  import { SpriteScalingOptions, SpriteTextureFilteringOptions } from './types';
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { Canvas2DSource } from './internalTypes';
12
11
  import { Deferred } from 'async-primitives';
12
+ import { Canvas2DSource } from '../internalTypes';
13
13
  export interface AtlasManagerOptions {
14
14
  readonly pageWidth?: number;
15
15
  readonly pageHeight?: number;
@@ -0,0 +1,54 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.15.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: d850b7e9c713f54f0630248dc4ea370721b6965b
9
+ */
10
+
11
+ import { Map as MapLibreMap } from 'maplibre-gl';
12
+ import { InternalSpriteCurrentState, InternalSpriteImageState, ProjectionHost, RegisteredImage } from '../internalTypes';
13
+ import { SpriteScreenPoint } from '../types';
14
+ import { ResolvedSpriteScalingOptions } from '../utils/math';
15
+ export interface HitTestEntry<T> {
16
+ readonly sprite: InternalSpriteCurrentState<T>;
17
+ readonly image: InternalSpriteImageState;
18
+ readonly corners: readonly [
19
+ SpriteScreenPoint,
20
+ SpriteScreenPoint,
21
+ SpriteScreenPoint,
22
+ SpriteScreenPoint
23
+ ];
24
+ readonly minX: number;
25
+ readonly maxX: number;
26
+ readonly minY: number;
27
+ readonly maxY: number;
28
+ }
29
+ export interface HitTestResult<T> {
30
+ readonly hitEntry: HitTestEntry<T> | null;
31
+ readonly screenPoint: SpriteScreenPoint;
32
+ }
33
+ export interface HitTestControllerParams {
34
+ readonly images: Map<string, RegisteredImage>;
35
+ readonly getResolvedScaling: () => ResolvedSpriteScalingOptions;
36
+ }
37
+ export interface HitTestController<T> {
38
+ readonly beginFrame: () => void;
39
+ readonly clearAll: () => void;
40
+ readonly getHitTestEntries: () => readonly HitTestEntry<T>[];
41
+ readonly registerHitTestEntry: (sprite: Readonly<InternalSpriteCurrentState<T>>, image: Readonly<InternalSpriteImageState>, corners: readonly [
42
+ SpriteScreenPoint,
43
+ SpriteScreenPoint,
44
+ SpriteScreenPoint,
45
+ SpriteScreenPoint
46
+ ], drawIndex: number) => void;
47
+ readonly removeImageBounds: (image: InternalSpriteImageState) => void;
48
+ readonly refreshSpriteHitTestBounds: (projectionHost: ProjectionHost, sprite: Readonly<InternalSpriteCurrentState<T>>) => void;
49
+ readonly findTopmostHitEntry: (point: SpriteScreenPoint, map: MapLibreMap | null) => HitTestEntry<T> | null;
50
+ readonly resolveHitTestResult: (nativeEvent: MouseEvent | PointerEvent | TouchEvent, canvasElement: HTMLCanvasElement | null, map: MapLibreMap | null) => HitTestResult<T> | null;
51
+ readonly setHitTestEnabled: (enabled: boolean) => boolean;
52
+ readonly isHitTestEnabled: () => boolean;
53
+ }
54
+ export declare const createHitTestController: <T>({ images, getResolvedScaling, }: HitTestControllerParams) => HitTestController<T>;
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { SpriteAnchor, SpriteScreenPoint } from './types';
12
- import { PreparedDrawSpriteImageParams, Releaseable } from './internalTypes';
11
+ import { SpriteAnchor, SpriteScreenPoint } from '../types';
12
+ import { PreparedDrawSpriteImageParams, Releasable } from '../internalTypes';
13
13
  /** Number of components per vertex (clipPosition.xyzw + uv.xy). */
14
14
  export declare const VERTEX_COMPONENT_COUNT = 6;
15
15
  /** Component count for clip-space position attributes. */
@@ -82,13 +82,13 @@ export declare const compileShader: (glContext: WebGLRenderingContext, type: num
82
82
  * @throws When linking fails or a program cannot be created.
83
83
  */
84
84
  export declare const createShaderProgram: (glContext: WebGLRenderingContext, vertexSource: string, fragmentSource: string) => WebGLProgram;
85
- export interface SpriteDrawProgram<TTag> extends Releaseable {
85
+ export interface SpriteDrawProgram<TTag> extends Releasable {
86
86
  beginFrame(): void;
87
87
  uploadVertexBatch(items: PreparedDrawSpriteImageParams<TTag>[]): void;
88
88
  draw(prepared: PreparedDrawSpriteImageParams<TTag>): boolean;
89
89
  }
90
90
  export declare const createSpriteDrawProgram: <TTag>(glContext: WebGLRenderingContext) => SpriteDrawProgram<TTag>;
91
- export interface DebugOutlineRenderer extends Releaseable {
91
+ export interface DebugOutlineRenderer extends Releasable {
92
92
  begin(screenToClipScaleX: number, screenToClipScaleY: number, screenToClipOffsetX: number, screenToClipOffsetY: number): void;
93
93
  drawOutline(corners: readonly [
94
94
  SpriteScreenPoint,
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.15.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: d850b7e9c713f54f0630248dc4ea370721b6965b
9
+ */
10
+
11
+ import { SpriteTextGlyphDimensions, SpriteTextGlyphOptions } from '../types';
12
+ export interface TextGlyphRenderResult {
13
+ readonly bitmap: ImageBitmap;
14
+ readonly width: number;
15
+ readonly height: number;
16
+ }
17
+ export declare const renderTextGlyphBitmap: (text: string, dimensions: SpriteTextGlyphDimensions, options?: SpriteTextGlyphOptions) => Promise<TextGlyphRenderResult>;
@@ -1,16 +1,16 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  import { Map as MapLibreMap } from 'maplibre-gl';
12
- import { InternalSpriteCurrentState, InternalSpriteImageState, RegisteredImage, ProjectionHost, PreparedDrawSpriteImageParams, RenderCalculationHost, PrepareDrawSpriteImageParamsBefore, PrepareDrawSpriteImageParamsAfter } from './internalTypes';
13
- import { SpritePoint } from './types';
12
+ import { DistanceInterpolationEvaluationParams, DistanceInterpolationEvaluationResult, DegreeInterpolationEvaluationParams, DegreeInterpolationEvaluationResult, InternalSpriteCurrentState, InternalSpriteImageState, RegisteredImage, ProjectionHost, PreparedDrawSpriteImageParams, RenderCalculationHost, PrepareDrawSpriteImageParamsBefore, PrepareDrawSpriteImageParamsAfter, RenderInterpolationParams, RenderInterpolationResult, SpriteInterpolationEvaluationParams, SpriteInterpolationEvaluationResult } from '../internalTypes';
13
+ import { SpritePoint } from '../types';
14
14
  import { ProjectionHostParams } from './projectionHost';
15
15
  /**
16
16
  * Cache entry storing anchor-adjusted and raw centers for a sprite image.
@@ -31,6 +31,7 @@ type ImageCenterCache = Map<string, Map<string, ImageCenterCacheEntry>>;
31
31
  * culled or stored in another bucket).
32
32
  */
33
33
  type OriginImageResolver<T> = (sprite: Readonly<InternalSpriteCurrentState<T>>, image: Readonly<InternalSpriteImageState>) => InternalSpriteImageState | null;
34
+ export declare const DEFAULT_RENDER_INTERPOLATION_RESULT: RenderInterpolationResult;
34
35
  interface DepthSortedItem<T> {
35
36
  readonly sprite: InternalSpriteCurrentState<T>;
36
37
  readonly image: InternalSpriteImageState;
@@ -43,6 +44,22 @@ export declare const collectDepthSortedItemsInternal: <T>(projectionHost: Projec
43
44
  * Prepares quad data for a single sprite image before issuing the draw call.
44
45
  */
45
46
  export declare const prepareDrawSpriteImageInternal: <TTag>(projectionHost: ProjectionHost, item: DepthSortedItem<TTag>, zoom: number, zoomScaleFactor: number, originCenterCache: ImageCenterCache, { imageResources, baseMetersPerPixel, spriteMinPixel, spriteMaxPixel, drawingBufferWidth, drawingBufferHeight, pixelRatio, clipContext, identityScaleX, identityScaleY, identityOffsetX, identityOffsetY, screenToClipScaleX, screenToClipScaleY, screenToClipOffsetX, screenToClipOffsetY, }: PrepareDrawSpriteImageParamsAfter) => PreparedDrawSpriteImageParams<TTag> | null;
47
+ export declare const applyVisibilityDistanceLod: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
48
+ export declare const syncPreparedOpacities: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
49
+ export declare const filterVisiblePreparedItems: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => PreparedDrawSpriteImageParams<TTag>[];
50
+ export interface ProcessInterpolationPresetRequests {
51
+ readonly distance: readonly DistanceInterpolationEvaluationParams[];
52
+ readonly degree: readonly DegreeInterpolationEvaluationParams[];
53
+ readonly sprite: readonly SpriteInterpolationEvaluationParams[];
54
+ }
55
+ export interface ProcessInterpolationsEvaluationHandlers {
56
+ readonly prepare?: (requests: ProcessInterpolationPresetRequests) => void;
57
+ readonly evaluateDistance: (requests: readonly DistanceInterpolationEvaluationParams[]) => readonly DistanceInterpolationEvaluationResult[];
58
+ readonly evaluateDegree: (requests: readonly DegreeInterpolationEvaluationParams[]) => readonly DegreeInterpolationEvaluationResult[];
59
+ readonly evaluateSprite: (requests: readonly SpriteInterpolationEvaluationParams[]) => readonly SpriteInterpolationEvaluationResult[];
60
+ }
61
+ export declare const processInterpolationsInternal: <TTag>(params: RenderInterpolationParams<TTag>, handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
62
+ export declare const processOpacityInterpolationsAfterPreparation: <TTag>(params: RenderInterpolationParams<TTag>, preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[], handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
46
63
  /**
47
64
  * Create calculation host that binding MapLibre.
48
65
  * @param TTag Tag type.
@@ -60,4 +77,9 @@ export declare const createCalculationHost: <TTag>(params: ProjectionHostParams)
60
77
  export declare const __wasmProjectionCalculationTestInternals: {
61
78
  __createWasmProjectionCalculationTestHost: <TTag>(params: ProjectionHostParams) => RenderCalculationHost<TTag>;
62
79
  };
80
+ export declare const __calculationHostTestInternals: {
81
+ applyVisibilityDistanceLod: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
82
+ syncPreparedOpacities: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
83
+ processOpacityInterpolationsAfterPreparation: <TTag>(params: RenderInterpolationParams<TTag>, preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[], handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
84
+ };
63
85
  export {};
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  import { Map as MapLibreMap } from 'maplibre-gl';
12
- import { ProjectionHost } from './internalTypes';
12
+ import { ProjectionHost } from '../internalTypes';
13
13
  /**
14
14
  * Create a projection host that delegates to MapLibre.
15
15
  * @param map MapLibre map instance
@@ -1,17 +1,17 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  import { mat4 as Mat4 } from 'gl-matrix';
12
12
  import { Map as MapLibreMap } from 'maplibre-gl';
13
- import { SpriteLocation } from './types';
14
- import { ClipContext, ProjectionHost } from './internalTypes';
13
+ import { SpriteLocation } from '../types';
14
+ import { ClipContext, ProjectionHost } from '../internalTypes';
15
15
  /**
16
16
  * Required projection parameters. These correspond to the MapLibre transform state.
17
17
  */
@@ -43,6 +43,7 @@ export interface PreparedProjectionState {
43
43
  readonly pixelPerMeter: number;
44
44
  readonly cameraToCenterDistance: number;
45
45
  readonly clipContext: ClipContext | null;
46
+ readonly cameraLocation: SpriteLocation | null;
46
47
  }
47
48
  export declare const prepareProjectionState: (params: ProjectionHostParams) => PreparedProjectionState;
48
49
  /**
@@ -1,15 +1,16 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { SpriteLayerCalculationVariant, SpriteLayerHostOptions } from './types';
11
+ import { SpriteLayerCalculationVariant, SpriteLayerHostOptions } from '../types';
12
12
  export declare const isSpriteLayerHostEnabled: () => boolean;
13
+ export declare const reportWasmRuntimeFailure: (reason?: unknown) => void;
13
14
  /**
14
15
  * Initialize maplibre-gl-layers runtime host.
15
16
  * @param variantOrOptions Options.
@@ -1,26 +1,24 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { ClipContext, ImageHandleBufferController, IdHandler, InternalSpriteCurrentState, InternalSpriteImageState, PreparedDrawSpriteImageParams, PrepareDrawSpriteImageParams, Releaseable, RegisteredImage, RenderCalculationHost, SpriteOriginReference } from './internalTypes';
12
- import { SurfaceCorner } from './math';
13
- import { SpriteLocation, SpriteScreenPoint } from './types';
11
+ import { DistanceInterpolationEvaluationResult, DegreeInterpolationEvaluationResult, ImageHandleBufferController, IdHandler, InternalSpriteCurrentState, InternalSpriteImageState, PreparedDrawSpriteImageParams, PrepareDrawSpriteImageParams, Releasable, RegisteredImage, RenderCalculationHost, RenderInterpolationParams, RenderInterpolationResult, SpriteOriginReference, SpriteInterpolationEvaluationResult } from '../internalTypes';
12
+ import { SurfaceCorner } from '../utils/math';
13
+ import { SpriteLocation } from '../types';
14
14
  import { BufferHolder, WasmHost } from './wasmHost';
15
+ import { ProcessInterpolationPresetRequests } from './calculationHost';
15
16
  import { PreparedProjectionState, ProjectionHostParams } from './projectionHost';
16
- export declare const createWasmProjectLngLatToClipSpace: () => {
17
- (clipContext: Readonly<ClipContext> | null, location: Readonly<SpriteLocation>): number[] | null;
18
- release(): void;
19
- };
20
- export declare const createWasmCalculateBillboardDepthKey: (preparedState: PreparedProjectionState) => {
21
- (_center: Readonly<SpriteScreenPoint>): number | null;
22
- release(): void;
23
- };
17
+ interface WasmProcessInterpolationResults {
18
+ readonly distance: DistanceInterpolationEvaluationResult[];
19
+ readonly degree: DegreeInterpolationEvaluationResult[];
20
+ readonly sprite: SpriteInterpolationEvaluationResult[];
21
+ }
24
22
  type CalculateSurfaceDepthKeyOptions = {
25
23
  readonly indices?: readonly number[];
26
24
  readonly bias?: {
@@ -32,7 +30,7 @@ export declare const createWasmCalculateSurfaceDepthKey: (preparedState: Prepare
32
30
  (baseLngLat: Readonly<SpriteLocation>, displacements: readonly SurfaceCorner[], options?: CalculateSurfaceDepthKeyOptions): number | null;
33
31
  release(): void;
34
32
  };
35
- interface PreparedInputBuffer extends Releaseable {
33
+ interface PreparedInputBuffer extends Releasable {
36
34
  readonly parameterHolder: BufferHolder<Float64Array>;
37
35
  readonly resultItemCount: number;
38
36
  }
@@ -64,5 +62,7 @@ export declare const __wasmCalculationTestInternals: {
64
62
  convertToWasmProjectionState: <TTag>(wasm: WasmHost, params: ProjectionHostParams, deps: WasmCalculationInteropDependencies<TTag>) => WritableWasmProjectionState<TTag>;
65
63
  converToPreparedDrawImageParams: <TTag>(state: WritableWasmProjectionState<TTag>, deps: WasmCalculationInteropDependencies<TTag>, resultBuffer: BufferHolder<Float64Array>) => PreparedDrawSpriteImageParams<TTag>[];
66
64
  prepareDrawSpriteImagesInternal: <TTag>(wasm: WasmHost, wasmState: WritableWasmProjectionState<TTag>, deps: WasmCalculationInteropDependencies<TTag>, params: PrepareDrawSpriteImageParams<TTag>) => PreparedDrawSpriteImageParams<TTag>[];
65
+ processInterpolationsViaWasm: (wasm: WasmHost, requests: ProcessInterpolationPresetRequests) => WasmProcessInterpolationResults;
66
+ processInterpolationsWithWasm: <TTag>(wasm: WasmHost, params: RenderInterpolationParams<TTag>) => RenderInterpolationResult;
67
67
  };
68
68
  export {};
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
- import { SpriteLayerCalculationVariant } from './types';
11
+ import { SpriteLayerCalculationVariant } from '../types';
12
12
  /**
13
13
  * `fromLngLat` function parameter
14
14
  */
@@ -29,6 +29,7 @@ export type WasmProjectLngLatToClipSpace = (lng: number, lat: number, altitude:
29
29
  export type WasmCalculateBillboardDepthKey = (centerX: number, centerY: number, worldSize: number, inverseMatrixPtr: number, mercatorMatrixPtr: number, outPtr: number) => boolean;
30
30
  export type WasmCalculateSurfaceDepthKey = (baseLng: number, baseLat: number, baseAltitude: number, displacementPtr: number, displacementCount: number, indexPtr: number, indexCount: number, mercatorMatrixPtr: number, applyBias: number, biasNdc: number, minClipZEpsilon: number, outPtr: number) => boolean;
31
31
  export type WasmPrepareDrawSpriteImages = (paramsPtr: number, resultPtr: number) => boolean;
32
+ export type WasmProcessInterpolations = (paramsPtr: number, resultPtr: number) => boolean;
32
33
  /**
33
34
  * Wasm raw pointer type.
34
35
  */
@@ -101,7 +102,8 @@ export interface WasmHost {
101
102
  readonly projectLngLatToClipSpace: WasmProjectLngLatToClipSpace;
102
103
  readonly calculateBillboardDepthKey: WasmCalculateBillboardDepthKey;
103
104
  readonly calculateSurfaceDepthKey: WasmCalculateSurfaceDepthKey;
104
- readonly prepareDrawSpriteImages?: WasmPrepareDrawSpriteImages;
105
+ readonly prepareDrawSpriteImages: WasmPrepareDrawSpriteImages;
106
+ readonly processInterpolations: WasmProcessInterpolations;
105
107
  }
106
108
  export type WasmVariant = SpriteLayerCalculationVariant;
107
109
  /**
@@ -119,7 +121,7 @@ export interface InitializeWasmHostOptions {
119
121
  * @param options Options.
120
122
  * @returns Initialized WasmHost.
121
123
  */
122
- export declare const initializeWasmHost: (preferredVariant: WasmVariant, options: InitializeWasmHostOptions | undefined) => Promise<WasmVariant>;
124
+ export declare const initializeWasmHost: (preferredVariant?: WasmVariant, options?: InitializeWasmHostOptions) => Promise<WasmVariant>;
123
125
  /**
124
126
  * Release wasm offload module.
125
127
  */
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.14.0
3
+ * version: 0.15.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: a531802b05777e1f54a8828a247254293df1415d
8
+ * git.commit.hash: d850b7e9c713f54f0630248dc4ea370721b6965b
9
9
  */
10
10
 
11
11
  import { ProjectionHostParams } from './projectionHost';
12
- import { ProjectionHost } from './internalTypes';
12
+ import { ProjectionHost } from '../internalTypes';
13
13
  /**
14
14
  * Create wasm-based calculation projection host.
15
15
  * @param params Projection parameters