maplibre-gl-layers 0.4.0 → 0.6.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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
9
9
  */
10
10
 
11
11
  import { EasingFunction, SpriteInterpolationMode, SpriteInterpolationOptions, SpriteLocation } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
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.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
9
9
  */
10
10
 
11
11
  import { SpriteAnchor, SpriteImageOffset, SpriteLocation, SpriteScalingOptions } from './types';
@@ -96,11 +96,12 @@ export declare const calculateDistanceAndBearingMeters: (from: SpriteLocation, t
96
96
  * @param {number} effectivePixelsPerMeter - Conversion between world meters and screen pixels.
97
97
  * @param {number} spriteMinPixel - Lower pixel clamp for the sprite's largest side.
98
98
  * @param {number} spriteMaxPixel - Upper pixel clamp for the sprite's largest side.
99
- * @returns {{ width: number; height: number }} Pixel dimensions after scaling and clamping.
99
+ * @returns {{ width: number; height: number; scaleAdjustment: number }} Pixel dimensions alongside the scale factor applied during clamping.
100
100
  */
101
101
  export declare const calculateBillboardPixelDimensions: (imageWidth: number | undefined, imageHeight: number | undefined, baseMetersPerPixel: number, imageScale: number, zoomScaleFactor: number, effectivePixelsPerMeter: number, spriteMinPixel: number, spriteMaxPixel: number) => {
102
102
  width: number;
103
103
  height: number;
104
+ scaleAdjustment: number;
104
105
  };
105
106
  /**
106
107
  * Computes the billboard offset in screen-space pixels.
@@ -108,9 +109,10 @@ export declare const calculateBillboardPixelDimensions: (imageWidth: number | un
108
109
  * @param {number} imageScale - User-provided scale multiplier applied to the offset distance.
109
110
  * @param {number} zoomScaleFactor - Zoom-dependent scale multiplier.
110
111
  * @param {number} effectivePixelsPerMeter - Conversion factor from meters to pixels.
112
+ * @param {number} [sizeScaleAdjustment=1] - Additional scale factor applied when sprite size is clamped.
111
113
  * @returns {{ x: number; y: number }} Screen-space offset relative to the billboard center.
112
114
  */
113
- export declare const calculateBillboardOffsetPixels: (offset: SpriteImageOffset | undefined, imageScale: number, zoomScaleFactor: number, effectivePixelsPerMeter: number) => {
115
+ export declare const calculateBillboardOffsetPixels: (offset: SpriteImageOffset | undefined, imageScale: number, zoomScaleFactor: number, effectivePixelsPerMeter: number, sizeScaleAdjustment?: number) => {
114
116
  x: number;
115
117
  y: number;
116
118
  };
@@ -133,7 +135,7 @@ export declare const calculateBillboardAnchorShiftPixels: (halfWidth: number, ha
133
135
  * @param {number} baseMetersPerPixel - World meters represented by a pixel at the current zoom.
134
136
  * @param {number} imageScale - User-provided scale multiplier.
135
137
  * @param {number} zoomScaleFactor - Zoom-dependent scale multiplier.
136
- * @returns {{ width: number; height: number }} Dimensions expressed as world-space meters.
138
+ * @returns {{ width: number; height: number; scaleAdjustment: number }} World dimensions in meters and the applied clamp scale factor.
137
139
  */
138
140
  export declare const calculateSurfaceWorldDimensions: (imageWidth: number | undefined, imageHeight: number | undefined, baseMetersPerPixel: number, imageScale: number, zoomScaleFactor: number, options?: {
139
141
  effectivePixelsPerMeter?: number;
@@ -142,6 +144,7 @@ export declare const calculateSurfaceWorldDimensions: (imageWidth: number | unde
142
144
  }) => {
143
145
  width: number;
144
146
  height: number;
147
+ scaleAdjustment: number;
145
148
  };
146
149
  /**
147
150
  * Computes east/north shifts from anchor rotation on surface images.
@@ -160,9 +163,10 @@ export declare const calculateSurfaceAnchorShiftMeters: (halfWidthMeters: number
160
163
  * @param {SpriteImageOffset | undefined} offset - Offset configuration for the surface sprite.
161
164
  * @param {number} imageScale - User-provided scale multiplier applied to the offset distance.
162
165
  * @param {number} zoomScaleFactor - Zoom-dependent scale multiplier.
166
+ * @param {number} [sizeScaleAdjustment=1] - Additional scale factor applied when sprite size is clamped.
163
167
  * @returns {{ east: number; north: number }} Offset vector in meters.
164
168
  */
165
- export declare const calculateSurfaceOffsetMeters: (offset: SpriteImageOffset | undefined, imageScale: number, zoomScaleFactor: number) => {
169
+ export declare const calculateSurfaceOffsetMeters: (offset: SpriteImageOffset | undefined, imageScale: number, zoomScaleFactor: number, sizeScaleAdjustment?: number) => {
166
170
  east: number;
167
171
  north: number;
168
172
  };
@@ -435,7 +439,7 @@ export type SurfaceCenterParams = {
435
439
  * Output describing the resolved surface center and displacement details.
436
440
  * @typedef SurfaceCenterResult
437
441
  * @property {{ x: number; y: number } | null} center - Projected screen coordinates or `null` when projection fails.
438
- * @property {{ width: number; height: number }} worldDimensions - Sprite dimensions in world meters.
442
+ * @property {{ width: number; height: number; scaleAdjustment: number }} worldDimensions - Sprite dimensions in world meters.
439
443
  * @property {{ east: number; north: number }} totalDisplacement - Combined anchor and offset displacement in meters.
440
444
  * @property {SpriteLocation} displacedLngLat - Geographic coordinates after applying displacement.
441
445
  * @property {{ x: number; y: number } | null | undefined} [anchorlessCenter] - Anchorless screen coordinates when requested.
@@ -450,6 +454,7 @@ export type SurfaceCenterResult = {
450
454
  worldDimensions: {
451
455
  width: number;
452
456
  height: number;
457
+ scaleAdjustment: number;
453
458
  };
454
459
  totalDisplacement: {
455
460
  east: number;
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
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.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
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.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
9
9
  */
10
10
 
11
11
  import { CustomLayerInterface } from 'maplibre-gl';
@@ -481,17 +481,50 @@ export declare const UNLIMITED_SPRITE_SCALING_OPTIONS: SpriteScalingOptions;
481
481
  * metersPerPixel is 1.
482
482
  */
483
483
  export declare const STANDARD_SPRITE_SCALING_OPTIONS: SpriteScalingOptions;
484
+ /**
485
+ * Allowed minification filters for sprite textures.
486
+ */
487
+ export type SpriteTextureMinFilter = 'nearest' | 'linear' | 'nearest-mipmap-nearest' | 'nearest-mipmap-linear' | 'linear-mipmap-nearest' | 'linear-mipmap-linear';
488
+ /**
489
+ * Allowed magnification filters for sprite textures.
490
+ */
491
+ export type SpriteTextureMagFilter = 'nearest' | 'linear';
492
+ /**
493
+ * Texture filtering configuration.
494
+ *
495
+ * @property {SpriteTextureMinFilter | undefined} minFilter - Minification filter to apply (defaults to `linear`).
496
+ * @property {SpriteTextureMagFilter | undefined} magFilter - Magnification filter to apply (defaults to `linear`).
497
+ * @property {boolean | undefined} generateMipmaps - Generates mipmaps during upload when true (defaults to `false`).
498
+ * @property {number | undefined} maxAnisotropy - Desired anisotropy factor (>= 1) when EXT_texture_filter_anisotropic is available.
499
+ */
500
+ export interface SpriteTextureFilteringOptions {
501
+ minFilter?: SpriteTextureMinFilter;
502
+ magFilter?: SpriteTextureMagFilter;
503
+ generateMipmaps?: boolean;
504
+ maxAnisotropy?: number;
505
+ }
506
+ /**
507
+ * Defaulted text filtering options.
508
+ */
509
+ export declare const DEFAULT_TEXTURE_FILTERING_OPTIONS: SpriteTextureFilteringOptions;
510
+ /**
511
+ * Better text filtering options than default options.
512
+ */
513
+ export declare const BETTER_TEXTURE_FILTERING_OPTIONS: SpriteTextureFilteringOptions;
484
514
  /**
485
515
  * Options accepted when creating a SpriteLayer.
486
516
  *
487
517
  * @property {string | undefined} id - Optional layer identifier supplied to MapLibre.
488
518
  * @property {SpriteScalingOptions | undefined} spriteScaling - Optional scaling controls. Default is UNLIMITED_SPRITE_SCALING_OPTIONS.
519
+ * @property {SpriteTextureFilteringOptions | undefined} textureFiltering - Optional texture filtering overrides.
489
520
  */
490
521
  export interface SpriteLayerOptions {
491
522
  /** Optional layer identifier supplied to MapLibre. */
492
523
  id?: string;
493
524
  /** Optional scaling controls. */
494
525
  spriteScaling?: SpriteScalingOptions;
526
+ /** Optional texture filtering configuration. */
527
+ textureFiltering?: SpriteTextureFilteringOptions;
495
528
  }
496
529
  /** Horizontal alignment options for text glyphs. */
497
530
  export type SpriteTextGlyphHorizontalAlign = 'left' | 'center' | 'right';
package/dist/utils.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.4.0
3
+ * version: 0.6.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: 366a9e1190bfe770b4002a06284ff627188b5c76
8
+ * git.commit.hash: 481f544de02fd3e71a2ba6c28bbb7eeb98b49eff
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"
4
+ "0.6.0"
5
5
  ],
6
6
  "branches": [
7
7
  "main"
8
8
  ],
9
- "version": "0.4.0",
9
+ "version": "0.6.0",
10
10
  "commit": {
11
- "hash": "366a9e1190bfe770b4002a06284ff627188b5c76",
12
- "shortHash": "366a9e1",
13
- "date": "2025-10-29T22:23:19+09:00Z",
11
+ "hash": "481f544de02fd3e71a2ba6c28bbb7eeb98b49eff",
12
+ "shortHash": "481f544",
13
+ "date": "2025-10-30T14:50:01+09:00Z",
14
14
  "message": "Merge branch 'develop'"
15
15
  }
16
16
  },
17
- "version": "0.4.0",
17
+ "version": "0.6.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",