Skip to content

bendardenne/MMM-TomTomTraffic

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
img
 
 
 
 
 
 
 
 
 
 
 
 
 
 

MMM-TomTomTraffic

This is a module for the MagicMirror².

This module shows a map with traffic density from TomTom's traffic API.

Example screenshot

Using the module

To use this module, add the following configuration block to the modules array in the config/config.js file:

var config = {
    modules: [
      {
        module: "MMM-TomTomTraffic",
        position: "bottom_left",
        config: {
          location: [50.8320000, 4.3818633],
          size: 500,
          zoomLevel: 14,
          tomtom: {
            apiToken: "TOM TOM API TOKEN",
            thickness: 4,
          },
          mapbox: {
            apiToken: "MAPBOX API TOKEN",
            mapId: "mapbox/light-v10"
          }
        }
      }
    ]
}

Configuration options

Option Description
location Required Array of Lon, Lat of the center of the map.
size Optional Size (in pixels) of the component. Default: 300
zoomLevel Optional Zoom level of the map. Default: 14
tomtom.apiToken Required Tom Tom API token.
tomtom.thickness Optional Thickness factor for the traffic lines. Default: 5
mapbox.apiToken Optional Mapbox API token. If not provided, no background data will be shown.
mapbox.mapId Optional Mapbox map id. This is of the form "user/styleId". Mapbox provides a couple of default styles. You can also make your own style in MapBox studio. The default style is a slightly tweaked version of Decimal (without labels).

API tokens

TomTom

To obtain a TomTom API token, go to https://developer.tomtom.com/ and create an account. Then create an app. Use the "Consumer API Key" in the configuration of the module.

MapBox

This is optional. If you don't provide a MapBox API token, no background data will be loaded and only the traffic map from TomTom will be shown. To obtain a token, go to https://account.mapbox.com and create an account, then create a token.

About

MagicMirror module showing a map with traffic congestion data from TomTom APIs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published