diff --git a/frontend/src/features/Dashboard/hooks/useExportImages.tsx b/frontend/src/features/Dashboard/hooks/useExportImages.tsx index 597c53639..521136245 100644 --- a/frontend/src/features/Dashboard/hooks/useExportImages.tsx +++ b/frontend/src/features/Dashboard/hooks/useExportImages.tsx @@ -171,9 +171,6 @@ 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) { @@ -181,6 +178,9 @@ export function useExportImages({ triggerExport }: ExportLayerProps) { 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]) @@ -195,6 +195,9 @@ export function useExportImages({ triggerExport }: ExportLayerProps) { }) }) } + } else { + dashboardFeature.setStyle([measurementStyle, measurementStyleWithCenter]) + layersVectorSourceRef.current.addFeature(dashboardFeature) } extractReportingFeatures(features)