Add pings back to map

This commit is contained in:
Fergal Moran
2024-01-29 20:30:08 +00:00
parent bdcf7c345f
commit f3d5b025ef

View File

@@ -27,26 +27,23 @@ const MainMap: React.FC<MainMapProps> = ({ kids }) => {
zoom={10} zoom={10}
scrollWheelZoom={true} scrollWheelZoom={true}
> >
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"> <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
<> {kids?.map((kid) =>
{kids?.map((kid) => kid.devices?.map((device) =>
kid.devices?.map((device) => device.pings.map((ping) => (
device.pings.map((ping) => ( <MapMarker
<MapMarker key={ping.id}
key={ping.id} deviceId={device.id}
deviceId={device.id} childName={kid.name}
childName={kid.name} avatar={kid.avatar}
avatar={kid.avatar} deviceName={device.name}
deviceName={device.name} latitude={ping.latitude}
latitude={ping.latitude} longitude={ping.longitude}
longitude={ping.longitude} timestamp={ping.timestamp}
timestamp={ping.timestamp} />
/> )),
)), ),
), )}
)}
</>
</TileLayer>
</MapContainer> </MapContainer>
</div> </div>
); );