From 9b2d9f747812a43282614304f9ae7a37e71523c1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 12 Jun 2022 08:14:03 -0700 Subject: Add traffic overlays --- modern/src/map/overlay/useMapOverlays.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modern/src') diff --git a/modern/src/map/overlay/useMapOverlays.js b/modern/src/map/overlay/useMapOverlays.js index 94baab3e..e7ea7322 100644 --- a/modern/src/map/overlay/useMapOverlays.js +++ b/modern/src/map/overlay/useMapOverlays.js @@ -16,6 +16,7 @@ export default () => { const t = useTranslation(); const openWeatherKey = useAttributePreference('openWeatherKey'); + const tomTomKey = useAttributePreference('tomTomKey'); const customMapOverlay = useSelector((state) => state.session.server?.overlayUrl); return [ @@ -60,6 +61,20 @@ export default () => { available: !!openWeatherKey, attribute: 'openWeatherKey', }, + { + id: 'tomTomFlow', + title: t('mapTomTomFlow'), + source: sourceCustom([`https://api.tomtom.com/traffic/map/4/tile/flow/absolute/{z}/{x}/{y}.png?key=${tomTomKey}`]), + available: !!tomTomKey, + attribute: 'tomTomKey', + }, + { + id: 'tomTomIncidents', + title: t('mapTomTomIncidents'), + source: sourceCustom([`https://api.tomtom.com/traffic/map/4/tile/incidents/s3/{z}/{x}/{y}.png?key=${tomTomKey}`]), + available: !!tomTomKey, + attribute: 'tomTomKey', + }, { id: 'custom', title: t('mapOverlayCustom'), -- cgit v1.2.3