diff options
author | Anton Tananaev <anton@traccar.org> | 2022-10-24 21:50:03 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-10-24 21:50:03 -0700 |
commit | c000fa00d3a4b71a814864b9c805885f85bdd8dc (patch) | |
tree | c32c23d4d11bb8f89d9ac5b9f8598cf43918a1ec /modern/src/other | |
parent | d307f8f7e0556c0a7f4544618a081eb9a80c5845 (diff) | |
download | trackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.tar.gz trackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.tar.bz2 trackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.zip |
Improve map markers
Diffstat (limited to 'modern/src/other')
-rw-r--r-- | modern/src/other/EventPage.js | 12 | ||||
-rw-r--r-- | modern/src/other/ReplayPage.js | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/modern/src/other/EventPage.js b/modern/src/other/EventPage.js index 9da8be79..8adc142c 100644 --- a/modern/src/other/EventPage.js +++ b/modern/src/other/EventPage.js @@ -13,6 +13,7 @@ import MapCamera from '../map/MapCamera'; import MapPositions from '../map/MapPositions'; import MapGeofence from '../map/MapGeofence'; import StatusCard from '../common/components/StatusCard'; +import { formatNotificationTitle } from '../common/util/formatter'; const useStyles = makeStyles(() => ({ root: { @@ -39,6 +40,13 @@ const EventPage = () => { const [position, setPosition] = useState(); const [showCard, setShowCard] = useState(false); + const formatType = (event) => formatNotificationTitle(t, { + type: event.type, + attributes: { + alarms: event.attributes.alarm, + }, + }); + const onMarkerClick = useCallback((positionId) => { setShowCard(!!positionId); }, [setShowCard]); @@ -75,13 +83,13 @@ const EventPage = () => { <IconButton color="inherit" edge="start" sx={{ mr: 2 }} onClick={() => navigate('/')}> <ArrowBackIcon /> </IconButton> - <Typography variant="h6">{t('positionEvent')}</Typography> + <Typography variant="h6">{formatType(event)}</Typography> </Toolbar> </AppBar> <div className={classes.mapContainer}> <MapView> <MapGeofence /> - {position && <MapPositions positions={[position]} onClick={onMarkerClick} />} + {position && <MapPositions positions={[position]} onClick={onMarkerClick} titleField="fixTime" />} </MapView> {position && <MapCamera latitude={position.latitude} longitude={position.longitude} />} {position && showCard && ( diff --git a/modern/src/other/ReplayPage.js b/modern/src/other/ReplayPage.js index ab549eba..8839138f 100644 --- a/modern/src/other/ReplayPage.js +++ b/modern/src/other/ReplayPage.js @@ -161,7 +161,7 @@ const ReplayPage = () => { <MapRoutePath positions={positions} /> <MapRoutePoints positions={positions} onClick={onPointClick} /> {index < positions.length && ( - <MapPositions positions={[positions[index]]} onClick={onMarkerClick} /> + <MapPositions positions={[positions[index]]} onClick={onMarkerClick} titleField="fixTime" /> )} </MapView> <MapCamera positions={positions} /> |