diff --git a/src/reports/CombinedReportPage.jsx b/src/reports/CombinedReportPage.jsx index 32ad5df0f8..f591a7a170 100644 --- a/src/reports/CombinedReportPage.jsx +++ b/src/reports/CombinedReportPage.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useMemo, useState } from 'react'; import { useSelector } from 'react-redux'; import { Table, TableBody, TableCell, TableHead, TableRow, @@ -27,6 +27,8 @@ const CombinedReportPage = () => { const [items, setItems] = useState([]); const [loading, setLoading] = useState(false); + const itemsCoordinates = useMemo(() => items.flatMap((item) => item.route), [items]); + const createMarkers = () => items.flatMap((item) => item.events .map((event) => item.positions.find((p) => event.positionId === p.id)) .filter((position) => position != null) @@ -68,7 +70,7 @@ const CombinedReportPage = () => { ))} - item.route)} /> + )}