maplibre-gl-lidar 0.8.0 → 0.8.2

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 CHANGED
@@ -4,6 +4,8 @@ A MapLibre GL JS plugin for visualizing LiDAR point clouds using deck.gl.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/maplibre-gl-lidar.svg)](https://www.npmjs.com/package/maplibre-gl-lidar)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/p/github/opengeos/maplibre-gl-lidar)
8
+ [![Open in StackBlitz](https://img.shields.io/badge/Open%20in-StackBlitz-blue?logo=stackblitz)](https://stackblitz.com/github/opengeos/maplibre-gl-lidar)
7
9
 
8
10
  ## Features
9
11
 
@@ -2376,9 +2376,7 @@ function requireLazPerf() {
2376
2376
  }
2377
2377
  function createNamedFunction(name, body) {
2378
2378
  name = makeLegalFunctionName(name);
2379
- return function() {
2380
- return body.apply(this, arguments);
2381
- };
2379
+ return new Function("body", "return function " + name + '() {\n "use strict"; return body.apply(this, arguments);\n};\n')(body);
2382
2380
  }
2383
2381
  function extendError(baseErrorType, errorName) {
2384
2382
  var errorClass = createNamedFunction(errorName, function(message) {
@@ -3083,6 +3081,17 @@ function requireLazPerf() {
3083
3081
  del(ptr);
3084
3082
  }
3085
3083
  }
3084
+ function new_(constructor, argumentList) {
3085
+ if (!(constructor instanceof Function)) {
3086
+ throw new TypeError("new_ called with constructor type " + typeof constructor + " which is not a function");
3087
+ }
3088
+ var dummy = createNamedFunction(constructor.name || "unknownFunctionName", function() {
3089
+ });
3090
+ dummy.prototype = constructor.prototype;
3091
+ var obj = new dummy();
3092
+ var r = constructor.apply(obj, argumentList);
3093
+ return r instanceof Object ? r : obj;
3094
+ }
3086
3095
  function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) {
3087
3096
  var argCount = argTypes.length;
3088
3097
  if (argCount < 2) {
@@ -3097,44 +3106,50 @@ function requireLazPerf() {
3097
3106
  }
3098
3107
  }
3099
3108
  var returns = argTypes[0].name !== "void";
3100
- var expectedArgCount = argCount - 2;
3101
- var argsWired = new Array(expectedArgCount);
3102
- var invokerFuncArgs = [];
3103
- var destructors = [];
3104
- return function() {
3105
- if (arguments.length !== expectedArgCount) {
3106
- throwBindingError("function " + humanName + " called with " + arguments.length + " arguments, expected " + expectedArgCount + " args!");
3107
- }
3108
- destructors.length = 0;
3109
- var thisWired;
3110
- invokerFuncArgs.length = isClassMethodFunc ? 2 : 1;
3111
- invokerFuncArgs[0] = cppTargetFunc;
3112
- if (isClassMethodFunc) {
3113
- thisWired = argTypes[1]["toWireType"](destructors, this);
3114
- invokerFuncArgs[1] = thisWired;
3115
- }
3116
- for (var i2 = 0; i2 < expectedArgCount; ++i2) {
3117
- argsWired[i2] = argTypes[i2 + 2]["toWireType"](destructors, arguments[i2]);
3118
- invokerFuncArgs.push(argsWired[i2]);
3119
- }
3120
- var rv = cppInvokerFunc.apply(null, invokerFuncArgs);
3121
- function onDone(rv2) {
3122
- if (needsDestructorStack) {
3123
- runDestructors(destructors);
3124
- } else {
3125
- for (var i3 = isClassMethodFunc ? 1 : 2; i3 < argTypes.length; i3++) {
3126
- var param = i3 === 1 ? thisWired : argsWired[i3 - 2];
3127
- if (argTypes[i3].destructorFunction !== null) {
3128
- argTypes[i3].destructorFunction(param);
3129
- }
3130
- }
3131
- }
3132
- if (returns) {
3133
- return argTypes[0]["fromWireType"](rv2);
3109
+ var argsList = "";
3110
+ var argsListWired = "";
3111
+ for (var i = 0; i < argCount - 2; ++i) {
3112
+ argsList += (i !== 0 ? ", " : "") + "arg" + i;
3113
+ argsListWired += (i !== 0 ? ", " : "") + "arg" + i + "Wired";
3114
+ }
3115
+ var invokerFnBody = "return function " + makeLegalFunctionName(humanName) + "(" + argsList + ") {\nif (arguments.length !== " + (argCount - 2) + ") {\nthrowBindingError('function " + humanName + " called with ' + arguments.length + ' arguments, expected " + (argCount - 2) + " args!');\n}\n";
3116
+ if (needsDestructorStack) {
3117
+ invokerFnBody += "var destructors = [];\n";
3118
+ }
3119
+ var dtorStack = needsDestructorStack ? "destructors" : "null";
3120
+ var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
3121
+ var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]];
3122
+ if (isClassMethodFunc) {
3123
+ invokerFnBody += "var thisWired = classParam.toWireType(" + dtorStack + ", this);\n";
3124
+ }
3125
+ for (var i = 0; i < argCount - 2; ++i) {
3126
+ invokerFnBody += "var arg" + i + "Wired = argType" + i + ".toWireType(" + dtorStack + ", arg" + i + "); // " + argTypes[i + 2].name + "\n";
3127
+ args1.push("argType" + i);
3128
+ args2.push(argTypes[i + 2]);
3129
+ }
3130
+ if (isClassMethodFunc) {
3131
+ argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired;
3132
+ }
3133
+ invokerFnBody += (returns ? "var rv = " : "") + "invoker(fn" + (argsListWired.length > 0 ? ", " : "") + argsListWired + ");\n";
3134
+ if (needsDestructorStack) {
3135
+ invokerFnBody += "runDestructors(destructors);\n";
3136
+ } else {
3137
+ for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
3138
+ var paramName = i === 1 ? "thisWired" : "arg" + (i - 2) + "Wired";
3139
+ if (argTypes[i].destructorFunction !== null) {
3140
+ invokerFnBody += paramName + "_dtor(" + paramName + "); // " + argTypes[i].name + "\n";
3141
+ args1.push(paramName + "_dtor");
3142
+ args2.push(argTypes[i].destructorFunction);
3134
3143
  }
3135
3144
  }
3136
- return onDone(rv);
3137
- };
3145
+ }
3146
+ if (returns) {
3147
+ invokerFnBody += "var ret = retType.fromWireType(rv);\nreturn ret;\n";
3148
+ }
3149
+ invokerFnBody += "}\n";
3150
+ args1.push(invokerFnBody);
3151
+ var invokerFunction = new_(Function, args1).apply(null, args2);
3152
+ return invokerFunction;
3138
3153
  }
3139
3154
  function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) {
3140
3155
  assert2(argCount > 0);
@@ -43088,4 +43103,4 @@ exports.getClassificationName = getClassificationName;
43088
43103
  exports.getColormap = getColormap;
43089
43104
  exports.getFilename = getFilename;
43090
43105
  exports.throttle = throttle;
43091
- //# sourceMappingURL=LidarLayerAdapter-Ds5r98GR.cjs.map
43106
+ //# sourceMappingURL=LidarLayerAdapter-BLZfG-we.cjs.map