Skip to content

Commit

Permalink
[Fix] Image export change resolution (#2105)
Browse files Browse the repository at this point in the history
* Issue: Changing the exported image resolution led to viewport changes of both the exported and the main map.
* After the fix the map viewport stays the same
  • Loading branch information
igorDykhta committed Jan 23, 2023
1 parent 7d9d54b commit 4e06992
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/src/map-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ export default function MapContainerFactory(
}

_onViewportChange = ({viewState}) => {
if (this.props.isExport) {
// Image export map shouldn't be interactive (otherwise this callback can
// lead to inadvertent changes to the state of the main map)
return;
}
onViewPortChange(
viewState,
this.props.mapStateActions.updateMap,
Expand Down

0 comments on commit 4e06992

Please sign in to comment.