Skip to content

Commit

Permalink
Merge pull request #151 from Dataport/fix/POLAR-339-no-interactions-i…
Browse files Browse the repository at this point in the history
…n-exports

disable map interactions while exporting
  • Loading branch information
ludoholic authored Jul 31, 2024
2 parents ba32b42 + 53bb295 commit 68c761d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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: Disable map interactions 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 @@ -25,6 +25,10 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
// 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()
Expand Down Expand Up @@ -102,6 +106,10 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
}
}

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

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

0 comments on commit 68c761d

Please sign in to comment.