WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: gwwilk on July 04, 2013, 10:03:49 AM

Title: Alternative Drought Monitor Page
Post by: gwwilk on July 04, 2013, 10:03:49 AM
This script relies heavily upon the Drought Monitor at UNL.  The top two maps have configurable defaults, the topmost map for the primary state of interest and the next map for the region of interest.  These two maps have mouseover tables that access all state and regional maps in addition to the national map.  You could use your editor's Search and Replace to search for 'mouseover' and replace all instances with 'onclick'(no apostrophes), but clicking with so many available maps soon grows tedious.  That's why the links are currently set to 'mouseover'.

The remaining four maps include the 'Drought Tendency', 'Palmer Index', 'Crop Moisture', and 'Precipitation Needed to End Drought'.  The 'Drought Tendency' map is clickable to display the full size map in a new tab.  There is a also link at the bottom of the page to the Weekly Weather and Crop Bulletin PDF.

This script was created by Steve at Dacula Weather, and has been modified by me.  (I can no longer find it on Steve's site.)

There are three settings, the first determines page width, the second sets the default state map, and the third sets the default region.  The default width of 680 works well for a Saratoga template, while 800 works well for dropdown pages of that width.  To set your region, just uncomment the desired default region while commenting out the current default region, and to set your state enter the two letter abbreviation for the desired default state map.

You might prefer the simpler SaratogaWx Page (http://www.wxforum.net/index.php?topic=19475.0), but this one has a more national flavor.  You can view it here (http://www.gwwilkins.org/wxdrought_maps.php).

Edit 2013 July 11:  The updated script in 'wxdrought_maps2.zip' will clear the browser cache upon loading.  I've noticed that I've had to manually clear the cache in order to see the new data each Thursday.  This version should eliminate that problem.

Edit2 2013 July 11:  I've also included an updated version with Alaska and Hawaii  state maps, 'wxdrought_maps-ak-hi.zip'.  This version allows selection the US as the 'region' to accomodate those areas.

Edit 2013 October 31:  The UNL Drought Monitor has changed their map names and url's.  The old versions are now obsolete and display maps only through 22 Oct 2013.  The new version 3 contains the updated map url's.  Please replace your old version with this new one.

Edit2 2013 October 31:  Version 3a contains a new Monthly Drought Tendency Map and all maps with larger native image sizes now have live links to open the full-size map in a new tab.

Edit 2013 November 11:  Version 3b moves inline styles to an internal style.  This allows customizing hyperlink text colors in one place so your site's normal hyperlink color can be optionally restored.  No functional change was made in this version.

Edit 2013 December 27:  Added the Animations Package, wxdroughtmongif12.zip, that can display all current and past animations.

Edit 2014 April 10:  Modified the Animations Package to include the current year once the Twelve Week Animation's coverage becomes insufficient.  This is in the 'wxdroughtmongif12a.zip' package which is otherwise unchanged.

Edit 2017 October 16:  Removed attached outdated zip files.  The script(s) can be gotten by using these links (http://www.wxforum.net/index.php?topic=19479.msg333643#msg333643).  Right-click on the source and 'Save as' not a 'txt' file but a 'php' file.
Title: Re: Drought Monitor Page
Post by: txweather.org on July 04, 2013, 10:46:54 AM
Me like!
Thanks.
Out of curiosity... What template are you using for your site?

TIA.
Title: Re: Drought Monitor Page
Post by: gwwilk on July 04, 2013, 11:10:02 AM
You mean Dashboard?  It's a customized version of Scott Thompson's ajax-dashboard681 (http://www.wxforum.net/index.php?topic=18217.0).  Some of the modifications may make it into Scott's next release.  The template began as a SaratogaWx-USA template (http://saratoga-weather.org/wxtemplates/index.php) using Weather Display data.  The site has since grown as I've adopted, adapted, and created more pages.  It could use some housecleaning and reorganization, but Spring has passed. :-)
Title: Re: Alternative Drought Monitor Page
Post by: txweather.org on July 04, 2013, 11:12:42 AM
You mean Dashboard?  It's a customized version of Scott Thompson's ajax-dashboard681 (http://www.wxforum.net/index.php?topic=18217.0).  Some of the modifications may make it into Scott's next release.  The template began as a SaratogaWx-USA template (http://saratoga-weather.org/wxtemplates/index.php) using Weather Display data.  The site has since grown as I've adopted, adapted, and created more pages.  It could use some housecleaning and reorganization, but Spring has passed. :-)

Ah yes dashboard.
Thanks for the info.
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on July 11, 2013, 12:59:48 PM
I've noticed that Chrome, my usual browser, doesn't flush its image cache upon loading the drought page.  This is particularly troublesome each Thursday AM when the maps are updated.

I've applied Capeweather's fix to the updated script in 'wxdrought_maps2.zip' above so that stale images shouldn't be shown by any browser.  Be aware that the images will be re-downloaded with each page load whether they're fresh or not.
Title: Re: Alternative Drought Monitor Page
Post by: Silversword on July 11, 2013, 03:08:59 PM
Hi Jerry,

Took a look at your page but it seem that it only includes the "lower 48". Hope that others that are seen on the big map will be included in the list.

Just an observation.

--Stan Y.
    Maui, Hawaii
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on July 11, 2013, 04:37:12 PM
Hi Jerry,

Took a look at your page but it seem that it only includes the "lower 48". Hope that others that are seen on the big map will be included in the list.

Just an observation.

--Stan Y.
    Maui, Hawaii


Sorry I gave Hawaii and Alaska the short shrift, Stan!  The wxdrought_maps-ak-hi.zip in the first post above corrects that oversight :-)
Title: Re: Alternative Drought Monitor Page
Post by: Silversword on July 12, 2013, 01:01:19 AM
Hi Jerry,

Thanks for the update and reply.  Hope to get it up and running this weekend when time permits.  Have to work on my river height pages again also.  From wet to dry data to work on.

Thanks for the inclusion.

Hawaii and Alaska seems to be left out with some of the the scripts that people produces.

Thanks for all again.

--Stan Y.
  Maui, Hawaii
Title: Re: Alternative Drought Monitor Page
Post by: Andy G on July 13, 2013, 10:19:27 AM
Got it running here http://www.sunprairieweather.com/wxdrought_maps.php (http://www.sunprairieweather.com/wxdrought_maps.php) looks great.

Thanks much Andy
Title: Re: Alternative Drought Monitor Page
Post by: Silversword on July 13, 2013, 02:28:10 PM
Hi Jerry,

Worked on your page and seems to be working well at http://www.dwayneyamato.com/wx/wxdrought_maps.php (http://www.dwayneyamato.com/wx/wxdrought_maps.php).

Thank you very much for this expanded drought page. 

I have also this page going. http://www.dwayneyamato.com/wx/wxdrought.php (http://www.dwayneyamato.com/wx/wxdrought.php).

Just was working on other stuff on my site so it was a "might as well" thingy.

Thank you very much for all and the inclusion of Hawaii and Alaska.

Have a good and safe weekend.

--Stan Y.
  Maui, Hawaii
Title: Re: Alternative Drought Monitor Page
Post by: AWL on July 13, 2013, 06:34:58 PM
Thanks, great work. Have it working with some mods as not using the template. Looks great and validates even after several changes to get it working. Wondering if it displays correctly for everyone else???

Thanks again, Doug

*Didn't see a 'South' as a default map
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 31, 2013, 05:57:58 PM
NOTE:  The UNL Drought Monitor has changed their map names and url's.  The old versions are now obsolete and display maps only through 22 Oct 2013.  The new version 3 contains the updated map url's.  Please replace your old version with the new one attached to the first post in this thread.  My apologies for any inconvenience this change has created.
Title: Re: Alternative Drought Monitor Page
Post by: BurnsvilleWeather on October 31, 2013, 07:26:29 PM
Jerry

Nice work on this script!  Thanks!

Scott
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 31, 2013, 09:14:44 PM
Thanks, Scott.  I've been revising this script this evening to, where available, link the maps to larger images in new tabs, found a few other errors, and added a monthly drought outlook map.  I also tried to save bytes by using variables for repetitive values in the url's.  The result is Version 3a above.
Title: Re: Alternative Drought Monitor Page
Post by: jay_hoehn on November 01, 2013, 12:41:47 PM
Jerry,

I tried to download version 3a and WinZip tells me it is not a valid archive file.  I am using the version 3 now.

Jay
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on November 01, 2013, 01:08:33 PM
Jerry,

I tried to download version 3a and WinZip tells me it is not a valid archive file.  I am using the version 3 now.

Jay
Indeed you are correct!  Sorry about that, Jay. :oops:  You should be able to open version 3a after downloading the zip in the first post.
Title: Re: Alternative Drought Monitor Page
Post by: DaculaWeather on November 01, 2013, 01:24:47 PM
Yea, I had to totally redo my drought page after they changed the links AND changed the image sizes.
http://www.daculaweather.com/4_drought_state.php
Title: Re: Alternative Drought Monitor Page
Post by: jahuff on November 04, 2013, 07:22:39 AM
Jerry,

Got it running here http://www.johnsnhweather.com/wxdrought_maps.php looks great.

Thanks so much.

John
Title: Re: Alternative Drought Monitor Page
Post by: mfd38 on November 11, 2013, 07:19:21 AM
Yes, nice setup. I did not know it existed until I realized the links had changed and started to poke around the weather watch forum, and then this forum.

Thanks Steve and Jerry for the nice, user friendly script, good work.

Paul
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on December 27, 2013, 06:38:08 AM
Added to the first post the Animations Package, wxdroughtmongif12.zip, that can display all current and past animations.  By clicking on them the animations can be displayed at maximum size in a new tab, or if displayed in wide screen style will display maximum size with no link.

Here is a link (http://www.gwwilkins.org/wxdroughtmongif12.php) to the page.
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on April 09, 2014, 09:41:52 AM
There was a gap in the animated map coverage once week 12 of the year is past.  I've modified the Animations Package to include the current year once the Twelve Week Animation's coverage becomes insufficient.  This is in the 'wxdroughtmongif12a.zip' package above (http://www.wxforum.net/index.php?topic=19479.0) which is otherwise unchanged.
Title: Re: Alternative Drought Monitor Page
Post by: mkutche on September 28, 2017, 06:36:12 PM
It seems the URL's are not working again.. http://gosportwx.com/wxdrought_maps.php
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on September 28, 2017, 07:02:32 PM
It seems the URL's are not working again.. http://gosportwx.com/wxdrought_maps.php
It's working here on my site (http://gwwilkins.org/wxdrought_maps.php).  Try updating the script from here (http://gwwilkins.org/wxdrought_maps.php?sce=view).

I'm not sure if you will also need to update the script to display the animations (https://www.gwwilkins.org/wxdroughtmongif12.php) (source here (https://www.gwwilkins.org/wxdroughtmongif12.php?sce=view)) and it's dependent 'includes' script (https://gwwilkins.org/inc-wxdroughtmongif12.php?sce=view) and 'select' script (https://gwwilkins.org/wxdroughtmongif12-select.php?sce=view).  There's a link in the drought maps script to the animations.
Title: Re: Alternative Drought Monitor Page
Post by: mkutche on September 28, 2017, 07:12:06 PM
I got it workin again :) thanks for the updates :)
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on October 15, 2017, 01:35:04 PM
I am trying to install the Drought Monitor Script with no luck. I have tried following the most current discussion in this thread, but have not got it to work. It loads with a blank map. Any assistance as to locating a correct script would be appreciated.

You can view my script at scannorthcounty.net/wxdrought_maps.php?sce-view (http://scannorthcounty.net/wxdrought_maps.php?sce-view)

Thanks,
John
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 15, 2017, 05:16:32 PM
I am trying to install the Drought Monitor Script with no luck. I have tried following the most current discussion in this thread, but have not got it to work. It loads with a blank map. Any assistance as to locating a correct script would be appreciated.

You can view my script at scannorthcounty.net/wxdrought_maps.php?sce-view (http://scannorthcounty.net/wxdrought_maps.php?sce-view)

Thanks,
John

'show_tab is not defined' is the error the 'console' (CTRL-Shift-I in Chrome) shows on your site.  This tells me that you probably tried to use highlight and then copy to obtain the script.

The script can be downloaded by using the link in this post (http://www.wxforum.net/index.php?topic=19479.msg333643#msg333643).  Right-click on the source and click 'Save as', then save not as a text file but as a php file, e.g. 'wxdrought_maps.php'.  You need to modify the settings to select your 'defaultRegion' and 'defaultState'.  The script should then exist on your site as 'wxdrought_maps.php'.

The same applies to the three scripts that are required for the drought animations.  Be sure to customize the link in 'wxdrought_maps.php' to point 'Animated US Drought Maps' to the script on your site rather than mine.

Hope this helps.
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on October 15, 2017, 08:25:41 PM

'show_tab is not defined' is the error the 'console' (CTRL-Shift-I in Chrome) shows on your site.  This tells me that you probably tried to use highlight and then copy to obtain the script.

The script can be downloaded by using the link in this post (http://www.wxforum.net/index.php?topic=19479.msg333643#msg333643).  Right-click on the source and click 'Save as', then save not as a text file but as a php file, e.g. 'wxdrought_maps.php'.  You need to modify the settings to select your 'defaultRegion' and 'defaultState'.  The script should then exist on your site as 'wxdrought_maps.php'.

The same applies to the three scripts that are required for the drought animations.  Be sure to customize the link in 'wxdrought_maps.php' to point 'Animated US Drought Maps' to the script on your site rather than mine.

Hope this helps.

I have downloaded the wxdrought_maps.php the correct way and changed the necessary items in the settings and also uploaded the necessary animation files. I still get a blank map when the page loads and nothing happens when I mouseover the different states. The animation link works fine and I did update the link to my site.

Anything else I should look at?

Thanks,

John
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 07:07:52 AM
I have downloaded the wxdrought_maps.php the correct way and changed the necessary items in the settings and also uploaded the necessary animation files. I still get a blank map when the page loads and nothing happens when I mouseover the different states. The animation link works fine and I did update the link to my site.

Anything else I should look at?

Thanks,

John
For some reason the script is crashing somewhere near or in the state map display table, and nothing loads past that.  This means the mouseover 'show_tab' state name entries aren't loading either, so the script obviously doesn't work.

Running your home page through the validator.w3.org site (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) produces errors right off the bat.  Perhaps clearing those up might help when it comes to troubleshooting the drought maps script?

Similarly, a blizzard of errors arise (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) when running the drought maps script on your site through the w3 validator.  This is in contrast with what happens when the page on my site is validated (https://validator.w3.org/check?uri=https%3A%2F%2Fgwwilkins.org%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) by the https://validator.w3c.org site.

Start with your main site and work on the errors from the top down.  It can be brutal, frustrating work at first, but the end result is a cleaner page and a much greater understanding of scripting.  Remember, Google is your friend when it comes to understanding the errors' cause(s).
Title: Re: Alternative Drought Monitor Page
Post by: Jáchym on October 16, 2017, 08:51:59 AM
As far as I can see there are no errors in the console or PHP on his homepage:

http://scannorthcounty.net/

Dont rely on W3, it often shows nonsense
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 08:57:59 AM
As far as I can see there are no errors in the console or PHP on his homepage:

http://scannorthcounty.net/

Dont rely on W3, it often shows nonsense
Mouse over the links, Jáchym, to see the console errors.
Title: Re: Alternative Drought Monitor Page
Post by: Jáchym on October 16, 2017, 08:59:53 AM
I hovered over the entire homepage and Console is blank.

The problem is in one of the PHP functions on the drought map page. I cant see the error exactly, but where it is supposed to show the URL of the image it throws fatal error resulting in the script ending unexpectedly. So I assume the problem is somewhere in loading or parsing of the img URL
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 11:14:09 AM
The links are the state names.
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 16, 2017, 12:09:05 PM
Having pretty much the same problems here as Johnmac, Jerry. http://tiggrweather.net/wxdrought_maps.php. As to config of wxdrought_maps.php I see no reference to your site other than line 322 which is the 'modified by' item (searched that script for gwwilkins). If your comment refers to $dmSiteURL that is set to http://droughtmonitor.unl.edu/. Running W3 against my home page comes up green.

Thanks.
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 01:52:11 PM
Having pretty much the same problems here as Johnmac, Jerry. http://tiggrweather.net/wxdrought_maps.php. As to config of wxdrought_maps.php I see no reference to your site other than line 322 which is the 'modified by' item (searched that script for gwwilkins). If your comment refers to $dmSiteURL that is set to http://droughtmonitor.unl.edu/. Running W3 against my home page comes up green.

Thanks.
Try commenting out your flagcounter/revolvermaps, John.  No javascript will load after the first javascript error, and the links to the state/regional maps aren't working because of it.  Your problem is not the same as Johnmac's.
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 16, 2017, 03:04:07 PM
Try commenting out your flagcounter/revolvermaps, John.  No javascript will load after the first javascript error, and the links to the state/regional maps aren't working because of it.  Your problem is not the same as Johnmac's.
That call is in the footer code so I commented out the footer include in the drought script. Same result as my post. Put that include back and tried commenting out just the JS call in the footer script. Still the same. Reverted to my first try (no footer) and left it that way in case you look at it again.

Thank you.
Title: Re: Alternative Drought Monitor Page
Post by: MackerelSky on October 16, 2017, 03:57:56 PM
Try commenting out your flagcounter/revolvermaps, John.  No javascript will load after the first javascript error, and the links to the state/regional maps aren't working because of it.  Your problem is not the same as Johnmac's.
That call is in the footer code so I commented out the footer include in the drought script. Same result as my post. Put that include back and tried commenting out just the JS call in the footer script. Still the same. Reverted to my first try (no footer) and left it that way in case you look at it again.

Thank you.

Check, in your settings for the script, to see that there is no 's' on the end of 'png' in this line. Somehow, I picked up a script that had settings with the 's'. It should look like this.

Code: [Select]
$mapsURL = 'data/png/current/current';
Looking at the source of the page, the image where the script stops producing in the first two maps has 'pngs' in the URL to the image...It thru me for a while when I set it up...

http://mckeanweather.com/mwdrought.php

Brad
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 04:14:19 PM
Thanks, Brad!  I think you're onto something there.  I don't know where the '/pngs/' came from, but it's the problem in John Gillett's case.  There's no 'pngs' in my source script.

You say you got a script with 'pngs' in it?  From my site? Hmmm...
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 16, 2017, 04:20:31 PM
Thanks very much, Brad. That was definitely it. Also put the footer back in with the JS for revolver maps and it's still working.

Jerry, definitely got everything from your links and did NOT add that 's' myself. I'm old and somewhat a Dumbo, but know better than that.   :grin:
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 04:26:10 PM
I'm glad you got it sorted out, John.  I'm still puzzled by the 'pngs' because when I look at the source on my site it isn't there.
Title: Re: Alternative Drought Monitor Page
Post by: MackerelSky on October 16, 2017, 04:26:36 PM
Thanks, Brad!  I think you're onto something there.  I don't know where the '/pngs/' came from, but it's the problem in John Gillett's case.  There's no 'pngs' in my source script.

You say you got a script with 'pngs' in it?  From my site? Hmmm...

From a link somewhere in these threads about the script Jerry, I'll see if I can find it but it was a while ago...
Brad
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 16, 2017, 04:29:34 PM
It's been a while since I got these scripts but was failing right out of the box before I made any edits at all. Given our past exercises together I'm quite sure it didn't come from you that way but have no explanation how it got there.
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 16, 2017, 04:36:13 PM
If you downloaded one of the 'zip' files from this thread's initial post, that was the source of the problem.  I apparently forgot to alert this thread when UNL made their latest change to the image URL's.  I've modified the initial post to reflect the current script's download procedure.  You may have noticed I no longer post zip files for just this reason, instead preferring to use the '?sce=view' method to distribute most of my scripts.

Sorry for the headaches, guys! #-o
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 16, 2017, 04:39:14 PM
Not to worry, Jerry. Fits right in with all my other headaches!   :roll:

Thanks again, guys.
Title: Re: Alternative Drought Monitor Page
Post by: MackerelSky on October 16, 2017, 04:43:38 PM
If you downloaded one of the 'zip' files from this thread's initial post, that was the source of the problem.  I apparently forgot to alert this thread when UNL made their latest change to the image URL's.  I've modified the initial post to reflect the current script's download procedure.  You may have noticed I no longer post zip files for just this reason, instead preferring to use the '?sce=view' method to distribute most of my scripts.

Sorry for the headaches, guys! #-o

That was it, wsdrought_maps3b.zip with the settings of
Code: [Select]
$version = '3b'; // Moved inline css styles to internal css style
$versionDate = '2013/11/11';
$mapsURL = 'data/pngs/current/current';
$dmSiteURL = 'http://droughtmonitor.unl.edu/'.$mapsURL;

Destroy, lol...
No biggie on this end...

Brad
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on October 16, 2017, 09:33:51 PM
I have attempted to download the script again and no matter how I save the script with "save as", it still comes up with the - mouseover 'show_tab' error. and when I view the source file after the page loads, a bulk of the script is missing, but the full script was uploaded to my website correctly.

I have done other scripts this same way and have not had any issues.

Further suggestions welcome?
Title: Re: Alternative Drought Monitor Page
Post by: MackerelSky on October 17, 2017, 06:17:34 AM
I have attempted to download the script again and no matter how I save the script with "save as", it still comes up with the - mouseover 'show_tab' error. and when I view the source file after the page loads, a bulk of the script is missing, but the full script was uploaded to my website correctly.

I have done other scripts this same way and have not had any issues.

Further suggestions welcome?

I can't see the source of your page before it runs, only the html source. Is this function in your script somewhere? That's the function/code for show_tab and probably the reason for the errors...As shown, it's in my script after 'end main-copy'..

Code: [Select]
</div><!-- end main-copy -->
<script language="Javascript" type="text/javascript">
function show_tab2(nam)
   {
   document.getElementById("United_StatesR").style.display= "none";
   document.getElementById("Southeast").style.display= "none";
   document.getElementById("Northeast").style.display= "none";
   document.getElementById("Midwest").style.display= "none";
   document.getElementById("High_Plains").style.display= "none";
   document.getElementById("West").style.display= "none";
   document.getElementById("South").style.display= "none";
   document.getElementById(nam).style.display = "block";
   }
function show_tab(nam)
   {
   document.getElementById("United_States").style.display= "none";
   document.getElementById("Alabama").style.display= "none";
   document.getElementById("Alaska").style.display= "none";
   document.getElementById("Arizona").style.display= "none";
   document.getElementById("Arkansas").style.display= "none";
   document.getElementById("California").style.display= "none";
   document.getElementById("Colorado").style.display= "none";
   document.getElementById("Connecticut").style.display= "none";
   document.getElementById("Delaware").style.display= "none";
   document.getElementById("Florida").style.display= "none";
   document.getElementById("Georgia").style.display= "none";
   document.getElementById("Hawaii").style.display= "none";
   document.getElementById("Idaho").style.display= "none";
   document.getElementById("Illinois").style.display= "none";
   document.getElementById("Indiana").style.display= "none";
   document.getElementById("Iowa").style.display= "none";
   document.getElementById("Kansas").style.display= "none";
   document.getElementById("Kentucky").style.display= "none";
   document.getElementById("Louisiana").style.display= "none";
   document.getElementById("Maine").style.display= "none";
   document.getElementById("Maryland").style.display= "none";
   document.getElementById("Massachusetts").style.display= "none";
   document.getElementById("Michigan").style.display= "none";
   document.getElementById("Minnesota").style.display= "none";
   document.getElementById("Mississippi").style.display= "none";
   document.getElementById("Missouri").style.display= "none";
   document.getElementById("Montana").style.display= "none";
   document.getElementById("Nebraska").style.display= "none";
   document.getElementById("Nevada").style.display= "none";
   document.getElementById("New_Hampshire").style.display= "none";
   document.getElementById("New_Jersey").style.display= "none";
   document.getElementById("New_Mexico").style.display= "none";
   document.getElementById("New_York").style.display= "none";
   document.getElementById("North_Carolina").style.display= "none";
   document.getElementById("North_Dakota").style.display= "none";
   document.getElementById("Ohio").style.display= "none";
   document.getElementById("Oklahoma").style.display= "none";
   document.getElementById("Oregon").style.display= "none";
   document.getElementById("Pennsylvania").style.display= "none";
   document.getElementById("Rhode_Island").style.display= "none";
   document.getElementById("South_Carolina").style.display= "none";
   document.getElementById("South_Dakota").style.display= "none";
   document.getElementById("Tennessee").style.display= "none";
   document.getElementById("Texas").style.display= "none";
   document.getElementById("Utah").style.display= "none";
   document.getElementById("Vermont").style.display= "none";
   document.getElementById("Virginia").style.display= "none";
   document.getElementById("Washington").style.display= "none";
   document.getElementById("West_Virginia").style.display= "none";
   document.getElementById("Wisconsin").style.display= "none";
   document.getElementById("Wyoming").style.display= "none";
   document.getElementById(nam).style.display = "block";
   }
</script>

That entire script has to be in your page somewhere.
Brad
Title: Re: Alternative Drought Monitor Page
Post by: gwwilk on October 17, 2017, 09:52:47 AM
Here (http://selincolnwx.info/wxdrought3.php) is another script (http://selincolnwx.info/wxdrought3.php?sce=view) to test on your site, Johnmac.  The script mimics the graphical portion of the Climate Prediction Center's home page.  Let's see how well this one works on your site.
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on October 17, 2017, 09:54:01 PM
Here (http://selincolnwx.info/wxdrought3.php) is another script (http://selincolnwx.info/wxdrought3.php?sce=view) to test on your site, Johnmac.  The script mimics the graphical portion of the Climate Prediction Center's home page.  Let's see how well this one works on your site.

I have uploaded the wxdrought3 script to my website and it appears to be working fine. Loaded a little slow, but the mouseover seems to work ok. Deleted all my wxdrought_maps files (I had numerous versions I was playing with) and started over from scratch. Still no luck.

I also found this site with similar issues - http://www.johnsnhweather.com/wxdrought_maps.php - but some of the other maps do load below the first map, which I do not get at all on my site. As I said in a previous thread, looking at the loaded source file, it does not look like the whole script is loading.

Any new suggestions?
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 17, 2017, 10:42:07 PM
The script in use at jonhsnhweather has the same problem I did - he's got the bad version that contains a problem with a reference to /pngs/ in $mapsURL = 'data/png/current/current';. Should be /png/ - no 's' - as shown. Check yours for the same thing?
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on October 18, 2017, 07:51:28 AM
The script in use at jonhsnhweather has the same problem I did - he's got the bad version that contains a problem with a reference to /pngs/ in $mapsURL = 'data/png/current/current';. Should be /png/ - no 's' - as shown. Check yours for the same thing?

I have checked for the added "s" on my script. it is the correct "png".
Title: Re: Alternative Drought Monitor Page
Post by: jgillett on October 18, 2017, 11:47:52 AM
The script in use at jonhsnhweather has the same problem I did - he's got the bad version that contains a problem with a reference to /pngs/ in $mapsURL = 'data/png/current/current';. Should be /png/ - no 's' - as shown. Check yours for the same thing?

I have checked for the added "s" on my script. it is the correct "png".
OK - just a thought. The site I was mainly talking about was jonhsnhweather.
Title: Re: Alternative Drought Monitor Page
Post by: Johnmac on May 22, 2018, 02:00:36 PM
I have downloaded the wxdrought_maps.php the correct way and changed the necessary items in the settings and also uploaded the necessary animation files. I still get a blank map when the page loads and nothing happens when I mouseover the different states. The animation link works fine and I did update the link to my site.

Anything else I should look at?

Thanks,

John
For some reason the script is crashing somewhere near or in the state map display table, and nothing loads past that.  This means the mouseover 'show_tab' state name entries aren't loading either, so the script obviously doesn't work.

Running your home page through the validator.w3.org site (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) produces errors right off the bat.  Perhaps clearing those up might help when it comes to troubleshooting the drought maps script?

Similarly, a blizzard of errors arise (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) when running the drought maps script on your site through the w3 validator.  This is in contrast with what happens when the page on my site is validated (https://validator.w3.org/check?uri=https%3A%2F%2Fgwwilkins.org%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) by the https://validator.w3c.org site.

Start with your main site and work on the errors from the top down.  It can be brutal, frustrating work at first, but the end result is a cleaner page and a much greater understanding of scripting.  Remember, Google is your friend when it comes to understanding the errors' cause(s).
I have downloaded the wxdrought_maps.php the correct way and changed the necessary items in the settings and also uploaded the necessary animation files. I still get a blank map when the page loads and nothing happens when I mouseover the different states. The animation link works fine and I did update the link to my site.

Anything else I should look at?

Thanks,

John
For some reason the script is crashing somewhere near or in the state map display table, and nothing loads past that.  This means the mouseover 'show_tab' state name entries aren't loading either, so the script obviously doesn't work.

Running your home page through the validator.w3.org site (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) produces errors right off the bat.  Perhaps clearing those up might help when it comes to troubleshooting the drought maps script?

Similarly, a blizzard of errors arise (https://validator.w3.org/check?uri=http%3A%2F%2Fscannorthcounty.net%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) when running the drought maps script on your site through the w3 validator.  This is in contrast with what happens when the page on my site is validated (https://validator.w3.org/check?uri=https%3A%2F%2Fgwwilkins.org%2Fwxdrought_maps.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices) by the https://validator.w3c.org site.

Start with your main site and work on the errors from the top down.  It can be brutal, frustrating work at first, but the end result is a cleaner page and a much greater understanding of scripting.  Remember, Google is your friend when it comes to understanding the errors' cause(s).

I would like to get this script working, but have had no luck and am looking for assistance. I have run the validator tool and looked at the errors. The errors appear not to be errors, as they are correct as far as I can tell. The drought script stops at this point -

<a class="hovertab" onmouseover="show_tab('Wyoming')">Wyoming</a><br/></td>
</tr>
</tbody>
</table>
<table width="662.09302325581" cellpadding="0" cellspacing="0">
<tbody><tr>
<td>
<div id="drought" class="frame_border center" style="width:662.09302325581px; height:496.56976744186px; position:relative">
<a href="http://droughtmonitor.unl.edu/data/png/current/current_total_trd.png" target="_blank" title="Larger Map"><img src="

I am not an expert in php, so am at a loss where to go from here and would add that all the other scripts that I have added to my site have worked just fine. I have checked other sites with this script and they all seem to work, so the issue must be with my site somewhere.

Any suggestions would be greatly appreciated.

Thanks, John