Skip to content

Commit

Permalink
fix: rename variable and remove unused callback
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed Oct 6, 2022
1 parent 59d7f9d commit 11a59be
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/ToolMenu/FeatureInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,17 @@ export const FeatureInfo: React.FC<FeatureInfoProps> = ({
const onSuccess = (coordinateInfoState: CoordinateInfoState) => {
const features = coordinateInfoState.features;

const o: SelectedFeatures = {};
const serializedFeatures: SelectedFeatures = {};
Object.entries(features).forEach(entry => {
const layerName = entry[0];
const feats = entry[1];
const selectedFeatures = entry[1];

o[layerName] = new OlFormatGeoJSON().writeFeatures(feats);
serializedFeatures[layerName] = new OlFormatGeoJSON().writeFeatures(selectedFeatures);
});

dispatch(setSelectedFeatures(o));
dispatch(setSelectedFeatures(serializedFeatures));
};

const onError = () => {};

return (
<div className='feature-info-panel'>
<CoordinateInfo
Expand All @@ -187,7 +185,6 @@ export const FeatureInfo: React.FC<FeatureInfoProps> = ({
resultRenderer={resultRenderer}
fetchOpts={getFetchOpts()}
onSuccess={onSuccess}
onError={onError}
{...restProps}
/>
</div>
Expand Down

0 comments on commit 11a59be

Please sign in to comment.