maplibre-gl-lidar 0.7.0 → 0.7.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.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -495,6 +495,32 @@ console.log(`Loaded ${data.pointCount} points`);
495
495
 
496
496
  **Note:** LAS 1.2 and 1.4 are loaded using copc.js for optimal performance. LAS 1.0, 1.1, and 1.3 files automatically fall back to @loaders.gl/las.
497
497
 
498
+ ## Framework Integration
499
+
500
+ ### Next.js
501
+
502
+ When using maplibre-gl-lidar with Next.js, you need to configure webpack to handle Node.js built-in modules that are referenced (but not executed) in browser code. Add the following to your `next.config.js`:
503
+
504
+ ```javascript
505
+ /** @type {import('next').NextConfig} */
506
+ const nextConfig = {
507
+ webpack: (config, { isServer }) => {
508
+ if (!isServer) {
509
+ config.resolve.fallback = {
510
+ ...config.resolve.fallback,
511
+ fs: false,
512
+ path: false,
513
+ };
514
+ }
515
+ return config;
516
+ },
517
+ };
518
+
519
+ module.exports = nextConfig;
520
+ ```
521
+
522
+ This configuration tells webpack not to bundle the `fs` and `path` modules for client-side code. These modules are only referenced in environment-guarded code paths that never execute in browsers.
523
+
498
524
  ## Coordinate Systems
499
525
 
500
526
  Point clouds are automatically transformed to WGS84 (EPSG:4326) for display on the map. The loader reads the WKT coordinate reference system from the file and uses proj4 to transform coordinates. Supported features:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maplibre-gl-lidar",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "A MapLibre GL JS plugin for visualizing LiDAR point clouds using deck.gl",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",