maplibre-gl-layers 0.19.0 → 1.1.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/index.cjs +8646 -6335
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1353 -7
- package/dist/index.mjs +8645 -6334
- package/dist/index.mjs.map +1 -1
- package/dist/wasm/offloads-nosimd.wasm +0 -0
- package/dist/wasm/offloads-simd-mt.wasm +0 -0
- package/dist/wasm/offloads-simd.wasm +0 -0
- package/package.json +10 -9
- package/dist/SpriteLayer.d.ts +0 -41
- package/dist/config.d.ts +0 -26
- package/dist/const.d.ts +0 -98
- package/dist/default.d.ts +0 -29
- package/dist/gl/atlas.d.ts +0 -64
- package/dist/gl/hitTest.d.ts +0 -54
- package/dist/gl/mouseEvents.d.ts +0 -36
- package/dist/gl/shader.d.ts +0 -114
- package/dist/gl/text.d.ts +0 -17
- package/dist/gl/tracking.d.ts +0 -36
- package/dist/host/calculationHost.d.ts +0 -87
- package/dist/host/mapLibreProjectionHost.d.ts +0 -18
- package/dist/host/projectionHost.d.ts +0 -62
- package/dist/host/runtime.d.ts +0 -38
- package/dist/host/wasmCalculationHost.d.ts +0 -72
- package/dist/host/wasmHost.d.ts +0 -133
- package/dist/host/wasmProjectionHost.d.ts +0 -19
- package/dist/internalTypes.d.ts +0 -582
- package/dist/interpolation/degreeInterpolation.d.ts +0 -48
- package/dist/interpolation/distanceInterpolation.d.ts +0 -31
- package/dist/interpolation/easing.d.ts +0 -26
- package/dist/interpolation/interpolationChannels.d.ts +0 -59
- package/dist/interpolation/locationInterpolation.d.ts +0 -30
- package/dist/interpolation/rotationInterpolation.d.ts +0 -40
- package/dist/types.d.ts +0 -944
- package/dist/utils/color.d.ts +0 -20
- package/dist/utils/image.d.ts +0 -32
- package/dist/utils/looseQuadTree.d.ts +0 -34
- package/dist/utils/math.d.ts +0 -451
- package/dist/utils/utils.d.ts +0 -37
- package/dist/wasm/config.json.d.ts +0 -16
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Map as MapLibreMap } from 'maplibre-gl';
|
|
12
|
-
import { InternalSpriteCurrentState, InternalSpriteImageState, RegisteredImage, ProjectionHost, PreparedDrawSpriteImageParams, RenderCalculationHost, PrepareDrawSpriteImageParamsBefore, PrepareDrawSpriteImageParamsAfter, RenderInterpolationParams, RenderInterpolationResult, SpriteInterpolationEvaluationResult, SpriteInterpolationState } from '../internalTypes';
|
|
13
|
-
import { SpriteLocation, SpritePoint } from '../types';
|
|
14
|
-
import { ProjectionHostParams } from './projectionHost';
|
|
15
|
-
/**
|
|
16
|
-
* Cache entry storing anchor-adjusted and raw centers for a sprite image.
|
|
17
|
-
*/
|
|
18
|
-
interface ImageCenterCacheEntry {
|
|
19
|
-
readonly anchorApplied?: SpritePoint;
|
|
20
|
-
readonly anchorless?: SpritePoint;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Nested cache keyed by sprite ID and image key to avoid recomputing centers each frame.
|
|
24
|
-
*/
|
|
25
|
-
type ImageCenterCache = Map<string, Map<string, ImageCenterCacheEntry>>;
|
|
26
|
-
/**
|
|
27
|
-
* Resolves the image entry that a sprite should use as its origin reference when
|
|
28
|
-
* another image in the same render bucket needs to inherit that origin.
|
|
29
|
-
* The resolver is always invoked with the current sprite/image pair and can
|
|
30
|
-
* return `null` when the origin is not available (e.g., the reference was
|
|
31
|
-
* culled or stored in another bucket).
|
|
32
|
-
*/
|
|
33
|
-
type OriginImageResolver<T> = (sprite: Readonly<InternalSpriteCurrentState<T>>, image: Readonly<InternalSpriteImageState>) => InternalSpriteImageState | undefined;
|
|
34
|
-
export declare const DEFAULT_RENDER_INTERPOLATION_RESULT: RenderInterpolationResult;
|
|
35
|
-
interface DepthSortedItem<T> {
|
|
36
|
-
readonly sprite: InternalSpriteCurrentState<T>;
|
|
37
|
-
readonly image: InternalSpriteImageState;
|
|
38
|
-
readonly resource: Readonly<RegisteredImage>;
|
|
39
|
-
readonly depthKey: number;
|
|
40
|
-
readonly cameraDistanceMeters: number;
|
|
41
|
-
readonly distanceScaleFactor: number;
|
|
42
|
-
readonly resolveOrigin: OriginImageResolver<T>;
|
|
43
|
-
}
|
|
44
|
-
export declare const collectDepthSortedItemsInternal: <T>(projectionHost: ProjectionHost, zoom: number, originCenterCache: ImageCenterCache, { bucket, bucketBuffers, imageResources, resolvedScaling, clipContext, baseMetersPerPixel, drawingBufferWidth, drawingBufferHeight, pixelRatio, }: PrepareDrawSpriteImageParamsBefore<T>) => DepthSortedItem<T>[];
|
|
45
|
-
/**
|
|
46
|
-
* Prepares quad data for a single sprite image before issuing the draw call.
|
|
47
|
-
*/
|
|
48
|
-
export declare const prepareDrawSpriteImageInternal: <TTag>(projectionHost: ProjectionHost, item: DepthSortedItem<TTag>, zoom: number, originCenterCache: ImageCenterCache, { imageResources, baseMetersPerPixel, drawingBufferWidth, drawingBufferHeight, pixelRatio, clipContext, identityScaleX, identityScaleY, identityOffsetX, identityOffsetY, screenToClipScaleX, screenToClipScaleY, screenToClipOffsetX, screenToClipOffsetY, }: PrepareDrawSpriteImageParamsAfter) => PreparedDrawSpriteImageParams<TTag> | null;
|
|
49
|
-
export declare const applyVisibilityDistanceLod: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
|
|
50
|
-
export declare const syncPreparedOpacities: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
|
|
51
|
-
export declare const filterVisiblePreparedItems: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => PreparedDrawSpriteImageParams<TTag>[];
|
|
52
|
-
export interface ProcessInterpolationPresetRequests {
|
|
53
|
-
readonly distance: readonly SpriteInterpolationState<number>[];
|
|
54
|
-
readonly degree: readonly SpriteInterpolationState<number>[];
|
|
55
|
-
readonly sprite: readonly SpriteInterpolationState<SpriteLocation>[];
|
|
56
|
-
}
|
|
57
|
-
export interface ProcessInterpolationsEvaluationHandlers {
|
|
58
|
-
readonly prepare?: (requests: ProcessInterpolationPresetRequests, timestamp: number) => void;
|
|
59
|
-
readonly evaluateDistance: (states: readonly SpriteInterpolationState<number>[], timestamp: number) => readonly SpriteInterpolationEvaluationResult<number>[];
|
|
60
|
-
readonly evaluateDegree: (states: readonly SpriteInterpolationState<number>[], timestamp: number) => readonly SpriteInterpolationEvaluationResult<number>[];
|
|
61
|
-
readonly evaluateSprite: (states: readonly SpriteInterpolationState<SpriteLocation>[], timestamp: number) => readonly SpriteInterpolationEvaluationResult<SpriteLocation>[];
|
|
62
|
-
}
|
|
63
|
-
export declare const processInterpolationsInternal: <TTag>(params: RenderInterpolationParams<TTag>, handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
|
|
64
|
-
export declare const processOpacityInterpolationsAfterPreparation: <TTag>(params: RenderInterpolationParams<TTag>, preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[], handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
|
|
65
|
-
/**
|
|
66
|
-
* Create calculation host that binding MapLibre.
|
|
67
|
-
* @param TTag Tag type.
|
|
68
|
-
* @param map MapLibre Map.
|
|
69
|
-
* @returns Calculation host.
|
|
70
|
-
*/
|
|
71
|
-
export declare const createMapLibreCalculationHost: <TTag>(map: MapLibreMap) => RenderCalculationHost<TTag>;
|
|
72
|
-
/**
|
|
73
|
-
* Create calculation host that pure implementation.
|
|
74
|
-
* @param TTag Tag type.
|
|
75
|
-
* @param params Projection host PrepareDrawSpriteImageInputsparams.
|
|
76
|
-
* @returns Calculation host.
|
|
77
|
-
*/
|
|
78
|
-
export declare const createCalculationHost: <TTag>(params: ProjectionHostParams) => RenderCalculationHost<TTag>;
|
|
79
|
-
export declare const __wasmProjectionCalculationTestInternals: {
|
|
80
|
-
__createWasmProjectionCalculationTestHost: <TTag>(params: ProjectionHostParams) => RenderCalculationHost<TTag>;
|
|
81
|
-
};
|
|
82
|
-
export declare const __calculationHostTestInternals: {
|
|
83
|
-
applyVisibilityDistanceLod: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
|
|
84
|
-
syncPreparedOpacities: <TTag>(preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[]) => void;
|
|
85
|
-
processOpacityInterpolationsAfterPreparation: <TTag>(params: RenderInterpolationParams<TTag>, preparedItems: readonly PreparedDrawSpriteImageParams<TTag>[], handlers?: ProcessInterpolationsEvaluationHandlers) => RenderInterpolationResult;
|
|
86
|
-
};
|
|
87
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Map as MapLibreMap } from 'maplibre-gl';
|
|
12
|
-
import { ProjectionHost } from '../internalTypes';
|
|
13
|
-
/**
|
|
14
|
-
* Create a projection host that delegates to MapLibre.
|
|
15
|
-
* @param map MapLibre map instance
|
|
16
|
-
* @returns Projection host
|
|
17
|
-
*/
|
|
18
|
-
export declare const createMapLibreProjectionHost: (map: MapLibreMap) => ProjectionHost;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { mat4 as Mat4 } from 'gl-matrix';
|
|
12
|
-
import { Map as MapLibreMap } from 'maplibre-gl';
|
|
13
|
-
import { SpriteLocation } from '../types';
|
|
14
|
-
import { ClipContext, ProjectionHost } from '../internalTypes';
|
|
15
|
-
/**
|
|
16
|
-
* Required projection parameters. These correspond to the MapLibre transform state.
|
|
17
|
-
*/
|
|
18
|
-
export interface ProjectionHostParams {
|
|
19
|
-
readonly zoom: number;
|
|
20
|
-
readonly width: number;
|
|
21
|
-
readonly height: number;
|
|
22
|
-
readonly center: Readonly<SpriteLocation>;
|
|
23
|
-
readonly cameraLocation: SpriteLocation | undefined;
|
|
24
|
-
readonly pitchDeg?: number;
|
|
25
|
-
readonly bearingDeg?: number;
|
|
26
|
-
readonly rollDeg?: number;
|
|
27
|
-
readonly fovDeg?: number;
|
|
28
|
-
readonly centerElevationMeters?: number;
|
|
29
|
-
readonly minElevationMeters?: number;
|
|
30
|
-
readonly cameraToCenterDistance?: number;
|
|
31
|
-
readonly centerOffsetX?: number;
|
|
32
|
-
readonly centerOffsetY?: number;
|
|
33
|
-
readonly tileSize?: number;
|
|
34
|
-
readonly autoCalculateNearFarZ?: boolean;
|
|
35
|
-
readonly nearZOverride?: number;
|
|
36
|
-
readonly farZOverride?: number;
|
|
37
|
-
}
|
|
38
|
-
export interface PreparedProjectionState {
|
|
39
|
-
readonly zoom: number;
|
|
40
|
-
readonly mercatorMatrix: Mat4 | undefined;
|
|
41
|
-
readonly pixelMatrix: Mat4 | undefined;
|
|
42
|
-
readonly pixelMatrixInverse: Mat4 | undefined;
|
|
43
|
-
readonly worldSize: number;
|
|
44
|
-
readonly pixelPerMeter: number;
|
|
45
|
-
readonly cameraToCenterDistance: number;
|
|
46
|
-
readonly clipContext: ClipContext | undefined;
|
|
47
|
-
readonly cameraLocation: SpriteLocation | undefined;
|
|
48
|
-
}
|
|
49
|
-
export declare const prepareProjectionState: (params: ProjectionHostParams) => PreparedProjectionState;
|
|
50
|
-
/**
|
|
51
|
-
* Create a pure calculation projection host.
|
|
52
|
-
* @param params Projection parameters
|
|
53
|
-
* @returns Projection host
|
|
54
|
-
*/
|
|
55
|
-
export declare const createProjectionHost: (params: ProjectionHostParams) => ProjectionHost;
|
|
56
|
-
/**
|
|
57
|
-
* Extract current MapLibre transform parameters into {@link ProjectionHostParams}.
|
|
58
|
-
* Falls back to safe defaults when certain transform fields are unavailable.
|
|
59
|
-
* @param map MapLibre map instance.
|
|
60
|
-
* @returns Projection parameters usable by {@link createProjectionHost}.
|
|
61
|
-
*/
|
|
62
|
-
export declare const createProjectionHostParamsFromMapLibre: (map: MapLibreMap) => ProjectionHostParams;
|
package/dist/host/runtime.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { SpriteLayerCalculationVariant, SpriteLayerHostOptions } from '../types';
|
|
12
|
-
export declare const isSpriteLayerHostEnabled: () => boolean;
|
|
13
|
-
export declare const reportWasmRuntimeFailure: (reason?: unknown) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Initialize maplibre-gl-layers runtime host.
|
|
16
|
-
* @param variantOrOptions Options.
|
|
17
|
-
* @returns Initialized calculation variant.
|
|
18
|
-
*/
|
|
19
|
-
export declare const initializeRuntimeHost: (options?: SpriteLayerHostOptions) => Promise<SpriteLayerCalculationVariant>;
|
|
20
|
-
/**
|
|
21
|
-
* Release maplibre-gl-layers runtime host.
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
export declare const releaseRuntimeHost: () => void;
|
|
25
|
-
/**
|
|
26
|
-
* SIMD and multi-threading module availability.
|
|
27
|
-
*/
|
|
28
|
-
export interface MultiThreadedModuleAvailability {
|
|
29
|
-
/** Is available? */
|
|
30
|
-
readonly available: boolean;
|
|
31
|
-
/** Not available, reason text */
|
|
32
|
-
readonly reason?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Detects SIMD and multi-threading module availability.
|
|
36
|
-
* @returns MultiThreadedModuleAvailability.
|
|
37
|
-
*/
|
|
38
|
-
export declare const detectMultiThreadedModuleAvailability: () => MultiThreadedModuleAvailability;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { 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
|
-
import { BufferHolder, WasmHost } from './wasmHost';
|
|
15
|
-
import { ProcessInterpolationPresetRequests } from './calculationHost';
|
|
16
|
-
import { PreparedProjectionState, ProjectionHostParams } from './projectionHost';
|
|
17
|
-
interface WasmProcessInterpolationResults {
|
|
18
|
-
readonly distance: SpriteInterpolationEvaluationResult<number>[];
|
|
19
|
-
readonly degree: SpriteInterpolationEvaluationResult<number>[];
|
|
20
|
-
readonly sprite: SpriteInterpolationEvaluationResult<SpriteLocation>[];
|
|
21
|
-
}
|
|
22
|
-
type CalculateSurfaceDepthKeyOptions = {
|
|
23
|
-
readonly indices?: readonly number[];
|
|
24
|
-
readonly bias?: {
|
|
25
|
-
readonly ndc: number;
|
|
26
|
-
readonly minClipZEpsilon?: number;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export declare const createWasmCalculateSurfaceDepthKey: (preparedState: PreparedProjectionState) => {
|
|
30
|
-
(baseLngLat: Readonly<SpriteLocation>, displacements: readonly SurfaceCorner[], options?: CalculateSurfaceDepthKeyOptions): number | null;
|
|
31
|
-
release(): void;
|
|
32
|
-
};
|
|
33
|
-
interface PreparedInputBuffer extends Releasable {
|
|
34
|
-
readonly parameterHolder: BufferHolder<Float64Array>;
|
|
35
|
-
readonly resultItemCount: number;
|
|
36
|
-
}
|
|
37
|
-
interface WritableWasmProjectionState<TTag> {
|
|
38
|
-
readonly preparedProjection: PreparedProjectionState;
|
|
39
|
-
lastFrameParams?: {
|
|
40
|
-
baseMetersPerPixel: number;
|
|
41
|
-
zoomScaleFactor: number;
|
|
42
|
-
};
|
|
43
|
-
readonly prepareInputBuffer: (params: PrepareDrawSpriteImageParams<TTag>) => PreparedInputBuffer;
|
|
44
|
-
readonly getImageRefs: () => readonly InternalSpriteImageState[];
|
|
45
|
-
readonly getResourceRefs: () => readonly (RegisteredImage | undefined)[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Wasm interoperability dependencies.
|
|
49
|
-
* @remarks These are a group of helpers that perform marshaling to generate input/output data for wasm calculation.
|
|
50
|
-
*/
|
|
51
|
-
export interface WasmCalculationInteropDependencies<TTag> {
|
|
52
|
-
readonly imageIdHandler: IdHandler<RegisteredImage>;
|
|
53
|
-
readonly imageHandleBuffersController: ImageHandleBufferController;
|
|
54
|
-
readonly originReference: SpriteOriginReference;
|
|
55
|
-
readonly spriteIdHandler: IdHandler<InternalSpriteCurrentState<TTag>>;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Create calculation host that wasm implementation.
|
|
59
|
-
* @param TTag Tag type.
|
|
60
|
-
* @param params Projection host params.
|
|
61
|
-
* @param deps Wasm interoperability dependencies.
|
|
62
|
-
* @returns Calculation host.
|
|
63
|
-
*/
|
|
64
|
-
export declare const createWasmCalculationHost: <TTag>(params: ProjectionHostParams, deps: WasmCalculationInteropDependencies<TTag>) => RenderCalculationHost<TTag>;
|
|
65
|
-
export declare const __wasmCalculationTestInternals: {
|
|
66
|
-
convertToWasmProjectionState: <TTag>(wasm: WasmHost, params: ProjectionHostParams, deps: WasmCalculationInteropDependencies<TTag>) => WritableWasmProjectionState<TTag>;
|
|
67
|
-
converToPreparedDrawImageParams: <TTag>(state: WritableWasmProjectionState<TTag>, deps: WasmCalculationInteropDependencies<TTag>, resultBuffer: BufferHolder<Float64Array>) => PreparedDrawSpriteImageParams<TTag>[];
|
|
68
|
-
prepareDrawSpriteImagesInternal: <TTag>(wasm: WasmHost, wasmState: WritableWasmProjectionState<TTag>, deps: WasmCalculationInteropDependencies<TTag>, params: PrepareDrawSpriteImageParams<TTag>) => PreparedDrawSpriteImageParams<TTag>[];
|
|
69
|
-
processInterpolationsViaWasm: (wasm: WasmHost, requests: ProcessInterpolationPresetRequests, timestamp: number) => WasmProcessInterpolationResults;
|
|
70
|
-
processInterpolationsWithWasm: <TTag>(wasm: WasmHost, params: RenderInterpolationParams<TTag>) => RenderInterpolationResult;
|
|
71
|
-
};
|
|
72
|
-
export {};
|
package/dist/host/wasmHost.d.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { SpriteLayerCalculationVariant } from '../types';
|
|
12
|
-
/**
|
|
13
|
-
* `fromLngLat` function parameter
|
|
14
|
-
*/
|
|
15
|
-
export type WasmFromLngLat = (lng: number, lat: number, altitude: number, outPtr: number) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* `project` function parameter
|
|
18
|
-
*/
|
|
19
|
-
export type WasmProject = (lng: number, lat: number, altitude: number, worldSize: number, matrixPtr: number, outPtr: number) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* `unproject` function parameter
|
|
22
|
-
*/
|
|
23
|
-
export type WasmUnproject = (x: number, y: number, worldSize: number, matrixPtr: number, outPtr: number) => boolean;
|
|
24
|
-
/**
|
|
25
|
-
* `calculatePerspectiveRatio` function parameter
|
|
26
|
-
*/
|
|
27
|
-
export type WasmCalculatePerspectiveRatio = (lng: number, lat: number, altitude: number, cachedMercatorPtr: number, cameraToCenterDistance: number, matrixPtr: number, outPtr: number) => boolean;
|
|
28
|
-
export type WasmProjectLngLatToClipSpace = (lng: number, lat: number, altitude: number, matrixPtr: number, outPtr: number) => boolean;
|
|
29
|
-
export type WasmCalculateBillboardDepthKey = (centerX: number, centerY: number, worldSize: number, inverseMatrixPtr: number, mercatorMatrixPtr: number, outPtr: number) => boolean;
|
|
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
|
-
export type WasmPrepareDrawSpriteImages = (paramsPtr: number, resultPtr: number) => boolean;
|
|
32
|
-
export type WasmProcessInterpolations = (paramsPtr: number, resultPtr: number) => boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Wasm raw pointer type.
|
|
35
|
-
*/
|
|
36
|
-
export type Pointer = number;
|
|
37
|
-
/**
|
|
38
|
-
* An array element type that createTypedBuffer.
|
|
39
|
-
* @param TArray - A type for ArrayBufferView (ex: Float64Array)
|
|
40
|
-
*/
|
|
41
|
-
export type TypedArrayElement<TArray> = TArray extends {
|
|
42
|
-
[index: number]: infer T;
|
|
43
|
-
} ? T : never;
|
|
44
|
-
/**
|
|
45
|
-
* Typed ArrayBufferView.
|
|
46
|
-
* @param TArray - A type for ArrayBufferView (ex: Float64Array)
|
|
47
|
-
*/
|
|
48
|
-
export interface TypedArrayBufferView<TArray> extends ArrayBufferView {
|
|
49
|
-
/**
|
|
50
|
-
* Copy in an array.
|
|
51
|
-
* @param from An array.
|
|
52
|
-
*/
|
|
53
|
-
readonly set: (from: ArrayLike<TypedArrayElement<TArray>>) => void;
|
|
54
|
-
readonly length: number;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* TypedArrayBuffer view constructor type.
|
|
58
|
-
* @param TArray - A type for ArrayBufferView (ex: Float64Array)
|
|
59
|
-
*/
|
|
60
|
-
export type TypedArrayConstructor<TArray extends TypedArrayBufferView<TArray>> = {
|
|
61
|
-
readonly BYTES_PER_ELEMENT: number;
|
|
62
|
-
new (buffer: ArrayBuffer, byteOffset: number, length: number): TArray;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* The BufferHolder, capsule both wasm raw memory pointer and ArrayBufferBuffer.
|
|
66
|
-
* @param TArray - A type for ArrayBufferView (ex: Float64Array)
|
|
67
|
-
*/
|
|
68
|
-
export interface BufferHolder<TArray extends TypedArrayBufferView<TArray>> {
|
|
69
|
-
/**
|
|
70
|
-
* Element count (Float64Array: mod 8)
|
|
71
|
-
*/
|
|
72
|
-
readonly length: number;
|
|
73
|
-
/**
|
|
74
|
-
* Prepare and get the raw pointer and the buffer reference.
|
|
75
|
-
* @returns The raw pointer and the buffer reference.
|
|
76
|
-
*/
|
|
77
|
-
readonly prepare: () => {
|
|
78
|
-
ptr: Pointer;
|
|
79
|
-
buffer: TArray;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Release the buffer.
|
|
83
|
-
* @returns
|
|
84
|
-
*/
|
|
85
|
-
readonly release: () => void;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Wasm host reference.
|
|
89
|
-
*/
|
|
90
|
-
export interface WasmHost {
|
|
91
|
-
/**
|
|
92
|
-
* Helper for wasm interoperation buffer.
|
|
93
|
-
* @param TArray - A type for ArrayBufferView (ex: Float64Array)
|
|
94
|
-
* @param ArrayType - ArrayBufferView constructor
|
|
95
|
-
* @param elements - Buffer element count or copy in data array.
|
|
96
|
-
*/
|
|
97
|
-
readonly allocateTypedBuffer: <TArray extends TypedArrayBufferView<TArray>>(ArrayType: TypedArrayConstructor<TArray>, elements: number | ArrayLike<TypedArrayElement<TArray>>) => BufferHolder<TArray>;
|
|
98
|
-
readonly fromLngLat: WasmFromLngLat;
|
|
99
|
-
readonly project: WasmProject;
|
|
100
|
-
readonly unproject: WasmUnproject;
|
|
101
|
-
readonly calculatePerspectiveRatio: WasmCalculatePerspectiveRatio;
|
|
102
|
-
readonly projectLngLatToClipSpace: WasmProjectLngLatToClipSpace;
|
|
103
|
-
readonly calculateBillboardDepthKey: WasmCalculateBillboardDepthKey;
|
|
104
|
-
readonly calculateSurfaceDepthKey: WasmCalculateSurfaceDepthKey;
|
|
105
|
-
readonly prepareDrawSpriteImages: WasmPrepareDrawSpriteImages;
|
|
106
|
-
readonly processInterpolations: WasmProcessInterpolations;
|
|
107
|
-
}
|
|
108
|
-
export type WasmVariant = SpriteLayerCalculationVariant;
|
|
109
|
-
/**
|
|
110
|
-
* Wasm initialization options.
|
|
111
|
-
*/
|
|
112
|
-
export interface InitializeWasmHostOptions {
|
|
113
|
-
/** Force initialization. Default is false. */
|
|
114
|
-
readonly force: boolean;
|
|
115
|
-
/** Override the URL used to fetch wasm artifacts. */
|
|
116
|
-
readonly wasmBaseUrl: string | undefined;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Initialize wasm offload module.
|
|
120
|
-
* @param preferredVariant Uses wasm offload module variant.
|
|
121
|
-
* @param options Options.
|
|
122
|
-
* @returns Initialized WasmHost.
|
|
123
|
-
*/
|
|
124
|
-
export declare const initializeWasmHost: (preferredVariant: WasmVariant, options: InitializeWasmHostOptions) => Promise<WasmVariant>;
|
|
125
|
-
/**
|
|
126
|
-
* Release wasm offload module.
|
|
127
|
-
*/
|
|
128
|
-
export declare const releaseWasmHost: () => void;
|
|
129
|
-
/**
|
|
130
|
-
* Get wasm host.
|
|
131
|
-
* @returns Entry points.
|
|
132
|
-
*/
|
|
133
|
-
export declare const prepareWasmHost: () => WasmHost;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* name: maplibre-gl-layers
|
|
3
|
-
* version: 0.19.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: 7bc93c11d7855dedb8d60f140af4e413252c32a7
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { ProjectionHostParams } from './projectionHost';
|
|
12
|
-
import { ProjectionHost } from '../internalTypes';
|
|
13
|
-
/**
|
|
14
|
-
* Create wasm-based calculation projection host.
|
|
15
|
-
* @param params Projection parameters
|
|
16
|
-
* @returns Projection host
|
|
17
|
-
* @remarks This needs using before initialization (initializeWasmHost function)
|
|
18
|
-
*/
|
|
19
|
-
export declare const createWasmProjectionHost: (params: ProjectionHostParams) => ProjectionHost;
|