Read the statement by Michael Teeuw here.
MM & Google Maps Traffic
-
Please install the MMM-Traffic module and replace the MMM-Traffic.js with the above code.
Below is a sample entry in config.js{ module: 'MMM-Traffic', position: 'top_left', classes: 'dimmed medium', //optional, default is 'bright medium', only applies to commute info not route_name config: { api_key: '', // Your Google Maps API_KEY needs to go here mode: 'driving', origin: '', destination: '', mon_destination: '', arrival_time: '', //optional, but needs to be in 24 hour time if used. route_name: 'Home to Work', changeColor: true, showGreen: false, limitYellow: 5, //Greater than 5% of journey time due to traffic limitRed: 20, //Greater than 20% of journey time due to traffic traffic_model: 'best_guess', interval: 60000, //2 minutes showWeekend: true, allTime: true, width: '300px', height: '300px' } },
-
There are two catches which I will try to correct:
- The Google Maps have their own lifecycle which I could not align with MM module’s. So you may not see the map in the first instance but it will get uploaded within the next interval (as configured in config.interval).
- The Maps div element keeps getting refreshed after every interval which is a bit irritating :(
-
@birdy you are missing quotes around the drivin mode, should be
mode: 'driving'
-
@Mirrorolentia - I was thinking of trying this too, but looks like you have made some progress. I hope to dig into what you have later this week. I had seen some further customization I would like to add when time allows. Thanks for the work on this!
-
@devtech8
Sure that would be great! Thanks! -
@Mirrorolentia - wow, thx!! I will test it later :) can’t await
-
so, as a complete noobie, I just pasted the code (adding Google Api key) in both files.
I can see, there is a gap in the corner (I hope for the map) and if I get you correctly, the map will load “soon”(?).
Thank you one more time and will keep u posted.
Cheers
Birdy -
@birdy
Yes that is correct. You will need to copy the lines from /global module**/ all the way till end…somehow the comments didn’t embed the code correctly -
somehow it’s not working:
-
@birdy
Seems like the MM system didn’t initialize the module itself :(
Are you seeing any errors on the console from where you run “node serveronly” or on the chromium browser i.e from More Tools–> Developer Tools–>Console.