Author Topic: NOAA Weather Radio Player scripts V3.00 now available  (Read 826 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
NOAA Weather Radio Player scripts V3.00 now available
« on: December 08, 2019, 08:27:25 PM »
As the NWS moved the NOAA Weather Radio site from www.nws.noaa.gov to weather.gov, they took the opportunity to add some new dynamic features to their detailed radio transmitter displays (and thereby broke the V2.x version of the script).

Now, there's V3.00 of the script set available.  It includes two new features:
1) optional display of the transmitter propagation map as an overlay on the basemap
2) optional display of the county/SAME code coverage for the transmitter
Note that these features are only available on NOAA/NWS transmitters, and not for EC/Canadian transmitters nor for auxiliary streams hosted at noaaweatherradio.org home site.

Yes, you should replace ALL the old scripts with the updated ones, and there's a new (fairly large) shp.js file needed for handling the NWS shapefiles from the weather.gov site for the propagation and county overlay maps.

Download from the script page at https://saratoga-weather.org/scripts-wxradio.php  or
the GitHub distribution at https://github.com/ktrue/Weather-radio-player

I've attached an image of how the new display looks.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 600
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #1 on: December 08, 2019, 09:46:38 PM »
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 916
  • BismarckWeather.net
    • BismarckWeather.net
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #2 on: December 09, 2019, 08:59:31 AM »
Copy, paste, done.

Thanks Ken.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Bloomsky, Saratoga Scripts, NOAA Stream via PI

Offline tmabell

  • Forecaster
  • *****
  • Posts: 302
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #3 on: December 11, 2019, 04:47:53 PM »
I haven't done my due diligence by checking these notices because I'm not sure that they even matter as everything works as it should, but the W3C CSS Validator is complaining:

http://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fmymishawakaweather.com%2FWxRadioNational.php
« Last Edit: December 11, 2019, 05:05:04 PM by tmabell »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #4 on: December 11, 2019, 05:16:42 PM »
The CSS cited are from bootstrap and the leaflet CSS .. they include pseudo markups for vendor-specific tags as many of the features used were not native parts of CSS 2.  The HTML validates, the CSS is a bit old (but not harmful).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Forecaster
  • *****
  • Posts: 302
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #5 on: December 11, 2019, 06:06:42 PM »
Thanks very much Ken!

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2197
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #6 on: December 12, 2019, 01:08:11 PM »
My stand alone version, HTML 5 compliant.  Thanks Ken!

https://stillwaterweather.com/wxradio

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/wx/2ndhome.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.01 now available
« Reply #7 on: May 25, 2020, 02:31:29 PM »
Update today to V3.01 to add a padlock 🔒 (🔒 UTF-8) SSL indicator to all https: provided streams and a note
Quote
Streams with 🔒 are provided with SSL (https:) streaming.
Your browser may not support playing non-SSL streams if you are viewing this site with https:// (secure).
in the page.

Updates were to NWR-radios.js and NWR-radios-inc.php only.

The script page has the demo and download.

Also available at GitHub
« Last Edit: May 25, 2020, 02:57:44 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #8 on: May 25, 2020, 03:52:30 PM »
Ken,

Just updated the 2 files and now see the lock on certain streams. However, it's not showing on my WXK36 stream that I set up on SSL over the weekend. Can you take a look at that for me?

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #9 on: May 25, 2020, 04:16:56 PM »
Oops.. I'd checked the SITE url, not the RADIO url for SSL in NWR-radios.js.

I've pushed an update to the distribution (and GitHub).

Replace that script, then to make sure your cache file is current, run NWR-radios-data.php?cache=no to freshen the cache file.

Thanks for spotting the issue Steve.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #10 on: May 25, 2020, 04:39:11 PM »
Ken,

Much better. Thanks for your quick response.

Steve

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #11 on: May 25, 2020, 05:06:36 PM »
Ken,

When viewing the updated WxRadio script, my OCD unfortunately kicked in. I happened to notice a misspelled word in the verbiage just above the map. The word is near the end of this sentence "These audio streams are graciously provided by personal weather website owners and others though NOAAWEATHERRADIO.org." I believe the word "though" should be "through".

Sorry to be nit-picky.  :grin:

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #12 on: May 25, 2020, 05:19:30 PM »
No issue with picking up on typos.. thanks!

I've pushed that update to NWR-radios-inc.php to the .zip and GitHub.

Thank you!
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #13 on: May 26, 2020, 04:04:17 PM »
Ken,

It appears the "Street2" map in the legend (I think this is the Wikimedia map), doesn't load. I've tried it on my site, your site, and others as well, and it only shows "Loading Map".

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #14 on: May 26, 2020, 04:39:47 PM »
It's an issue with maps.wikimedia.org  .. some tiles get [HTTP/2 429 No Reason Phrase) returns instead of getting the tile pane and the content of the response is html
Quote
Error

Our servers are currently under maintenance or experiencing a technical problem. Please try again in a few minutes.

See the error message at the bottom of this page for more information.

When their servers are back to normal, the issue should disappear.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #15 on: May 26, 2020, 04:49:36 PM »
Thanks Ken.

I've been looking at the various maps and have seen a couple more interesting issues.

1) In radios.php and wxradio.php, there is no $mapProvider defined for NatGeo even though NatGeo is in the legend and has code in NWR-radios-inc.php.
2) When I set $mapProvider='Terrain' in radios.php, the map that is displayed is the OSM map instead of the ESRI map and the 'Street' radio button is selected in the legend.

Steve

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 152
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #16 on: May 26, 2020, 05:16:49 PM »
Hi Ken,

After this update the radio and the map will not load. The script is not modified at all.
I'm thinking it may be something with my server or old software?

http://www.weathercat.net/wxradio.php
« Last Edit: May 26, 2020, 05:27:50 PM by Forever »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #17 on: May 26, 2020, 05:30:28 PM »
The NWR-radios-inc.php has the complete list of all the (current) map providers .. I guess I'd just forgotten to update the similar commented-out settings in radios.php and wxradio.php.

I'd coded a hierarchy of the settings for the NWR-radios-inc.php:
1) the local settings inside wxradio.php or radios.php are the initial ones.
2) If wxradio.php is loaded inside a saratoga template, then the following overrides can be made:
Code: [Select]
if(isset($SITE['WXRstartup']))    { $startup = $SITE['WXRstartup']; }
if(isset($SITE['WXRmapprovider']))    { $mapProvider = $SITE['WXRmapprovider']; }
if(isset($SITE['WXRprovider']))   { $streamprovider = $SITE['WXRprovider']; }
if(isset($SITE['WXRautoplay']))   { $autoplaystartup = $SITE['WXRautoplay']; }
if(isset($SITE['WXRbackground'])) { $backgroundColor = $SITE['WXRbackground']; }
if(isset($SITE['mapboxAPIkey']))  { $mapboxAPIkey = $SITE['mapboxAPIkey'];}
The currently supported maps are shown in the $mapTileProviders = array() with the 'key' as the map provider and the 'name'=> the map name displayed in the selection box.
Code: [Select]
$mapTileProviders = array(
  'OSM' => array(
   'name' => 'Street',
   'URL' =>'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
'attrib' => '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Points &copy 2012 LINZ',
'maxzoom' => 18
  ),
  'Wikimedia' => array(
  'name' => 'Street2',
    'URL' =>'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png',
  'attrib' =>  '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>',
  'maxzoom' =>  18
    ),
  'Esri_WorldTopoMap' =>  array(
  'name' => 'Terrain',
    'URL' => 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
  'attrib' =>  'Tiles &copy; <a href="https://www.esri.com/en-us/home" title="Sources: Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community">Esri</a>',
  'maxzoom' =>  18
    ),
'Terrain' => array(
   'name' => 'Terrain2',
'URL' =>'http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.jpg',
'attrib' => '<a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> <a href="https://stamen.com">Stamen.com</a> | Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
'maxzoom' => 14
  ),
'NatGeo' => array(
   'name' => 'NatGeo',
'URL' =>'https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',
'attrib' => 'Tiles &copy; <a href="https://www.esri.com/en-us/home" title="Sources: Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community">Esri NatGeo</a>',
'maxzoom' => 16
  ),
'OpenTopo' => array(
   'name' => 'Topo',
'URL' =>'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
'attrib' => ' &copy; <a href="https://opentopomap.org/">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>) | Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
'maxzoom' => 15
  ),
'MapboxTer' => array(
   'name' => 'Terrain3',
'URL' =>'https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/tiles/256/{z}/{x}/{y}?access_token='.
$mapboxAPIkey,
'attrib' => '&copy; <a href="https://mapbox.com">MapBox.com</a> | Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
'maxzoom' => 18
  ),
'MapboxSat' => array(
   'name' => 'Satellite',
'URL' =>'https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v10/tiles/256/{z}/{x}/{y}?access_token='.
$mapboxAPIkey,
'attrib' => '&copy; <a href="https://mapbox.com">MapBox.com</a> | Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
'maxzoom' => 18
  ),

);

For (2) above, the $mapProvider='Terrain' isn't a valid choice (no 'Terrain' entry in the $mapProvider array) so the script defaults to using 'OSM' with
Code: [Select]
  if(isset($mapTileProviders[$mapProvider]) ) {
$sct = "// using \$mapProvider = '$mapProvider' as default map tiles. \n";
} else {
$sct = "// invalid \$mapProvider = '$mapProvider' - using OSM for map tiles instead. \n";
$mapProvider = 'OSM';
  }
and 'OSM' will show 'Street' in the legend.

Guess I should add the valid choices in the comments in radios.php and wxradio.php so folks can just uncomment a line for their choice.

 
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #18 on: May 26, 2020, 05:37:50 PM »
Hi Ken,

After this update the radio and the map will not load. The script is not modified at all.
I'm thinking it may be something with my server or old software?

http://www.weathercat.net/wxradio.php
Hmmm... loads just fine for me.  Try clearing the browser cache and do a shift-reload of the page.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 152
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #19 on: May 26, 2020, 05:48:52 PM »
I just tried that and still nothing. It looks like the attached image.
 [ You are not allowed to view attachments ]


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #20 on: May 26, 2020, 06:11:28 PM »
Based on the screenshot, it looks like you're using IE11 for a browser.  I see it has the same problem for me in IE11.
Try using Edge, Firefox, Chrome or Opera .. they all work.

The developer tools in IE11 shows
Quote
jQuery.Deferred exception: Object doesn't support property or method 'includes' TypeError: Object doesn't support property or method 'includes'
so Microsoft's JavaScript engine doesn't like that particular thing in jQuery itself, so it stops execution of jQuery and so the rest of the page/map stops loading.

Time to switch to Edge (or Firefox/Chrome/Opera) .. IE11 is past it's prime.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 152
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #21 on: May 26, 2020, 06:13:19 PM »
But I'm old and don't like change.

Thanks Ken.

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 407
    • Tyler Texas Weather
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #22 on: May 26, 2020, 06:21:14 PM »
Ken,

I think I've got a better handle on it now. But of course, that leads to another question. If I want to use the Terrain Map from stamen.com, I assumed I could just uncomment the
$mapProvider = 'Terrain'; line and that the code following would be used.
Code: [Select]
'Terrain' => array(
   'name' => 'Terrain2',
'URL' =>'http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.jpg',
'attrib' => '<a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> <a href="https://stamen.com">Stamen.com</a> | Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
'maxzoom' => 14
  ),

But this gives me the OSM map because it's not finding something. I understand why it goes to OSM if it's not finding the $mapProvider, but it looks like it should find 'Terrain' just like it finds 'Street' or 'NatGeo' or the others.

I hope I've clarified my problem a little better.

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7906
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #23 on: May 26, 2020, 06:31:55 PM »
You're doing it correctly.  The issue is that the *.tile.stamen.com tiles are HTTP and so in an HTTPS page (view-source) you'll see
Quote
// skipping Terrain2 due to http only map tile link while our page is https

since the tiles there wouldn't load.
I just tested, and https://{*}.tile.stamen.com/ accesses just fail.. no map returned, so those tiles only work when the loading page is http, not https.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Forever

  • Senior Contributor
  • ****
  • Posts: 152
Re: NOAA Weather Radio Player scripts V3.00 now available
« Reply #24 on: May 26, 2020, 07:02:29 PM »
I got the script to work in IE11. It seems some web browsers have an issue with .includes() so adding the code below fixed it for me.

Code: [Select]
String.prototype.includes = function (str) {
  var returnValue = false;

  if (this.indexOf(str) !== -1) {
    returnValue = true;
  }

  return returnValue;
}