Skip to content

Commit

Permalink
export missing png bug on safari workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Dec 4, 2023
1 parent ca58b40 commit afade92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion teammapper-frontend/mmp/src/map/handlers/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export default class Export {
if (typeof type === 'string') {
type = 'image/' + type
}

// Safari seems to have an issue with loading all included images on time during the download of the data url.
// This is a small workaround, as calling toBlob before seems to solve the problem most of the times.
if (navigator.userAgent.search("Safari") >= 0 && navigator.userAgent.search("Chrome") < 0) canvas.toBlob(() => {})
callback(canvas.toDataURL(type))
this.map.events.call(Event.exportImage)
}
Expand Down

0 comments on commit afade92

Please sign in to comment.