aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/map/MapMarkers.js2
-rw-r--r--modern/src/reports/CombinedReportPage.js10
2 files changed, 11 insertions, 1 deletions
diff --git a/modern/src/map/MapMarkers.js b/modern/src/map/MapMarkers.js
index 2fbfceea..7cb3b8a5 100644
--- a/modern/src/map/MapMarkers.js
+++ b/modern/src/map/MapMarkers.js
@@ -43,7 +43,7 @@ const MapMarkers = ({ markers }) => {
},
properties: {
category: category || 'default',
- color,
+ color: color || 'neutral',
},
})),
});
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>