Skip to content

Commit

Permalink
[Brief] Fix dashboardFeature style when feature flag is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Jan 30, 2025
1 parent 1752843 commit 32dd27d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/features/Dashboard/hooks/useExportImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ export function useExportImages({ triggerExport }: ExportLayerProps) {
return allImages
}

dashboardFeature.setStyle([measurementStyle, measurementStyleWithCenter])
layersVectorSourceRef.current.addFeature(dashboardFeature)

if (isBriefWithImagesEnabled) {
// eslint-disable-next-line no-restricted-syntax
for (const feature of features) {
mapContext.clearRect(0, 0, mapCanvas.width, mapCanvas.height)
layersVectorSourceRef.current.clear()
layersVectorSourceRef.current.addFeature(feature)

dashboardFeature.setStyle([measurementStyle, measurementStyleWithCenter])
layersVectorSourceRef.current.addFeature(dashboardFeature)

// eslint-disable-next-line no-await-in-loop
await zoomToFeatures([dashboardFeature, feature])

Expand All @@ -195,6 +195,9 @@ export function useExportImages({ triggerExport }: ExportLayerProps) {
})
})
}
} else {
dashboardFeature.setStyle([measurementStyle, measurementStyleWithCenter])
layersVectorSourceRef.current.addFeature(dashboardFeature)
}

extractReportingFeatures(features)
Expand Down

0 comments on commit 32dd27d

Please sign in to comment.