Read the statement by Michael Teeuw here.
MMM-GoogleMapsTraffic
-
@evroom ```here is my code
{ module: "calendar", header: "US Holidays", position: "top_left", config: { calendars: [ { symbol: "calendar-check-o ", url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics" } ] } }, { module: "compliments", position: "lower_third" }, var config = { modules: [ { module: 'MMM-GoogleMapsTraffic', position: 'bottom_left', config: { key: 'YOUR_KEY', lat: 37.8262306, lng: -122.2920096, height: '300px', width: '300px' styledMapType: "transparent", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 37.8262316, lng: -122.2920196, fillColor: '#9966ff' }, ], }, } ]
}
-
Yes, the README tricked you a bit.
Remove this:
var config = { modules: [
and the last 2 lines:
} ]
Verify with:
cd ~/MagicMirror; npm run config:check
-
did what you said and did the config check and this is what i got
Line 134 col 5 Unexpected ‘]’.
Line 134 col 5 Expected an identifier and instead saw ‘]’.
Line 134 col 6 Missing semicolon.
Line 134 col 5 Unrecoverable syntax error. (95% scanned).
pi@raspberrypi:~/MagicMirror $ -
it says line 134 but the only thing on line 134 is a ]
here is my code leading up to 134
{ module: "MMM-EARTH", position: "bottom_center", config: { mode: "Natural", rotateInterval: 15000, MaxWidth: "50%", MaxHeight: "50%", } }, ] };
That is line 116 to 136 the end of my config
-
This is your current config entry
var config = { modules: [ { module: 'MMM-GoogleMapsTraffic', position: 'bottom_left', config: { key: 'YOUR_KEY', lat: 37.8262306, lng: -122.2920096, height: '300px', width: '300px' styledMapType: "transparent", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 37.8262316, lng: -122.2920196, fillColor: '#9966ff' }, ], }, } ]
Make it look like this or copy and paste
{ module: 'MMM-GoogleMapsTraffic', position: 'bottom_left', config: { key: 'YOUR_KEY', lat: 37.8262306, lng: -122.2920096, height: '300px', width: '300px' styledMapType: "transparent", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 37.8262316, lng: -122.2920196, fillColor: '#9966ff' }, ], },
Props to @evroom
-
@mykle1 said in MMM-GoogleMapsTraffic:
{ module: 'MMM-GoogleMapsTraffic', position: 'bottom_left', config: { key: 'YOUR_KEY', lat: 37.8262306, lng: -122.2920096, height: '300px', width: '300px' styledMapType: "transparent", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 37.8262316, lng: -122.2920196, fillColor: '#9966ff' }, ], },
still getting a error
-
Sorry about that. I just checked it. Try this please. There was a comma missing after
width: '300px',
and no comma after the closing } Not your fault. The example in the readme is incorrect{ module: 'MMM-GoogleMapsTraffic', position: 'bottom_left', config: { key: 'YOUR_KEY', lat: 37.8262306, lng: -122.2920096, height: '300px', width: '300px', styledMapType: "transparent", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 37.8262316, lng: -122.2920196, fillColor: '#9966ff' }, ], } },
-
this worked thank you!!
-
You’re welcome, mate. :thumbsup:
-
it all seems to be working but googlemaps can not be loaded, i used a new key though
any ideas?