2f1c42a1b4013a3c00fab862443fa699fbca773f
MMM-CombinedMap
A MagicMirror² module that displays a combined map with:
- Rain radar from DWD (Deutscher Wetterdienst) with animated history and forecast
- Traffic layer from TomTom showing real-time traffic flow and incidents
All on a sleek dark-themed Leaflet map.
Installation
-
Navigate to your MagicMirror modules folder:
cd ~/MagicMirror/modules -
Clone this repository:
git clone https://gitea.olex.me/clawd/MMM-CombinedMap.git -
No npm install needed - dependencies are loaded from CDN.
Configuration
Add the module to your config/config.js:
{
module: "MMM-CombinedMap",
position: "bottom_right",
config: {
lat: 49.8833, // Latitude of map center
lng: 8.8333, // Longitude of map center
zoom: 7, // Zoom level (1-18)
width: "300px", // Map width
height: "300px", // Map height
showMarker: true, // Show a marker at center
markerColor: "#3388ff", // Marker color
showTraffic: true, // Enable traffic layer
showRadar: true, // Enable rain radar layer
tomtomApiKey: "", // Your TomTom API key (required for traffic)
animationSpeed: 500, // Radar animation speed (ms per frame)
radarOpacity: 0.7, // Rain radar opacity (0-1)
trafficOpacity: 0.7, // Traffic layer opacity (0-1)
updateInterval: 300000 // Radar refresh interval (ms), default 5 min
}
}
Getting a TomTom API Key
- Go to developer.tomtom.com
- Create a free account
- Create a new application
- Copy the API key
- Free tier includes 50,000 tile requests per day
How It Works
Base Map
Uses CartoDB Dark Matter tiles - a dark-themed OpenStreetMap-based tileset perfect for MagicMirror displays.
Traffic Layer
TomTom provides two overlay layers:
- Traffic Flow: Color-coded roads (green = free, yellow = moderate, red = heavy, dark red = blocked)
- Traffic Incidents: Icons for accidents, roadwork, closures
Rain Radar
DWD (German Weather Service) provides free WMS radar data:
- Past 2 hours: Actual radar observations (every 5 minutes)
- Next 2 hours: Nowcast/forecast data
The radar animates through all frames showing precipitation movement and predicted evolution.
Timestamp Display
The timestamp overlay in the corner shows:
- Negative values (e.g.,
-30 min): Historical radar data - Now: Current observation
- Positive values (e.g.,
+30 min): Forecast/nowcast - shown with blue background
Data Sources
- Base Map: CartoDB/OpenStreetMap
- Traffic: TomTom Traffic API
- Rain Radar: DWD Open Data
License
MIT License
Credits
Built by James for Olex's MagicMirror setup.
Description
MagicMirror module combining rain radar (DWD) and traffic (TomTom) on a single Leaflet map
Languages
JavaScript
78.8%
CSS
21.2%
