maplibre-gl-layers 0.1.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/README.md +1 -1
- package/dist/SpriteLayer.d.ts +15 -2
- package/dist/easing.d.ts +2 -2
- package/dist/index.cjs +411 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +411 -82
- 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 +40 -4
- package/dist/numericInterpolation.d.ts +2 -2
- package/dist/rotationInterpolation.d.ts +2 -2
- package/dist/types.d.ts +385 -25
- package/dist/utils.d.ts +2 -2
- package/package.json +7 -7
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';
|
|
@@ -185,6 +185,18 @@ export declare const applySurfaceDisplacement: (baseLng: number, baseLat: number
|
|
|
185
185
|
* @returns {[number, number]} Clip-space coordinates in the range [-1, 1].
|
|
186
186
|
*/
|
|
187
187
|
export declare const screenToClip: (x: number, y: number, drawingBufferWidth: number, drawingBufferHeight: number, pixelRatio: number) => [number, number];
|
|
188
|
+
/**
|
|
189
|
+
* Converts homogeneous clip coordinates back into screen-space pixels.
|
|
190
|
+
* @param {[number, number, number, number]} clipPosition - Homogeneous clip coordinates.
|
|
191
|
+
* @param {number} drawingBufferWidth - WebGL drawing buffer width in device pixels.
|
|
192
|
+
* @param {number} drawingBufferHeight - WebGL drawing buffer height in device pixels.
|
|
193
|
+
* @param {number} pixelRatio - Device pixel ratio relating CSS pixels to device pixels.
|
|
194
|
+
* @returns {{ x: number; y: number } | null} Screen-space coordinates or `null` when invalid.
|
|
195
|
+
*/
|
|
196
|
+
export declare const clipToScreen: (clipPosition: readonly [number, number, number, number], drawingBufferWidth: number, drawingBufferHeight: number, pixelRatio: number) => {
|
|
197
|
+
x: number;
|
|
198
|
+
y: number;
|
|
199
|
+
} | null;
|
|
188
200
|
/**
|
|
189
201
|
* Index order used to decompose a quad into two triangles.
|
|
190
202
|
* @constant
|
|
@@ -387,7 +399,13 @@ export declare const calculateBillboardCornerScreenPositions: (params: Billboard
|
|
|
387
399
|
* @property {number} totalRotateDeg - Rotation applied to the sprite in degrees.
|
|
388
400
|
* @property {SpriteAnchor} [anchor] - Anchor definition normalized between -1 and 1.
|
|
389
401
|
* @property {SpriteImageOffset} [offset] - Offset definition applied in meters/deg.
|
|
390
|
-
* @property {ProjectLngLatFn} project - Projection function mapping longitude/latitude to screen space.
|
|
402
|
+
* @property {ProjectLngLatFn} [project] - Projection function mapping longitude/latitude to screen space.
|
|
403
|
+
* @property {ProjectToClipSpaceFn} [projectToClipSpace] - Projection into clip space when available.
|
|
404
|
+
* @property {number} [drawingBufferWidth] - WebGL drawing buffer width in device pixels.
|
|
405
|
+
* @property {number} [drawingBufferHeight] - WebGL drawing buffer height in device pixels.
|
|
406
|
+
* @property {number} [pixelRatio] - Device pixel ratio relating CSS pixels to device pixels.
|
|
407
|
+
* @property {number} [altitudeMeters] - Altitude used when projecting points into clip space.
|
|
408
|
+
* @property {boolean} [resolveAnchorless] - When true, also computes the anchorless center.
|
|
391
409
|
*/
|
|
392
410
|
export type SurfaceCenterParams = {
|
|
393
411
|
baseLngLat: SpriteLocation;
|
|
@@ -399,7 +417,13 @@ export type SurfaceCenterParams = {
|
|
|
399
417
|
totalRotateDeg: number;
|
|
400
418
|
anchor?: SpriteAnchor;
|
|
401
419
|
offset?: SpriteImageOffset;
|
|
402
|
-
project
|
|
420
|
+
project?: ProjectLngLatFn;
|
|
421
|
+
projectToClipSpace?: ProjectToClipSpaceFn;
|
|
422
|
+
drawingBufferWidth?: number;
|
|
423
|
+
drawingBufferHeight?: number;
|
|
424
|
+
pixelRatio?: number;
|
|
425
|
+
altitudeMeters?: number;
|
|
426
|
+
resolveAnchorless?: boolean;
|
|
403
427
|
};
|
|
404
428
|
/**
|
|
405
429
|
* Output describing the resolved surface center and displacement details.
|
|
@@ -408,6 +432,9 @@ export type SurfaceCenterParams = {
|
|
|
408
432
|
* @property {{ width: number; height: number }} worldDimensions - Sprite dimensions in world meters.
|
|
409
433
|
* @property {{ east: number; north: number }} totalDisplacement - Combined anchor and offset displacement in meters.
|
|
410
434
|
* @property {SpriteLocation} displacedLngLat - Geographic coordinates after applying displacement.
|
|
435
|
+
* @property {{ x: number; y: number } | null | undefined} [anchorlessCenter] - Anchorless screen coordinates when requested.
|
|
436
|
+
* @property {{ east: number; north: number } | undefined} [anchorlessDisplacement] - Offset-only displacement when requested.
|
|
437
|
+
* @property {SpriteLocation | undefined} [anchorlessLngLat] - Anchorless geographic coordinate when requested.
|
|
411
438
|
*/
|
|
412
439
|
export type SurfaceCenterResult = {
|
|
413
440
|
center: {
|
|
@@ -423,6 +450,15 @@ export type SurfaceCenterResult = {
|
|
|
423
450
|
north: number;
|
|
424
451
|
};
|
|
425
452
|
displacedLngLat: SpriteLocation;
|
|
453
|
+
anchorlessCenter?: {
|
|
454
|
+
x: number;
|
|
455
|
+
y: number;
|
|
456
|
+
} | null;
|
|
457
|
+
anchorlessDisplacement?: {
|
|
458
|
+
east: number;
|
|
459
|
+
north: number;
|
|
460
|
+
};
|
|
461
|
+
anchorlessLngLat?: SpriteLocation;
|
|
426
462
|
};
|
|
427
463
|
/**
|
|
428
464
|
* Calculates the projected center of a surface sprite and derives related world-space displacements.
|
|
@@ -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';
|