vicmora / MMM-GoogleMapsTraffic

A raspberry pi MagicMirror module that displays a map, centered at provided coordinates, with Google Maps Traffic information.
MIT License
90 stars 32 forks source link

MM Please Create config file Error. #38

Open MagicMoeed opened 3 years ago

MagicMoeed commented 3 years ago

So i have been looking at this thread and following all the comments but nothing seems to help. { module: 'MMM-GoogleMapsTraffic', position: 'top_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 is what i have in my config. I have fixed added the comma at the end of 300px' and also tried it by removing the bit where it refers to "Makers:[" I am complete new to this and been tackling with this for days.

Is there anyone who can help. I apologies in advance if i sound silly.

r1ckylol commented 3 years ago

I am also having the same issue just now.

Did you get an API key? I changed, styledmpatype: from transparent to standard, since it gave me an error on that line

MagicMoeed commented 3 years ago

I am also having the same issue just now.

Did you get an API key? I changed, styledmpatype: from transparent to standard, since it gave me an error on that line

I did get an API. I have tried changing it to standard and night but nothing. i have noticed some of the quotations were single so i changed them all to double too . "(not sure if it was a good idea). But nothing seems to work

r1ckylol commented 3 years ago

this is how I have mine:
{ module: "MMM-GoogleMapsTraffic", position: "bottom_right", config: { key: "private xx", lat: 36.xxxxxx, lng: -122.xxxxxx, height: "300px", width: "300px", styledMapType: "standard", disableDefaultUI: true, backgroundColor: 'hsla(0, 0%, 0%, 0)', markers: [ { lat: 36.xxxxxx, lng: 122.xxxxx, fillColor: '#9966ff' },

I'm also getting the error, create config file error =[

MagicMoeed commented 3 years ago

I have zero knowledge of coding, All i am doing is copy pasting codes but i have checked on code checker and its coming up with this message: Syntax errors detected :

Line 18: }, ^ SyntaxError: unexpected EOF while parsing

line 18 is basically the last line you posted

r1ckylol commented 3 years ago

@MagicMoeed I got it working!

Refer to this thread: https://github.com/vicmora/MMM-GoogleMapsTraffic/issues/33

Now I just have to figure out the size numbers to make it smaller, its half of my screen

MagicMoeed commented 3 years ago

@MagicMoeed I got it working!

Refer to this thread: #33

Now I just have to figure out the size numbers to make it smaller, its half of my screen

I have tried that . Did not work for me . i will give it another go and see if it works.

Meanwhile mind sharing your code?

MagicMoeed commented 3 years ago

image

r1ckylol commented 3 years ago

@MagicMoeed I got it working! Refer to this thread: #33 Now I just have to figure out the size numbers to make it smaller, its half of my screen

I have tried that . Did not work for me . i will give it another go and see if it works.

Meanwhile mind sharing your code?

I will share it when I get home from work this evening. :-)

r1ckylol commented 3 years ago

Here what I have: { module: "MMM-GoogleMapsTraffic", position: "bottom_right", config: { key: "xxxxxxxxx_xxxxxxxxxxxxxx", lat: 36.97xxxxx, lng: -122.02xxxxx, zoom: 14, height: "750px", width: "600px", styledMapType: "night", disableDefaultUI: true, backgroundColor: "hsla(0, 0%, 0%, 0)", }, },

This is in my config.js file. Added between my calendar and clock code. Hope this helps!

MagicMoeed commented 3 years ago

Here what I have: { module: "MMM-GoogleMapsTraffic", position: "bottom_right", config: { key: "xxxxxxxxx_xxxxxxxxxxxxxx", lat: 36.97xxxxx, lng: -122.02xxxxx, zoom: 14, height: "750px", width: "600px", styledMapType: "night", disableDefaultUI: true, backgroundColor: "hsla(0, 0%, 0%, 0)", }, },

This is in my config.js file. Added between my calendar and clock code. Hope this helps!

I manage to fix mine with a bit of a help from you and a relative of mine.

Here is what my code looks like { module: "MMM-GoogleMapsTraffic", position: "top_center", config: { key: "My key", lat: 5xxxx, lng: -2.xx, zoom: 15, height: "500px", width: "800px", styledMapType: "night", disableDefaultUI: true, backgroundColor: "hsla(0, 0%, 0%, 0)", }, },

MagicMoeed commented 3 years ago

WhatsApp Image 2020-12-17 at 15 06 14

r1ckylol commented 3 years ago

Sweet, it looks good!

Sh-Karl commented 3 years ago

Hi ! Thank you for this thread, it was help me a lot. But at the end I have the same problem with Google, can you tell me how you fix it ?

(my screen is in french, but it's the same text) Sans titre

maxduinhoven commented 1 year ago

this is how the basic config file should look like:

{ module: 'MMM-GoogleMapsTraffic', position: 'top_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' }, ], }, },