maplibre-gl-layers 0.15.0 → 0.16.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 (38) hide show
  1. package/dist/SpriteLayer.d.ts +4 -3
  2. package/dist/config.d.ts +2 -2
  3. package/dist/const.d.ts +6 -2
  4. package/dist/default.d.ts +2 -2
  5. package/dist/gl/atlas.d.ts +2 -2
  6. package/dist/gl/hitTest.d.ts +5 -5
  7. package/dist/gl/shader.d.ts +40 -26
  8. package/dist/gl/text.d.ts +2 -2
  9. package/dist/host/calculationHost.d.ts +3 -3
  10. package/dist/host/mapLibreProjectionHost.d.ts +2 -2
  11. package/dist/host/projectionHost.d.ts +8 -7
  12. package/dist/host/runtime.d.ts +2 -2
  13. package/dist/host/wasmCalculationHost.d.ts +6 -2
  14. package/dist/host/wasmHost.d.ts +2 -2
  15. package/dist/host/wasmProjectionHost.d.ts +2 -2
  16. package/dist/index.cjs +1849 -987
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.mjs +1849 -987
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/internalTypes.d.ts +38 -23
  22. package/dist/interpolation/degreeInterpolation.d.ts +2 -2
  23. package/dist/interpolation/distanceInterpolation.d.ts +2 -2
  24. package/dist/interpolation/easing.d.ts +7 -7
  25. package/dist/interpolation/interpolation.d.ts +2 -2
  26. package/dist/interpolation/interpolationChannels.d.ts +2 -2
  27. package/dist/interpolation/rotationInterpolation.d.ts +2 -2
  28. package/dist/types.d.ts +112 -23
  29. package/dist/utils/color.d.ts +25 -0
  30. package/dist/utils/image.d.ts +2 -2
  31. package/dist/utils/looseQuadTree.d.ts +2 -2
  32. package/dist/utils/math.d.ts +15 -14
  33. package/dist/utils/utils.d.ts +2 -2
  34. package/dist/wasm/config.json.d.ts +2 -2
  35. package/dist/wasm/offloads-nosimd.wasm +0 -0
  36. package/dist/wasm/offloads-simd-mt.wasm +0 -0
  37. package/dist/wasm/offloads-simd.wasm +0 -0
  38. package/package.json +6 -6
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.16.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: 8d2149a6811cac25ed9d8c1d97acde73e1a38e25
9
9
  */
10
10
 
11
11
  import { SpriteAnchor, SpriteImageOffset, SpriteLocation, SpritePoint, SpriteScalingOptions, SpriteScreenPoint } from '../types';
@@ -203,25 +203,25 @@ export declare const calculateEffectivePixelsPerMeter: (metersPerPixelAtLatitude
203
203
  * Projects a geographic coordinate and elevation into homogeneous clip space.
204
204
  * @typedef ProjectToClipSpaceFn
205
205
  * @param {number} location - Location in degrees.
206
- * @returns {[number, number, number, number] | null} Homogeneous clip coordinates or `null` when outside the view.
206
+ * @returns {[number, number, number, number] | undefined} Homogeneous clip coordinates or `undefined` when outside the view.
207
207
  */
208
- export type ProjectToClipSpaceFn = (location: Readonly<SpriteLocation>) => [number, number, number, number] | null;
208
+ export type ProjectToClipSpaceFn = (location: Readonly<SpriteLocation>) => [number, number, number, number] | undefined;
209
209
  /**
210
210
  * Unprojects a screen-space point back to longitude/latitude.
211
211
  * @typedef UnprojectPointFn
212
212
  * @param {SpriteScreenPoint} point - Screen-space coordinates in pixels.
213
- * @returns {SpriteLocation | null} Geographic location or `null` when unprojection fails.
213
+ * @returns {SpriteLocation | undefined} Geographic location or `undefined` when unprojection fails.
214
214
  */
215
- export type UnprojectPointFn = (point: Readonly<SpriteScreenPoint>) => SpriteLocation | null;
215
+ export type UnprojectPointFn = (point: Readonly<SpriteScreenPoint>) => SpriteLocation | undefined;
216
216
  /**
217
217
  * Resolves a depth key for billboards by sampling the clip-space Z at the sprite center.
218
218
  * @param {SpriteScreenPoint} center - Screen-space center of the billboard in pixels.
219
219
  * @param {SpriteLocation} spriteLocation - Geographic location including optional altitude.
220
220
  * @param {UnprojectPointFn} unproject - Function for converting screen coordinates to geographic coordinates.
221
221
  * @param {ProjectToClipSpaceFn} projectToClipSpace - Function that projects a geographic coordinate to clip space.
222
- * @returns {number | null} Negative normalized device coordinate Z used for depth sorting, or `null` when unavailable.
222
+ * @returns {number | undefined} Negative normalized device coordinate Z used for depth sorting, or `undefined` when unavailable.
223
223
  */
224
- export declare const calculateBillboardDepthKey: (center: Readonly<SpriteScreenPoint>, unproject: UnprojectPointFn, projectToClipSpace: ProjectToClipSpaceFn) => number | null;
224
+ export declare const calculateBillboardDepthKey: (center: Readonly<SpriteScreenPoint>, unproject: UnprojectPointFn, projectToClipSpace: ProjectToClipSpaceFn) => number | undefined;
225
225
  /**
226
226
  * Signature for surface depth bias callbacks that tweak clip-space Z/W.
227
227
  * @typedef SurfaceDepthBiasFn
@@ -242,19 +242,19 @@ export type SurfaceDepthBiasFn = (params: {
242
242
  * @param {readonly SurfaceCorner[]} displacements - Corner offsets in meters from the center.
243
243
  * @param {ProjectToClipSpaceFn} projectToClipSpace - Projection function used to reach clip space.
244
244
  * @param {{ readonly indices?: readonly number[]; readonly biasFn?: SurfaceDepthBiasFn }} [options] - Optional overrides.
245
- * @returns {number | null} Depth key suitable for sorting, or `null` when any corner cannot be projected.
245
+ * @returns {number | undefined} Depth key suitable for sorting, or `undefined` when any corner cannot be projected.
246
246
  */
247
247
  export declare const calculateSurfaceDepthKey: (baseLngLat: Readonly<SpriteLocation>, displacements: readonly SurfaceCorner[], projectToClipSpace: ProjectToClipSpaceFn, options?: {
248
248
  readonly indices?: readonly number[];
249
249
  readonly biasFn?: SurfaceDepthBiasFn;
250
- }) => number | null;
250
+ }) => number | undefined;
251
251
  /**
252
252
  * Projects a longitude/latitude pair to screen-space pixels.
253
253
  * @typedef ProjectLngLatFn
254
254
  * @param {SpriteLocation} lngLat - Geographic coordinate to project.
255
- * @returns {SpriteScreenPoint | null} Screen coordinates or `null` when projection fails.
255
+ * @returns {SpriteScreenPoint | undefined} Screen coordinates or `undefined` when projection fails.
256
256
  */
257
- export type ProjectLngLatFn = (lngLat: Readonly<SpriteLocation>) => SpriteScreenPoint | null;
257
+ export type ProjectLngLatFn = (lngLat: Readonly<SpriteLocation>) => SpriteScreenPoint | undefined;
258
258
  /**
259
259
  * Parameters required to resolve a billboard center position.
260
260
  * @typedef BillboardCenterParams
@@ -304,6 +304,7 @@ export interface BillboardCenterResult {
304
304
  pixelHeight: number;
305
305
  anchorShift: SpritePoint;
306
306
  offsetShift: SpritePoint;
307
+ scaleAdjustment: number;
307
308
  }
308
309
  /**
309
310
  * Calculates the final billboard center position, applying scaling, anchor, and offset adjustments.
@@ -398,7 +399,7 @@ export interface SurfaceCenterParams {
398
399
  /**
399
400
  * Output describing the resolved surface center and displacement details.
400
401
  * @typedef SurfaceCenterResult
401
- * @property {SpriteScreenPoint | null} center - Projected screen coordinates or `null` when projection fails.
402
+ * @property {SpriteScreenPoint | undefined} center - Projected screen coordinates or `undefined` when projection fails.
402
403
  * @property {{ width: number; height: number; scaleAdjustment: number }} worldDimensions - Sprite dimensions in world meters.
403
404
  * @property {SurfaceCorner} totalDisplacement - Combined anchor and offset displacement in meters.
404
405
  * @property {SpriteLocation} displacedLngLat - Geographic coordinates after applying displacement.
@@ -407,7 +408,7 @@ export interface SurfaceCenterParams {
407
408
  * @property {SpriteLocation | undefined} [anchorlessLngLat] - Anchorless geographic coordinate when requested.
408
409
  */
409
410
  export interface SurfaceCenterResult {
410
- center: Readonly<SpriteScreenPoint> | null;
411
+ center: Readonly<SpriteScreenPoint> | undefined;
411
412
  worldDimensions: Readonly<{
412
413
  width: number;
413
414
  height: number;
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.16.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: 8d2149a6811cac25ed9d8c1d97acde73e1a38e25
9
9
  */
10
10
 
11
11
  import { ImageHandleBufferController, IdHandler, RenderTargetBucketBuffers, RenderTargetEntryLike, SpriteOriginReference } from '../internalTypes';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.15.0
3
+ * version: 0.16.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: 8d2149a6811cac25ed9d8c1d97acde73e1a38e25
9
9
  */
10
10
 
11
11
  declare const _default: {
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "git": {
3
3
  "tags": [
4
- "0.15.0"
4
+ "0.16.0"
5
5
  ],
6
6
  "branches": [
7
7
  "main"
8
8
  ],
9
- "version": "0.15.0",
9
+ "version": "0.16.0",
10
10
  "commit": {
11
- "hash": "d850b7e9c713f54f0630248dc4ea370721b6965b",
12
- "shortHash": "d850b7e",
13
- "date": "2025-11-15T21:29:11+09:00Z",
11
+ "hash": "8d2149a6811cac25ed9d8c1d97acde73e1a38e25",
12
+ "shortHash": "8d2149a",
13
+ "date": "2025-11-18T18:12:19+09:00Z",
14
14
  "message": "Merge branch 'develop'"
15
15
  }
16
16
  },
17
- "version": "0.15.0",
17
+ "version": "0.16.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",