Skip to content

Commit

Permalink
Also set selectedFormatConfiguration when changing selected MapExport…
Browse files Browse the repository at this point in the history
… format
  • Loading branch information
manisandro committed Feb 28, 2024
1 parent b8c179e commit 4a316de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/MapExport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class MapExport extends React.Component {
exporting: false,
availableFormats: [],
selectedFormat: null,
selectedFormatConfiguration: '',
scale: '',
pageSize: null,
dpi: 96
Expand Down Expand Up @@ -131,7 +132,12 @@ class MapExport extends React.Component {
}
}
formatChanged = (ev) => {
this.setState({selectedFormat: ev.target.value});
const selectedFormat = ev.target.value;
const selectedFormatConfiguration = ((this.props.formatConfiguration?.[selectedFormat] || [])[0] || {}).name;
this.setState({
selectedFormat: selectedFormat,
selectedFormatConfiguration: selectedFormatConfiguration
});
};
dpiChanged = (ev) => {
this.setState({dpi: parseInt(ev.target.value, 10)});
Expand Down

0 comments on commit 4a316de

Please sign in to comment.