You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add onExport handler so hosts can save GeoJSON exports (#5)
* feat: add onExport handler so hosts can save GeoJSON exports
The layer export button downloads GeoJSON via an anchor element, which
works in browsers but not in desktop webviews (e.g. Tauri) that have no
download manager, so the button appears to do nothing there.
Add an optional `onExport(filename, data)` control option. When set, the
control delegates the export to it instead of triggering the browser
download, letting a host application save the file with its own dialog.
Default behavior (browser download) is unchanged when no handler is set.
* Address CodeRabbit review feedback
- Guard the host onExport callback in exportLayer with try/catch: a throwing
host handler no longer breaks the click path. On failure we surface a notice,
set the error state, and return null so UI feedback stays consistent.
0 commit comments