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/README.md CHANGED
@@ -83,8 +83,8 @@ In addition to images, you can render text alongside sprites and animate them to
83
83
  - Add multiple images and text to the same sprite, adjusting rotation, offset, scale, opacity, and more.
84
84
  - Animate sprite movement, rotation, and offsets with interpolation controls.
85
85
  - Control draw order via sub-layers and per-sprite ordering.
86
- - Bulk update API for many sprite states.
87
- - No package dependencies except MapLibre.
86
+ - Fully imperative APIs. Updates with high-performance and extensible.
87
+ - Accelerating computational processing with WASM and shaders.
88
88
 
89
89
  ### Requirements
90
90
 
@@ -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 { SpriteLayerInterface, SpriteLayerOptions, SpriteLocation, SpriteImageDefinitionInit } from './types';
@@ -17,16 +17,17 @@ import { InternalSpriteImageState, InternalSpriteCurrentState, SpriteOriginRefer
17
17
  * @param {SpriteLocation} nextLocation - Destination location used to derive bearing and distance.
18
18
  * @returns {boolean} `true` when auto-rotation was applied, `false` otherwise.
19
19
  */
20
- export declare const applyAutoRotation: <T>(sprite: InternalSpriteCurrentState<T>, nextLocation: SpriteLocation) => boolean;
20
+ export declare const applyAutoRotation: <T>(sprite: InternalSpriteCurrentState<T>, nextLocation: SpriteLocation, forceAutoRotation: boolean) => boolean;
21
21
  /**
22
22
  * Creates internal sprite image state from initialization data and layer bookkeeping fields.
23
23
  * @param {SpriteImageDefinitionInit} imageInit - Caller-provided image definition.
24
24
  * @param {number} subLayer - Sub-layer index the image belongs to.
25
25
  * @param {number} order - Ordering slot within the sub-layer.
26
26
  * @param {SpriteOriginReference} originReference - Encode/Decode origin reference.
27
+ * @param {boolean} invalidated - Initially invalidate state.
27
28
  * @returns {InternalSpriteImageState} Normalized internal state ready for rendering.
28
29
  */
29
- export declare const createImageStateFromInit: (imageInit: SpriteImageDefinitionInit, subLayer: number, order: number, originReference: SpriteOriginReference) => InternalSpriteImageState;
30
+ export declare const createImageStateFromInit: (imageInit: SpriteImageDefinitionInit, subLayer: number, order: number, originReference: SpriteOriginReference, invalidated: boolean) => InternalSpriteImageState;
30
31
  /**
31
32
  * Factory that creates the MapLibre layer interface for the sprite layer.
32
33
  * Implements the CustomLayerInterface lifecycle (init -> render -> dispose), packing thousands
package/dist/config.d.ts CHANGED
@@ -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
  /** Debug flag */
package/dist/const.d.ts CHANGED
@@ -1,15 +1,16 @@
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 { Rect } from './utils/looseQuadTree';
12
12
  import { SpriteAnchor, SpriteImageOffset, SpriteTextGlyphHorizontalAlign } from './types';
13
+ import { RgbaColor } from './internalTypes';
13
14
  /** Default sprite anchor centered at the image origin. */
14
15
  export declare const DEFAULT_ANCHOR: Readonly<SpriteAnchor>;
15
16
  /** Default image offset applied when none is provided. */
@@ -21,6 +22,10 @@ export declare const DEFAULT_TEXT_GLYPH_COLOR = "#000000";
21
22
  export declare const DEFAULT_TEXT_GLYPH_ALIGN: SpriteTextGlyphHorizontalAlign;
22
23
  export declare const DEFAULT_TEXT_GLYPH_FONT_SIZE = 32;
23
24
  export declare const DEFAULT_TEXT_GLYPH_RENDER_PIXEL_RATIO = 1;
25
+ /** Default threshold in meters for auto-rotation to treat movement as significant. */
26
+ export declare const DEFAULT_AUTO_ROTATION_MIN_DISTANCE_METERS = 20;
27
+ /** Default border width in meters for sprite image outlines. */
28
+ export declare const DEFAULT_BORDER_WIDTH_METERS = 1;
24
29
  /**
25
30
  * WGS84-compatible Earth radius in meters.
26
31
  * Used to convert one radian of longitude into meters when scaling sprites.
@@ -65,3 +70,26 @@ export declare const TRIANGLE_INDICES: readonly [0, 1, 2, 2, 1, 3];
65
70
  * @constant
66
71
  */
67
72
  export declare const UV_CORNERS: ReadonlyArray<readonly [number, number]>;
73
+ declare const __CSS_KEYWORD_COLORS: {
74
+ black: RgbaColor;
75
+ silver: RgbaColor;
76
+ gray: RgbaColor;
77
+ white: RgbaColor;
78
+ maroon: RgbaColor;
79
+ red: RgbaColor;
80
+ purple: RgbaColor;
81
+ fuchsia: RgbaColor;
82
+ green: RgbaColor;
83
+ lime: RgbaColor;
84
+ olive: RgbaColor;
85
+ yellow: RgbaColor;
86
+ navy: RgbaColor;
87
+ blue: RgbaColor;
88
+ teal: RgbaColor;
89
+ aqua: RgbaColor;
90
+ transparent: RgbaColor;
91
+ };
92
+ export declare const CSS_KEYWORD_COLORS: typeof __CSS_KEYWORD_COLORS & Record<string, RgbaColor>;
93
+ export declare const DEFAULT_BORDER_COLOR = "red";
94
+ export declare const DEFAULT_BORDER_COLOR_RGBA: RgbaColor;
95
+ export {};
package/dist/default.d.ts CHANGED
@@ -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 { SpriteScalingOptions, SpriteTextureFilteringOptions } 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
  import { Deferred } from 'async-primitives';
@@ -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 { Map as MapLibreMap } from 'maplibre-gl';
@@ -27,7 +27,7 @@ export interface HitTestEntry<T> {
27
27
  readonly maxY: number;
28
28
  }
29
29
  export interface HitTestResult<T> {
30
- readonly hitEntry: HitTestEntry<T> | null;
30
+ readonly hitEntry: HitTestEntry<T> | undefined;
31
31
  readonly screenPoint: SpriteScreenPoint;
32
32
  }
33
33
  export interface HitTestControllerParams {
@@ -46,8 +46,8 @@ export interface HitTestController<T> {
46
46
  ], drawIndex: number) => void;
47
47
  readonly removeImageBounds: (image: InternalSpriteImageState) => void;
48
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;
49
+ readonly findTopmostHitEntry: (point: SpriteScreenPoint, map: MapLibreMap | undefined) => HitTestEntry<T> | undefined;
50
+ readonly resolveHitTestResult: (nativeEvent: MouseEvent | PointerEvent | TouchEvent, canvasElement: HTMLCanvasElement | undefined, map: MapLibreMap | undefined) => HitTestResult<T> | undefined;
51
51
  readonly setHitTestEnabled: (enabled: boolean) => boolean;
52
52
  readonly isHitTestEnabled: () => boolean;
53
53
  }
@@ -1,15 +1,16 @@
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
- import { SpriteAnchor, SpriteScreenPoint } from '../types';
12
- import { PreparedDrawSpriteImageParams, Releasable } from '../internalTypes';
11
+ import { SpriteAnchor, SpriteScreenPoint, SpriteTextureFilteringOptions } from '../types';
12
+ import { ImageHandleBufferController, PreparedDrawSpriteImageParams, RegisteredImage, Releasable, ResolvedTextureFilteringOptions, RgbaColor } from '../internalTypes';
13
+ import { AtlasManager, AtlasOperationQueue, AtlasPageState } from './atlas';
13
14
  /** Number of components per vertex (clipPosition.xyzw + uv.xy). */
14
15
  export declare const VERTEX_COMPONENT_COUNT = 6;
15
16
  /** Component count for clip-space position attributes. */
@@ -24,30 +25,12 @@ export declare const VERTEX_STRIDE: number;
24
25
  export declare const UV_OFFSET: number;
25
26
  /** Vertex count required to draw one sprite as two triangles. */
26
27
  export declare const QUAD_VERTEX_COUNT = 6;
27
- /** Shared vertex shader that converts screen-space vertices when requested. */
28
- export declare const VERTEX_SHADER_SOURCE: "\nattribute vec4 a_position;\nattribute vec2 a_uv;\nuniform vec2 u_screenToClipScale;\nuniform vec2 u_screenToClipOffset;\nuniform float u_billboardMode;\nuniform float u_surfaceMode;\nuniform vec2 u_billboardCenter;\nuniform vec2 u_billboardHalfSize;\nuniform vec2 u_billboardAnchor;\nuniform vec2 u_billboardSinCos;\nuniform float u_surfaceClipEnabled;\nuniform mat4 u_surfaceClipMatrix;\nuniform float u_surfaceDepthBias;\nvarying vec2 v_uv;\nvec2 computeBillboardCorner(vec2 baseCorner) {\n vec2 anchorShift = vec2(u_billboardAnchor.x * u_billboardHalfSize.x, u_billboardAnchor.y * u_billboardHalfSize.y);\n vec2 shifted = vec2(baseCorner.x * u_billboardHalfSize.x, baseCorner.y * u_billboardHalfSize.y) - anchorShift;\n float sinR = u_billboardSinCos.x;\n float cosR = u_billboardSinCos.y;\n vec2 rotated = vec2(\n shifted.x * cosR - shifted.y * sinR,\n shifted.x * sinR + shifted.y * cosR\n );\n return vec2(\n u_billboardCenter.x + rotated.x,\n u_billboardCenter.y - rotated.y\n );\n}\nvec4 computeSurfaceCorner(vec2 corner) {\n if (u_surfaceClipEnabled < 0.5) {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n vec4 clip = u_surfaceClipMatrix * vec4(1.0, corner.x, corner.y, 0.0);\n clip.z += u_surfaceDepthBias * clip.w;\n return clip;\n}\nvoid main() {\n v_uv = a_uv;\n vec4 position;\n if (u_billboardMode > 0.5) {\n vec2 screenPosition = computeBillboardCorner(a_position.xy);\n position = vec4(screenPosition, 0.0, 1.0);\n } else if (u_surfaceMode > 0.5) {\n vec2 baseCorner = vec2(a_position.x, a_position.y);\n position = computeSurfaceCorner(baseCorner);\n } else {\n position = a_position;\n }\n position.xy = position.xy * u_screenToClipScale + u_screenToClipOffset;\n gl_Position = position;\n}\n";
29
- /** Fragment shader that applies texture sampling and opacity. */
30
- export declare const FRAGMENT_SHADER_SOURCE: "\nprecision mediump float;\nuniform sampler2D u_texture;\nuniform float u_opacity;\nvarying vec2 v_uv;\nvoid main() {\n vec4 texel = texture2D(u_texture, v_uv);\n gl_FragColor = vec4(texel.rgb, texel.a) * u_opacity;\n}\n";
31
28
  /** Initial vertex data for a unit quad. */
32
29
  export declare const INITIAL_QUAD_VERTICES: Float32Array<ArrayBuffer>;
33
30
  /** Scratch buffer rewritten for each draw call. */
34
31
  export declare const QUAD_VERTEX_SCRATCH: Float32Array<ArrayBuffer>;
35
- /** Vertex shader for debug hit-test outline rendering using screen coordinates. */
36
- export declare const DEBUG_OUTLINE_VERTEX_SHADER_SOURCE: "\nattribute vec4 a_position;\nuniform vec2 u_screenToClipScale;\nuniform vec2 u_screenToClipOffset;\nvoid main() {\n vec4 position = a_position;\n position.xy = position.xy * u_screenToClipScale + u_screenToClipOffset;\n gl_Position = position;\n}\n";
37
- /** Fragment shader emitting a solid color for debug outlines. */
38
- export declare const DEBUG_OUTLINE_FRAGMENT_SHADER_SOURCE: "\nprecision mediump float;\nuniform vec4 u_color;\nvoid main() {\n gl_FragColor = u_color;\n}\n";
39
- /** Number of vertices required to outline a quad using LINE_LOOP. */
40
- export declare const DEBUG_OUTLINE_VERTEX_COUNT = 4;
41
- /** Components per debug outline vertex (clipPosition.xyzw). */
42
- export declare const DEBUG_OUTLINE_POSITION_COMPONENT_COUNT = 4;
43
- /** Stride in bytes for debug outline vertices. */
44
- export declare const DEBUG_OUTLINE_VERTEX_STRIDE: number;
45
- /** Scratch buffer reused when emitting debug outlines. */
46
- export declare const DEBUG_OUTLINE_VERTEX_SCRATCH: Float32Array<ArrayBuffer>;
47
- /** Solid red RGBA color used for debug outlines. */
48
- export declare const DEBUG_OUTLINE_COLOR: readonly [number, number, number, number];
49
32
  /** Corner traversal order used when outlining a quad without crossing diagonals. */
50
- export declare const DEBUG_OUTLINE_CORNER_ORDER: readonly [0, 1, 3, 2];
33
+ export declare const BORDER_OUTLINE_CORNER_ORDER: readonly [0, 1, 3, 2];
51
34
  /** Base corner definitions used when expanding billboards in shaders. */
52
35
  export declare const BILLBOARD_BASE_CORNERS: ReadonlyArray<readonly [number, number]>;
53
36
  /** Base corner definitions used when expanding surface quads in shaders. */
@@ -88,14 +71,44 @@ export interface SpriteDrawProgram<TTag> extends Releasable {
88
71
  draw(prepared: PreparedDrawSpriteImageParams<TTag>): boolean;
89
72
  }
90
73
  export declare const createSpriteDrawProgram: <TTag>(glContext: WebGLRenderingContext) => SpriteDrawProgram<TTag>;
91
- export interface DebugOutlineRenderer extends Releasable {
74
+ export interface BorderOutlineRenderer extends Releasable {
92
75
  begin(screenToClipScaleX: number, screenToClipScaleY: number, screenToClipOffsetX: number, screenToClipOffsetY: number): void;
93
76
  drawOutline(corners: readonly [
94
77
  SpriteScreenPoint,
95
78
  SpriteScreenPoint,
96
79
  SpriteScreenPoint,
97
80
  SpriteScreenPoint
98
- ]): void;
81
+ ], color: RgbaColor, lineWidth: number): void;
99
82
  end(): void;
100
83
  }
101
- export declare const createDebugOutlineRenderer: (glContext: WebGLRenderingContext) => DebugOutlineRenderer;
84
+ export declare const createBorderOutlineRenderer: (glContext: WebGLRenderingContext) => BorderOutlineRenderer;
85
+ export interface LeaderLineRenderer extends Releasable {
86
+ begin(screenToClipScaleX: number, screenToClipScaleY: number, screenToClipOffsetX: number, screenToClipOffsetY: number): void;
87
+ drawLine(from: Readonly<SpriteScreenPoint>, to: Readonly<SpriteScreenPoint>, color: RgbaColor, lineWidth: number): void;
88
+ end(): void;
89
+ }
90
+ export declare const createLeaderLineRenderer: (glContext: WebGLRenderingContext) => LeaderLineRenderer;
91
+ export declare const resolveTextureFilteringOptions: (options?: SpriteTextureFilteringOptions) => ResolvedTextureFilteringOptions;
92
+ export declare const resolveAnisotropyExtension: (glContext: WebGLRenderingContext) => EXT_texture_filter_anisotropic | undefined;
93
+ export interface EnsureTexturesParams {
94
+ readonly glContext: WebGLRenderingContext | undefined;
95
+ readonly atlasQueue: AtlasOperationQueue;
96
+ readonly atlasManager: AtlasManager;
97
+ readonly atlasPageTextures: Map<number, WebGLTexture>;
98
+ readonly atlasNeedsUpload: boolean;
99
+ readonly resolvedTextureFiltering: ResolvedTextureFilteringOptions;
100
+ readonly anisotropyExtension: EXT_texture_filter_anisotropic | undefined;
101
+ readonly maxSupportedAnisotropy: number;
102
+ readonly images: ReadonlyMap<string, RegisteredImage>;
103
+ readonly imageHandleBuffersController: ImageHandleBufferController;
104
+ readonly atlasPageIndexNone: number;
105
+ readonly shouldUploadAtlasPages: (pageStates?: readonly AtlasPageState[]) => boolean;
106
+ }
107
+ /**
108
+ * Creates or refreshes WebGL textures for registered images.
109
+ * Processes only queued entries to avoid unnecessary work.
110
+ * Intended to run just before drawing; returns immediately if the GL context is unavailable.
111
+ * Ensures registerImage calls outside the render loop sync on the next frame.
112
+ * @returns {boolean} Updated atlas upload requirement flag.
113
+ */
114
+ export declare const ensureTextures: ({ glContext, atlasQueue, atlasManager, atlasPageTextures, atlasNeedsUpload, resolvedTextureFiltering, anisotropyExtension, maxSupportedAnisotropy, images, imageHandleBuffersController, atlasPageIndexNone, shouldUploadAtlasPages, }: EnsureTexturesParams) => boolean;
package/dist/gl/text.d.ts CHANGED
@@ -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 { SpriteTextGlyphDimensions, SpriteTextGlyphOptions } 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
  import { Map as MapLibreMap } from 'maplibre-gl';
@@ -30,7 +30,7 @@ type ImageCenterCache = Map<string, Map<string, ImageCenterCacheEntry>>;
30
30
  * return `null` when the origin is not available (e.g., the reference was
31
31
  * culled or stored in another bucket).
32
32
  */
33
- type OriginImageResolver<T> = (sprite: Readonly<InternalSpriteCurrentState<T>>, image: Readonly<InternalSpriteImageState>) => InternalSpriteImageState | null;
33
+ type OriginImageResolver<T> = (sprite: Readonly<InternalSpriteCurrentState<T>>, image: Readonly<InternalSpriteImageState>) => InternalSpriteImageState | undefined;
34
34
  export declare const DEFAULT_RENDER_INTERPOLATION_RESULT: RenderInterpolationResult;
35
35
  interface DepthSortedItem<T> {
36
36
  readonly sprite: InternalSpriteCurrentState<T>;
@@ -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 { Map as MapLibreMap } from 'maplibre-gl';
@@ -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 { mat4 as Mat4 } from 'gl-matrix';
@@ -20,6 +20,7 @@ export interface ProjectionHostParams {
20
20
  readonly width: number;
21
21
  readonly height: number;
22
22
  readonly center: Readonly<SpriteLocation>;
23
+ readonly cameraLocation: SpriteLocation | undefined;
23
24
  readonly pitchDeg?: number;
24
25
  readonly bearingDeg?: number;
25
26
  readonly rollDeg?: number;
@@ -36,14 +37,14 @@ export interface ProjectionHostParams {
36
37
  }
37
38
  export interface PreparedProjectionState {
38
39
  readonly zoom: number;
39
- readonly mercatorMatrix: Mat4 | null;
40
- readonly pixelMatrix: Mat4 | null;
41
- readonly pixelMatrixInverse: Mat4 | null;
40
+ readonly mercatorMatrix: Mat4 | undefined;
41
+ readonly pixelMatrix: Mat4 | undefined;
42
+ readonly pixelMatrixInverse: Mat4 | undefined;
42
43
  readonly worldSize: number;
43
44
  readonly pixelPerMeter: number;
44
45
  readonly cameraToCenterDistance: number;
45
- readonly clipContext: ClipContext | null;
46
- readonly cameraLocation: SpriteLocation | null;
46
+ readonly clipContext: ClipContext | undefined;
47
+ readonly cameraLocation: SpriteLocation | undefined;
47
48
  }
48
49
  export declare const prepareProjectionState: (params: ProjectionHostParams) => PreparedProjectionState;
49
50
  /**
@@ -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 { SpriteLayerCalculationVariant, SpriteLayerHostOptions } 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
  import { DistanceInterpolationEvaluationResult, DegreeInterpolationEvaluationResult, ImageHandleBufferController, IdHandler, InternalSpriteCurrentState, InternalSpriteImageState, PreparedDrawSpriteImageParams, PrepareDrawSpriteImageParams, Releasable, RegisteredImage, RenderCalculationHost, RenderInterpolationParams, RenderInterpolationResult, SpriteOriginReference, SpriteInterpolationEvaluationResult } from '../internalTypes';
@@ -36,6 +36,10 @@ interface PreparedInputBuffer extends Releasable {
36
36
  }
37
37
  interface WritableWasmProjectionState<TTag> {
38
38
  readonly preparedProjection: PreparedProjectionState;
39
+ lastFrameParams?: {
40
+ baseMetersPerPixel: number;
41
+ zoomScaleFactor: number;
42
+ };
39
43
  readonly prepareInputBuffer: (params: PrepareDrawSpriteImageParams<TTag>) => PreparedInputBuffer;
40
44
  readonly getImageRefs: () => readonly InternalSpriteImageState[];
41
45
  readonly getResourceRefs: () => readonly (RegisteredImage | undefined)[];
@@ -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 { SpriteLayerCalculationVariant } from '../types';
@@ -121,7 +121,7 @@ export interface InitializeWasmHostOptions {
121
121
  * @param options Options.
122
122
  * @returns Initialized WasmHost.
123
123
  */
124
- export declare const initializeWasmHost: (preferredVariant?: WasmVariant, options?: InitializeWasmHostOptions) => Promise<WasmVariant>;
124
+ export declare const initializeWasmHost: (preferredVariant: WasmVariant, options: InitializeWasmHostOptions) => Promise<WasmVariant>;
125
125
  /**
126
126
  * Release wasm offload module.
127
127
  */
@@ -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 { ProjectionHostParams } from './projectionHost';