Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

NOAA Weather Radio

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
acatalano
Posts: 91
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

NOAA Weather Radio

Post by acatalano » Fri 13 Apr 2018 12:15 pm

I have been streaming NOAA Weather Radio via noaaweatherradio.org and have been using wxradio.php on my website: http://www.boulderwx.com. Ken's page displays the map and the location of the radio on a google api generated map. This has been working very well for about a month or more. In order to implement this, one needs to get a Google Maps API key, which is free. Again, this has been easy to do, and just works...until now

Suddenly, yesterday the map would not display and the Javascript console shows an API key error. I've tried generating a new key, restricting it to http requests etc., but no matter what I've tried, the map displays briefly then generates the error. Of course the audio still works but no map.

I'm no Javascript programmer so I could use some advice. Coincidentally I just updated my out-of-date pages, but wxradios.php was not one of them. Any ideas?
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: NOAA Weather Radio

Post by beteljuice » Fri 13 Apr 2018 1:23 pm

In your html you have ..

Code: Select all

<script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=-replace-this-with-your-API-key-here-&language=en">
... so where is your API key ?
Image
......................Imagine, what you will KNOW tomorrow !

acatalano
Posts: 91
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

Re: NOAA Weather Radio

Post by acatalano » Fri 13 Apr 2018 2:05 pm

I have been putting it after key= in single quotes within wxradio.php. That's where it has been from the start, and when it (used to) display the maps properly. There are actually two places to put the API key. I had inserted the key within wxradio.php file, where it seemed to work. However, at the top of the file Ken mentions that it can be put in settings.php so it applies site-wide. Like this:

$SITE['googleAPI'] = 'key goes here'; // key used for all Google Maps on site

Putting it in settings.php overides the one in wxradio.php. I kinda feel like I must be crazy...worked for a month or so, then without touching the file, it stops.

So I solved the problem with a new key by putting it in Settings.php, and now the map displays properly. Not sure why it stopped but it's working perfectly again!

Problem solved!
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965

acatalano
Posts: 91
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

Re: NOAA Weather Radio

Post by acatalano » Fri 13 Apr 2018 8:59 pm

After re-reading my post I want to clarify the solution. The problem arose with the Googlemaps API key within wxradio.php. It was apparently solved by putting it into settings.php as shown in the post.
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965

Post Reply