File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 44
55- Fix: PDF export with download: false now works correctly.
66- Fix: Adjust documentation to properly describe optionality of configuration parameters.
7+ - Fix: Map interactions are now disabled during the export process so potential interaction features won't be exported
78- Chore: Update dependencies to latest versions.
89
910## 1.2.0
Original file line number Diff line number Diff line change 11import { jsPDF } from 'jspdf'
22import { PolarActionTree } from '@polar/lib-custom-types'
3+ import { Interaction } from 'ol/interaction'
34import { ExportFormat , ExportGetters , ExportState } from '../types'
45
56const actions : PolarActionTree < ExportState , ExportGetters > = {
@@ -25,6 +26,13 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
2526 // Screenshot canvas
2627 const CANVAS_ID = 'export-canvas'
2728
29+ const disabledInteractions : Array < Interaction > = [ ]
30+
31+ map . getInteractions ( ) . forEach ( ( interaction ) => {
32+ disabledInteractions . push ( interaction )
33+ interaction . setActive ( false )
34+ } )
35+
2836 map . once ( 'postrender' , function ( ) {
2937 // Map properties
3038 const size = map . getSize ( )
@@ -102,6 +110,10 @@ const actions: PolarActionTree<ExportState, ExportGetters> = {
102110 }
103111 }
104112
113+ disabledInteractions . forEach ( ( interaction ) => {
114+ interaction . setActive ( true )
115+ } )
116+
105117 commit ( 'setExportedMap' , src )
106118 } )
107119 map . renderSync ( )
You can’t perform that action at this time.
0 commit comments