aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/reports')
-rw-r--r--modern/src/reports/CombinedReportPage.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/modern/src/reports/CombinedReportPage.js b/modern/src/reports/CombinedReportPage.js
index 59d5fb69..4efc7b9c 100644
--- a/modern/src/reports/CombinedReportPage.js
+++ b/modern/src/reports/CombinedReportPage.js
@@ -17,6 +17,7 @@ import MapGeofence from '../map/MapGeofence';
import { formatTime } from '../common/util/formatter';
import { usePreference } from '../common/util/preferences';
import { prefixString } from '../common/util/stringUtils';
+import MapMarkers from '../map/MapMarkers';
const CombinedReportPage = () => {
const classes = useReportStyles();
@@ -29,6 +30,14 @@ const CombinedReportPage = () => {
const [items, setItems] = useState([]);
const [loading, setLoading] = useState(false);
+ const createMarkers = () => items.flatMap((item) => item.events.map((event) => {
+ const position = item.positions.find((p) => event.positionId === p.id);
+ return {
+ latitude: position.latitude,
+ longitude: position.longitude,
+ };
+ }));
+
const handleSubmit = useCatch(async ({ deviceIds, groupIds, from, to }) => {
const query = new URLSearchParams({ from, to });
deviceIds.forEach((deviceId) => query.append('deviceId', deviceId));
@@ -60,6 +69,7 @@ const CombinedReportPage = () => {
coordinates={item.route}
/>
))}
+ <MapMarkers markers={createMarkers()} />
</MapView>
<MapCamera coordinates={items.flatMap((item) => item.route)} />
</div>