maplibre-gl-components 0.20.6 → 0.22.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 +47 -1
- package/dist/ControlGrid-BBOB4hcq.cjs +16851 -0
- package/dist/ControlGrid-CXnEfoxn.js +102866 -0
- package/dist/{DuckDBConverter-G6cWy2IS.js → DuckDBConverter-BmkTmy9v.js} +27 -27
- package/dist/{DuckDBConverter-4zGbThM1.cjs → DuckDBConverter-CY3p1iVn.cjs} +1 -1
- package/dist/{ShapefileConverter-BefhyBOj.js → ShapefileConverter-Bgv06LK7.js} +1 -1
- package/dist/{ShapefileConverter-Dk_BW4ca.cjs → ShapefileConverter-D3wQtYHO.cjs} +1 -1
- package/dist/{geotiff-BsSRJ-4E.js → geotiff-BFWKZ7Ej.js} +10 -11
- package/dist/{geotiff-GFm9cPD1.cjs → geotiff-DvXk5w3O.cjs} +2 -2
- package/dist/{globals-BKIWameS.js → globals-Da065JQj.js} +55 -33
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +138 -136
- package/dist/{lerc-IUhdhKhj.js → lerc-CwzT0cMz.js} +9 -10
- package/dist/{lerc-CPfGdIIh.cjs → lerc-cUMeQO-8.cjs} +1 -1
- package/dist/{maplibre-geoman.es-BC6M2gop.cjs → maplibre-geoman.es-DqoIAudd.cjs} +1 -1
- package/dist/maplibre-gl-components.css +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +10 -10
- package/dist/types/lib/core/BookmarkControl.d.ts +34 -1
- package/dist/types/lib/core/BookmarkControl.d.ts.map +1 -1
- package/dist/types/lib/core/types.d.ts +46 -1
- package/dist/types/lib/core/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/ControlGrid-BmxIgQg5.js +0 -150653
- package/dist/ControlGrid-ChGLgBGL.cjs +0 -17280
package/README.md
CHANGED
|
@@ -1300,7 +1300,53 @@ See the [measure-control example](./examples/measure-control/) for a complete wo
|
|
|
1300
1300
|
|
|
1301
1301
|
### BookmarkControl
|
|
1302
1302
|
|
|
1303
|
-
A control for saving and restoring map views with localStorage persistence.
|
|
1303
|
+
A control for saving and restoring map views with localStorage persistence. The
|
|
1304
|
+
panel is resizable by dragging its corner, bookmarks can be reordered by dragging
|
|
1305
|
+
their grip handle, an optional per-item checkbox lets a subset be exported, and a
|
|
1306
|
+
`captureState`/`restoreState` hook lets the host persist extra state (e.g. which
|
|
1307
|
+
layers were visible) alongside each view.
|
|
1308
|
+
|
|
1309
|
+
```typescript
|
|
1310
|
+
interface BookmarkControlOptions {
|
|
1311
|
+
position?: ControlPosition; // Control position (default: 'top-right')
|
|
1312
|
+
className?: string; // Custom CSS class
|
|
1313
|
+
visible?: boolean; // Initial visibility (default: true)
|
|
1314
|
+
collapsed?: boolean; // Start collapsed (default: true)
|
|
1315
|
+
bookmarks?: MapBookmark[]; // Initial bookmarks
|
|
1316
|
+
storageKey?: string; // localStorage key for persistence
|
|
1317
|
+
maxBookmarks?: number; // Maximum bookmarks (default: 20)
|
|
1318
|
+
generateThumbnails?: boolean; // Capture a thumbnail per bookmark
|
|
1319
|
+
flyToDuration?: number; // Fly-to animation ms (default: 1500)
|
|
1320
|
+
panelWidth?: number; // Panel width in pixels (default: 260)
|
|
1321
|
+
maxHeight?: number; // Max panel height when not resizable
|
|
1322
|
+
resizable?: boolean; // Drag-resize the panel (default: true)
|
|
1323
|
+
reorderable?: boolean; // Drag-reorder bookmarks (default: true)
|
|
1324
|
+
selectable?: boolean; // Per-item export checkboxes (default: false)
|
|
1325
|
+
captureState?: () => Record<string, unknown> | undefined; // State to store on a new bookmark
|
|
1326
|
+
restoreState?: (extra: Record<string, unknown> | undefined) => void; // Restore on open
|
|
1327
|
+
captureStateLabel?: string; // When set, show an opt-in checkbox in the add form
|
|
1328
|
+
captureStateDefault?: boolean; // Initial state of that checkbox (default: true)
|
|
1329
|
+
backgroundColor?: string;
|
|
1330
|
+
borderRadius?: number;
|
|
1331
|
+
fontSize?: number;
|
|
1332
|
+
fontColor?: string;
|
|
1333
|
+
minzoom?: number;
|
|
1334
|
+
maxzoom?: number;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// Methods
|
|
1338
|
+
bookmarkControl.getBookmarks() // All bookmarks
|
|
1339
|
+
bookmarkControl.addBookmark(name?) // Add a bookmark for the current view
|
|
1340
|
+
bookmarkControl.removeBookmark(id)
|
|
1341
|
+
bookmarkControl.goTo(id) // Fly to a bookmark (and restore its state)
|
|
1342
|
+
bookmarkControl.clear()
|
|
1343
|
+
bookmarkControl.importBookmarks(bookmarks) // Append an array of bookmarks
|
|
1344
|
+
bookmarkControl.exportBookmarks() // JSON string (selected subset if any)
|
|
1345
|
+
bookmarkControl.getSelectedIds() // IDs ticked for selective export
|
|
1346
|
+
bookmarkControl.setSelectedIds(ids) // Set the export selection
|
|
1347
|
+
bookmarkControl.on('reorder', handler) // Fired after a drag-reorder
|
|
1348
|
+
bookmarkControl.on('export', handler) // Fired after an export
|
|
1349
|
+
```
|
|
1304
1350
|
|
|
1305
1351
|
See the [bookmark-control example](./examples/bookmark-control/) for a complete working example.
|
|
1306
1352
|
|