Author Topic: WXUSALERTS Clickable Alerts Map Script  (Read 20241 times)

0 Members and 1 Guest are viewing this topic.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
WXUSALERTS Clickable Alerts Map Script
« on: December 26, 2012, 10:06:52 AM »
This script displays a clickable US map that has been modified to open on click a NWS regional map in a new tab.  This map in turn displays a VERY localized forecast and current conditions page.  The US map auto-updates every 2 minutes with an ajax timeout on the SaratogaWx script page and no timeout on the stand-alone page.  I let the stand-alone page run overnight last night, and it was up to date this morning.  The idea for this page originally came from Steve at DaculaWeather.

If your site doesn't switch between narrow and wide css files, modify
Code: [Select]
<div id="main-copy" style=" border:inset; width:<?php echo ($_SESSION['CSSwidescreen']==? -806?>px" class="bCenter"> to set a fixed width ~806px on a narrow site or no width on a wide site, thus eliminating the php conditional statement.

I like the fact that you can drill down to virtually anywhere in the US with a couple of clicks starting with this map.

Thanks again, Steve!

Edit:  There is a new script available, wxusalerts1a.zip,  that includes the clickable NWS Legend.  The legend items link to current NOAA/NWS text messages in that category.  Because the legend uses css formatting, a new stylesheet, wxusalerts.css, is now included.  Just upload both files to your site in order to run the revised script.

Edit 26 Jan 2013:  The Legend was improperly formatted via the stylesheet, and wasn't stable across browsers.  I've reworked the php script and the css stylesheet to better display the legend, and it is stable across browsers.  The script validates at validator.w3c.org, but still has a remaining problem.  The reworked css hides the flyout menu text in Safari, although it's still visible during mouse over.  The ;new script and stylesheet are in wxusalerts1d.zip

Edit 27 Jan 2013:  It appears that I was having cache issues with Safari, and that flushing the cache with the 'Ctl-Alt-E' shortcut was needed in order to evaluate my changes with this browser.  The wxusalerts1e.zip attached cleans up a little of the stylesheet code, and it renders as desired in all modern browsers while validating.  No other files will be attached here now.

Edit2 27 Jan 2013:  The home page map at NOAA/NWS now shows 31 Legend categories instead of the previous 25.  The wxalerts1f.zip has a Legends section that has been updated accordingly.  I may have to chase this down for a while in order to get a Legend that's complete.  If they change colors, and so far they haven't, then all bets are off.  This zip is current as of now.

Edit 28 Jan 2013:  Today's gift from NOAA/NWS is four more Legend categories making a total of 35.  The wxalerts1g.zip has a suitably enlarged Legends section.  There were also some slight color changes this morning, but the zip is current as of this moment.
Edit2 28 Jan 2013:  Another Legend item just popped up, a Flash Flood Warning in Hawaii.  It occurs to me that there quite a few other alerts/watches/warnings yet to be seen, such as with regard to tornadoes.  Zip wxusalerts1h is current as of now.

Edit 29 Jan 2013:  Three more Legend items appeared this morning:  Severe Thunderstorm Warning, Tornado Watch, and Blowing Dust Advisory for a total of 39 items today.  Perhaps a reversion to the initial script, wxusalerts.zip, would be a good option until Legend stability is achieved, if ever.  The latest legend is in wxusalerts1i.zip and I've reposted the initial script.

Edit2 29 Jan 2013:  We're now up to 41 Legend items in wxusalerts1j.zip  Today has been a 'good' day for severe watches and warning--rather remarkable considering it's January.

Edit 30 Jan 2013:  Yesterday was busy with the huge system in the central US doing its thing.  There are currently 48 Legend items, and I've changed the Alaska and Hawaii map locations.  That along with some added text have prompted the move to wxusalerts2.zip

Edit 31 Jan 2013:  The recent storm added six more Legend items, making a total of 54 now shown in wxusalerts2a.zip  The explanatory text has been modified as well.

Edit 1 Feb 2013:  Another new Legend item, Freeze Warning, appeared this afternoon for a total of 55 in wxusalerts2b.zip

Edit 2 Feb 2013:  'Civil Emergency Message' showed up this afternoon in ND due to blowing snow closing an Interstate.  That's not one I expected at all.  It's added into wxusalerts2c.zip

Edit 6 Feb 2013:  'Hazardous Seas Warning' appeared today off the Pacific Coast.  It's added to wxusalerts2d.zip

Edit 7 Feb 2013:  'Coastal Flood Watch', 'Hurricane Force Wind Watch', and 'Blizzard Watch' all added to wxusalerts2e.zip

Edit 8 Feb 2013:  'Hurricane Force Wind Warning' is now up in the Atlantic off New England.  Added to wxusalerts2f.zip
Edit2 8 Feb 2013:  '911 Telephone Outage Emergency' has appeared, but there's no associated text.  Added to wxusalerts2g.zip

Edit 15 Feb 2013:  'Hard Freeze Alert' is up for parts of Florida into tomorrow night.  Added to wxusalerts2h.zip

Edit 20 Feb 2013:  'Ice Storm Warming' now seen in North Central Arkansas, and has been added to wxusalerts2i.zip

Edit 23 Feb 2013:  'Freezing Fog Advisory' seen now in upper Mississippi valley.  Added to wxusalerts2j.zip

Edit 25 Feb 2013:  The code now accommodates the Legend automatically in wxusalerts3.zip.  Thanks, Ryan.

Edit 3 Mar 2013:   'Child Abduction Alert' added to wxusalerts3a.zip

Edit 9 Mar 2013:  The autoupdate timeout allows only two or three updates of the maps before timing out.  Camping on this page results in a hit on the NWS server only every 2 minutes, which is far from excessive, so wxusalerts4_no_timeout.zip doesn't time out.  The timeout code remains in place and has just been commented out.  There are no other changes from v3a.

Edit 17 April 2013:  NWS has changed the color of 'Flash Flood Watch' to match that of 'Flood Watch', thereby eliminating any visual distinction between them.  Makes no sense to me, but the change is in wxusalerts4a.zip  There's still no timeout in the 4 series, and the color change has prompted me to remove all prior versions.

Edit2 17 April 2013:  I've included code in wxusalerts4b.zip to check for the use of the $_SESSION['CSSwidescreen'] flag before using its state or lack thereof to center the output.

Edit 2 May 2013:  Two new alert codes are in effect this evening, 'Heat Advisory' and 'Hard Freeze Warning'.  They have been added to the legend in wxusalerts4c.zip.

Edit 5 June 2013:  Four new alert codes were posted this evening:  'Tropical Storm Warning', 'Excessive Heat Warning', 'Hazardous Seas Watch', and 'Excessive Heat Watch'.  They have been added to the legend in wxusalerts4d.zip.

Edit 5 November 2013:  The Legend now toggles on and off in version 5.  Version 4d with the permanently displayed Legend is also still available.

Edit 5 December 2013:  A new alert code is in effect this morning, 'Wind Chill Warning'.  It has been added to wxusalerts5a.zip along with a setting, '$toggleAlerts'; this is the only version available.

Edit 26 March 2014:  A new alert code is in effect today, 'Coastal Flood Warning'.  It has been added to wxusalerts6.zip and the NWS modifications to the freezing weather codes have been incorporated.  They had overloaded the #00FFFF color and I think they are correcting the problem.  Time will tell. There was an error in wxusalerts6.zip's validation.  wxusalerts.6a.zip corrects this.

Edit 14 April 2014:  The NWS has made further undocumented color changes to the freezing weather codes.  These are incorporated into wxusalerts6b.zip

Edit2 14 April 2014:  I've posted a new script as 'wxusalerts-all.zip' here that uses the dynamic legends that the NWS posts on www.weather.com  rather than the static legend of the prior versions.

Edit 8 December 2017: The Alaskan links have changed, so all prior versions of this script are obsolete.  The new version, 20171208, contains the proper AK links.  (Right-click and select 'Save as...' and save not as a '.txt' but as '.php' file.
« Last Edit: December 08, 2017, 07:30:49 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #1 on: December 30, 2012, 03:49:44 AM »
Thanks.  I have it set up here:  http://stillwaterweather.com/wx/wxusalerts.php.  But didn't understand your directive about how to change the code for wide only pages.

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

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #2 on: December 30, 2012, 08:07:34 AM »
For a wide screen only installation use this:
Code: [Select]
<div id="main-copy" style=" border:inset;" class="bCenter">The class 'bCenter' is built into our 'weather-screen...css' files, and is quite useful, as is the 'center' class for <div>'s, etc.
For a narrow screen only installation use this:
Code: [Select]
<div id="main-copy" style=" border:inset; width:806px" class="bCenter">Sorry my instructions weren't clear.  Your page looks great, BTW. :-)
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #3 on: December 30, 2012, 01:37:13 PM »
Got mine running here  http://hayskansasweather.com/wxusalerts.php   I can't seem to get the map centered in the middle of the page.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #4 on: December 30, 2012, 01:45:40 PM »
Got mine running here  http://hayskansasweather.com/wxusalerts.php   I can't seem to get the map centered in the middle of the page.
Check your weather-screen...css for a bCenter entry.  If it isn't there try class="aligncenter" rather than class="bCenter"

Edit:  I apologize for the confusion.  It turns out that the style 'center' was one I had included in my 'top.php' right beneath <head>:
Code: [Select]
<head>
<style type="text/css"> div.center {  width:100%;  margin-left: auto;  margin-right: auto; display:block }</style>
Including it there means that it's available sitewide.  'aligncenter' is  similar class in the weather-screen...css file(s).  'bCenter' is nowhere to be found at the moment.  No harm, no foul, I guess.
« Last Edit: December 30, 2012, 03:10:49 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #5 on: December 30, 2012, 03:21:18 PM »
Thanks Jerry. I will work on it tomorrow.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #6 on: January 25, 2013, 09:23:17 AM »
I've uploaded in the first post above a revised version of the wxusalerts script that includes the NOAA/NWS Legend with links to current text pertinent to each legend category.  A separate stylesheet is now included in order to display the Legend.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #7 on: January 25, 2013, 10:09:42 AM »
Thanks Jerry... I made the changes and mine does not look like yours?????

Joe

http://joesweather.info/wxusalerts.php 
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #8 on: January 25, 2013, 10:44:14 AM »
Thanks Jerry... I made the changes and mine does not look like yours?????

Joe

http://joesweather.info/wxusalerts.php 

You mean the centering?  I keep forgetting about that style in my top.php.  I've uploaded a new version, wxusalerts1b.zip,  that incorporates the centering style into wxusalerts.css and I think that will do what you want, Joe.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #9 on: January 25, 2013, 11:21:49 AM »
Thanks Jerry... I made the changes and mine does not look like yours?????

Joe

http://joesweather.info/wxusalerts.php 

You mean the centering?  I keep forgetting about that style in my top.php.  I've uploaded a new version, wxusalerts1b.zip,  that incorporates the centering style into wxusalerts.css and I think that will do what you want, Joe.

Centering will be nice... the issue is when you click on the area I want to view, my display is not the same as yours.
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #10 on: January 25, 2013, 11:45:09 AM »
Thanks Jerry... I made the changes and mine does not look like yours?????

Joe

http://joesweather.info/wxusalerts.php 

You mean the centering?  I keep forgetting about that style in my top.php.  I've uploaded a new version, wxusalerts1b.zip,  that incorporates the centering style into wxusalerts.css and I think that will do what you want, Joe.

Centering will be nice... the issue is when you click on the area I want to view, my display is not the same as yours.
I see no difference between the script's output on your site vs. mine.  Clicking on the US map in the same areas display the same NWS site.  If you look at the Titles that pop up as you mouse over the map, I think you'll see that they're the same.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: http://www.weather.gov/ Clickable Alerts Map Script
« Reply #11 on: January 25, 2013, 08:13:00 PM »
Thanks Jerry... I made the changes and mine does not look like yours?????

Joe

http://joesweather.info/wxusalerts.php 

You mean the centering?  I keep forgetting about that style in my top.php.  I've uploaded a new version, wxusalerts1b.zip,  that incorporates the centering style into wxusalerts.css and I think that will do what you want, Joe.

Centering will be nice... the issue is when you click on the area I want to view, my display is not the same as yours.
I see no difference between the script's output on your site vs. mine.  Clicking on the US map in the same areas display the same NWS site.  If you look at the Titles that pop up as you mouse over the map, I think you'll see that they're the same.

You are right. Sorry
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #12 on: January 26, 2013, 11:10:13 PM »
I initially wrote the script using Chrome to debug it, but when I viewed it in the latest versions of Firefox, IE, and Safari the Legend misbehaved badly.  In the first post above there's a revised version, wxusalerts1d.zip, that is much better behaved across browsers.  A problem remains when the page is viewed in Safari in that the flyout menu text is hidden.  It does display during mouse over and the flyout menus are all visible.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #13 on: January 27, 2013, 10:43:53 AM »
Latest version, wxusalerts1e.zip, is posted above, and is now the only version available for download.  It now does display properly in all modern browsers, including Safari.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #14 on: January 27, 2013, 03:17:01 PM »
The Legend categories may not be stable because there were 7 more found this afternoon.  The latest zip, wxusalerts1f.zip, contains all of the current categories.  There may be more updates to come down the road.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jay_hoehn

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 656
    • Jay's Woodcrafts
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #15 on: January 27, 2013, 03:36:59 PM »
Jerry,

Thanks for the good work.  Looks great.

http://jayswoodfurniture.com/wx/wxusalerts.php

Jay
Davis Vantage Pro2 Plus
VVP
Weather Display


Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #16 on: January 27, 2013, 03:42:59 PM »
Jerry,

Thanks for the good work.  Looks great.

http://jayswoodfurniture.com/wx/wxusalerts.php

Jay

Jerry,
Same here... great work.

Joe
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #17 on: January 28, 2013, 09:08:05 AM »
Another 4 Legend categories appeared today.  The first post contains the updated files in wxusalerts1g.zip
« Last Edit: January 28, 2013, 05:27:43 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #18 on: January 28, 2013, 05:28:23 PM »
Make that 5 in all today.  So wxusalerts1h.zip contains the latest Legend with an Hawaiian Flash Flood Warning that has now expired as the latest entry.
« Last Edit: January 28, 2013, 05:31:32 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #19 on: January 29, 2013, 08:02:59 AM »
Three more Legend items are present this morning, Severe Thunderstorm Warning, Tornado Watch, and Blowing Dust Advisory.  In view of the protean nature of the Legend in all of the lettered versions of wxusalerts, it might be more reasonable to revert to the initial script that relied on a link to the currently displayed NOAA/NWS Legend.  I've reposted it in the first post.  I'll still keep up with the Legend changes, but while the Legend is changing rapidly unless you diligently keep up with the changes the original version is preferable.  Sorry for the tail-chasing that's going on here. :oops: :oops:
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jay_hoehn

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 656
    • Jay's Woodcrafts
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #20 on: January 29, 2013, 03:37:21 PM »
Jerry,

I like the legend on the page.  If you will continue to provide the updates whenever it changes I'd like to use that one.

Thanks for the work,

Jay
Davis Vantage Pro2 Plus
VVP
Weather Display


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #21 on: January 29, 2013, 04:31:54 PM »
Jerry,

I like the legend on the page.  If you will continue to provide the updates whenever it changes I'd like to use that one.

Thanks for the work,

Jay

The updates will continue, Jay, not to worry.  I just posted wxusalerts1j.zip that contains a couple more Legend items.  The diversity of weather today has been remarkable.  We have had blizzard warnings and tornado warnings!
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Harryca

  • Forecaster
  • *****
  • Posts: 756
    • Union City, CA Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #22 on: January 29, 2013, 05:26:42 PM »
Jerry,

I like the legend on the page.  If you will continue to provide the updates whenever it changes I'd like to use that one.

Thanks for the work,

Jay

The updates will continue, Jay, not to worry.  I just posted wxusalerts1j.zip that contains a couple more Legend items.  The diversity of weather today has been remarkable.  We have had blizzard warnings and tornado warnings!

If you need a complete list of all the current hazards/weather events that may appear in the legend, maybe this will help.  The following web page has the complete list of hazards/weather events that may show up on the map along with map colors, color names, and color codes.

http://www.nws.noaa.gov/wwamap-prd/faq.php#events

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #23 on: January 29, 2013, 07:31:21 PM »
Jerry,

I like the legend on the page.  If you will continue to provide the updates whenever it changes I'd like to use that one.

Thanks for the work,

Jay

The updates will continue, Jay, not to worry.  I just posted wxusalerts1j.zip that contains a couple more Legend items.  The diversity of weather today has been remarkable.  We have had blizzard warnings and tornado warnings!

If you need a complete list of all the current hazards/weather events that may appear in the legend, maybe this will help.  The following web page has the complete list of hazards/weather events that may show up on the map along with map colors, color names, and color codes.

http://www.nws.noaa.gov/wwamap-prd/faq.php#events


Thanks!  I'm going to have to rethink the Legend presentation.  I've preliminarily created some space by moving the Hawaii and Alaska maps up to the lower left corner of the US maps like they are on the NWS site.  The links on the events page aren't live, so I'm not certain how it's going to work out yet.
« Last Edit: January 29, 2013, 07:33:55 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #24 on: January 30, 2013, 08:18:16 AM »
wxusalerts2.zip now lists 48 Legend items, changes the Hawaii and Alaska map locations, and adds some more explanatory text.
Regards, Jerry Wilkins
gwwilk@gmail.com

 

anything