maplibre-gl-components 0.14.0 → 0.16.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 +56 -2
- package/dist/{ControlGrid-C50dMHKH.js → ControlGrid-BEStthg7.js} +46729 -77014
- package/dist/ControlGrid-mYpIdQ3m.cjs +17062 -0
- package/dist/DuckDBConverter-B98M0DFs.cjs +23 -0
- package/dist/DuckDBConverter-RPq48-t0.js +434 -0
- package/dist/{deflate-DE_6Tu1v.cjs → deflate-Bay-vzHJ.cjs} +1 -1
- package/dist/{deflate-2UPB1DER.js → deflate-yeu3ogBn.js} +1 -1
- package/dist/geotiff-BNxc90fm.cjs +8 -0
- package/dist/{geotiff-Bm1hERxI.js → geotiff-BUZniE5g.js} +460 -463
- package/dist/index.cjs +1 -3819
- package/dist/index.mjs +158 -19536
- package/dist/{jpeg-Oi0NUa0d.js → jpeg-B7yImnpY.js} +1 -1
- package/dist/{jpeg-DOGSyqmU.cjs → jpeg-BiN8bMT5.cjs} +1 -1
- package/dist/lerc-BvSjGMM2.cjs +1 -0
- package/dist/{lerc-GEl3vfh2.js → lerc-CqgA9njy.js} +3 -4
- package/dist/{lzw-CdNKcZyA.cjs → lzw-C-_B7Jis.cjs} +1 -1
- package/dist/{lzw-BWnPY6Nd.js → lzw-DL9RcHOz.js} +1 -1
- package/dist/maplibre-gl-components.css +1 -1
- package/dist/{packbits-DA_gKBrr.cjs → packbits-DRGSjtn-.cjs} +1 -1
- package/dist/{packbits-N4O0lK34.js → packbits-YEJGULcy.js} +1 -1
- package/dist/{raw-C_7LFtVe.js → raw-CoQHiEnn.js} +1 -1
- package/dist/{raw-DjO0R23L.cjs → raw-D6OidBKc.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +4 -4
- package/dist/types/index.d.ts +7 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/adapters/CogLayerAdapter.d.ts.map +1 -1
- package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts.map +1 -1
- package/dist/types/lib/addControlGrid.d.ts.map +1 -1
- package/dist/types/lib/converters/DuckDBConverter.d.ts +40 -0
- package/dist/types/lib/converters/DuckDBConverter.d.ts.map +1 -1
- package/dist/types/lib/core/AddVector.d.ts +19 -0
- package/dist/types/lib/core/AddVector.d.ts.map +1 -1
- package/dist/types/lib/core/ChoroplethControl.d.ts.map +1 -1
- package/dist/types/lib/core/CogLayer.d.ts.map +1 -1
- package/dist/types/lib/core/ColorbarGuiControl.d.ts.map +1 -1
- package/dist/types/lib/core/ControlGrid.d.ts.map +1 -1
- package/dist/types/lib/core/HtmlGuiControl.d.ts.map +1 -1
- package/dist/types/lib/core/InspectControl.d.ts.map +1 -1
- package/dist/types/lib/core/LegendGuiControl.d.ts.map +1 -1
- package/dist/types/lib/core/PMTilesLayer.d.ts.map +1 -1
- package/dist/types/lib/core/PrintControl.d.ts.map +1 -1
- package/dist/types/lib/core/SpinGlobeControl.d.ts +91 -0
- package/dist/types/lib/core/SpinGlobeControl.d.ts.map +1 -0
- package/dist/types/lib/core/StacLayer.d.ts.map +1 -1
- package/dist/types/lib/core/TileLayerControl.d.ts +105 -0
- package/dist/types/lib/core/TileLayerControl.d.ts.map +1 -0
- package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -1
- package/dist/types/lib/core/types.d.ts +158 -1
- package/dist/types/lib/core/types.d.ts.map +1 -1
- package/dist/types/react.d.ts.map +1 -1
- package/dist/{webimage-DkvnM6pZ.js → webimage-BXLN-zu8.js} +1 -1
- package/dist/{webimage-BtstXjHv.cjs → webimage-mWTez3Wv.cjs} +1 -1
- package/package.json +36 -12
- package/dist/ControlGrid-CeBx0eSA.cjs +0 -19632
- package/dist/DuckDBConverter-BFCTc7WL.cjs +0 -11
- package/dist/DuckDBConverter-BJE6TxaX.js +0 -320
- package/dist/geotiff-CqKxlcxH.cjs +0 -8
- package/dist/index-B-Nr9y7J.cjs +0 -84
- package/dist/index-B3hAiB3W.js +0 -4
- package/dist/index-B5NoFrpY.js +0 -8892
- package/dist/index-BOzG2jBO.js +0 -4163
- package/dist/index-BcQIUorP.cjs +0 -107
- package/dist/index-C9fk_HKR.js +0 -167
- package/dist/index-CBBRBJvR.cjs +0 -274
- package/dist/index-wUaULgz-.cjs +0 -1
- package/dist/lerc-ClKCnxkg.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
|
[](https://badge.fury.io/js/maplibre-gl-components)
|
|
6
6
|
[](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
|
|