maplibre-gl-components 0.15.0 → 0.16.1

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 (45) hide show
  1. package/README.md +56 -2
  2. package/dist/{ControlGrid-rVNG7B9O.js → ControlGrid-BwNNCjQO.js} +47626 -78147
  3. package/dist/ControlGrid-y9Ko3OWk.cjs +17062 -0
  4. package/dist/{deflate-DEdCz12a.cjs → deflate-Bay-vzHJ.cjs} +1 -1
  5. package/dist/{deflate-BA1jZeSX.js → deflate-yeu3ogBn.js} +1 -1
  6. package/dist/geotiff-BNxc90fm.cjs +8 -0
  7. package/dist/{geotiff-o_Fq1Na4.js → geotiff-BUZniE5g.js} +460 -463
  8. package/dist/index.cjs +1 -3819
  9. package/dist/index.mjs +158 -19536
  10. package/dist/{jpeg-CF9OGQg_.js → jpeg-B7yImnpY.js} +1 -1
  11. package/dist/{jpeg-JSQOxGHy.cjs → jpeg-BiN8bMT5.cjs} +1 -1
  12. package/dist/lerc-BvSjGMM2.cjs +1 -0
  13. package/dist/{lerc-7LlQoT6u.js → lerc-CqgA9njy.js} +3 -4
  14. package/dist/{lzw-BhML-BvT.cjs → lzw-C-_B7Jis.cjs} +1 -1
  15. package/dist/{lzw-BZniWIYG.js → lzw-DL9RcHOz.js} +1 -1
  16. package/dist/{packbits-B9b7gX2c.cjs → packbits-DRGSjtn-.cjs} +1 -1
  17. package/dist/{packbits-DWY5O-FG.js → packbits-YEJGULcy.js} +1 -1
  18. package/dist/{raw-DUslI1gr.js → raw-CoQHiEnn.js} +1 -1
  19. package/dist/{raw-C3ARbSFo.cjs → raw-D6OidBKc.cjs} +1 -1
  20. package/dist/react.cjs +1 -1
  21. package/dist/react.mjs +4 -4
  22. package/dist/types/index.d.ts +3 -1
  23. package/dist/types/index.d.ts.map +1 -1
  24. package/dist/types/lib/addControlGrid.d.ts.map +1 -1
  25. package/dist/types/lib/core/ControlGrid.d.ts.map +1 -1
  26. package/dist/types/lib/core/SpinGlobeControl.d.ts +91 -0
  27. package/dist/types/lib/core/SpinGlobeControl.d.ts.map +1 -0
  28. package/dist/types/lib/core/TileLayerControl.d.ts +105 -0
  29. package/dist/types/lib/core/TileLayerControl.d.ts.map +1 -0
  30. package/dist/types/lib/core/types.d.ts +114 -1
  31. package/dist/types/lib/core/types.d.ts.map +1 -1
  32. package/dist/{webimage-ibSPOLHJ.js → webimage-BXLN-zu8.js} +1 -1
  33. package/dist/{webimage-CBRffWZD.cjs → webimage-mWTez3Wv.cjs} +1 -1
  34. package/package.json +36 -12
  35. package/dist/ControlGrid-DN5md8hp.cjs +0 -19636
  36. package/dist/geotiff-De1w1lBy.cjs +0 -8
  37. package/dist/index-B-Nr9y7J.cjs +0 -84
  38. package/dist/index-B5NoFrpY.js +0 -8892
  39. package/dist/index-Bi1MMPUx.js +0 -4163
  40. package/dist/index-C9fk_HKR.js +0 -167
  41. package/dist/index-CBBRBJvR.cjs +0 -274
  42. package/dist/index-CZxPF1qt.js +0 -4
  43. package/dist/index-CiDPSJ9T.cjs +0 -1
  44. package/dist/index-CjM_nbxd.cjs +0 -107
  45. package/dist/lerc-BIsodce9.cjs +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # maplibre-gl-components
2
2
 
3
- Legend, colorbar, basemap switcher, terrain toggle, search, vector data loader, feature inspector, measurement tools, coordinate display, bookmarks, minimap, and more for MapLibre GL JS maps.
3
+ Legend, colorbar, basemap switcher, terrain toggle, search, vector data loader, feature inspector, measurement tools, coordinate display, bookmarks, minimap, spinning globe, and more for MapLibre GL JS maps.
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/maplibre-gl-components.svg)](https://badge.fury.io/js/maplibre-gl-components)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -27,6 +27,7 @@ Legend, colorbar, basemap switcher, terrain toggle, search, vector data loader,
27
27
  - **BookmarkControl** - Save and restore map views with localStorage persistence
28
28
  - **PrintControl** - Export the map as PNG, JPEG, or PDF with optional title overlay
29
29
  - **MinimapControl** - Inset overview map showing the current viewport extent with optional click-to-navigate
30
+ - **SpinGlobeControl** - Automatically spin the globe at a configurable speed with pause-on-interaction support
30
31
  - **ControlGrid** - Collapsible toolbar grid that hosts any combination of built-in and plugin controls
31
32
  - **addControlGrid** - One-call convenience function to add all default controls with customization
32
33
  - **Three.js Integration** - Re-exported helpers (`MapScene`, `SceneTransform`, `Sun`, `Creator`) from `@dvt3d/maplibre-three-plugin`
@@ -1462,6 +1463,59 @@ minimapControl.on("expand", (event) => {
1462
1463
 
1463
1464
  See the [minimap-control example](./examples/minimap-control/) for a complete working example.
1464
1465
 
1466
+ ### SpinGlobeControl
1467
+
1468
+ A control that automatically spins the globe by continuously shifting the map center longitude. Works in both globe and flat map projections — in globe projection it resembles a physical globe spinning on its axis.
1469
+
1470
+ ```typescript
1471
+ interface SpinGlobeControlOptions {
1472
+ speed?: number; // Rotation speed in degrees per second (default: 10)
1473
+ spinOnLoad?: boolean; // Auto-start spinning when added to the map (default: false)
1474
+ pauseOnInteraction?: boolean; // Pause on drag/touch/wheel, resume on release (default: true)
1475
+ }
1476
+ ```
1477
+
1478
+ ```typescript
1479
+ // Methods
1480
+ spinControl.startSpin()
1481
+ spinControl.stopSpin()
1482
+ spinControl.toggleSpin()
1483
+ spinControl.isSpinning() // Returns true if currently spinning
1484
+ spinControl.getState() // Returns { spinning: boolean }
1485
+ spinControl.update(options) // Update speed or other options at runtime
1486
+ spinControl.on(event, handler) // 'spinstart' | 'spinstop'
1487
+ spinControl.off(event, handler)
1488
+ ```
1489
+
1490
+ **Usage:**
1491
+
1492
+ ```typescript
1493
+ import { SpinGlobeControl } from "maplibre-gl-components";
1494
+
1495
+ const spinControl = new SpinGlobeControl({
1496
+ speed: 10,
1497
+ spinOnLoad: true,
1498
+ pauseOnInteraction: true,
1499
+ });
1500
+ map.addControl(spinControl, "top-right");
1501
+
1502
+ spinControl.on("spinstart", () => console.log("Spinning"));
1503
+ spinControl.on("spinstop", () => console.log("Stopped"));
1504
+
1505
+ // Change speed at runtime
1506
+ spinControl.update({ speed: 30 });
1507
+ ```
1508
+
1509
+ **Features:**
1510
+
1511
+ - Toggle button with active state indicator
1512
+ - Configurable speed (degrees per second)
1513
+ - Pauses automatically when the user drags, touches, or scrolls, then resumes on release
1514
+ - `spinOnLoad` option to auto-start when added to the map
1515
+ - Works standalone or as a `"spinGlobe"` default control in `ControlGrid` / `addControlGrid`
1516
+
1517
+ See the [spin-globe example](./examples/spin-globe/) for a complete working example.
1518
+
1465
1519
  ### ControlGrid
1466
1520
 
1467
1521
  A collapsible toolbar grid that organizes multiple controls (built-in and plugin) in a configurable rows × columns layout.
@@ -1491,7 +1545,7 @@ interface ControlGridOptions {
1491
1545
  }
1492
1546
  ```
1493
1547
 
1494
- **Available default controls:** `fullscreen`, `globe`, `north`, `terrain`, `search`, `viewState`, `inspect`, `vectorDataset`, `basemap`, `cogLayer`, `minimap`, `measure`, `bookmark`, `print`, `zarrLayer`, `pmtilesLayer`, `stacLayer`, `stacSearch`, `addVector`, `geoEditor`, `lidar`, `planetaryComputer`, `gaussianSplat`, `streetView`, `swipe`, `usgsLidar`
1548
+ **Available default controls:** `fullscreen`, `globe`, `spinGlobe`, `north`, `terrain`, `search`, `viewState`, `inspect`, `vectorDataset`, `basemap`, `cogLayer`, `minimap`, `measure`, `bookmark`, `print`, `zarrLayer`, `pmtilesLayer`, `stacLayer`, `stacSearch`, `addVector`, `geoEditor`, `lidar`, `planetaryComputer`, `gaussianSplat`, `streetView`, `swipe`, `usgsLidar`
1495
1549
 
1496
1550
  **StreetView env setup (for `streetView` default control):**
1497
1551