aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-12 08:14:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-12 08:14:03 -0700
commit9b2d9f747812a43282614304f9ae7a37e71523c1 (patch)
treeda8cff87cddb52435902f6c1bd679f57707161d3
parent29433f9dea1aad1611ccc2a02b93aeb4eb1d0912 (diff)
downloadtrackermap-web-9b2d9f747812a43282614304f9ae7a37e71523c1.tar.gz
trackermap-web-9b2d9f747812a43282614304f9ae7a37e71523c1.tar.bz2
trackermap-web-9b2d9f747812a43282614304f9ae7a37e71523c1.zip
Add traffic overlays
-rw-r--r--modern/src/map/overlay/useMapOverlays.js15
-rw-r--r--web/l10n/en.json2
2 files changed, 17 insertions, 0 deletions
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 [
@@ -61,6 +62,20 @@ export default () => {
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'),
source: sourceCustom(customMapOverlay),
diff --git a/web/l10n/en.json b/web/l10n/en.json
index dc1aff32..46378c96 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -288,6 +288,8 @@
"mapLocationIqHybrid": "LocationIQ Hybrid",
"mapLocationIqKey": "LocationIQ Access Token",
"mapTomTomBasic": "TomTom Basic",
+ "mapTomTomFlow": "TomTom Traffic Flow",
+ "mapTomTomIncidents": "TomTom Traffic Incidents",
"mapTomTomKey": "TomTom API Key",
"mapShapePolygon": "Polygon",
"mapShapeCircle": "Circle",