Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable map interactions while exporting #151

Merged
merged 6 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/plugins/Export/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix: PDF export with download:false now works correctly.
- Fix: Adjust documentation to properly describe optionality of configuration parameters.
- Fix: Map interactions are now disabled during the export process so potential interaction features won't be exported
- Chore: Update dependencies to latest versions.

## 1.2.0
Expand Down
8 changes: 8 additions & 0 deletions packages/plugins/Export/src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ExportFormat, ExportGetters, ExportState } from '../types'

const actions: PolarActionTree<ExportState, ExportGetters> = {
exportAs(

Check warning on line 6 in packages/plugins/Export/src/store/actions.ts

View workflow job for this annotation

GitHub Actions / lint-test

Method 'exportAs' has too many lines (111). Maximum allowed is 50
{ commit, getters: { download }, rootGetters: { map } },
type: ExportFormat
) {
Expand All @@ -25,7 +25,11 @@
// Screenshot canvas
const CANVAS_ID = 'export-canvas'

map.getInteractions().forEach((interaction) => {
interaction.setActive(false)
})

map.once('postrender', function () {

Check warning on line 32 in packages/plugins/Export/src/store/actions.ts

View workflow job for this annotation

GitHub Actions / lint-test

Function has too many lines (83). Maximum allowed is 50
// Map properties
const size = map.getSize()
if (!Array.isArray(size) || size.length !== 2) {
Expand Down Expand Up @@ -102,6 +106,10 @@
}
}

map.getInteractions().forEach((interaction) => {
interaction.setActive(true)
})

commit('setExportedMap', src)
})
map.renderSync()
Expand Down
Loading