Skip to content

Commit 68c761d

Browse files
authored
Merge pull request #151 from Dataport/fix/POLAR-339-no-interactions-in-exports
disable map interactions while exporting
2 parents ba32b42 + 53bb295 commit 68c761d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/plugins/Export/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fix: PDF export with download:false now works correctly.
66
- Fix: Adjust documentation to properly describe optionality of configuration parameters.
7+
- Fix: Disable map interactions during the export process so potential interaction features won't be exported.
78
- Chore: Update dependencies to latest versions.
89

910
## 1.2.0

packages/plugins/Export/src/store/actions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
2525
// Screenshot canvas
2626
const CANVAS_ID = 'export-canvas'
2727

28+
map.getInteractions().forEach((interaction) => {
29+
interaction.setActive(false)
30+
})
31+
2832
map.once('postrender', function () {
2933
// Map properties
3034
const size = map.getSize()
@@ -102,6 +106,10 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
102106
}
103107
}
104108

109+
map.getInteractions().forEach((interaction) => {
110+
interaction.setActive(true)
111+
})
112+
105113
commit('setExportedMap', src)
106114
})
107115
map.renderSync()

0 commit comments

Comments
 (0)