Author Topic: Alternative Drought Monitor Page  (Read 8343 times)

0 Members and 1 Guest are viewing this topic.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #25 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

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.  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.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 170
    • Westminster Massachusetts Weather
Re: Alternative Drought Monitor Page
« Reply #26 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.  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
John
Westminster, MA USA

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #27 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 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 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 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).
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Alternative Drought Monitor Page
« Reply #28 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

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #29 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.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Alternative Drought Monitor Page
« Reply #30 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

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #31 on: October 16, 2017, 11:14:09 AM »
The links are the state names.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #32 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.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #33 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.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #34 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.
John
W7JKG

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Alternative Drought Monitor Page
« Reply #35 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
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #36 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...
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #37 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:
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #38 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.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Alternative Drought Monitor Page
« Reply #39 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
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #40 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.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #41 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
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #42 on: October 16, 2017, 04:39:14 PM »
Not to worry, Jerry. Fits right in with all my other headaches!   :roll:

Thanks again, guys.
John
W7JKG

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Alternative Drought Monitor Page
« Reply #43 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
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 170
    • Westminster Massachusetts Weather
Re: Alternative Drought Monitor Page
« Reply #44 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?
John
Westminster, MA USA

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Alternative Drought Monitor Page
« Reply #45 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
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative Drought Monitor Page
« Reply #46 on: October 17, 2017, 09:52:47 AM »
Here is another script 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.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 170
    • Westminster Massachusetts Weather
Re: Alternative Drought Monitor Page
« Reply #47 on: October 17, 2017, 09:54:01 PM »
Here is another script 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?
John
Westminster, MA USA

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Drought Monitor Page
« Reply #48 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?
John
W7JKG

Offline Johnmac

  • Senior Contributor
  • ****
  • Posts: 170
    • Westminster Massachusetts Weather
Re: Alternative Drought Monitor Page
« Reply #49 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".
John
Westminster, MA USA