maplibre-gl-layers 0.13.0 → 0.14.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.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteMode, SpriteAnchor, SpriteImageOffset, SpriteInterpolationOptions, SpriteImageOriginLocation, SpriteLocation, SpriteTextGlyphHorizontalAlign, SpriteTextureMagFilter, SpriteTextureMinFilter, SpriteInterpolationMode, EasingFunction, SpriteScreenPoint, SpritePoint } from './types';
@@ -405,6 +405,11 @@ export interface RegisteredImage {
405
405
  readonly height: number;
406
406
  readonly bitmap: ImageBitmap;
407
407
  texture: WebGLTexture | undefined;
408
+ atlasPageIndex: number;
409
+ atlasU0: number;
410
+ atlasV0: number;
411
+ atlasU1: number;
412
+ atlasV1: number;
408
413
  }
409
414
  /**
410
415
  * Padding resolved for glyph rendering with guaranteed non-negative values.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteInterpolationOptions, SpriteLocation } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteInterpolationOptions, SpriteImageOffset } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  export interface Rect {
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { Map as MapLibreMap } from 'maplibre-gl';
package/dist/math.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteAnchor, SpriteImageOffset, SpriteLocation, SpritePoint, SpriteScalingOptions, SpriteScreenPoint } from './types';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { mat4 as Mat4 } from 'gl-matrix';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteInterpolationOptions } from './types';
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.14.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: a531802b05777e1f54a8828a247254293df1415d
9
+ */
10
+
11
+ import { SpriteLayerCalculationVariant, SpriteLayerHostOptions } from './types';
12
+ export declare const isSpriteLayerHostEnabled: () => boolean;
13
+ /**
14
+ * Initialize maplibre-gl-layers runtime host.
15
+ * @param variantOrOptions Options.
16
+ * @returns Initialized calculation variant.
17
+ */
18
+ export declare const initializeRuntimeHost: (options?: SpriteLayerHostOptions) => Promise<SpriteLayerCalculationVariant>;
19
+ /**
20
+ * Release maplibre-gl-layers runtime host.
21
+ * @returns
22
+ */
23
+ export declare const releaseRuntimeHost: () => void;
24
+ /**
25
+ * SIMD and multi-threading module availability.
26
+ */
27
+ export interface MultiThreadedModuleAvailability {
28
+ /** Is available? */
29
+ readonly available: boolean;
30
+ /** Not available, reason text */
31
+ readonly reason?: string;
32
+ }
33
+ /**
34
+ * Detects SIMD and multi-threading module availability.
35
+ * @returns MultiThreadedModuleAvailability.
36
+ */
37
+ export declare const detectMultiThreadedModuleAvailability: () => MultiThreadedModuleAvailability;
package/dist/shader.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteAnchor, SpriteScreenPoint } from './types';
12
+ import { PreparedDrawSpriteImageParams, Releaseable } from './internalTypes';
12
13
  /** Number of components per vertex (clipPosition.xyzw + uv.xy). */
13
14
  export declare const VERTEX_COMPONENT_COUNT = 6;
14
15
  /** Component count for clip-space position attributes. */
@@ -24,7 +25,7 @@ export declare const UV_OFFSET: number;
24
25
  /** Vertex count required to draw one sprite as two triangles. */
25
26
  export declare const QUAD_VERTEX_COUNT = 6;
26
27
  /** Shared vertex shader that converts screen-space vertices when requested. */
27
- 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 vec4 u_surfaceClipCenter;\nuniform vec4 u_surfaceClipBasisEast;\nuniform vec4 u_surfaceClipBasisNorth;\nuniform float u_surfaceDepthBias;\nvarying vec2 v_uv;\nvec2 computeBillboardCorner(vec2 uv) {\n vec2 base = vec2(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0);\n vec2 anchorShift = vec2(u_billboardAnchor.x * u_billboardHalfSize.x, u_billboardAnchor.y * u_billboardHalfSize.y);\n vec2 shifted = vec2(base.x * u_billboardHalfSize.x, base.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_surfaceClipCenter\n + (corner.x * u_surfaceClipBasisEast)\n + (corner.y * u_surfaceClipBasisNorth);\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_uv);\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";
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";
28
29
  /** Fragment shader that applies texture sampling and opacity. */
29
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";
30
31
  /** Initial vertex data for a unit quad. */
@@ -81,3 +82,20 @@ export declare const compileShader: (glContext: WebGLRenderingContext, type: num
81
82
  * @throws When linking fails or a program cannot be created.
82
83
  */
83
84
  export declare const createShaderProgram: (glContext: WebGLRenderingContext, vertexSource: string, fragmentSource: string) => WebGLProgram;
85
+ export interface SpriteDrawProgram<TTag> extends Releaseable {
86
+ beginFrame(): void;
87
+ uploadVertexBatch(items: PreparedDrawSpriteImageParams<TTag>[]): void;
88
+ draw(prepared: PreparedDrawSpriteImageParams<TTag>): boolean;
89
+ }
90
+ export declare const createSpriteDrawProgram: <TTag>(glContext: WebGLRenderingContext) => SpriteDrawProgram<TTag>;
91
+ export interface DebugOutlineRenderer extends Releaseable {
92
+ begin(screenToClipScaleX: number, screenToClipScaleY: number, screenToClipOffsetX: number, screenToClipOffsetY: number): void;
93
+ drawOutline(corners: readonly [
94
+ SpriteScreenPoint,
95
+ SpriteScreenPoint,
96
+ SpriteScreenPoint,
97
+ SpriteScreenPoint
98
+ ]): void;
99
+ end(): void;
100
+ }
101
+ export declare const createDebugOutlineRenderer: (glContext: WebGLRenderingContext) => DebugOutlineRenderer;
package/dist/types.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { CustomLayerInterface } from 'maplibre-gl';
@@ -512,10 +512,6 @@ export interface SpriteTextureFilteringOptions {
512
512
  generateMipmaps?: boolean;
513
513
  maxAnisotropy?: number;
514
514
  }
515
- /**
516
- * Calculation variant. It is internal calculation methods.
517
- */
518
- export type SpriteLayerCalculationVariant = 'simd' | 'nosimd' | 'disabled';
519
515
  /**
520
516
  * Options accepted when creating a SpriteLayer.
521
517
  *
@@ -800,3 +796,22 @@ export interface SpriteLayerInterface<TTag = any> extends CustomLayerInterface {
800
796
  */
801
797
  readonly off: <K extends keyof SpriteLayerEventMap<TTag>>(type: K, listener: SpriteLayerEventListener<TTag, K>) => void;
802
798
  }
799
+ /**
800
+ * Calculation variant. It is internal calculation methods.
801
+ */
802
+ export type SpriteLayerCalculationVariant = 'simd-mt' | 'simd' | 'nosimd' | 'disabled';
803
+ /**
804
+ * SpriteLayer host options.
805
+ */
806
+ export interface SpriteLayerHostOptions {
807
+ /**
808
+ * Calculation variant. Default is `simd`.
809
+ * Use `simd-mt` to enable pthread/SIMD wasm when `SharedArrayBuffer` is available
810
+ * (i.e. cross-origin isolated contexts) and fall back to the other variants otherwise.
811
+ */
812
+ readonly variant?: SpriteLayerCalculationVariant;
813
+ /**
814
+ * Wasm runtime module base URL path. Default is `/wasm`
815
+ */
816
+ readonly wasmBaseUrl?: string;
817
+ }
package/dist/utils.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { ImageHandleBufferController, IdHandler, RenderTargetBucketBuffers, RenderTargetEntryLike, SpriteOriginReference } from './internalTypes';
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * name: maplibre-gl-layers
3
+ * version: 0.14.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: a531802b05777e1f54a8828a247254293df1415d
9
+ */
10
+
11
+ declare const _default: {
12
+ "pthreadPoolSize": 4
13
+ }
14
+ ;
15
+
16
+ export default _default;
Binary file
@@ -0,0 +1,2 @@
1
+ async function Module(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var ENVIRONMENT_IS_PTHREAD=ENVIRONMENT_IS_WORKER&&self.name?.startsWith("em-pthread");if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("module");var require=createRequire(import.meta.url);var worker_threads=require("worker_threads");global.Worker=worker_threads.Worker;ENVIRONMENT_IS_WORKER=!worker_threads.isMainThread;ENVIRONMENT_IS_PTHREAD=ENVIRONMENT_IS_WORKER&&worker_threads["workerData"]=="em-pthread"}var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}if(!ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var defaultPrint=console.log.bind(console);var defaultPrintErr=console.error.bind(console);if(ENVIRONMENT_IS_NODE){var utils=require("util");var stringify=a=>typeof a=="object"?utils.inspect(a):a;defaultPrint=(...args)=>fs.writeSync(1,args.map(stringify).join(" ")+"\n");defaultPrintErr=(...args)=>fs.writeSync(2,args.map(stringify).join(" ")+"\n")}var out=defaultPrint;var err=defaultPrintErr;var wasmBinary;var wasmModule;var ABORT=false;var EXITSTATUS;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;if(ENVIRONMENT_IS_NODE&&ENVIRONMENT_IS_PTHREAD){var parentPort=worker_threads["parentPort"];parentPort.on("message",msg=>global.onmessage?.({data:msg}));Object.assign(globalThis,{self:global,postMessage:msg=>parentPort["postMessage"](msg)});process.on("uncaughtException",err=>{postMessage({cmd:"uncaughtException",error:err});process.exit(1)})}var startWorker;if(ENVIRONMENT_IS_PTHREAD){var initializedJS=false;self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{var msgData=e["data"];var cmd=msgData.cmd;if(cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);startWorker=()=>{postMessage({cmd:"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};for(const handler of msgData.handlers){if(!Module[handler]||Module[handler].proxy){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler,args})};if(handler=="print")out=Module[handler];if(handler=="printErr")err=Module[handler]}}wasmMemory=msgData.wasmMemory;updateMemoryViews();wasmModule=msgData.wasmModule;createWasm();run()}else if(cmd==="run"){establishStackSpace(msgData.pthread_ptr);__emscripten_thread_init(msgData.pthread_ptr,0,0,1,0,0);PThread.threadInitTLS();__emscripten_thread_mailbox_await(msgData.pthread_ptr);if(!initializedJS){initializedJS=true}try{invokeEntryPoint(msgData.start_routine,msgData.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(msgData.target==="setimmediate"){}else if(cmd==="checkMailbox"){if(initializedJS){checkMailbox()}}else if(cmd){err(`worker: received unknown command ${cmd}`);err(msgData)}}catch(ex){__emscripten_thread_crashed();throw ex}}self.onmessage=handleMessage}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function initMemory(){if(ENVIRONMENT_IS_PTHREAD){return}if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||536870912;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:INITIAL_MEMORY/65536,shared:true})}updateMemoryViews()}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return startWorker();wasmExports["s"]()}function postRun(){if(ENVIRONMENT_IS_PTHREAD){return}if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("offloads-simd-mt.wasm")}return new URL("offloads-simd-mt.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){assignWasmImports();var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;registerTLSInit(wasmExports["D"]);assignWasmExports(wasmExports);wasmModule=module;return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"],result["module"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}if(ENVIRONMENT_IS_PTHREAD){var instance=new WebAssembly.Instance(wasmModule,getWasmImports());return receiveInstance(instance,wasmModule)}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var terminateWorker=worker=>{worker.terminate();worker.onmessage=e=>{}};var cleanupThread=pthread_ptr=>{var worker=PThread.pthreads[pthread_ptr];PThread.returnWorkerToPool(worker)};var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var runDependencies=0;var dependenciesFulfilled=null;var removeRunDependency=id=>{runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}};var addRunDependency=id=>{runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)};var spawnThread=threadParams=>{var worker=PThread.getNewWorker();if(!worker){return 6}PThread.runningWorkers.push(worker);PThread.pthreads[threadParams.pthread_ptr]=worker;worker.pthread_ptr=threadParams.pthread_ptr;var msg={cmd:"run",start_routine:threadParams.startRoutine,arg:threadParams.arg,pthread_ptr:threadParams.pthread_ptr};if(ENVIRONMENT_IS_NODE){worker.unref()}worker.postMessage(msg,threadParams.transferList);return 0};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var stackSave=()=>_emscripten_stack_get_current();var stackRestore=val=>__emscripten_stack_restore(val);var stackAlloc=sz=>__emscripten_stack_alloc(sz);var proxyToMainThread=(funcIndex,emAsmAddr,sync,...callArgs)=>{var serializedNumCallArgs=callArgs.length*2;var sp=stackSave();var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i<callArgs.length;i++){var arg=callArgs[i];if(typeof arg=="bigint"){HEAP64[b+2*i]=1n;HEAP64[b+2*i+1]=arg}else{HEAP64[b+2*i]=0n;HEAPF64[b+2*i+1]=arg}}var rtn=__emscripten_run_js_on_main_thread(funcIndex,emAsmAddr,serializedNumCallArgs,args,sync);stackRestore(sp);return rtn};function _proc_exit(code){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(0,0,1,code);EXITSTATUS=code;if(!keepRuntimeAlive()){PThread.terminateAllThreads();Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))}function exitOnMainThread(returnCode){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(1,0,0,returnCode);_exit(returnCode)}var exitJS=(status,implicit)=>{EXITSTATUS=status;if(ENVIRONMENT_IS_PTHREAD){exitOnMainThread(status);throw"unwind"}_proc_exit(status)};var _exit=exitJS;var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){if(!ENVIRONMENT_IS_PTHREAD){PThread.initMainThread()}},initMainThread(){var pthreadPoolSize=4;while(pthreadPoolSize--){PThread.allocateUnusedWorker()}addOnPreRun(async()=>{var pthreadPoolReady=PThread.loadWasmModuleToAllWorkers();addRunDependency("loading-workers");await pthreadPoolReady;removeRunDependency("loading-workers")})},terminateAllThreads:()=>{for(var worker of PThread.runningWorkers){terminateWorker(worker)}for(var worker of PThread.unusedWorkers){terminateWorker(worker)}PThread.unusedWorkers=[];PThread.runningWorkers=[];PThread.pthreads={}},returnWorkerToPool:worker=>{var pthread_ptr=worker.pthread_ptr;delete PThread.pthreads[pthread_ptr];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);worker.pthread_ptr=0;__emscripten_thread_free_data(pthread_ptr)},threadInitTLS(){PThread.tlsInitFunctions.forEach(f=>f())},loadWasmModuleToWorker:worker=>new Promise(onFinishedLoading=>{worker.onmessage=e=>{var d=e["data"];var cmd=d.cmd;if(d.targetThread&&d.targetThread!=_pthread_self()){var targetWorker=PThread.pthreads[d.targetThread];if(targetWorker){targetWorker.postMessage(d,d.transferList)}else{err(`Internal error! Worker sent a message "${cmd}" to target pthread ${d.targetThread}, but that thread no longer exists!`)}return}if(cmd==="checkMailbox"){checkMailbox()}else if(cmd==="spawnThread"){spawnThread(d)}else if(cmd==="cleanupThread"){callUserCallback(()=>cleanupThread(d.thread))}else if(cmd==="loaded"){worker.loaded=true;if(ENVIRONMENT_IS_NODE&&!worker.pthread_ptr){worker.unref()}onFinishedLoading(worker)}else if(d.target==="setimmediate"){worker.postMessage(d)}else if(cmd==="uncaughtException"){worker.onerror(d.error)}else if(cmd==="callHandler"){Module[d.handler](...d.args)}else if(cmd){err(`worker sent an unknown command ${cmd}`)}};worker.onerror=e=>{var message="worker sent an error!";err(`${message} ${e.filename}:${e.lineno}: ${e.message}`);throw e};if(ENVIRONMENT_IS_NODE){worker.on("message",data=>worker.onmessage({data}));worker.on("error",e=>worker.onerror(e))}var handlers=[];var knownHandlers=["onExit","onAbort","print","printErr"];for(var handler of knownHandlers){if(Module.propertyIsEnumerable(handler)){handlers.push(handler)}}worker.postMessage({cmd:"load",handlers,wasmMemory,wasmModule})}),async loadWasmModuleToAllWorkers(){if(ENVIRONMENT_IS_PTHREAD){return}let pthreadPoolReady=Promise.all(PThread.unusedWorkers.map(PThread.loadWasmModuleToWorker));return pthreadPoolReady},allocateUnusedWorker(){var worker;if(Module["mainScriptUrlOrBlob"]){var pthreadMainJs=Module["mainScriptUrlOrBlob"];if(typeof pthreadMainJs!="string"){pthreadMainJs=URL.createObjectURL(pthreadMainJs)}worker=new Worker(pthreadMainJs,{type:"module",workerData:"em-pthread",name:"em-pthread"})}else worker=new Worker(new URL("offloads-simd-mt.js",import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});PThread.unusedWorkers.push(worker)},getNewWorker(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);function establishStackSpace(pthread_ptr){var stackHigh=HEAPU32[pthread_ptr+52>>2];var stackSize=HEAPU32[pthread_ptr+56>>2];var stackLow=stackHigh-stackSize;_emscripten_stack_set_limits(stackHigh,stackLow);stackRestore(stackHigh)}var wasmTableMirror=[];var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var invokeEntryPoint=(ptr,arg)=>{runtimeKeepaliveCounter=0;noExitRuntime=0;var result=getWasmTableEntry(ptr)(arg);function finish(result){if(keepRuntimeAlive()){EXITSTATUS=result;return}__emscripten_thread_exit(result)}finish(result)};var noExitRuntime=true;var registerTLSInit=tlsInitFunc=>PThread.tlsInitFunctions.push(tlsInitFunc);var wasmMemory;class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}}var exceptionLast=0;var uncaughtExceptionCount=0;var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};function pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(2,0,1,pthread_ptr,attr,startRoutine,arg);return ___pthread_create_js(pthread_ptr,attr,startRoutine,arg)}var _emscripten_has_threading_support=()=>!!globalThis.SharedArrayBuffer;var ___pthread_create_js=(pthread_ptr,attr,startRoutine,arg)=>{if(!_emscripten_has_threading_support()){return 6}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg)}if(error)return error;var threadParams={startRoutine,pthread_ptr,arg,transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)};var __abort_js=()=>abort("");var __emscripten_init_main_thread_js=tb=>{__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1,!ENVIRONMENT_IS_WEB,65536,false);PThread.threadInitTLS()};var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var maybeExit=()=>{if(!keepRuntimeAlive()){try{if(ENVIRONMENT_IS_PTHREAD){if(_pthread_self())__emscripten_thread_exit(EXITSTATUS);return}_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};var __emscripten_thread_mailbox_await=pthread_ptr=>{if(Atomics.waitAsync){var wait=Atomics.waitAsync(HEAP32,pthread_ptr>>2,pthread_ptr);wait.value.then(checkMailbox);var waitingAsync=pthread_ptr+128;Atomics.store(HEAP32,waitingAsync>>2,1)}};var checkMailbox=()=>callUserCallback(()=>{var pthread_ptr=_pthread_self();if(pthread_ptr){__emscripten_thread_mailbox_await(pthread_ptr);__emscripten_check_mailbox()}});var __emscripten_notify_mailbox_postmessage=(targetThread,currThreadId)=>{if(targetThread==currThreadId){setTimeout(checkMailbox)}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread,cmd:"checkMailbox"})}else{var worker=PThread.pthreads[targetThread];if(!worker){return}worker.postMessage({cmd:"checkMailbox"})}};var proxiedJSCallArgs=[];var __emscripten_receive_on_main_thread_js=(funcIndex,emAsmAddr,callingThread,numCallArgs,args)=>{numCallArgs/=2;proxiedJSCallArgs.length=numCallArgs;var b=args>>3;for(var i=0;i<numCallArgs;i++){if(HEAP64[b+2*i]){proxiedJSCallArgs[i]=HEAP64[b+2*i+1]}else{proxiedJSCallArgs[i]=HEAPF64[b+2*i+1]}}var func=proxiedFunctionTable[funcIndex];PThread.currentProxiedOperationCallerThread=callingThread;var rtn=func(...proxiedJSCallArgs);PThread.currentProxiedOperationCallerThread=0;return rtn};var __emscripten_thread_cleanup=thread=>{if(!ENVIRONMENT_IS_PTHREAD)cleanupThread(thread);else postMessage({cmd:"cleanupThread",thread})};var __emscripten_thread_set_strongref=thread=>{if(ENVIRONMENT_IS_NODE){PThread.pthreads[thread].ref()}};var _emscripten_get_now=()=>performance.timeOrigin+performance.now();var _emscripten_check_blocking_allowed=()=>{};var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};var _emscripten_exit_with_live_runtime=()=>{runtimeKeepalivePush();throw"unwind"};var getHeapMax=()=>HEAPU8.length;var _emscripten_get_heap_max=()=>getHeapMax();var _emscripten_num_logical_cores=()=>ENVIRONMENT_IS_NODE?require("os").cpus().length:navigator["hardwareConcurrency"];var abortOnCannotGrowMemory=requestedSize=>{abort("OOM")};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;abortOnCannotGrowMemory(requestedSize)};var printCharBuffers=[null,[],[]];var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.buffer instanceof ArrayBuffer?heapOrArray.subarray(idx,endPtr):heapOrArray.slice(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(3,0,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0}PThread.init();{initMemory();if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}Module["wasmMemory"]=wasmMemory;var proxiedFunctionTable=[_proc_exit,exitOnMainThread,pthreadCreateProxied,_fd_write];var _fromLngLat,_project,_unproject,_calculatePerspectiveRatio,_setThreadPoolSize,_projectLngLatToClipSpace,_calculateBillboardDepthKey,_calculateSurfaceDepthKey,_prepareDrawSpriteImages,__emscripten_tls_init,_pthread_self,__emscripten_thread_init,__emscripten_thread_crashed,__emscripten_run_js_on_main_thread,__emscripten_thread_free_data,__emscripten_thread_exit,_malloc,_free,__emscripten_check_mailbox,_emscripten_stack_set_limits,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,__indirect_function_table,wasmTable;function assignWasmExports(wasmExports){_fromLngLat=Module["_fromLngLat"]=wasmExports["t"];_project=Module["_project"]=wasmExports["u"];_unproject=Module["_unproject"]=wasmExports["v"];_calculatePerspectiveRatio=Module["_calculatePerspectiveRatio"]=wasmExports["w"];_setThreadPoolSize=Module["_setThreadPoolSize"]=wasmExports["y"];_projectLngLatToClipSpace=Module["_projectLngLatToClipSpace"]=wasmExports["z"];_calculateBillboardDepthKey=Module["_calculateBillboardDepthKey"]=wasmExports["A"];_calculateSurfaceDepthKey=Module["_calculateSurfaceDepthKey"]=wasmExports["B"];_prepareDrawSpriteImages=Module["_prepareDrawSpriteImages"]=wasmExports["C"];__emscripten_tls_init=wasmExports["D"];_pthread_self=wasmExports["E"];__emscripten_thread_init=wasmExports["F"];__emscripten_thread_crashed=wasmExports["G"];__emscripten_run_js_on_main_thread=wasmExports["H"];__emscripten_thread_free_data=wasmExports["I"];__emscripten_thread_exit=wasmExports["J"];_malloc=Module["_malloc"]=wasmExports["K"];_free=Module["_free"]=wasmExports["L"];__emscripten_check_mailbox=wasmExports["M"];_emscripten_stack_set_limits=wasmExports["N"];__emscripten_stack_restore=wasmExports["O"];__emscripten_stack_alloc=wasmExports["P"];_emscripten_stack_get_current=wasmExports["Q"];__indirect_function_table=wasmTable=wasmExports["x"]}var wasmImports;function assignWasmImports(){wasmImports={f:___cxa_throw,g:___pthread_create_js,o:__abort_js,k:__emscripten_init_main_thread_js,q:__emscripten_notify_mailbox_postmessage,l:__emscripten_receive_on_main_thread_js,c:__emscripten_thread_cleanup,j:__emscripten_thread_mailbox_await,i:__emscripten_thread_set_strongref,d:_emscripten_check_blocking_allowed,h:_emscripten_exit_with_live_runtime,m:_emscripten_get_heap_max,b:_emscripten_get_now,n:_emscripten_num_logical_cores,p:_emscripten_resize_heap,r:_exit,e:_fd_write,a:wasmMemory}}function run(){if(runDependencies>0){dependenciesFulfilled=run;return}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve?.(Module);initRuntime();return}preRun();if(runDependencies>0){dependenciesFulfilled=run;return}function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;if(!ENVIRONMENT_IS_PTHREAD){wasmExports=await (createWasm());run()}if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
2
+ ;return moduleRtn}export default Module;var isPthread=globalThis.self?.name?.startsWith("em-pthread");var isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(isNode)isPthread=(await import("worker_threads")).workerData==="em-pthread";isPthread&&Module();
Binary file
Binary file
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { ClipContext, ImageHandleBufferController, IdHandler, InternalSpriteCurrentState, InternalSpriteImageState, PreparedDrawSpriteImageParams, PrepareDrawSpriteImageParams, Releaseable, RegisteredImage, RenderCalculationHost, SpriteOriginReference } from './internalTypes';
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { SpriteLayerCalculationVariant } from './types';
@@ -65,6 +65,10 @@ export type TypedArrayConstructor<TArray extends TypedArrayBufferView<TArray>> =
65
65
  * @param TArray - A type for ArrayBufferView (ex: Float64Array)
66
66
  */
67
67
  export interface BufferHolder<TArray extends TypedArrayBufferView<TArray>> {
68
+ /**
69
+ * Element count (Float64Array: mod 8)
70
+ */
71
+ readonly length: number;
68
72
  /**
69
73
  * Prepare and get the raw pointer and the buffer reference.
70
74
  * @returns The raw pointer and the buffer reference.
@@ -92,8 +96,8 @@ export interface WasmHost {
92
96
  readonly allocateTypedBuffer: <TArray extends TypedArrayBufferView<TArray>>(ArrayType: TypedArrayConstructor<TArray>, elements: number | ArrayLike<TypedArrayElement<TArray>>) => BufferHolder<TArray>;
93
97
  readonly fromLngLat: WasmFromLngLat;
94
98
  readonly project: WasmProject;
95
- readonly calculatePerspectiveRatio: WasmCalculatePerspectiveRatio;
96
99
  readonly unproject: WasmUnproject;
100
+ readonly calculatePerspectiveRatio: WasmCalculatePerspectiveRatio;
97
101
  readonly projectLngLatToClipSpace: WasmProjectLngLatToClipSpace;
98
102
  readonly calculateBillboardDepthKey: WasmCalculateBillboardDepthKey;
99
103
  readonly calculateSurfaceDepthKey: WasmCalculateSurfaceDepthKey;
@@ -105,9 +109,9 @@ export type WasmVariant = SpriteLayerCalculationVariant;
105
109
  */
106
110
  export interface InitializeWasmHostOptions {
107
111
  /** Force initialization. Default is false. */
108
- readonly force?: boolean;
112
+ readonly force: boolean;
109
113
  /** Override the URL used to fetch wasm artifacts. */
110
- readonly wasmBaseUrl?: string;
114
+ readonly wasmBaseUrl: string | undefined;
111
115
  }
112
116
  /**
113
117
  * Initialize wasm offload module.
@@ -115,7 +119,7 @@ export interface InitializeWasmHostOptions {
115
119
  * @param options Options.
116
120
  * @returns Initialized WasmHost.
117
121
  */
118
- export declare const initializeWasmHost: (preferredVariant: WasmVariant, options?: InitializeWasmHostOptions) => Promise<WasmVariant>;
122
+ export declare const initializeWasmHost: (preferredVariant: WasmVariant, options: InitializeWasmHostOptions | undefined) => Promise<WasmVariant>;
119
123
  /**
120
124
  * Release wasm offload module.
121
125
  */
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: maplibre-gl-layers
3
- * version: 0.13.0
3
+ * version: 0.14.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: 4934aa7f4fed93594ece419184b32b5b972bbb88
8
+ * git.commit.hash: a531802b05777e1f54a8828a247254293df1415d
9
9
  */
10
10
 
11
11
  import { ProjectionHostParams } from './projectionHost';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "git": {
3
3
  "tags": [
4
- "0.13.0"
4
+ "0.14.0"
5
5
  ],
6
6
  "branches": [
7
7
  "main"
8
8
  ],
9
- "version": "0.13.0",
9
+ "version": "0.14.0",
10
10
  "commit": {
11
- "hash": "4934aa7f4fed93594ece419184b32b5b972bbb88",
12
- "shortHash": "4934aa7",
13
- "date": "2025-11-10T23:20:51+09:00Z",
11
+ "hash": "a531802b05777e1f54a8828a247254293df1415d",
12
+ "shortHash": "a531802",
13
+ "date": "2025-11-12T18:13:49+09:00Z",
14
14
  "message": "Merge branch 'develop'"
15
15
  }
16
16
  },
17
- "version": "0.13.0",
17
+ "version": "0.14.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",
@@ -60,7 +60,7 @@
60
60
  "pack": "npm run build && screw-up pack --pack-destination ../artifacts"
61
61
  },
62
62
  "dependencies": {
63
- "async-primitives": ">=1.4.0",
63
+ "async-primitives": ">=1.5.0",
64
64
  "maplibre-gl": ">=5.0.0"
65
65
  },
66
66
  "devDependencies": {