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

0 Members and 1 Guest are viewing this topic.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #50 on: February 24, 2013, 01:08:43 PM »
Increase  <div align="center" style="margin-top:410px;"> margin-top value until everything lines up again.  Try 440px and see what happens.  The floating legend lists will distort this text beneath them unless an adequate top margin for this text is specified.  Each time I've added a new row in the legend list I've increased the top margin of this paragraph.
« Last Edit: February 24, 2013, 01:11:16 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #51 on: February 24, 2013, 01:12:56 PM »
I changed the line below on  wxusalerts.php  and no change.

Code: [Select]
<div align="center" style="margin-top:440px;"><hr/>Click on map to open a new tab zoomed in on area of interest where the local legend decodes the colors.<br/> The NWS map which opens is in turn clickable to then display <b>VERY</b> localized conditions and a 7 day forecast.<br/>The above legends and the local legends link to NOAA/NWS texts.<br/> The above links display no text when clicked if the warning, watch, advisory, statement or outlook is inactive.<br/>
    <i>All Maps and Data Are Courtesy of <a href="http://www.weather.gov" target="_blank">NOAA NWS</a> where any missing legend links can be found.</i><br/>
</div>

Is the line below correct?

Code: [Select]
<div id="main-copy" style=" border:inset; width:<?php echo ($_SESSION['CSSwidescreen']==? -806?>px">




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: WXUSALERTS Clickable Alerts Map Script
« Reply #52 on: February 24, 2013, 01:15:04 PM »
Try more px until it works.
« Last Edit: February 24, 2013, 01:17:40 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #53 on: February 24, 2013, 01:17:04 PM »
Try 660px

That did it. Thanks Jerry for this script as I use it ALOT! :grin:


http://hayskansasweather.com/wxusalerts.php




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: WXUSALERTS Clickable Alerts Map Script
« Reply #54 on: February 24, 2013, 01:18:45 PM »
Now back off on the number of px in margin-top until you're happy with the appearance.  I have tried to keep the margin at the top of the Legend and the bottom of the Legend the same with the horizontal lines as my guide.  I'm not sure why our pixel counts differ here--must have to do with font metrics.  I see that your text font is larger than mine, and I think that would account for the discrepancy.
« Last Edit: February 24, 2013, 01:23:24 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #55 on: February 24, 2013, 01:20:49 PM »
Now back off on the number of px in margin-top until you're happy with the appearance.

Perfect! I put it at 580.




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: WXUSALERTS Clickable Alerts Map Script
« Reply #56 on: February 24, 2013, 01:24:34 PM »
Now back off on the number of px in margin-top until you're happy with the appearance.

Perfect! I put it at 580.
Lots of room for growth there. :-)
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 #57 on: February 25, 2013, 08:57:27 AM »
Ryan's problem highlighted the difficulties kludge coding can produce.  I had a misplaced </div>, and this produced the malformed code.  Rather than using a 'margin-top:123px' kludge in the last paragraph, I've correctly placed the closure of the legend <div> so that it automatically accommodates the size of the Legend.  This revised code is now available as wxusalerts3.zip in the first post of this thread.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joe’s Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #58 on: February 25, 2013, 09:39:42 AM »
Thanks for all you do Jerry!
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #59 on: February 28, 2013, 08:51:11 PM »
Hi Jerry,

Thank you again for another nice script.

Bob
Bob
KK4QXH

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #60 on: March 03, 2013, 11:54:10 PM »
You're welcome, guys.

A 'Child Abduction Alert' is in effect in parts of Texas this evening.  It has been added to wxusalerts3a.zip in the first post in this thread.
« Last Edit: March 03, 2013, 11:55:51 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 #61 on: March 09, 2013, 08:25:30 AM »
I got tired of being unable to view a current map after this page has been in the background for just a few minutes, so I commented out the autoupdate timeout code in wxusalerts4_no_timeout.zip in the first post of this thread.  A hit on the NWS servers every 2 minutes while camping on this page hardly seems excessive.
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 #62 on: April 17, 2013, 08:03:34 AM »
I'm not sure why, but the NWS has seen fit to use the same color on 'Flash Flood Watch' as 'Flood Watch'.  There's now no visual distinction between the two, and it seems like they're going backwards with this change.  By the time the NWS can change the 'Flash Flood Watch' to a 'Flood Warning' the flash flood victims will already be swimming.  Version wxusalerts4a.zip contains the currently correct color legend.
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 #63 on: May 02, 2013, 11:46:47 PM »
Two new items have been added to the Legend in the first post's wxusalerts4c.zip this evening, 'Hard Freeze Warning' and 'Heat Advisory.
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 #64 on: June 05, 2013, 11:08:00 PM »
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 found in the first post of this thread.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #65 on: June 06, 2013, 06:22:17 AM »
LOL! I just now saw this!  :grin:

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #66 on: November 05, 2013, 08:19:26 AM »
The Legend now toggles on and off in version 5 which is available in the first post.  Version 4d with the permanently displayed Legend is also still available.
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 #67 on: December 05, 2013, 06:55:05 AM »
A new alert code is in effect this morning, 'Wind Chill Warning'.  It has been added to wxusalerts5a.zip and this is the only version available.  Version 5 also contained two <span>'s that didn't pass W3C validation.  Version 5a corrects this problem and adds a setting, '$toggleLegend', to optionally disable this feature and display the legend at all times.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #68 on: March 20, 2014, 09:35:05 AM »
Hi, Is there a way to utilize just the clickable map as an item in a web page without anything else included?  Specifically I'd like to include just the National Map... nothing else around, above or below it.  Thanks!

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #69 on: March 20, 2014, 01:40:24 PM »
Hi, Is there a way to utilize just the clickable map as an item in a web page without anything else included?  Specifically I'd like to include just the National Map... nothing else around, above or below it.  Thanks!
Just copy the requisite portions of the script to a new web page.  Include in the <head> the .css,
Code: [Select]
<link rel="stylesheet" type="text/css" href="./wxusalerts.css" />
Then put everything between
Code: [Select]
<h2 align="center"><?php langtrans('Clickable NWS National Advisory Maps'); ?></h2>
and
Code: [Select]
</script>
<?php
############################################################################
in the body of your new page.

Then delete
Code: [Select]
</div><!-- end main-copy -->

Be aware of the switch, '$toggleLegend'.  You need to use this PHP somewhere at the top of your page:
Code: [Select]
<?php $toggleLegend true// true or false?>
I'll leave it to you to figure out how to display this as a working <html> page.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #70 on: March 20, 2014, 01:47:15 PM »
Thank you very much!  I can handle it form here.  I appreciate your help.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #71 on: March 20, 2014, 02:03:53 PM »
I see that I may have mislead you about the cut at the end.  Include the </script>, but cut the <?php #############...
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #72 on: March 20, 2014, 02:08:25 PM »
I got that figured out and I have the new html page the way I want it.  Just working to insert it in the page at the size I want it.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #73 on: March 20, 2014, 02:09:49 PM »
I got that figured out and I have the new html page the way I want it.  Just working to insert it in the page at the size I want it.
Beware!  I think re-sizing will break the clickable links, but I haven't tried it.
« Last Edit: March 20, 2014, 02:13:42 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #74 on: March 20, 2014, 02:18:55 PM »
Thanks, I thought of that so I tried putting it in an Iframe.  I wasn't sure if that would work or not, so far, not. Noting shows up, just a blank box.  Still working on it.

 

anything