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/EventPage.js | |
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/EventPage.js')
-rw-r--r-- | modern/src/other/EventPage.js | 12 |
1 files changed, 10 insertions, 2 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 && ( |